-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtkb.class.php
More file actions
67 lines (54 loc) · 1.7 KB
/
Copy pathtkb.class.php
File metadata and controls
67 lines (54 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/**
* [淘客宝(tkb.{modulename})] (C)2012-2099 Powered by tkb.
* Version: 1.0
* Date: 2012-12-28 11:15
* Author:lvenle@gmail.com
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class plugin_tkb {
function show_items($fid, $items) {
}
}
class plugin_tkb_portal extends plugin_tkb {
function view_article_content() {
global $_G;
$vars = $_G['cache']['plugin']['tkb'];
$portals = explode(',', $vars['portalcat']);
$article = C::t('portal_article_title')->fetch($_GET['aid']);
$fid = $article['catid'];
$displaycount = empty($vars['displaycountportal']) ? 3 : $vars['displaycountportal'];
if(in_array($fid, $portals)) {
require_once dirname(__FILE__).'/lib/items_service.php';
$items_service = new items_service;
$items_service->items_dao = C::t('#tkb#tkb_items');
$items = $items_service->get_items_rand($fid, 1, 2);
include template("tkb:tkb_thread_show");
return $return;
}
return '';
}
}
class plugin_tkb_forum extends plugin_tkb {
function viewthread_postsightmlafter_output() {
global $_G;
$vars = $_G['cache']['plugin']['tkb'];
$groups = (array)unserialize($vars['forums']);
$displaycount = empty($vars['displaycount']) ? 4 : $vars['displaycount'];
$fid = $_G['fid'];
if(in_array($fid, $groups)) {
require_once dirname(__FILE__).'/lib/items_service.php';
$items_service = new items_service;
$items_service->items_dao = C::t('#tkb#tkb_items');
$items = $items_service->get_items_rand($fid, 0, 2);
include template("tkb:tkb_thread_show");
$ret [] = $return;
return $ret;
} else {
return array();
}
}
}
?>