First commit

This commit is contained in:
2025-06-18 10:24:27 +08:00
commit ebc39cd5dd
3873 changed files with 412712 additions and 0 deletions

View File

@@ -0,0 +1,80 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_article.php 13141 2010-07-22 00:56:42Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_article {
var $version = '1.0';
var $name = 'article_name';
var $description = 'article_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('portal');
var $imagesizes = array('250x60', '250x250', '250x300', '658x40', '658x60');
var $categoryvalue = array();
function getsetting() {
global $_G;
$settings = array(
'position' => array(
'title' => 'article_position',
'type' => 'mradio',
'value' => array(
array(1, 'article_position_float'),
array(2, 'article_position_up'),
array(3, 'article_position_down'),
),
'default' => 1,
),
'category' => array(
'title' => 'article_category',
'type' => 'mselect',
'value' => array(),
),
);
loadcache('portalcategory');
$this->getcategory(0);
$settings['category']['value'] = $this->categoryvalue;
return $settings;
}
function getcategory($upid) {
global $_G;
foreach($_G['cache']['portalcategory'] as $category) {
if($category['upid'] == $upid) {
$this->categoryvalue[] = array($category['catid'], str_repeat('&nbsp;', $category['level'] * 4).$category['catname']);
$this->getcategory($category['catid']);
}
}
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) {
$parameters['extra']['category'] = array();
}
}
function evalcode() {
return array(
'check' => '
$checked = $params[2] == $parameter[\'position\'] && (!$parameter[\'category\'] || $parameter[\'category\'] && in_array($_G[\'catid\'], $parameter[\'category\']));
',
'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
);
}
}
?>

View File

@@ -0,0 +1,79 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_articlelist.php 13141 2010-07-22 00:56:42Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_articlelist {
var $version = '1.0';
var $name = 'articlelist_name';
var $description = 'articlelist_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('portal');
var $imagesizes = array('658x40', '658x60');
function getsetting() {
$settings = array(
'position' => array(
'title' => 'articlelist_position',
'type' => 'mradio',
'value' => array(
array(1, 'articlelist_position_up1'),
array(2, 'articlelist_position_up2'),
array(3, 'articlelist_position_down1'),
array(4, 'articlelist_position_down2'),
),
'default' => 1,
),
'category' => array(
'title' => 'articlelist_category',
'type' => 'mselect',
'value' => array(),
),
);
loadcache('portalcategory');
$this->getcategory(0);
$settings['category']['value'] = $this->categoryvalue;
return $settings;
}
function getcategory($upid) {
global $_G;
foreach($_G['cache']['portalcategory'] as $category) {
if($category['upid'] == $upid) {
$this->categoryvalue[] = array($category['catid'], str_repeat('&nbsp;', $category['level'] * 4).$category['catname']);
$this->getcategory($category['catid']);
}
}
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) {
$parameters['extra']['category'] = array();
}
}
function evalcode() {
return array(
'check' => '
$checked = $params[2] == $parameter[\'position\'] && (!$parameter[\'category\'] || $parameter[\'category\'] && in_array($_G[\'catid\'], $parameter[\'category\']));
',
'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
);
}
}
?>

View File

@@ -0,0 +1,41 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_blog.php 7169 2010-03-30 06:34:18Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_blog {
var $version = '1.0';
var $name = 'blog_name';
var $description = 'blog_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('home');
var $imagesizes = array('120x60', '120x240');
function getsetting() {
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
}
function evalcode() {
return array(
'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
);
}
}
?>

View File

