コード例 #1
0
 public function __autoload()
 {
     parent::__autoload();
     $banner = getBanner('home');
     $advert = getBanner('advert');
     $news = get_recommend_articles('news', 9);
     $notice = get_recommend_articles('notice', 9);
     /*个人译者店铺*/
     $shop_personal = get_recommend_shop(1);
     /*公司店铺*/
     $shop_company = get_recommend_shop();
     $shop_new = get_new_shop();
     $written_shop = $this->recommend_shop(36);
     $interpreter_shop = $this->recommend_shop(37);
     /*获取网站指数*/
     $site_index = get_site_index();
     $data['site_index'] = $site_index;
     $data['home_banner'] = $banner;
     $data['advert'] = $advert;
     $data['news'] = $news;
     $data['notice'] = $notice;
     $data['shop_personal'] = $shop_personal;
     $data['shop_company'] = $shop_company;
     $data['shop_new'] = $shop_new;
     $data['written_shop'] = $written_shop;
     $data['interpreter_shop'] = $interpreter_shop;
     $this->info = $data;
     $this->assign($data);
 }
コード例 #2
0
 /**
  * 广告列表页
  * @author						李东
  * @date						2015-06-16
  */
 public function index()
 {
     if (I('title')) {
         $map['title'] = array('like', '%' . I('title') . '%');
     }
     $map['page'] = $this->cache_name;
     $map['status'] = array('gt', -1);
     $list = $this->page($this->table, $map, 'sort desc,id desc');
     getBanner('advert');
     $data['_list'] = $list;
     $this->assign($data);
     $this->display();
 }
