当前位置: 首页>>代码示例>>PHP>>正文


PHP get_article函数代码示例

本文整理汇总了PHP中get_article函数的典型用法代码示例。如果您正苦于以下问题:PHP get_article函数的具体用法?PHP get_article怎么用?PHP get_article使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_article函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: view

 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);
 }
开发者ID:workplayteam,项目名称:P2P,代码行数:25,代码来源:usagetipModule.class.php

示例2: format_nav_list

/**
 * 获取导航菜单
 */
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;
}
开发者ID:eliu03,项目名称:fanweP2P,代码行数:30,代码来源:common.php

示例3: get_latest_article

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;
}
开发者ID:halfbyte,项目名称:janzyklopedie,代码行数:9,代码来源:funcs.inc.php

示例4: index

 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);
 }
开发者ID:norain2050,项目名称:fanwei_xindai_3.2,代码行数:44,代码来源:helpModule.class.php

示例5: index

 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);
 }
开发者ID:workplayteam,项目名称:P2P,代码行数:67,代码来源:sysModule.class.php

示例6: require

<? 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 />
开发者ID:jeffayle,项目名称:RSS-Maker,代码行数:31,代码来源:article.php

示例7: get_footer

function get_footer()
{
    return get_article('footer');
}
开发者ID:kishanterry,项目名称:emdlog,代码行数:4,代码来源:helpers.php

示例8: get_header

<?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.
}
?>
开发者ID:southworkscom,项目名称:vscom,代码行数:30,代码来源:document-template.php

示例9: get_article

<?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';
开发者ID:Boleiko-Nastia,项目名称:conference,代码行数:17,代码来源:edit_news_translation.php

示例10: get_points

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;
}
开发者ID:RandomEtc,项目名称:apimaps,代码行数:40,代码来源:data.php

示例11: get_articles

             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']);
     }
 }
开发者ID:justincawthorne,项目名称:mt-test,代码行数:31,代码来源:index.php

示例12: get_article

    }
    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);
			?>
开发者ID:rokibul-hasan,项目名称:michel-wein,代码行数:31,代码来源:weinliste_detail.php

示例13: article_json_pmid

            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;
    }
}
开发者ID:BIDS-collaborative,项目名称:brainspell,代码行数:31,代码来源:brainspell.php

示例14: get_post

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);
开发者ID:enascimento,项目名称:carmack,代码行数:31,代码来源:slash2html.php

示例15: index

 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);
 }
开发者ID:YouthAndra,项目名称:huaitaoo2o,代码行数:66,代码来源:articleModule.class.php


注:本文中的get_article函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。