@@ -0,0 +1,129 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_cornerbanner.php 26692 2011-12-20 05:27:38Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_cornerbanner {
var $version = '1.1';
var $name = 'cornerbanner_name';
var $description = 'cornerbanner_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('portal', 'home', 'member', 'forum', 'group', 'plugin', 'custom');
var $imagesizes = array('300x250', '290x200', '250x180');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'cornerbanner_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'cornerbanner_groups',
'type' => 'mselect',
'value' => array(),
),
'category' => array(
'title' => 'cornerbanner_category',
'type' => 'mselect',
'value' => array(),
),
'disableclose' => array(
'title' => 'cornerbanner_disableclose',
'type' => 'mradio',
'value' => array(
array(0, 'cornerbanner_show'),
array(1, 'cornerbanner_hidden'),
),
'default' => 0,
),
'animator' => array(
'title' => 'cornerbanner_animator',
'type' => 'radio',
'default' => 0,
),
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
$settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'cornerbanner_index');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, str_repeat('&nbsp;', 4).$group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
loadcache('portalcategory');
$this->categoryvalue[] = array(-1, 'cornerbanner_index');
$this->getcategory(0);
$settings['category']['value'] = $this->categoryvalue;
return $settings;
}
function getcategory($upid) {
global $_G;
foreach($_G['cache']['portalcategory'] as $category) {
if($category['upid'] == $upid) {
$this->categoryvalue[] = array($category['catid'], str_repeat('&nbsp;', $category['level'] * 4).$category['catname']);
$this->getcategory($category['catid']);
}
}
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) {
$parameters['extra']['category'] = array();
}
$parameters['extra']['animator'] = $parameters['animator'];
}
function evalcode($adv) {
return array(
'check' => '
if($_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !(in_array($_G[\'fid\'], $parameter[\'fids\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'fids\']) || defined(\'IN_ARCHIVER\') && in_array(-2, $parameter[\'fids\']))
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !(in_array($_G[\'grouptypeid\'], $parameter[\'groups\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'groups\']))
|| $_G[\'basescript\'] == \'portal\' && $parameter[\'category\'] && !(!empty($_G[\'catid\']) && in_array($_G[\'catid\'], $parameter[\'category\']) || empty($_G[\'catid\']) && in_array(-1, $parameter[\'category\']))
) {
$checked = false;
}',
'create' => '
if(empty($parameter[\'disableclose\'])) {
$adid = $adids[array_rand($adids)];
$aniscript = $parameter[\'animator\'] ? \'<script type="text/javascript">_attachEvent(window, \\\'load\\\', function () {var ad_corner_obj = $(\\\'ad_corner_close\\\').parentNode,ad_corner_height = ad_corner_obj.clientHeight,ad_corner_hi=0,ad_corner_si=setInterval(function () { ad_corner_obj.style.visibility=\\\'visible\\\';ad_corner_obj.style.overflow=\\\'hidden\\\';ad_corner_obj.style.height=ad_corner_hi+\\\'px\\\';ad_corner_hi+=10;if(ad_corner_height<ad_corner_hi) {ad_corner_obj.style.overflow=\\\'visible\\\';clearInterval(ad_corner_si);}}, 1);}, document);</script>\' : \'\';
$adcode = empty($_G[\'cookie\'][\'adclose_\'.$adid]) ? \'<p class="close" id="ad_corner_close" onclick="setcookie(\\\'adclose_\'.$adid.\'\\\', 1, 86400);this.parentNode.style.display=\\\'none\\\'"><a href="javascript:;"><img src="\'.STATICURL.\'image/common/ad_close.gif" /></a></p>\'.$codes[$adid].$aniscript : \'\';
$extra = \'style="\'.($parameter[\'animator\'] ? \';visibility:hidden\': \'\').\'"\';
} else {
$adcode = $codes[$adids[array_rand($adids)]];
}
',
);
}
}
?>

View File

@@ -0,0 +1,140 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_couplebanner.php 26692 2011-12-20 05:27:38Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_couplebanner {
var $version = '1.1';
var $name = 'couplebanner_name';
var $description = 'couplebanner_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('portal', 'home', 'member', 'forum', 'group', 'search', 'plugin', 'custom');
var $imagesizes = array('60x120', '60x250', '60x468');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'couplebanner_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'couplebanner_groups',
'type' => 'mselect',
'value' => array(),
),
'category' => array(
'title' => 'couplebanner_category',
'type' => 'mselect',
'value' => array(),
),
'position' => array(
'title' => 'couplebanner_position',
'type' => 'mradio',
'value' => array(
array(1, 'couplebanner_position_left'),
array(2, 'couplebanner_position_right'),
),
'default' => 1,
),
'coupleadid' => array(
'title' => 'couplebanner_coupleadid',
'type' => 'select',
'value' => array(),
),
'disableclose' => array(
'title' => 'couplebanner_disableclose',
'type' => 'mradio',
'value' => array(
array(0, 'couplebanner_show'),
array(1, 'couplebanner_hidden'),
),
'default' => 0,
)
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
$settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'couplebanner_index');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, str_repeat('&nbsp;', 4).$group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
foreach(C::t('common_advertisement')->fetch_all_by_type('couplebanner') as $couple) {
$settings['coupleadid']['value'][] = array($couple['advid'], $couple['title']);
}
loadcache('portalcategory');
$this->categoryvalue[] = array(-1, 'couplebanner_index');
$this->getcategory(0);
$settings['category']['value'] = $this->categoryvalue;
return $settings;
}
function getcategory($upid) {
global $_G;
foreach($_G['cache']['portalcategory'] as $category) {
if($category['upid'] == $upid) {
$this->categoryvalue[] = array($category['catid'], str_repeat('&nbsp;', $category['level'] * 4).$category['catname']);
$this->getcategory($category['catid']);
}
}
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) {
$parameters['extra']['category'] = array();
}
}
function evalcode() {
return array(
'check' => '
if($params[2] != $parameter[\'position\']
|| $_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !(in_array($_G[\'fid\'], $parameter[\'fids\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'fids\']))
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !(in_array($_G[\'grouptypeid\'], $parameter[\'groups\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'groups\']))
|| $_G[\'basescript\'] == \'portal\' && $parameter[\'category\'] && !(!empty($_G[\'catid\']) && in_array($_G[\'catid\'], $parameter[\'category\']) || empty($_G[\'catid\']) && in_array(-1, $parameter[\'category\']))
) {
$checked = false;
}',
'create' => '
if(empty($_G[\'couplebrother\'])) {
$coupleadid = $adids[array_rand($adids)];
$_G[\'couplebrother\'] = $parameters[$coupleadid][\'coupleadid\'];
} else {
$coupleadid = $_G[\'couplebrother\'];
}
$adcode = empty($parameter[\'disableclose\']) ? (empty($_G[\'cookie\'][\'adclose_\'.$coupleadid]) ? $codes[$coupleadid].\'<br /><a href="javascript:;" onclick="setcookie(\\\'adclose_\'.$coupleadid.\'\\\', 1, 86400);this.parentNode.style.display=\\\'none\\\'"><img src="\'.STATICURL.\'image/common/ad_close.gif" /></a>\' : \'\') : $codes[$coupleadid];
',
);
}
}
?>

View File

@@ -0,0 +1,50 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_custom.php 29605 2012-04-23 02:27:52Z liulanbo $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_custom {
var $version = '1.0';
var $name = 'custom_name';
var $description = 'custom_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('portal', 'home', 'member', 'forum', 'group', 'plugin', 'api', 'search', 'misc');
var $imagesizes = array('60x120', '60x250', '60x468', '120x60', '120x240', '120x60', '250x60', '100x100', '468x40', '468x60', '658x60', '728x90', '760x90', '950x90', '950x130');
var $customname = '';
function getsetting() {
global $_G;
$custom = C::t('common_advertisement_custom')->fetch($_GET['customid']);
if(!$custom) {
echo '<br >';cpmsg(lang('adv/custom', 'custom_id_notfound'));
}
$this->customname = $custom['name'];
}
function setsetting(&$advnew, &$parameters) {
global $_G;
$advnew['targets'] = implode("\t", $this->targets);
}
function evalcode($adv) {
return array(
'check' => '
if($customid != $parameter[\'customid\']) {
$checked = false;
}',
'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
);
}
}
?>

View File

@@ -0,0 +1,41 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_feed.php 7169 2010-03-30 06:34:18Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_feed {
var $version = '1.0';
var $name = 'feed_name';
var $description = 'feed_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('home');
var $imagesizes = array('468x40', '468x60', '658x60');
function getsetting() {
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
}
function evalcode() {
return array(
'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
);
}
}
?>

View File

@@ -0,0 +1,126 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_float.php 26692 2011-12-20 05:27:38Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_float {
var $version = '1.1';
var $name = 'float_name';
var $description = 'float_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('portal', 'home', 'member', 'forum', 'group', 'search', 'plugin', 'custom');
var $imagesizes = array('60x120', '60x250', '60x468');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'float_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'float_groups',
'type' => 'mselect',
'value' => array(),
),
'category' => array(
'title' => 'float_category',
'type' => 'mselect',
'value' => array(),
),
'position' => array(
'title' => 'float_position',
'type' => 'mradio',
'value' => array(
array(1, 'float_position_left'),
array(2, 'float_position_right'),
),
'default' => 1,
),
'disableclose' => array(
'title' => 'float_disableclose',
'type' => 'mradio',
'value' => array(
array(0, 'float_show'),
array(1, 'float_hidden'),
),
'default' => 0,
)
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
$settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'float_index');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, str_repeat('&nbsp;', 4).$group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
loadcache('portalcategory');
$this->categoryvalue[] = array(-1, 'float_index');
$this->getcategory(0);
$settings['category']['value'] = $this->categoryvalue;
return $settings;
}
function getcategory($upid) {
global $_G;
foreach($_G['cache']['portalcategory'] as $category) {
if($category['upid'] == $upid) {
$this->categoryvalue[] = array($category['catid'], str_repeat('&nbsp;', $category['level'] * 4).$category['catname']);
$this->getcategory($category['catid']);
}
}
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) {
$parameters['extra']['category'] = array();
}
}
function evalcode() {
return array(
'check' => '
if($params[2] != $parameter[\'position\']
|| $_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !(in_array($_G[\'fid\'], $parameter[\'fids\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'fids\']))
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !(in_array($_G[\'grouptypeid\'], $parameter[\'groups\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'groups\']))
|| $_G[\'basescript\'] == \'portal\' && $parameter[\'category\'] && !(!empty($_G[\'catid\']) && in_array($_G[\'catid\'], $parameter[\'category\']) || empty($_G[\'catid\']) && in_array(-1, $parameter[\'category\']))
) {
$checked = false;
}',
'create' => '
$adcode = empty($parameter[\'disableclose\']) ? (empty($_G[\'cookie\'][\'adclose_\'.$coupleadid]) ? $codes[$adids[array_rand($adids)]].\'<br /><a href="javascript:;" onclick="setcookie(\\\'adclose_\'.$coupleadid.\'\\\', 1, 86400);this.parentNode.style.display=\\\'none\\\'"><img src="\'.STATICURL.\'image/common/ad_close.gif" /></a>\' : \'\') : $codes[$adids[array_rand($adids)]];
'
);
}
}
?>

View File

@@ -0,0 +1,117 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_footerbanner.php 22514 2011-05-10 11:11:11Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_footerbanner {
var $version = '1.0';
var $name = 'footerbanner_name';
var $description = 'footerbanner_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('portal', 'home', 'member', 'forum', 'group', 'search', 'plugin', 'custom');
var $imagesizes = array('468x60', '658x60', '728x90', '760x90', '950x90', '950x130');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'footerbanner_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'footerbanner_groups',
'type' => 'mselect',
'value' => array(),
),
'category' => array(
'title' => 'footerbanner_category',
'type' => 'mselect',
'value' => array(),
),
'position' => array(
'title' => 'footerbanner_position',
'type' => 'mradio',
'value' => array(
array(1, 'footerbanner_position_up'),
array(2, 'footerbanner_position_middle'),
array(3, 'footerbanner_position_down'),
),
'default' => 1,
),
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
$settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'footerbanner_index');
$settings['fids']['value'][] = array(-2, 'Archiver');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, str_repeat('&nbsp;', 4).$group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
loadcache('portalcategory');
$this->categoryvalue[] = array(-1, 'footerbanner_index');
$this->getcategory(0);
$settings['category']['value'] = $this->categoryvalue;
return $settings;
}
function getcategory($upid) {
global $_G;
foreach($_G['cache']['portalcategory'] as $category) {
if($category['upid'] == $upid) {
$this->categoryvalue[] = array($category['catid'], str_repeat('&nbsp;', $category['level'] * 4).$category['catname']);
$this->getcategory($category['catid']);
}
}
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) {
$parameters['extra']['category'] = array();
}
}
function evalcode() {
return array(
'check' => '
if($params[2] != $parameter[\'position\']
|| $_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !(!defined(\'IN_ARCHIVER\') && (in_array($_G[\'fid\'], $parameter[\'fids\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'fids\'])) || defined(\'IN_ARCHIVER\') && in_array(-2, $parameter[\'fids\']))
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !(in_array($_G[\'grouptypeid\'], $parameter[\'groups\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'groups\']))
|| $_G[\'basescript\'] == \'portal\' && $parameter[\'category\'] && !(!empty($_G[\'catid\']) && in_array($_G[\'catid\'], $parameter[\'category\']) || empty($_G[\'catid\']) && in_array(-1, $parameter[\'category\']))
) {
$checked = false;
}',
'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
);
}
}
?>

View File

@@ -0,0 +1,110 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_headerbanner.php 22514 2011-05-10 11:11:11Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_headerbanner {
var $version = '1.0';
var $name = 'headerbanner_name';
var $description = 'headerbanner_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('portal', 'home', 'member', 'forum', 'group', 'plugin', 'custom');
var $imagesizes = array('468x40', '468x60', '658x60', '728x90', '760x90', '950x90');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'headerbanner_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'headerbanner_groups',
'type' => 'mselect',
'value' => array(),
),
'category' => array(
'title' => 'headerbanner_category',
'type' => 'mselect',
'value' => array(),
),
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
$settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'headerbanner_index');
$settings['fids']['value'][] = array(-2, 'Archiver');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, str_repeat('&nbsp;', 4).$group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
loadcache('portalcategory');
$this->categoryvalue[] = array(-1, 'headerbanner_index');
$this->getcategory(0);
$settings['category']['value'] = $this->categoryvalue;
return $settings;
}
function getcategory($upid) {
global $_G;
foreach($_G['cache']['portalcategory'] as $category) {
if($category['upid'] == $upid) {
$this->categoryvalue[] = array($category['catid'], str_repeat('&nbsp;', $category['level'] * 4).$category['catname']);
$this->getcategory($category['catid']);
}
}
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) {
$parameters['extra']['category'] = array();
}
}
function evalcode($adv) {
return array(
'check' => '
if($_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !(!defined(\'IN_ARCHIVER\') && (in_array($_G[\'fid\'], $parameter[\'fids\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'fids\'])) || defined(\'IN_ARCHIVER\') && in_array(-2, $parameter[\'fids\']))
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !(in_array($_G[\'grouptypeid\'], $parameter[\'groups\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'groups\']))
|| $_G[\'basescript\'] == \'portal\' && $parameter[\'category\'] && !(!empty($_G[\'catid\']) && in_array($_G[\'catid\'], $parameter[\'category\']) || empty($_G[\'catid\']) && in_array(-1, $parameter[\'category\']))
) {
$checked = false;
}',
'create' => '
$adid = $adids[array_rand($adids)];
$extra = $parameters[$adid][\'height\'] ? \' style="line-height:\'.$parameters[$adid][\'height\'].\'px;height:\'.$parameters[$adid][\'height\'].\'px"\' : \'\';
$adcode = $codes[$adid];
',
);
}
}
?>

View File

@@ -0,0 +1,76 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_intercat.php 26440 2011-12-13 06:28:38Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_intercat {
var $version = '1.1';
var $name = 'intercat_name';
var $description = 'intercat_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('forum');
var $imagesizes = array('468x60', '658x60', '728x90', '760x90', '950x90');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'intercat_fids',
'type' => 'mselect',
'value' => array(),
),
'position' => array(
'title' => 'intercat_position',
'type' => 'mradio',
'value' => array(),
'default' => 0,
),
);
loadcache('forums');
$settings['fids']['value'][] = array(0, '&nbsp;');
$settings['fids']['value'][] = array(-1, 'intercat_position_fav');
$settings['position']['value'][] = array(0, 'intercat_position_random');
$settings['position']['value'][] = array(-1, 'intercat_position_fav');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
if($forum['type'] == 'group') {
$settings['fids']['value'][] = array($fid, $forum['name']);
$settings['position']['value'][] = array($fid, $forum['name']);
}
}
return $settings;
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
}
function evalcode() {
return array(
'check' => '
if(!(!$parameter[\'position\'] || $parameter[\'position\'] && $params[2] == $parameter[\'position\'] || $parameter[\'fids\'] && in_array($_GET[\'gid\'], $parameter[\'fids\']))) {
$checked = false;
}',
'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
);
}
}
?>

View File

@@ -0,0 +1,93 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_interthread.php 24553 2011-09-26 03:21:13Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_interthread {
var $version = '1.1';
var $name = 'interthread_name';
var $description = 'interthread_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('forum', 'group');
var $imagesizes = array('468x60', '658x60', '728x90', '760x90');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'interthread_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'interthread_groups',
'type' => 'mselect',
'value' => array(),
),
'pnumber' => array(
'title' => 'interthread_pnumber',
'type' => 'mselect',
'value' => array(),
'default' => array(0),
),
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, $group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
for($i = 1;$i <= $_G['ppp'];$i++) {
$settings['pnumber']['value'][$i] = array($i, '> #'.$i);
}
return $settings;
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
}
function evalcode() {
return array(
'check' => '
$parameter[\'pnumber\'] = $parameter[\'pnumber\'] ? $parameter[\'pnumber\'] : array(1);
if(!in_array($params[2] + 1, (array)$parameter[\'pnumber\'])
|| $_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !in_array($_G[\'fid\'], $parameter[\'fids\'])
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !in_array($_G[\'grouptypeid\'], $parameter[\'groups\'])
) {
$checked = false;
}',
'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
);
}
}
?>

View File

@@ -0,0 +1,41 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_search.php 22150 2011-04-22 07:36:09Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_search {
var $version = '1.0';
var $name = 'search_name';
var $description = 'search_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('search');
var $imagesizes = array('120x60', '120x240');
function getsetting() {}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
}
function evalcode() {
return array(
'check' => '',
'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
);
}
}
?>

View File

@@ -0,0 +1,105 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_subnavbanner.php 19237 2010-12-23 04:27:46Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_subnavbanner {
var $version = '1.0';
var $name = 'subnavbanner_name';
var $description = 'subnavbanner_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('portal', 'home', 'member', 'forum', 'group', 'plugin', 'custom');
var $imagesizes = array('468x40', '468x60', '658x60', '728x90', '760x90', '950x90');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'subnavbanner_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'subnavbanner_groups',
'type' => 'mselect',
'value' => array(),
),
'category' => array(
'title' => 'subnavbanner_category',
'type' => 'mselect',
'value' => array(),
),
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
$settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'subnavbanner_index');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, str_repeat('&nbsp;', 4).$group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 8).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
loadcache('portalcategory');
$this->categoryvalue[] = array(-1, 'subnavbanner_index');
$this->getcategory(0);
$settings['category']['value'] = $this->categoryvalue;
return $settings;
}
function getcategory($upid) {
global $_G;
foreach($_G['cache']['portalcategory'] as $category) {
if($category['upid'] == $upid) {
$this->categoryvalue[] = array($category['catid'], str_repeat('&nbsp;', $category['level'] * 4).$category['catname']);
$this->getcategory($category['catid']);
}
}
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
if(is_array($parameters['extra']['category']) && in_array(0, $parameters['extra']['category'])) {
$parameters['extra']['category'] = array();
}
}
function evalcode($adv) {
return array(
'check' => '
if($_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !(in_array($_G[\'fid\'], $parameter[\'fids\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'fids\']))
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !(in_array($_G[\'grouptypeid\'], $parameter[\'groups\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'groups\']))
|| $_G[\'basescript\'] == \'portal\' && $parameter[\'category\'] && !(!empty($_G[\'catid\']) && in_array($_G[\'catid\'], $parameter[\'category\']) || empty($_G[\'catid\']) && in_array(-1, $parameter[\'category\']))
) {
$checked = false;
}',
'create' => '$adcode = $codes[$adids[array_rand($adids)]];'
);
}
}
?>

View File

@@ -0,0 +1,125 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_text.php 13462 2010-07-27 07:26:27Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_text {
var $version = '2.0';
var $name = 'text_name';
var $description = 'text_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('forum', 'group', 'home', 'portal');
var $imagesizes = array('120x60', '250x60', '100x100');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'text_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'text_groups',
'type' => 'mselect',
'value' => array(),
),
'category' => array(
'title' => 'text_category',
'type' => 'mselect',
'value' => array(),
),
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
$settings['fids']['value'][] = $settings['groups']['value'][] = array(-1, 'text_index');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, $group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 4).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
loadcache('portalcategory');
$this->getcategory(0);
$settings['category']['value'] = $this->categoryvalue;
return $settings;
}
function getcategory($upid) {
global $_G;
foreach($_G['cache']['portalcategory'] as $category) {
if($category['upid'] == $upid) {
$this->categoryvalue[] = array($category['catid'], str_repeat('&nbsp;', $category['level'] * 4).$category['catname']);
$this->getcategory($category['catid']);
}
}
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
}
function evalcode() {
return array(
'check' => '
if($_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !(in_array($_G[\'fid\'], $parameter[\'fids\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'fids\']))
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !(in_array($_G[\'grouptypeid\'], $parameter[\'groups\']) || CURMODULE == \'index\' && in_array(-1, $parameter[\'groups\']))
|| $_G[\'basescript\'] == \'portal\' && $parameter[\'category\'] && !(in_array($_G[\'catid\'], $parameter[\'category\']))
) {
$checked = false;
}',
'create' => '
$advcount = count($adids);
if($advcount > 5) {
$minfillpercent = 0;
for($cols = 5; $cols >= 3; $cols--) {
if(($remainder = $advcount % $cols) == 0) {
$advcols = $cols;
break;
} elseif($remainder / $cols > $minfillpercent) {
$minfillpercent = $remainder / $cols;
$advcols = $cols;
}
}
} else {
$advcols = $advcount;
}
$adcode = \'\';
for($i = 0; $i < $advcols * ceil($advcount / $advcols); $i++) {
$adcode .= (($i + 1) % $advcols == 1 || $advcols == 1 ? \'<tr>\' : \'\').
\'<td width="\'.intval(100 / $advcols).\'%">\'.(isset($codes[$adids[$i]]) ? $codes[$adids[$i]] : \'&nbsp;\').\'</td>\'.
(($i + 1) % $advcols == 0 ? "</tr>\n" : \'\');
}
$adcode = \'<table cellpadding="0" cellspacing="1">\'.$adcode.\'</table>\';
',
);
}
}
?>

View File

@@ -0,0 +1,115 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_thread.php 23660 2011-08-02 06:59:11Z maruitao $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_thread {
var $version = '1.0';
var $name = 'thread_name';
var $description = 'thread_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('forum', 'group');
var $imagesizes = array('120x60', '120x240');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'thread_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'thread_groups',
'type' => 'mselect',
'value' => array(),
),
'position' => array(
'title' => 'thread_position',
'type' => 'mradio',
'value' => array(
array(2, 'thread_position_top'),
array(3, 'thread_position_right'),
array(1, 'thread_position_bottom'),
),
'default' => 1,
),
'pnumber' => array(
'title' => 'thread_pnumber',
'type' => 'mselect',
'value' => array(
array(0, 'thread_pnumber_all'),
),
'default' => array(0),
),
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, $group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 4).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
for($i = 1;$i <= $_G['ppp'];$i++) {
$settings['pnumber']['value'][$i] = array($i, '> #'.$i);
}
return $settings;
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
if(is_array($parameters['extra']['pnumber']) && in_array(0, $parameters['extra']['pnumber'])) {
$parameters['extra']['pnumber'] = array();
}
}
function evalcode($adv) {
return array(
'check' => '
if($params[2] != $parameter[\'position\']
|| $parameter[\'pnumber\'] && !in_array($params[3] + 1, (array)$parameter[\'pnumber\'])
|| $_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !in_array($_G[\'fid\'], $parameter[\'fids\'])
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !in_array($_G[\'grouptypeid\'], $parameter[\'groups\'])
) {
$checked = false;
}',
'create' => '
$adid = $adids[array_rand($adids)];
if($parameters[$adid][\'position\'] == 3) {
$_G[\'thread\'][\'contentmr\'] = $parameters[$adid][\'width\'] ? $parameters[$adid][\'width\'].\'px\' : \'auto\';
$extra = \'style="margin-left:10px;width:\'.$_G[\'thread\'][\'contentmr\'].\'"\';
}
$adcode = $codes[$adid];
',
);
}
}
?>

View File

@@ -0,0 +1,145 @@
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: adv_threadlist.php 29052 2012-03-23 09:07:40Z monkey $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class adv_threadlist {
var $version = '1.0';
var $name = 'threadlist_name';
var $description = 'threadlist_desc';
var $copyright = '<a href="https://www.discuz.vip/" target="_blank">Discuz!</a>';
var $targets = array('forum', 'group');
var $imagesizes = array('120x60', '468x40', '468x60');
function getsetting() {
global $_G;
$settings = array(
'fids' => array(
'title' => 'threadlist_fids',
'type' => 'mselect',
'value' => array(),
),
'groups' => array(
'title' => 'threadlist_groups',
'type' => 'mselect',
'value' => array(),
),
'pos' => array(
'title' => 'threadlist_pos',
'type' => 'text',
'value' => '',
),
'mode' => array(
'title' => 'threadlist_mode',
'type' => 'mradio',
'value' => array(
array(0, 'threadlist_mode_0'),
array(1, 'threadlist_mode_1'),
),
),
'tid' => array(
'title' => 'threadlist_tid',
'type' => 'text',
'value' => '',
),
'threadurl' => array(
'title' => 'threadlist_threadurl',
'type' => 'text',
'value' => '',
),
);
loadcache(array('forums', 'grouptype'));
$settings['fids']['value'][] = $settings['groups']['value'][] = array(0, '&nbsp;');
if(empty($_G['cache']['forums'])) $_G['cache']['forums'] = array();
foreach($_G['cache']['forums'] as $fid => $forum) {
$settings['fids']['value'][] = array($fid, ($forum['type'] == 'forum' ? str_repeat('&nbsp;', 4) : ($forum['type'] == 'sub' ? str_repeat('&nbsp;', 8) : '')).$forum['name']);
}
foreach($_G['cache']['grouptype']['first'] as $gid => $group) {
$settings['groups']['value'][] = array($gid, $group['name']);
if($group['secondlist']) {
foreach($group['secondlist'] as $sgid) {
$settings['groups']['value'][] = array($sgid, str_repeat('&nbsp;', 4).$_G['cache']['grouptype']['second'][$sgid]['name']);
}
}
}
return $settings;
}
function setsetting(&$advnew, &$parameters) {
global $_G;
if(is_array($advnew['targets'])) {
$advnew['targets'] = implode("\t", $advnew['targets']);
}
if(is_array($parameters['extra']['fids']) && in_array(0, $parameters['extra']['fids'])) {
$parameters['extra']['fids'] = array();
}
if(is_array($parameters['extra']['groups']) && in_array(0, $parameters['extra']['groups'])) {
$parameters['extra']['groups'] = array();
}
$parameters['extra']['pos'] = $parameters['pos'];
$parameters['extra']['tid'] = $parameters['tid'];
$parameters['extra']['threadurl'] = $parameters['threadurl'];
}
function evalcode() {
return array(
'check' => '
if($GLOBALS[\'page\'] != 1 || !empty($_GET[\'filter\'])
|| $_G[\'basescript\'] == \'forum\' && $parameter[\'fids\'] && !in_array($_G[\'fid\'], $parameter[\'fids\'])
|| $_G[\'basescript\'] == \'group\' && $parameter[\'groups\'] && !in_array($_G[\'grouptypeid\'], $parameter[\'groups\'])
) {
$checked = false;
} else {
if(empty($_G[\'adv_vtp_count\'])) {
for($i = 1;$i <= $_G[\'forum_threadnum\'];$i++) {
if(empty($parameter[\'pos\'])) {
$_G[\'adv_vtp\'][0][$i][] = $adid;
} elseif($parameter[\'pos\'] == $i) {
$_G[\'adv_vtp\'][1][$i][] = $adid;
}
}
$_G[\'adv_vtp_showed\'] = $_G[\'adv_vtp_thread\'] = array();
}
if($parameter[\'mode\'] && $parameter[\'tid\']) {
$_G[\'adv_vtp_tids\'][] = $parameter[\'tid\'];
}
}',
'create' => '
$_G[\'adv_vtp_count\']++;
if($_G[\'adv_vtp_count\'] == 1 && !empty($_G[\'adv_vtp_tids\'])) {
foreach(C::t(\'forum_thread\')->fetch_all_by_tid($_G[\'adv_vtp_tids\']) as $row) {
$_G[\'adv_vtp_thread\'][$row[\'tid\']] = $row;
}
}
$vt = $_G[\'adv_vtp_thread\'];
$adi = !empty($_G[\'adv_vtp\'][1][$_G[\'adv_vtp_count\']]) ? 1 : 0;
$adary = !empty($_G[\'adv_vtp\'][$adi][$_G[\'adv_vtp_count\']]) && is_array($_G[\'adv_vtp\'][$adi][$_G[\'adv_vtp_count\']]) ? array_diff($_G[\'adv_vtp\'][$adi][$_G[\'adv_vtp_count\']], $_G[\'adv_vtp_showed\']) : array();
$adid = empty($adary) ? 0 : $adary[array_rand($adary)];
$_G[\'adv_vtp_showed\'][] = $adid;
$vttid = $parameters[$adid][\'tid\'];
$notag = true;
$adcode = $adid ? (!$parameters[$adid][\'mode\'] ? \'<tbody><tr><td colspan=\'.($_G[\'forum\'][\'ismoderator\'] && !$_GET[\'archiveid\'] ? 6 : 5).\'>\'.$codes[$adid].\'</td></tr></tbody>\'
: \'<tr><td class="icn"><a href="forum.php?mod=viewthread&tid=\'.$vt[$vttid][\'tid\'].\'" target="_blank"><img src="\'.$_G[\'style\'][\'imgdir\'].\'/folder_new.gif" /></a></td>\'.
($_G[\'forum\'][\'ismoderator\'] && !$_GET[\'archiveid\'] ? \'<td class="o"></td>\' : \'\').
\'<td class="new"><a href="\'.($parameters[$adid][\'threadurl\'] ? $parameters[$adid][\'threadurl\'] : \'forum.php?mod=viewthread&tid=\'.$vt[$vttid][\'tid\']).\'" class="xst">\'.$codes[$adid].\'</a></td>\'.
\'<td class="by"><cite><a href="home.php?mod=space&uid=\'.$vt[$vttid][\'authorid\'].\'">\'.$vt[$vttid][\'author\'].\'</a></cite><em>\'.dgmdate($vt[$vttid][\'dateline\'], \'d\').\'</em></td>\'.
\'<td class="num"><a href="forum.php?mod=viewthread&tid=\'.$vt[$vttid][\'tid\'].\'" class="xi2">\'.$vt[$vttid][\'replies\'].\'</a><em>\'.$vt[$vttid][\'views\'].\'</em></td>\'.
\'<td class="by"><cite><a href="forum.php?mod=viewthread&tid=\'.$vt[$vttid][\'tid\'].\'">\'.$vt[$vttid][\'lastposter\'].\'</a></cite>\'.
\'<em><a href="forum.php?mod=redirect&tid=\'.$vt[$vttid][\'tid\'].\'&goto=lastpost#lastpost">\'.dgmdate($vt[$vttid][\'lastpost\'], \'u\').\'</a></em></td>\'.
\'</tr>\') : \'\';',
);
}
}
?>

View File