コード例 #3
0
foreach (array_keys($disks) as $descriptor) {
    // skip removable devices
    if ($disks[$descriptor]['removable']) {
        continue;
    }
    // show anything else
    echo ' ', basename($descriptor), ' -> ', $disks[$descriptor]['info'], ' (', $disks[$descriptor]['sizelabel'], ')', PHP_EOL;
    //
}
do {
    fwrite($rout, "\nEnter the device name you wish to install onto: ");
    $target_disk = chop(fgets($rin));
    if ($target_disk === '') {
        exit(0);
    }
} while (!array_key_exists("/dev/{$target_disk}", $disks));
getBanner($msg_dev_overwrite, 'WARNING!', $target_disk);
fwrite($rout, 'Do you want to proceed? (y/n)');
if (strcasecmp(chop(fgets($rin)), "y") == 0) {
    echo "Installing...";
    mwexec("/bin/gunzip -c /offload/firmware.img.gz | dd of=/dev/{$target_disk} bs=512");
    echo "done\n";
    /* copy existing configuration */
    echo "Copying configuration...";
    @mkdir("/mnttmp");
    mwexec("/bin/mount -w -o noatime /dev/{$target_disk}1 /mnttmp");
    mwexec("cp {$g['conf_path']}/config.xml /mnttmp/conf/");
    mwexec("/bin/umount /mnttmp");
    echo "done\n";
    system_reboot_sync();
}
コード例 #4
0
ファイル: query.php プロジェクト: valemunoz/chilemap_html
			  			</ul>	
			  			
			  		</li>
			  	<?php 
            }
            ?>
			  
			  </ul>     
			<?php 
        } else {
            echo "No hay favoritos.";
        }
    } elseif ($_REQUEST['tipo'] == 12) {
        addQuery($_REQUEST['q']);
    } elseif ($_REQUEST['tipo'] == 13) {
        $banners = getBanner();
        if (count($banners) > 0) {
            ?>
			<script>
				//alert("busco");
			 	
				 	swfobject.embedSWF("<?php 
            echo $banners[5];
            ?>
", "swf_div", "332", "80", "9.0.0", "js/expressInstall.swf",var1,var2,var3);
				</script>
			<?php 
        }
    } elseif ($_REQUEST['tipo'] == 14) {
        //echo $_REQUEST['region'];
        $comuna = getComunaxRegion($_REQUEST['region']);
コード例 #5
0
ファイル: banner.php プロジェクト: billadams/forever-frame
function controllerAction()
{
    global $data;
    $bannerId = getRequestParam('id');
    $storeId = getRequestParam('store_id') ? getRequestParam('store_id') : 0;
    $accountId = getRequestParam('account_id');
    if (!$accountId) {
        return;
    }
    $banner = getBanner($bannerId, $storeId);
    if (!$banner) {
        return;
    }
    $ipAddress = $_SERVER['REMOTE_ADDR'];
    if (!isRobots()) {
        if (!detectCookie()) {
            $link = getConnection();
            $table = getTable('affiliateplus_action');
            if ($actionId = getActionId($accountId, $bannerId, $storeId, $ipAddress)) {
                // update total view
                $sql = "UPDATE `{$table}` SET `totals` = `totals` + 1,";
                $sql .= "updated_time = '" . date('Y-m-d H:i:s') . "' WHERE `action_id` = {$actionId}";
                mysql_query($sql, $link);
            } else {
                // process for unique view row
                $uniqueSql = "SELECT `is_unique` FROM `{$table}` WHERE ";
                $uniqueSql .= "account_id = {$accountId} AND type = 1";
                $uniqueSql .= " AND banner_id = {$bannerId} AND store_id = {$storeId}";
                $uniqueSql .= " AND ip_address = '{$ipAddress}' AND is_unique = 1";
                if ($resetDay = getAffiliateplusConfig('action/resetclickby')) {
                    $uniqueSql .= " AND created_date > '" . date('Y-m-d', time() - $resetDay * 86400) . "'";
                }
                $uniqueSql .= " LIMIT 1";
                $isUniqueView = 1;
                if ($result = mysql_query($uniqueSql, $link)) {
                    $result = mysql_fetch_assoc($result);
                    if (isset($result['is_unique'])) {
                        $isUniqueView = 0;
                    }
                }
                if ($isUniqueView) {
                    // check for 1000 view (999 is ok) and call the Magento system
                    $lastSql = "SELECT `action_id` FROM `{$table}` WHERE ";
                    $lastSql .= "account_id = {$accountId} AND type = 1";
                    $lastSql .= " AND banner_id = {$bannerId} AND store_id = {$storeId}";
                    $lastSql .= " AND is_commission = 1 ORDER BY `action_id` DESC LIMIT 1";
                    $totalSql = "SELECT SUM(`is_unique`) as total_view FROM `{$table}` WHERE ";
                    $totalSql .= "account_id = {$accountId} AND type = 1";
                    $totalSql .= " AND banner_id = {$bannerId} AND store_id = {$storeId}";
                    $totalSql .= " AND (action_id > ({$lastSql}) OR ({$lastSql}) IS NULL)";
                    if ($result = mysql_query($totalSql, $link)) {
                        $result = mysql_fetch_assoc($result);
                        if (isset($result['total_view']) && ($result['total_view'] == 999 || $result['total_view'] == 1000)) {
                            $url = 'http';
                            if ($_SERVER["HTTPS"] == "on") {
                                $url .= 's';
                            }
                            $url .= '://' . $_SERVER["SERVER_NAME"];
                            if ($_SERVER["SERVER_PORT"] != "80") {
                                $url .= ':' . $_SERVER["SERVER_PORT"];
                            }
                            $url .= $_SERVER["REQUEST_URI"];
                            $url = str_replace('js/magestore/affiliateplus/banner.php', 'index.php/affiliates/banner/image/', $url);
                            header("Location: {$url}");
                            exit;
                        }
                    }
                }
                // create new view row
                $accountTbl = getTable('affiliateplus_account');
                $sql = "INSERT INTO `{$table}` SET ";
                $sql .= "account_id = {$accountId},";
                $sql .= "account_email = (SELECT email FROM `{$accountTbl}` WHERE account_id = {$accountId}),";
                $sql .= "banner_id = {$bannerId},";
                $sql .= "banner_title = '" . mysql_real_escape_string($banner['title'], $link) . "',";
                $sql .= "type = 1,totals = 1,";
                $sql .= "ip_address = '{$ipAddress}',";
                if (isset($_SERVER['HTTP_REFERER'])) {
                    $sql .= "domain = '{$_SERVER['HTTP_REFERER']}',";
                    $sql .= "referer = '" . refineDomain($_SERVER['HTTP_REFERER']) . "'";
                }
                $sql .= "created_date = '" . date('Y-m-d') . "',";
                $sql .= "updated_time = '" . date('Y-m-d H:i:s') . "',";
                $sql .= "store_id = {$storeId},";
                $sql .= "is_unique = {$isUniqueView}";
                mysql_query($sql, $link);
            }
        }
    }
    if (getRequestParam('type') == 'javascript') {
        return;
    }
    $sourceFile = '..' . DS . '..' . DS . '..' . DS . 'media' . DS . 'affiliateplus' . DS . 'banner' . DS;
    $sourceFile .= $banner['source_file'];
    $fileExt = pathinfo($banner['source_file'], PATHINFO_EXTENSION);
    $mimeTypes = array('swf' => 'application/x-shockwave-flash', 'swf' => 'application/x-shockwave-flash', 'jpg' => 'image/jpeg', 'JPG' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'JPEG' => 'image/jpeg', 'gif' => 'image/gif', 'GIF' => 'image/gif', 'png' => 'image/png', 'PNG' => 'image/png');
    if (isset($mimeTypes[$fileExt])) {
        header("Content-Type: " . $mimeTypes[$fileExt], true);
        header("Content-Length: " . filesize($sourceFile), true);
        header("Accept-Ranges: bytes", true);
        header("Connection: keep-alive", true);
        echo file_get_contents($sourceFile);
    } else {
        header('Content-Type: text/javascript');
    }
}
コード例 #6
0
ファイル: functions.php プロジェクト: aliihaidar/pso
/**
 * Show Template
 *
 * @author Jad Bou Chebl
 * @version 2009-01-10
 * @param string $template
 */
function showTpl($template)
{
    global $_SESSION;
    global $cssIncludes, $jsIncludes, $id1, $id2, $jsOnReady, $title, $content;
    $tpl = file_get_contents(PROJECT_TPL_PATH . $template);
    $tpl = str_replace("\$projectName", PROJECT_NAME, $tpl);
    $cssIncludes ? $tpl = str_replace("\$cssIncludes", $cssIncludes, $tpl) : ($tpl = str_replace("\$cssIncludes", "", $tpl));
    $jsIncludes ? $tpl = str_replace("\$jsIncludes", $jsIncludes, $tpl) : ($tpl = str_replace("\$jsIncludes", "", $tpl));
    $id1 ? $tpl = str_replace("\$id1", $id1, $tpl) : ($tpl = str_replace("\$id1", "", $tpl));
    $id2 ? $tpl = str_replace("\$id2", $id2, $tpl) : ($tpl = str_replace("\$id2", "", $tpl));
    $jsOnReady ? $tpl = str_replace("\$jsOnReady", $jsOnReady, $tpl) : ($tpl = str_replace("\$jsOnReady", "", $tpl));
    $title ? $tpl = str_replace("\$title", $title, $tpl) : ($tpl = str_replace("\$title", "", $tpl));
    $content ? $tpl = str_replace("\$content", $content, $tpl) : ($tpl = str_replace("\$content", "", $tpl));
    /**
     * Manage common includes
     */
    $tpl = str_replace("\$left_menu", file_get_contents(PROJECT_PATH . 'ssi/left_menu.html'), $tpl);
    $tpl = str_replace("\$chapters", getChapters(null), $tpl);
    $tpl = str_replace("\$banner1", getBanner(null, 1), $tpl);
    $tpl = str_replace("\$under_banner_left", file_get_contents(PROJECT_PATH . 'ssi/under_banner_left.html'), $tpl);
    $tpl = str_replace("\$login", include $_SESSION['fe_us_id'] ? 'ssi/logout.php' : 'ssi/login.php', $tpl);
    $tpl = str_replace("\$right_links", include 'ssi/right_links.php', $tpl);
    $tpl = str_replace("\$under_right_links", include 'ssi/under_right_links.php', $tpl);
    $tpl = str_replace("\$banner5", getBanner(null, 5), $tpl);
    $tpl = str_replace("\$footer", file_get_contents(PROJECT_PATH . 'ssi/footer.html'), $tpl);
    print $tpl;
    exit;
}
コード例 #7
0
 /**
  * Return HTML of a warning-message
  */
 protected function getWarning($msg)
 {
     return getBanner($msg, 'error', 'grey');
 }