function doUpdate() { include_once iPATH . 'include/forum.class.php'; if ($_POST['forum']) { $forum = new forum(); $forum->cache(); } if ($_POST['adm']) { include_once iPATH . 'admin/advertise.mo.php'; $rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__advertise`", OBJECT); $_count = count($rs); for ($i = 0; $i < $_count; $i++) { adm($rs[$i]); } } $_POST['tpl'] && $this->iCMS->clear_compiled_tpl(); $_POST['iCMS_list'] && FS::rmdir(iPATH . 'cache/list'); $_POST['iCMS_forum'] && FS::rmdir(iPATH . 'cache/forum'); $_POST['iCMS_tag'] && FS::rmdir(iPATH . 'cache/tags'); if ($_POST['iCMS_ALL']) { FS::rmdir(iPATH . 'cache/list'); FS::rmdir(iPATH . 'cache/forum'); FS::rmdir(iPATH . 'cache/tags'); } $_POST['keywords'] && keywords_cache(); $_POST['tags'] && tags_cache(); if ($_POST['model']) { include iPATH . 'include/model.class.php'; model::cache(); } $_POST['field'] && field_cache(); $_POST['config'] && CreateConfigFile(); if ($_POST['Re-Article-Count']) { $rs = iCMS_DB::getArray("SELECT fid FROM `#iCMS@__forum`"); $_count = count($rs); for ($i = 0; $i < $_count; $i++) { $c = iCMS_DB::getValue("SELECT count(*) FROM #iCMS@__article where `fid`='" . $rs[$i]['fid'] . "' LIMIT 1 "); iCMS_DB::query("UPDATE `#iCMS@__forum` SET `count` ='{$c}' WHERE `fid` ='" . $rs[$i]['fid'] . "' LIMIT 1 "); } } if ($_POST['Re-Tag-Count']) { include_once iPATH . 'include/forum.class.php'; $rs = iCMS_DB::getArray("SELECT id FROM `#iCMS@__tags`"); $_count = count($rs); for ($i = 0; $i < $_count; $i++) { $_count = iCMS_DB::getValue("SELECT count(*) FROM `#iCMS@__taglist` WHERE `tid`='" . $rs[$i]['id'] . "'"); iCMS_DB::query("UPDATE `#iCMS@__tags` SET `count` = '{$_count}' WHERE `id` ='" . $rs[$i]['id'] . "'"); tags_cache($rs[$i]['id']); } } javascript::dialog("执行完毕!", 'url:1'); }
function iCMS_advertise($vars, &$iCMS) { if (empty($vars['name'])) { echo $iCMS->language('empty:TPL_advName'); return false; } $rs = $iCMS->getCache('system/adm/' . md5($vars['name'])); if ($rs->status != '1') { return false; } $file = FS::path($iCMS->config['htmlURL'] . '/!adm') . '/'; switch ($rs->load) { case "js": $file .= "{$rs->style}-{$rs->id}.js"; echo "<script src=\"" . $file . "\" language=\"javascript\"></script>"; break; case "iframe": $file .= "{$rs->style}-{$rs->id}.html"; if ($rs->style == "image") { $rs->code['image']['width'] && ($width = " width=\"{$rs->code['image']['width']}\""); $rs->code['image']['height'] && ($height = " height=\"{$rs->code['image']['height']}\""); } elseif ($rs->style == "flash") { $rs->code['flash']['width'] && ($width = " width=\"{$rs->code['flash']['width']}\""); $rs->code['flash']['height'] && ($height = " height=\"{$rs->code['flash']['height']}\""); } echo '<iframe src="' . $file . '" name="' . $rs->style . '-id-' . $rs->id . '"' . $width . $height . ' frameborder="0"scrolling="no" style="overflow: visible;"></iframe>'; break; case "shtml": $file .= "{$rs->style}-{$rs->id}.shtml"; $uri = parse_url($file); echo '<!--#include virtual="' . $uri['path'] . '"-->'; break; default: if (time() >= $rs->starttime && (time() <= $rs->endtime || empty($rs->endtime))) { echo adm($rs); } } }
function msgEncode($cmd, $id, $fields, $user) { global $send_sep, $fld_sep, $val_sep; $now = time(); $t = $now % 10000; $msg = $cmd . $send_sep . $id . $t . $send_sep; foreach ($fields as $name => $value) { $msg .= $name . $val_sep . $value . $fld_sep; } $msg .= 'createcode' . $val_sep . 'php' . $fld_sep; $msg .= 'createby' . $val_sep . $user . $fld_sep; $msg .= 'createinet' . $val_sep . zeip() . $fld_sep; $msg .= 'webtime' . $val_sep . $now; adm($user, $msg); return $msg; }
function create($id, $fn = false) { $rs = iCMS_DB::getRow("SELECT * FROM `#iCMS@__advertise` WHERE `id`='{$id}'"); return adm($rs); }