static function ad_show($code, $do = 'index', $is_slide = null)
 {
     global $_lang, $_K;
     $ad_target = db_factory::get_one(sprintf(" select * from %switkey_ad_target where code='%s' and is_allow=1", TABLEPRE, $code), 3600 * 24);
     if ($ad_target) {
         if (intval($is_slide)) {
             return self::get_adgroup_by_target($ad_target['target_id'], $ad_target['name'], $ad_target['ad_num']);
         }
         $sql = " select a.ad_id,a.ad_name,a.ad_file,a.ad_content,a.ad_url,a.width,a.height,\n\t\t\ta.ad_type,a.ad_position,a.on_time from %switkey_ad a left join %switkey_ad_target b on a.target_id=b.target_id\n\t\t\twhere b.code='%s' and a.is_allow='1' order by a.ad_id desc limit 0,%d";
         $ad_info = db_factory::get_one(sprintf($sql, TABLEPRE, TABLEPRE, $code, $ad_target['ad_num']), true, $_K['timespan']);
         if ($ad_info) {
             $ad_str .= "<div class='adv'>";
             switch ($ad_info['ad_type']) {
                 case "flash":
                     $ad_str .= keke_file_class::flash_codeout($ad_info['ad_file'], $ad_info['width'], $ad_info['height'], $ad_info['ad_url']);
                     break;
                 case "text":
                 case "code":
                     $ad_str .= "<a href='" . $ad_info['ad_url'] . "' target='_blank' title='" . $ad_info['ad_name'] . "'>" . kekezu::k_stripslashes($ad_info['ad_content']) . "</a>";
                     break;
                 case "image":
                     if ($ad_info['ad_file']) {
                         //修改 2015-08-01
                         $ad_str .= "<a href='" . $ad_info['ad_url'] . "' target='_blank' title='" . $ad_info['ad_name'] . "'><img src='" . $ad_info['ad_file'] . "' width='" . $ad_info['width'] . "' class='lazy' data-original='" . $ad_info['ad_file'] . "'  height='" . $ad_info['height'] . "' alt='" . $ad_info['ad_name'] . "' title='" . $ad_info['ad_name'] . "'></a>";
                     } else {
                         $ad_str .= "<a href='" . $ad_info['ad_url'] . "' target='_blank' title='" . $ad_info['ad_name'] . "'><img src='" . $ad_info['ad_file'] . "'data-src='holder.js/950x50/#f8f8f8:#ddd/text:AD'  width='" . $ad_info['width'] . "' height='" . $ad_info['height'] . "' alt='" . $ad_info['ad_name'] . "' title='" . $ad_info['ad_name'] . "'></a>";
                     }
                     break;
             }
             self::update_ad($ad_info);
             $ad_str .= "</div>";
         }
     }
     echo $ad_str;
 }
         if ($arrService[$v['f_code']]['content'] != $extdata[$i]) {
             $arrUpdateParts['custom'][$j] = $extdata[$i];
             $arrUpdateParts['old_custom'][$j] = $arrService[$v['f_code']]['content'];
         }
     }
 }
 if ($arrServiceInfo['price'] != $goodsprice && $goodsname) {
     $arrUpdateParts['price'] = $goodsprice;
     $arrUpdateParts['old_price'] = $arrServiceInfo['price'];
 }
 if ($arrServiceInfo['pic'] != $file_ids && $goodsname) {
     $arrUpdateParts['pic'] = $file_ids;
     $arrUpdateParts['old_pic'] = $arrServiceInfo['pic'];
 }
 if ($arrServiceInfo['content'] != kekezu::k_stripslashes($goodsdesc) && $goodsdesc) {
     $arrUpdateParts['content'] = kekezu::k_stripslashes($goodsdesc);
     $arrUpdateParts['old_content'] = $arrServiceInfo['content'];
 }
 if ($arrServiceInfo['unite_price'] != $unite_price && $unite_price) {
     $arrUpdateParts['unite_price'] = $unite_price;
     $arrUpdateParts['old_unite_price'] = $arrServiceInfo['unite_price'];
 }
 if ($arrServiceInfo['submit_method'] != $submit_method && $submit_method) {
     $arrUpdateParts['submit_method'] = $submit_method;
     $arrUpdateParts['old_submit_method'] = $arrServiceInfo['submit_method'];
 }
 if ($arrServiceInfo['file_path'] != $file_path_2 && $file_path_2) {
     $arrUpdateParts['file_path'] = $file_path_2;
     $arrUpdateParts['old_file_path'] = $arrServiceInfo['file_path'];
 }
 if ($arrServiceInfo['service_time'] != $service_time && $service_time) {
Example #3
0
 static function flash_codeout($src, $width, $height, $ad_url)
 {
     $str = ' <a href=' . $ad_url . '><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
     $str .= ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0"';
     $str .= ' width="' . $width . '" height="' . $height . '"/>';
     $str .= ' <param name="movie" value="' . $src . '" />';
     $str .= ' <param name="quality" value="high" />';
     $str .= ' <param name="quality" value="transparent" />';
     $str .= ' <param name="wmode" value="transparent" /> ';
     $str .= ' <param name="SCALE" value="exactfit" />';
     $str .= ' <embed src="' . $src . '" quality="high" width="' . $width . '" height="' . $height . '" ';
     $str .= ' pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"';
     $str .= ' type="application/x-shockwave-flash" wmode="transparent"/></embed></object></a>';
     return kekezu::k_stripslashes($str);
 }
Example #4
0
 function browing_history($task_id, $task_cash, $task_title)
 {
     $histroy = array();
     if ($_COOKIE['task_browing_history_' . $this->_uid]) {
         if (get_magic_quotes_gpc()) {
             $_COOKIE['task_browing_history_' . $this->_uid] = kekezu::k_stripslashes($_COOKIE['task_browing_history_' . $this->_uid]);
         }
         $temp = unserialize($_COOKIE['task_browing_history_' . $this->_uid]);
     } else {
         $temp = array();
     }
     $len = sizeof($temp);
     if (!$temp[$task_id]) {
         $arr = array($task_id, $task_cash, $task_title);
         $len >= 5 and array_pop($temp);
         array_unshift($temp, $arr);
     }
     foreach ($temp as $v) {
         $histroy[$v[0]] = $v;
     }
     setcookie('task_browing_history_' . $this->_uid, serialize($histroy), NULL, COOKIE_PATH, COOKIE_DOMAIN, NULL, TRUE);
     return $histroy;
 }
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(51);
$filename = S_ROOT . './tpl/' . $tplname . '/' . $tname;
$code_content = htmlspecialchars(keke_tpl_class::sreadfile($filename));
if ($sbt_edit) {
    $filename = S_ROOT . $tname;
    if (!is_writable($filename)) {
        kekezu::admin_show_msg($_lang['file'] . $filename . $_lang['can_not_write_please_check'], "index.php?do=tpl&view=tpllist&tplname={$tplname}", 3, '', 'warning');
    }
    keke_tpl_class::swritefile($filename, htmlspecialchars_decode(kekezu::k_stripslashes($txt_code_content)));
    kekezu::admin_system_log($_lang['edit_template'] . $tplname . '/' . $tname);
    kekezu::admin_show_msg($_lang['tpl_edit_success'], "index.php?do=tpl&view=tpllist&tplname={$tplname}", 3, '', 'success');
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_tpl_' . $view);
<?php

$url = "index.php?do={$do}&view={$view}&target_id={$target_id}";
if (isset($stb_add)) {
    eval("\$arr=" . kekezu::k_stripslashes($position) . ";");
    $position = serialize($arr);
    $insertsqlarr = array('name' => $name, 'code' => $code, 'description' => $description, 'targets' => $targets, 'position' => $position, 'ad_size' => $ad_size, 'ad_num' => $ad_num, 'sample_pic' => $sample_pic);
    if ($target_id) {
        $result = db_factory::updatetable("keke_witkey_ad_target", $insertsqlarr, array("target_id" => $target_id));
    } else {
        $result = db_factory::inserttable('keke_witkey_ad_target', $insertsqlarr);
    }
    $result && kekezu::admin_show_msg($_lang['add_submit_success'], $url, 3, '', 'success');
}
if ($target_id) {
    $target_arr = db_factory::get_one("select * from " . TABLEPRE . "witkey_ad_target where target_id='{$target_id}'");
    $target_arr['position'] = var_export(unserialize($target_arr['position']), 1);
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . '_' . $view);