本文整理汇总了PHP中get_news函数的典型用法代码示例。如果您正苦于以下问题:PHP get_news函数的具体用法?PHP get_news怎么用?PHP get_news使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_news函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: show_page
function show_page($page)
{
$template = "view/templates/default_template.php";
if (file_exists($template) && is_file($template)) {
require_once $template;
} else {
require_once "view/templates/default_template.php";
}
echo get_document_head();
echo get_header_start();
if (is_logged_in()) {
echo get_logout();
} else {
}
echo get_header_end();
if (is_logged_in()) {
echo get_menu();
} else {
echo get_guest_menu();
}
if (is_logged_in()) {
if ($page == "startpage") {
echo "startpage";
} else {
if ($page == "fileupload") {
echo get_fileupload();
} else {
if ($page == "nyheter") {
echo get_news();
} else {
if ($page == "flowing") {
echo get_flowing();
} else {
if ($page == "event") {
echo get_event();
} else {
if ($page == "profile") {
$user_id = 1;
echo get_profile($user_id);
} else {
echo get_default("");
}
}
}
}
}
}
} else {
echo get_login();
}
echo get_footer();
echo get_document_end();
}
开发者ID:eva-chaunm,项目名称:paraflow,代码行数:53,代码来源:page.php
示例2: news_mangament_print
function news_mangament_print()
{
echo '
<table class="content">
<tr>
<td>ID</td>
<td>Wiadomość</td>
<td>Data wiadomośći</td>
<td>Modyfikuj</td>
<td>Usuń</td>
</tr>
';
$news = get_news();
foreach ($news as $msg) {
echo '<tr>
<td>
<form action="index.php" method="POST">
' . $msg['id_message_board'] . '
</td>
<td>
<input type="text" name="message_message_board" value="' . $msg['message_message_board'] . '"/>
</td>
<td>
' . $msg['date_message_board'] . '
</td>
<td>
<input type="hidden" name="update_news_id" value="' . $msg['id_message_board'] . '"/>
<input type="hidden" name="kat" value="settings"/>
<input type="hidden" name="id" value="updatenews"/>
<input type="submit" name="update_news_submit" value="Aktualizuj"/>
</form>
</td>
<td>
<form action="index.php" method="POST">
<input type="hidden" name="delete_news" value="' . $msg['id_message_board'] . '"/>
<input type="hidden" name="kat" value="settings"/>
<input type="hidden" name="id" value="deletenews"/>
<input type="submit" name="delete_news_submit" value="Usuń"/>
</form>
</td>
</tr>';
}
echo ' </table>
';
}
开发者ID:poorrepo,项目名称:smsproject,代码行数:45,代码来源:settings.php
示例3: show_page
function show_page($page)
{
$template = '';
$posts_per_page = 5;
$page_nr = isset($_GET['page_nr']) ? $_GET['page_nr'] : '0';
$limit = $page_nr * $posts_per_page . ", {$posts_per_page}";
// $template_file = select_from_db(array('blogs.template'), array('blogs'), array("blogs.name='$page'"));
// $template = "view/templates/" . $template_file[0]['template'];
$template = "view/templates/default_template.php";
if (file_exists($template) && is_file($template)) {
require_once $template;
} else {
require_once "view/templates/default_template.php";
}
echo get_document_head();
echo get_header();
echo get_menu();
if ($page == "startpage") {
echo "startpage";
} else {
if ($page == "search") {
echo get_searchbar();
echo get_search_results();
echo get_thechosen();
} else {
if ($page == "fileupload") {
echo get_fileupload();
} else {
if ($page == "nyheter") {
echo get_news();
} else {
if ($page == "receipes") {
$recipe = "Hallonmums";
echo get_recipes($recipe);
} else {
echo get_default("Välkommen");
}
}
}
}
}
echo get_footer();
echo get_document_end();
}
开发者ID:eva-chaunm,项目名称:paraflow,代码行数:44,代码来源:page.php
示例4: print_news_html
/**
* prints out the news (for the HTML pages)
*/
function print_news_html($type, $number)
{
$news = get_news($type, $number);
// see if we have no news items...
if ($news == "No news.") {
print "No news items.";
} else {
// split the news posts into separate ones
$news_posts = explode("_____", $news);
// split a news post into its individual parts
foreach ($news_posts as $news_post) {
// to strip out the blank one
if ($news_post != "") {
list($id, $timestamp, $subject, $body) = explode("::::", $news_post);
print "<div class=\"news_item\"><p class=\"news_subject\">{$subject}</p><p class=\"news_body\">{$body}</p><p class=\"news_byline\"><a href=\"news.php?archive&id={$id}\" title=\"{$subject}\">Posted at " . date("m-d-y h:i:s", $timestamp) . "</a></p></div>";
}
}
}
}
开发者ID:kfr2,项目名称:phpmygrades,代码行数:22,代码来源:newslib.php
示例5: public_menu
function public_menu()
{
//funkcija koja sluzi za generisanje menija koji ce se prikazivati javnim korisnicima
$result = get_all('categories');
$output = '<ul class="nav navbar-nav">';
while ($category = mysqli_fetch_assoc($result)) {
$all_news = get_news($category['id']);
if (mysqli_num_rows($all_news) > 0 && $category['visible'] == 1) {
//ako je kategorija vidljiva i ima vidljivih vijesti
$output .= '<li class="dropdown">';
$output .= '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' . $category['title'] . '<span class="caret"></span></a>';
$output .= '<ul class="dropdown-menu">';
while ($news = mysqli_fetch_assoc($all_news)) {
$output .= '<li><a href="index.php?id=' . $news['id'] . '">' . $news['title'] . '</a></li>';
}
$output .= '</ul>';
$output .= '</li>';
}
}
$output .= '</ul>';
return $output;
}
开发者ID:Ognj3n,项目名称:cms,代码行数:22,代码来源:functions.php
示例6: get_content
function get_content()
{
global $content;
$file = 'pages/' . in('p');
if (in('dyn')) {
$id = in('dyn');
$content = get_dyn_content($id);
return;
}
if (in('l') == 'eng') {
$file .= '_e';
}
$file .= '.html';
if (in('p') == 'news') {
$content = get_news(in('id'));
return;
}
if (!in('p')) {
$id = in('l') == 'eng' ? 26 : 9;
$content = get_dyn_content($id);
$t = new Template("inc/news.tmpls");
$c = get_news_list(1, 0);
// avalehele kolm uudist koos kstga
if (in('l') == 'eng') {
$tmpl = 'news1_e';
} else {
$tmpl = 'news1';
}
$news_content = $t->get($tmpl, array($c));
$content = preg_replace("/\\[UUDISED\\]/", $news_content, $content);
return;
}
if (file_exists($file)) {
$content = implode("\n", file($file));
list($savi, $content, $savi) = explode("<delimiter>", $content);
} else {
if (in('l') == 'eng') {
$content = 'Coming soon...';
} else {
$content = 'Valmimas...';
}
}
}
开发者ID:vcgato29,项目名称:poff,代码行数:43,代码来源:index.php
示例7: post_news
/**
* 依据给定的地址和规则采集并发表文章
* @package WordPress
* @subpackage Auto-Post-News
* @since 0.0.1
* @param array $news_args 所有需要用到的参数,参考示例
* @return bool 成功则返回文章ID,失败则返回具体原因
*/
function post_news()
{
$news_args = array('lock_file' => dirname(__FILE__) . '/post.lock', 'news_list_type' => 'rss', 'news_rss' => 'http://feeds.bbci.co.uk/news/business/rss.xml', 'news_max' => 2, 'auto_matche' => FALSE, 'news_pattern' => array(array('<!-- / story-body -->', '|<h1 class="story-header">([\\W\\w]*?)</h1>([\\W\\w]*?)</div><!-- / story-body -->|i'), array('<div id="page-bookmark-links-foot"', '|<h1 class="story-header">([\\W\\w]*?)</h1>([\\W\\w]*?)<div id="page-bookmark-links-foot"|i'), array('<table class="storycontent"', '|<table class="storycontent"[\\W\\w]*?<h1>([\\W\\w]*?)</h1>([\\W\\w]*?)<!-- body - End -->|i')), 'preg_replace' => array('|<noscript>[\\W\\w]*?</noscript>|i', '|<script[\\W\\w]*?</script>|i', '|<form[\\W\\w]*?</form>|i', '|<ul class="related-links-list">[\\W\\w]*?</ul>|i', '|<!--[\\W\\w]*?-->|i', '|<[a-z][^>]*></[^>]*>|i', '|<div class="read-more">[\\W\\w]*?</div>|i'), 'str_replace' => array("\n", "\t", "\r", "", "\v", ' ', 'Continue reading the main story'), 'has_content_post' => 'publish', 'no_content_post' => 'draft', 'author' => '1', 'category_name' => 'Business', 'rss_time' => FALSE, 'add_more' => array(TRUE, 1000, 500), 'publish_time' => TRUE, 'orgin_link' => TRUE);
if (lock('check', $news_args['lock_file']) == 'locked') {
return 'Locked';
}
ignore_user_abort(TRUE);
$rss = fetch_feed($news_args['news_rss']);
if (!is_wp_error($rss)) {
$items = $rss->get_items();
} else {
lock('delete', $news_args['lock_file']);
return $rss;
}
$post_guids = get_guids('numberposts=50&post_status=publish,draft');
$allowedposttags = array('address' => array(), 'a' => array('href' => array(), 'id' => array(), 'title' => array(), 'rel' => array(), 'rev' => array(), 'name' => array(), 'target' => array()), 'abbr' => array('title' => array()), 'acronym' => array('title' => array()), 'article' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'aside' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'b' => array(), 'big' => array(), 'blockquote' => array('id' => array(), 'cite' => array(), 'lang' => array(), 'xml:lang' => array()), 'br' => array('class' => array()), 'caption' => array('align' => array(), 'class' => array()), 'cite' => array('dir' => array(), 'lang' => array(), 'title' => array()), 'code' => array(), 'col' => array('align' => array(), 'char' => array(), 'charoff' => array(), 'span' => array(), 'dir' => array(), 'valign' => array(), 'width' => array()), 'del' => array('datetime' => array()), 'dd' => array(), 'details' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'open' => array(), 'xml:lang' => array()), 'dl' => array(), 'dt' => array(), 'em' => array(), 'figure' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'figcaption' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'font' => array('color' => array(), 'face' => array(), 'size' => array()), 'footer' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'h1' => array('align' => array(), 'id' => array()), 'h2' => array('align' => array(), 'id' => array()), 'h3' => array('align' => array(), 'id' => array()), 'h4' => array('align' => array(), 'id' => array()), 'h5' => array('align' => array(), 'id' => array()), 'h6' => array('align' => array(), 'id' => array()), 'header' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'hgroup' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'hr' => array('align' => array(), 'noshade' => array(), 'size' => array(), 'width' => array()), 'i' => array(), 'img' => array('alt' => array(), 'align' => array(), 'border' => array(), 'height' => array(), 'hspace' => array(), 'longdesc' => array(), 'vspace' => array(), 'src' => array(), 'width' => array()), 'ins' => array('datetime' => array(), 'cite' => array()), 'kbd' => array(), 'li' => array('align' => array(), 'class' => array()), 'menu' => array('type' => array()), 'p' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'pre' => array('width' => array()), 'q' => array('cite' => array()), 's' => array(), 'span' => array('dir' => array(), 'align' => array(), 'lang' => array(), 'title' => array(), 'xml:lang' => array()), 'section' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'strike' => array(), 'strong' => array(), 'sub' => array(), 'summary' => array('align' => array(), 'dir' => array(), 'lang' => array(), 'xml:lang' => array()), 'sup' => array(), 'table' => array('align' => array(), 'bgcolor' => array(), 'border' => array(), 'cellpadding' => array(), 'cellspacing' => array(), 'dir' => array(), 'id' => array(), 'rules' => array(), 'summary' => array(), 'width' => array()), 'tbody' => array('align' => array(), 'char' => array(), 'charoff' => array(), 'valign' => array()), 'td' => array('abbr' => array(), 'align' => array(), 'axis' => array(), 'bgcolor' => array(), 'char' => array(), 'charoff' => array(), 'colspan' => array(), 'dir' => array(), 'headers' => array(), 'height' => array(), 'nowrap' => array(), 'rowspan' => array(), 'scope' => array(), 'valign' => array(), 'width' => array()), 'tfoot' => array('align' => array(), 'char' => array(), 'charoff' => array(), 'valign' => array()), 'th' => array('abbr' => array(), 'align' => array(), 'axis' => array(), 'bgcolor' => array(), 'char' => array(), 'charoff' => array(), 'colspan' => array(), 'headers' => array(), 'height' => array(), 'nowrap' => array(), 'rowspan' => array(), 'scope' => array(), 'valign' => array(), 'width' => array()), 'thead' => array('align' => array(), 'char' => array(), 'charoff' => array(), 'valign' => array()), 'title' => array(), 'tr' => array('align' => array(), 'bgcolor' => array(), 'char' => array(), 'charoff' => array(), 'valign' => array()), 'tt' => array(), 'u' => array(), 'ul' => array('type' => array()), 'ol' => array('start' => array(), 'type' => array()), 'video' => array('autoplay' => array(), 'controls' => array(), 'height' => array(), 'loop' => array()), 'preload' => array(), 'src' => array(), 'width' => array());
$count_post = 0;
foreach ($items as $item) {
$news_matche = array();
$post = array();
if (in_array($item->get_id(), $post_guids)) {
continue;
}
$news = get_news($item->get_id());
//提取正文
if ($news == FALSE) {
$post_content = $item->get_content();
$post_status = $news_args['no_content_post'];
} else {
foreach ($news_args['news_pattern'] as $pattern) {
if (!$news_args['auto_matche'] && stripos($news, $pattern['0'])) {
preg_match($pattern['1'], $news, $news_matche);
break;
} else {
preg_match($pattern['1'], $news, $news_matche);
}
}
// print_r($news_matche);
if (!empty($news_matche)) {
$post_content = $news_matche['2'];
$post_status = $news_args['has_content_post'];
} elseif ($item->get_content()) {
$post_content = $item->get_content();
$post_status = $news_args['no_content_post'];
} else {
continue;
}
}
$post_content = custom_replace($post_content, $news_args['str_replace'], $news_args['preg_replace']);
$post_content = wp_kses($post_content, $allowedposttags);
$post_content = wptexturize($post_content);
$post_content = popuplinks($post_content);
$post_content = make_link_absolute($post_content, $item->get_id());
if ($news_args['add_more']['0'] && strlen($post_content) > max(600, $news_args['add_more']['1'])) {
$post_content = substr_replace($post_content, '<!--more-->', stripos($post_content, '</p>', max(300, $news_args['add_more']['2'])) + 4, 0);
}
if ($news_args['publish_time']) {
$post_content .= '<br />Published at ' . $item->get_date(get_option('date_format') . ' ' . get_option('time_format')) . ' GMT';
}
if ($news_args['orgin_link']) {
$post_content .= '<br />From: <a target="_blank" title="' . $item->get_title() . '" href="' . $item->get_id() . '">' . $item->get_title() . '</a>';
}
// echo $post_content . '<hr />';
$post_category = term_exists($news_args['category_name'], 'category');
if (!$post_category && $news_args['category_name']) {
$post_category = wp_insert_term($news_args['category_name'], 'category');
}
$post = array('post_status' => $post_status, 'post_author' => $news_args['author'], 'post_category' => $post_category ? array($post_category['term_id']) : '', 'post_date' => $news_args['rss_time'] ? $item->get_date() : '', 'post_content' => $post_content, 'post_excerpt' => $item->get_description(), 'post_title' => $item->get_title(), 'tags_input' => '', 'guid' => $item->get_id());
generic_ping(wp_insert_post($post));
if (++$count_post >= $news_args['news_max']) {
break;
}
sleep('1');
}
lock('delete', $news_args['lock_file']);
}
开发者ID:023yangbo,项目名称:WordPress,代码行数:84,代码来源:auto-post-news.php
示例8: header
<?php
if (!file_exists('./includes/admin_config.php')) {
header('Location:install.php');
}
include 'front.php';
$smarty = new smarty();
smarty_front();
get_nav();
get_adds();
get_news();
get_hot_news();
get_new_message();
$smarty->display('index.html');
开发者ID:hxfsc,项目名称:hxfsc,代码行数:14,代码来源:index.php
示例9: emit_news
function emit_news($en_newspath, $lang_newspath, $oldnews)
{
global $top_dir;
// a little debugging
echo "<!-- in news/news-script.php: top_dir = {$top_dir} -->\n";
echo "<!-- lang-path: {$lang_newspath} ; en-path: {$en_newspath} -->\n";
# Be sure to define the following path to newsdirs
if (!$en_newspath) {
exit;
}
if (!$lang_newspath) {
exit;
}
// This is how many news items to display on the main page.
// Everything after this is displayed on the "oldnews" page.
$cutoff = 10;
$newsfiles = get_news($en_newspath, $lang_newspath);
if ($oldnews) {
$newsfile = array_slice($newsfiles, $cutoff, -1);
} else {
$newsfile = array_slice($newsfiles, 0, $cutoff);
}
// Output files to browser
$filecount = 0;
for (reset($newsfile); $key = key($newsfile); next($newsfile)) {
$fa = file($key);
$n = count($fa);
$anchor = generate_anchor($key);
print_news_item($fa, $n, $newsfile, $key, $anchor);
}
}
开发者ID:sss,项目名称:gnucash-htdocs,代码行数:31,代码来源:news-script.php
示例10: strlen
$len = strlen($semi_atom_date);
return substr($semi_atom_date, 0, $len - 2) . ":" . substr($semi_atom_date, $len - 2);
}
echo "<?xml version=\"1.0\" encoding=\"{$charset}\"?>";
include "{$top_dir}/news/news-script.php";
?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>GnuCash News</title>
<subtitle>GnuCash is personal and small-business financial-accounting software, freely licensed under the GNU GPL and available for GNU/Linux, BSD, Solaris, Mac OS X and Microsoft Windows.</subtitle>
<generator>GnuCash htdocs/trunk/atom.php 1.0 <[email protected]></generator>
<logo>http://www.gnucash.org/images/icons/gnc-icon.png</logo>
<link rel="alternate" href="http://www.gnucash.org/" />
<link rel="self" href="http://www.gnucash.org/atom.php" />
<?php
$news_items = get_news($newsdir, $newsdir);
$news_items = array_slice($news_items, 0, $entry_count);
reset($news_items);
$most_recent = file(key($news_items));
$most_recent_update = chop($most_recent[1]);
?>
<updated><?php
echo date_convert_news_to_atom($most_recent_update);
?>
</updated>
<?php
for (reset($news_items); $key = key($news_items); next($news_items)) {
$fa = file($key);
$n = count($fa);
$title = strip_tags(chop($fa[0]));
开发者ID:sss,项目名称:gnucash-htdocs,代码行数:31,代码来源:atom.php
示例11: get_news
<div id="right-column">
<div id="latest-news">
<div class="news-header">
<h2>LATEST NEWS</h2><div class="title-right"><a href="<?php
echo $_SERVER['DOCUMENT_ROOT'];
?>
/channel_news">view more »</a></div>
<div style="clear:both;"></div>
</div>
<div class="news-content">
<ul>
<?php
/* GETS NEWS FILTERED BY SECTION BEING VIEWED */
get_news($filter, $section);
?>
</ul>
</div>
</div>
</div>
<?php
}
?>
</div>
<?php
}
?>
开发者ID:awotherspoon-score,项目名称:FSN,代码行数:29,代码来源:list.php
示例12: ajout_news
<?php
include 'lib/PDO.php';
include 'lib/user.php';
if (!empty($_POST['action']) && $_POST['action'] == 'ajout') {
include 'modele/index/ajout_news.php';
ajout_news($_POST);
} else {
//On affiche les 5 dernieres nouvelles sur l'accueil
include_once 'modele/index/get_news.php';
$liste_news = get_news(0, 5);
//securisation données
foreach ($liste_news as $cle => $news) {
$liste_news[$cle]['titre'] = htmlspecialchars($news['titre']);
$liste_news[$cle]['message'] = nl2br(htmlspecialchars($news['message']));
}
include_once 'vue/index/index.php';
}
开发者ID:Yourgene,项目名称:scout,代码行数:18,代码来源:index.php
示例13: function
$app->flash('error', 'Login required');
$app->redirect('/backoffice/login');
}
});
// Logout
$app->get('/logout', function () use($app) {
$_SESSION['user'] = '';
session_destroy();
$app->redirect('/backoffice/login');
});
$app->get('/', $authenticate($app), function () use($app) {
$app->render('index.php', array('pageTitle' => _('Home')));
});
// Obtem uma lista de todas as noticias
$app->get('/noticias', $authenticate($app), function () use($app) {
$news = get_news();
$app->render('noticias.php', array('news' => $news, 'pageTitle' => get_setting('noticia_plural')));
});
// Criar uma nova noticia
$app->get('/noticia/nova', $authenticate($app), function () use($app) {
$app->render('noticia_nova.php', array('pageTitle' => _('Adicionar') . ' ' . get_setting('noticia_singular')));
});
// Guardar noticia
$app->post('/noticia/nova', $authenticate($app), function () use($app) {
$news = $app->request()->post('news');
save_news($news);
$app->redirect('/backoffice/noticias');
});
$app->get('/noticia/editar/:id', $authenticate($app), function ($id) use($app) {
$news = get_news_id($id);
$app->render('noticia_editar.php', array('news' => $news, 'pageTitle' => _('Editar') . ' ' . get_setting('noticia_singular')));
开发者ID:sousatg,项目名称:events-backoffice,代码行数:31,代码来源:index.php
示例14: header
if (getval("next", "") != "") {
$ref++;
if ($ref > $maxref) {
$ref = $minref;
header('location: ' . $baseurl . '/plugins/news/pages/news.php?ref=' . $ref);
exit;
}
} else {
$ref--;
if ($ref < $minref) {
$ref = $maxref;
header('location: ' . $baseurl . '/plugins/news/pages/news.php?ref=' . $ref);
exit;
}
}
$newsdisplay = get_news($ref, "", "");
}
header('location: ' . $baseurl . '/plugins/news/pages/news.php?ref=' . $ref);
exit;
}
include dirname(__FILE__) . "/../../../include/header.php";
?>
<div>
<form action="<?php
echo $baseurl . '/plugins/news/pages/news.php?ref=' . $ref;
?>
" method="post">
<label for="buttons"></label>
<input name="previous" type="submit" value="<"/>
开发者ID:perryrothjohnson,项目名称:resourcespace,代码行数:31,代码来源:news.php
示例15: strtotime
}
if (!empty($_GET['settr'])) {
$settr = strtotime("-" . intval($_GET['settr']) . " day");
$wheresql = empty($wheresql) ? " WHERE a.addtime> " . $settr : $wheresql . " AND a.addtime> " . $settr;
$oederbysql = " order BY a.addtime DESC";
}
if (intval($_CFG['subsite_id']) > 0) {
$wheresql .= empty($wheresql) ? " WHERE " : " AND ";
$wheresql .= " a.subsite_id=" . intval($_CFG['subsite_id']) . " ";
}
$joinsql = " LEFT JOIN " . table('article_category') . " AS c ON a.type_id=c.id LEFT JOIN " . table('article_property') . " AS p ON a.focos=p.id ";
$total_sql = "SELECT COUNT(*) AS num FROM " . table('article') . " AS a " . $joinsql . $wheresql;
$page = new page(array('total' => $db->get_total($total_sql), 'perpage' => $perpage));
$currenpage = $page->nowindex;
$offset = ($currenpage - 1) * $perpage;
$article = get_news($offset, $perpage, $joinsql . $wheresql . $oederbysql);
$smarty->assign('article', $article);
$smarty->assign('page', $page->show(3));
$smarty->assign('pageheader', "新闻资讯");
get_token();
$smarty->display('article/admin_article.htm');
} elseif ($act == 'migrate_article') {
$id = $_REQUEST['id'];
if (empty($id)) {
adminmsg("请选择项目!", 1);
}
check_token();
check_permissions($_SESSION['admin_purview'], "article_del");
if (del_news($id)) {
adminmsg("删除成功!", 2);
}
开发者ID:winiceo,项目名称:fenzhan,代码行数:31,代码来源:admin_article.php
示例16: get_news
<?php
include_once 'includes/db.php';
include_once 'includes/bbcode.php';
include_once 'includes/cache.php';
include_once 'includes/thumbs.php';
include_once 'includes/news.php';
// Prepare newsitems
$news = get_news($db);
// Get a random welcome image
$sql = 'select a.attach_id ';
$sql .= 'from phpbb3_attachments as a, phpbb3_topics as t ';
$sql .= "where t.forum_id = 33 and a.topic_id = t.topic_id ";
$sql .= "and (extension = 'gif' or extension = 'jpg' or extension = 'jpeg' or extension = 'png')";
$sql .= 'order by rand() limit 1';
$res = mysqli_query($db, $sql);
$row = mysqli_fetch_array($res);
$welcome = '/screenshot.php?id=' . intval($row['attach_id']);
// Fetch 4 random screenshots
$sql = 'select a.attach_id, physical_filename, topic_title ';
$sql .= 'from phpbb3_attachments as a, phpbb3_topics as t ';
$sql .= "where t.forum_id = 35 and a.topic_id = t.topic_id ";
$sql .= "and (extension = 'gif' or extension = 'jpg' or extension = 'jpeg' or extension = 'png')";
$sql .= 'order by rand() limit 4';
$res = mysqli_query($db, $sql);
$rowcount = mysqli_num_rows($res);
$screenthumbs = array();
if ($rowcount >= 4) {
$screenids = array();
while (count($screenids) < 4) {
$proposed = rand(0, $rowcount - 1);
开发者ID:spring,项目名称:spring-website,代码行数:31,代码来源:index.php
示例17: vcn_load_news
function vcn_load_news()
{
//cmd/vcn_load_news.html
?>
<ul class='list-news'>
<?php
$news = get_news(array('status' => '1', 'type_' => array('operator' => '!=', 'value' => 'alert-news')), array('limit' => '5'));
var_dump($news);
while ($result = mysql_fetch_array($news)) {
?>
<li><?php
if ($result['is_new']) {
?>
<img src='http://www.vietcombank.com.vn/images/icons/new.gif'/><?php
}
?>
<a target='_blank' href='<?php
//echo vcn_Url('view-news',$result)
?>
'><?php
echo $result['title'];
?>
</a> - <font color='#808080'><i><?php
echo $result['post_time'];
?>
</i></font></li>
<?php
}
?>
</ul>
<?php
}
开发者ID:hoangsoft90,项目名称:multichoice-quiz-logic,代码行数:32,代码来源:ajax.php
示例18: array
if ($lang != 'en') {
include $path_to_root . "lang/{$lang}/translations.inc";
}
// the other languages
$channel = array('encoding' => $l_charset_encoding, 'name' => 'KDevelop news', 'url' => $site, 'self_url' => $site . $rss_dir . "kdevelop_news_{$lang}.rss", 'description' => "KDevelop development news ({$languages[$lang]})", 'language' => $lang, 'pub_date' => date("r", $pub_date));
$fp = @fopen($path_to_root . $rss_dir . "kdevelop_news_{$lang}.rss", "w");
@fwrite($fp, create_rss_feed($channel, $rss_items)) or die("File {$news_filename} not writeable");
@fclose($fp);
}
// Establish a connection with the MySQL server
$mysql_link = @mysql_connect("localhost", $k_login, $k_password);
// Exit if it canot get a connection to the MySQL database
if ($mysql_link == false) {
die('Could not connect to the database. Will not be able to create rss news feeds.
');
}
mysql_select_db("kdevelop_db");
// Make sure the news directory exists
if (!file_exists($path_to_root . $news_dir)) {
die("The dir <b>\"{$path_to_root}{$news_dir}\"</b> does not exist, please create it\n");
}
// Make sure the rss directory exists
if (!file_exists($path_to_root . $rss_dir)) {
die("The dir <b>\"{$path_to_root}{$rss_dir}\"</b> does not exist, please create it\n");
}
// get news
$news_items = get_news($news_dir);
// build one RSS news feed for each language
foreach ($activelanguages as $lang) {
build_rss_feed($site, $rss_dir, $lang, $news_items);
}
开发者ID:KDE,项目名称:kdev-www,代码行数:31,代码来源:update_rss_news.php
示例19: get_news
<?php
include_once 'model/news/get_news.php';
include_once 'model/news/get_nb_news.php';
$max = 5;
if (array_key_exists('goto', $_GET)) {
if ($_GET['goto'] < 1) {
$pageact = 1;
} else {
$pageact = $_GET['goto'];
}
} else {
$pageact = 1;
}
$news = get_news($pageact, $max);
$nb_total = get_nb_news();
include 'view/index.php';
开发者ID:YannBertrand,项目名称:CovoiturageENIB,代码行数:17,代码来源:index.php
示例20: dirname
if (getval("create","")!="")
{
header("location:".$baseurl."/plugins/news/pages/news_content_edit.php?ref=new");
}
include dirname(__FILE__)."/../../../include/header.php";
?>
<div class="BasicsBox">
<h1><?php echo $lang["news_manage"]?></h1>
<h2><?php echo $lang["news_intro"]?></h2>
<?php
$news=get_news("","",$findtext);
# pager
$per_page=15;
$results=count($news);
$totalpages=ceil($results/$per_page);
$curpage=floor($offset/$per_page)+1;
$url="news_edit.php?findtext=".urlencode($findtext)."&offset=". $offset;
$jumpcount=1;
?>
<div class="BasicsBox">
<form method="post">
<div class="QuestionSubmit">
<label for="buttons"> </label>
<input name="create" type="submit" value="<?php echo $lang["news_add"]?>"/>
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:30,代码来源:news_edit.php
注:本文中的get_news函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论