adv_custom.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: adv_custom.php 29605 2012-04-23 02:27:52Z liulanbo $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class adv_custom {
  12. var $version = '1.0';
  13. var $name = 'custom_name';
  14. var $description = 'custom_desc';
  15. var $copyright = '<a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a>';
  16. var $targets = array('portal', 'home', 'member', 'forum', 'group', 'userapp', 'plugin', 'api');
  17. var $imagesizes = array('60x120', '60x250', '60x468', '120x60', '120x240', '120x60', '250x60', '100x100', '468x40', '468x60', '658x60', '728x90', '760x90', '950x90', '950x130');
  18. var $customname = '';
  19. function getsetting() {
  20. global $_G;
  21. $custom = C::t('common_advertisement_custom')->fetch($_GET['customid']);
  22. if(!$custom) {
  23. echo '<br >';cpmsg(lang('adv/custom', 'custom_id_notfound'));
  24. }
  25. $this->customname = $custom['name'];
  26. }
  27. function setsetting(&$advnew, &$parameters) {
  28. global $_G;
  29. $advnew['targets'] = implode("\t", $this->targets);
  30. }
  31. function evalcode($adv) {
  32. return array(
  33. 'check' => '
  34. if($customid != $parameter[\'customid\']) {
  35. $checked = false;
  36. }',
  37. 'create' => '$adcode = $codes[$adids[array_rand($adids)]];',
  38. );
  39. }
  40. }
  41. ?>