private function view() { $id = intval($_REQUEST['id']); if ($id == 0) { app_redirect(url("index", "usagetip")); } $GLOBALS['tmpl']->caching = true; $GLOBALS['tmpl']->cache_lifetime = 6000; //首页缓存10分钟 $cache_id = md5(MODULE_NAME . ACTION_NAME . "view" . $id); if (!$GLOBALS['tmpl']->is_cached("page/usagetip_view.html", $cache_id)) { $article = get_article($id); $GLOBALS['tmpl']->assign("article", $article); $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title']; $GLOBALS['tmpl']->assign("page_title", $seo_title); $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title']; $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ","); $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title']; $GLOBALS['tmpl']->assign("page_description", $seo_description . ","); //使用技巧 $use_tech_list = get_article_list(6, 6); $GLOBALS['tmpl']->assign("use_tech_list", $use_tech_list); } $GLOBALS['tmpl']->display("page/usagetip_view.html", $cache_id); }
/** * 获取导航菜单 */ function format_nav_list($nav_list) { foreach ($nav_list as $k => $v) { if (trim($v['url']) != '') { if (substr($v['url'], 0, 7) != "http://") { //开始分析url $nav_list[$k]['url'] = APP_ROOT . "/" . $v['url']; } } else { preg_match("/id=(\\d+)/i", $v['u_param'], $matches); $id = intval($matches[1]); if ($v['u_module'] == 'article' && $id > 0) { $article = get_article($id); if ($article['type_id'] == 1) { $nav_list[$k]['u_module'] = "help"; } elseif ($article['type_id'] == 2) { $nav_list[$k]['u_module'] = "notice"; } elseif ($article['type_id'] == 3) { $nav_list[$k]['u_module'] = "sys"; } else { $nav_list[$k]['u_module'] = 'article'; } } } } return $nav_list; }
function get_latest_article() { if ($entry_all = return_query("SELECT entry_id FROM enz_entries ORDER BY entry_id DESC LIMIT 0,1")) { $entry = $entry_all[0]; $entry = get_article($entry['entry_id']); return $entry; } return 0; }
public function index() { $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . $GLOBALS['deal_city']['id']); if (!$GLOBALS['tmpl']->is_cached('page/help_index.html', $cache_id)) { $id = intval($_REQUEST['id']); $uname = addslashes(trim($_REQUEST['id'])); if ($id == 0 && $uname == '') { $id = $GLOBALS['db']->getOne("select a.id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where ac.type_id = 1 order by a.sort desc"); } elseif ($id == 0 && $uname != '') { $id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "article where uname = '" . $uname . "'"); } $article = get_article($id); if (!$article || $article['type_id'] != 1) { app_redirect(APP_ROOT . "/"); } else { if (check_ipop_limit(get_client_ip(), "article", 60, $article['id'])) { //每一分钟访问更新一次点击数 $GLOBALS['db']->query("update " . DB_PREFIX . "article set click_count = click_count + 1 where id =" . $article['id']); } if ($article['rel_url'] != '') { if (!preg_match("/http:\\/\\//i", $article['rel_url'])) { if (substr($article['rel_url'], 0, 2) == 'u:') { app_redirect(parse_url_tag($article['rel_url'])); } else { app_redirect(APP_ROOT . "/" . $article['rel_url']); } } else { app_redirect($article['rel_url']); } } } $article = get_article($id); $GLOBALS['tmpl']->assign("article", $article); $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title']; $GLOBALS['tmpl']->assign("page_title", $seo_title); $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title']; $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ","); $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title']; $GLOBALS['tmpl']->assign("page_description", $seo_description . ","); $GLOBALS['tmpl']->assign("relate_help", $cate_list); } $GLOBALS['tmpl']->display("page/help_index.html", $cache_id); }
public function index() { $id = intval($_REQUEST['id']); $uname = addslashes(trim($_REQUEST['id'])); if ($uname == 'list') { $this->list_notice(); exit; } $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . $GLOBALS['deal_city']['id']); if (!$GLOBALS['tmpl']->is_cached('sys_index.html', $cache_id)) { if ($id == 0 && $uname == '') { app_redirect(APP_ROOT . "/"); } elseif ($id == 0 && $uname != '') { $id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "article where uname = '" . $uname . "'"); } $article = get_article($id); if (!$article || $article['type_id'] != 3) { app_redirect(APP_ROOT . "/"); } else { if (check_ipop_limit(get_client_ip(), "article", 60, $article['id'])) { //每一分钟访问更新一次点击数 $GLOBALS['db']->query("update " . DB_PREFIX . "article set click_count = click_count + 1 where id =" . $article['id']); } if ($article['rel_url'] != '') { if (!preg_match("/http:\\/\\//i", $article['rel_url'])) { if (substr($article['rel_url'], 0, 2) == 'u:') { app_redirect(parse_url_tag($article['rel_url'])); } else { app_redirect(APP_ROOT . "/" . $article['rel_url']); } } else { app_redirect($article['rel_url']); } } } $article = get_article($id); $GLOBALS['tmpl']->assign("article", $article); //开始输出当前的site_nav $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/"); $site_nav[] = array('name' => $GLOBALS['lang']['SHOP_SYSTEM'], 'url' => url("shop", "sys#list")); if ($article['type_id'] == 1) { $module = "help"; } elseif ($article['type_id'] == 2) { $module = "notice"; } elseif ($article['type_id'] == 3) { $module = "sys"; } else { $module = 'article'; } if ($article['uname'] != '') { $aurl = url("index", $module, array("id" => $article['uname'])); } else { $aurl = url("index", $module, array("id" => $article['id'])); } $site_nav[] = array('name' => $article['title'], 'url' => $aurl); $GLOBALS['tmpl']->assign("site_nav", $site_nav); //输出当前的site_nav $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title']; $GLOBALS['tmpl']->assign("page_title", $seo_title); $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title']; $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ","); $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title']; $GLOBALS['tmpl']->assign("page_description", $seo_description . ","); } $GLOBALS['tmpl']->display("sys_index.html", $cache_id); }
<? require('header.php'); $id = $_GET['a']; $article = get_article($db, $id); ?> <div id="nav"> <a href="index.php">Home</a> | <a href="feed.php?f=<?php echo $article['feed']; ?> ">Feed</a> </div> <h2><?php echo $article['title']; ?> </h2> <form action="newarticle.php?edit" method="post"> <input type="hidden" name="article" value="<?php echo $id; ?> " /> Title: <input type="text" name="title" value="<?php echo $article['title']; ?> " /> <br /> <textarea name="desc"><?php echo $article['description']; ?> </textarea> <br />
function get_footer() { return get_article('footer'); }
<?php /* Template Name: document-template */ get_header(); if (function_exists('get_article')) { $stringContent = get_article($wp_query->query_vars['documentation_id']); print_r($stringContent); } ?> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php // Start the loop. while (have_posts()) { the_post(); // Include the page content template. get_template_part('content', 'page'); // If comments are open or we have at least one comment, load up the comment template. if (comments_open() || get_comments_number()) { comments_template(); } // End the loop. } ?>
<?php require_once 'common.php'; require_once 'models/edit_news_translation.model.php'; $article_id = $_GET['article']; $lang_id = $_GET['lang']; $article = get_article($article_id, $lang_id); $article = $article[0]; if ($article_id && $lang_id && $_POST) { $title = $_POST['title']; $addedby = $_POST['name']; $full_text = $_POST['article']; $lang = get_lang_by_name($lang_id); $data = array('title' => $title, 'full_text' => $full_text, 'article_id' => $article_id, 'lang_id' => $lang); set_article($data); } require_once 'templates/edit_news_translation.php';
function get_points(&$C, $args) { $count = is_numeric($args['count']) ? intval($args['count']) : 1000; $offset = is_numeric($args['offset']) ? intval($args['offset']) : 0; $woe_id = is_int($args['woe_id']) ? $args['woe_id'] : null; $woe_ids = is_array($args['woe_ids']) ? $args['woe_ids'] : null; $article_id = is_int($args['article_id']) ? $args['article_id'] : null; $article_ids = is_array($args['article_ids']) ? $args['article_ids'] : null; $where = array('1'); $order = array(); if ($woe_id) { $where[] = sprintf('p.woe_id = %d', $woe_id); } if ($woe_ids) { $where[] = sprintf('p.woe_id IN (%s)', join(', ', $woe_ids)); } if ($article_id) { $where[] = sprintf('p.article_id = %d', $article_id); } if ($article_ids) { $where[] = sprintf('p.article_id IN (%s)', join(', ', $article_ids)); } // default sort $order[] = 'p.created DESC'; $where_clause = join(' AND ', $where); $order_clause = join(', ', $order); $q = sprintf("SELECT p.article_id, p.woe_id,\n p.latitude, p.longitude,\n p.place_id, p.place_path, p.place_type, p.place_name,\n p.created\n FROM points AS p\n WHERE {$where_clause}\n ORDER BY {$order_clause}\n LIMIT {$count} OFFSET {$offset}"); $res = $C->dbh->query($q); if (PEAR::isError($res)) { die("DB Error: " . $q); } $points = array(); while ($point = $res->fetchRow(DB_FETCHMODE_ASSOC)) { $point['article'] = get_article($C, $point['article_id']); $point['article_id'] = intval($point['article_id']); $point['woe_id'] = intval($point['woe_id']); $points[] = $point; } return $points; }
case 'per_page': default: $config['layout']['list_style'] = $config['front']['front_list_style']; $articles = get_articles($config['layout']); break; } } } // 404 error if ($_GET['page_name'] == '404') { // no content // we set up the meta tags and parse the request string on the partial page } // single article if ($_GET['page_name'] == 'article') { $article = get_article($_GET['article_id']); } // multiple articles - either a search or listings request if ($_GET['page_name'] == 'listing') { if (isset($_GET['feed_listing'])) { // for a list of all available feeds we'll borrow the listing page $feeds = get_feeds($config['admin']['show_all_feeds']); $articles = format_feeds_list($feeds); } elseif (!empty($_GET['search'])) { // run a search $articles = search_articles($_GET['search'], $config['layout']); } else { // standard article listing $articles = get_articles($config['layout']); } }
} if (!in_array($artikel, $result)) { $artikel = "101"; } $sql = "SELECT * FROM `produkte` WHERE `artikelnummer` = \"{$artikel}\" LIMIT 1"; $ergebnis = $db->query($sql); if ($ergebnis->num_rows == 0) { $ergebnis = False; } $db->close(); return $ergebnis; } $result = get_article(); if ($result == False) { $_GET['artikel'] = "101"; $result = get_article(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body> <div class="detailviewdiv"> <? $z = $result->fetch_object(); $files = array(); $pattern = "weinliste_images/{$z->artikelnummer}_72_medium_*.jpg"; $files = glob("$pattern",GLOB_BRACE); ?>
article_json_pmid($_GET["PMID"]); break; case "article_json_doi": article_json_doi($_GET["PMID"]); break; case "search_lucene": search_lucene($_GET["query"]); break; case "article_list": article_list($_GET["query"]); break; case "index_lucene": index_lucene($_GET, 1); break; case "get_article": get_article($_GET); break; case "get_concept": get_concept($_GET); break; case "add_log": add_log($_GET); break; case "get_log": get_log($_GET); break; case "admin_updateDOI": admin_updateDOI($_GET); break; } }
function get_post($fp) { return array("date" => fgetschop($fp), "url" => fgetschop($fp), "title" => fgetschop($fp), "post" => fgetschop($fp)); } $sids = array(); $posts = array(); $post_count = 0; $cur_sid = ""; $cur_title = ""; $fp = fopen("../slash_files/slash_parsed2.txt", "r"); if (!$fp) { exit; } $articles = fgetschop($fp); while ($articles--) { $article = get_article($fp); $cur_sid = $article["sid"]; $cur_title = $article["title"]; $sids[$cur_sid] = array("title" => $cur_title, "url" => $article["url"]); while ($article["posts"]--) { $post = get_post($fp); $posts[$cur_sid][$post["date"]][] = array("url" => $post["url"], "title" => $post["title"], "article" => $cur_title, "post" => $post["post"]); } } fclose($fp); $output_file = "../slashdot.html"; $fp = fopen($output_file, "w"); $head = preg_replace(array("/@keywords/", "/@title/"), array($conf->keywords . ", slashdot", "{$conf->title} - Slashdot archive"), $conf->header); $head .= read_file("template/slashdot.html"); $titles = "<h2>Article List</h2>\n<ul>\n"; ksort($sids);
public function index() { $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['id']) . $GLOBALS['deal_city']['id']); if (!$GLOBALS['tmpl']->is_cached('article_index.html', $cache_id)) { $cate_tree = get_acate_tree(); $GLOBALS['tmpl']->assign("acate_tree", $cate_tree); //获取当前页的团购商品 $id = intval($_REQUEST['id']); $uname = addslashes(trim($_REQUEST['id'])); if ($id == 0 && $uname == '') { app_redirect(APP_ROOT . "/"); } elseif ($id == 0 && $uname != '') { $id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "article where is_delete = 0 and is_effect = 1 and uname = '" . $uname . "'"); } $article = get_article($id); if (!$article || $article['type_id'] != 0) { app_redirect(APP_ROOT . "/"); } else { if ($article['rel_url'] != '') { if (!preg_match("/http:\\/\\//i", $article['rel_url'])) { if (substr($article['rel_url'], 0, 2) == 'u:') { app_redirect(parse_url_tag($article['rel_url'])); } else { app_redirect(APP_ROOT . "/" . $article['rel_url']); } } else { app_redirect($article['rel_url']); } } } //开始输出当前的site_nav $cates = array(); $cate = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = " . $article['cate_id']); do { $cates[] = $cate; $pid = intval($cate['pid']); $cate = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where is_effect =1 and is_delete =0 and id = " . $pid); } while ($pid != 0); $page_title = substr($page_title, 0, -3); krsort($cates); $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => APP_ROOT . "/"); if ($cates) { foreach ($cates as $cate_row) { $site_nav[] = array('name' => $cate_row['title'], 'url' => url("shop", "acate#index", array("id" => $cate_row['id']))); } } if ($article['uname'] != '') { $aurl = url("shop", "article#index", array("id" => $article['uname'])); } else { $aurl = url("shop", "article#index", array("id" => $article['id'])); } $site_nav[] = array('name' => $article['title'], 'url' => $aurl); $GLOBALS['tmpl']->assign("site_nav", $site_nav); //输出当前的site_nav $article = get_article($id); $GLOBALS['tmpl']->assign("article", $article); $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title']; $GLOBALS['tmpl']->assign("page_title", $seo_title); $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title']; $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ","); $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title']; $GLOBALS['tmpl']->assign("page_description", $seo_description . ","); } $GLOBALS['tmpl']->display("article_index.html", $cache_id); }
<script> $(function() { $( "#datepicker" ).datepicker(); }); </script> <!---/End-date-piker----> <div class="p-ww"> <form> <span> Where</span> <input class="dest" type="text" value="Distination" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Distination';}"> <span> When</span> <input class="date" id="datepicker" type="text" value="Select date" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Select date';}"> <input type="submit" value="Search" /> </form> </div> </div> <div class="clear"> </div></div> <!----//End-find-place----> <div class="wrap"> <?php if (isset($page)) { echo get_page($page); } ?> <?php if (isset($article)) { echo get_article($article); } ?> </div>
function part_items($items, &$prod_id, &$date_mod, $start_pos) { $start_time = time(); for ($i = $start_pos; $i < count($items) && $i < $start_pos + 30; $i++) { $item_id = get_id_by_sku(get_article($items[$i]->No)); if ($item_id) { $prod_id[$items[$i]->No] = $item_id; $date_mod[$items[$i]->No] = get_post_meta($item_id, '_last_time_modified', true); if ($date_mod[$items[$i]->No] < $items[$i]->Last_time_modified) { //если дата последнего изменения товара в бд меньше, чем дата изменения выгруженного товара, то обновляем set_main_information($items[$i], $item_id); update_post_meta($item_id, '_last_time_modified', $items[$i]->Last_time_modified); } } else { //новый продукт добавляем в базу create_item($items[$i], $prod_id); } if (time() - $start_time > 25 || $i == $start_pos + 29) { restart_load_items($items, $prod_id, $date_mod, ++$i); break; } error_log(current_time('mysql') . " Added item " . $i . ": " . $prod_id[$items[$i]->No] . ": " . $items[$i]->No . " \r\n", 3, "connect.log"); } }
</div> </div> <div class="iirig"> <h5>网络热门文章</h5> <dl class="channel"> <dd><a href="<?php echo url('public/article/more'); ?> " target="_blank" title="更多文章">更多</a></dd> </dl> <div class="content"> <div class="inew-class"> <ul> <?php if (is_array(get_article())) { foreach (get_article() as $one) { ?> <li><a href="<?php echo url('public/article', array('id' => $one['id'])); ?> " target="_blank" title="<?php echo $one['title']; ?> "><?php echo $one['title']; ?> </a></li> <?php } } ?>
$c = chr($s); if ($entries = return_query("SELECT entry_id,title,date FROM enz_entries WHERE idx='{$c}' ORDER BY title")) { foreach ($entries as $entry) { $tpl->SetCurrentBlock("eintrag"); $tpl->SetVariable("titel", $entry[title]); $tpl->SetVariable("entry_id", $entry[entry_id]); $tpl->SetVariable("date", $entry[date]); $tpl->ParseCurrentBlock("eintrag"); } } $tpl->SetCurrentBlock("buchstabe"); $tpl->SetVariable("buchstabe", strtoupper($c)); $tpl->ParseCurrentBlock("buchstabe"); } } elseif ($_GET[action] == "entry") { if ($entry = get_article($_GET[id])) { # head- titel setzen $headtpl->SetVariable("titel", $entry[title]); # main-template laden $tpl->loadTemplatefile("entry.tpl.html", true, true); $tpl->SetVariable("titel", $entry[title]); $tpl->SetVariable("entry_id", $entry[entry_id]); $tpl->SetVariable("artikel", $entry[artikel]); $tpl->SetVariable("date", $entry[date]); $tpl->SetVariable("text", nl2br($entry[text])); $comments = get_comments($_GET['id']); if ($comments) { foreach ($comments as $comment) { $link = $comment['link']; if (strpos($link, "@") != false) { if (strpos($link, "mailto:") == false) {
<?php include_once 'db_fns.php'; if (empty($_GET['view'])) { $view = 'start'; } else { $view = $_GET['view']; } echo 'view:::::---| ' . $view . '<br />'; switch ($view) { case 'start': $items = get_exercises(); break; case 'muscle_group': $m_group = $_GET['align']; $items = get_muscle_group_exercise($m_group); break; case 'article': $id = $_GET['id']; $item = get_article($id); break; } include $_SERVER['DOCUMENT_ROOT'] . '/euro/view/layouts/blog.php';