本文整理汇总了PHP中getNewsContent函数的典型用法代码示例。如果您正苦于以下问题:PHP getNewsContent函数的具体用法?PHP getNewsContent怎么用?PHP getNewsContent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getNewsContent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertNews
if (isset($_POST['id'])) {
if ($_POST['id'] == 0) {
insertNews($db, $_POST['title'], $_POST['newscontent'], $usr->getProperty('user_id'));
} else {
updateNewsContent($db, $_POST['id'], $_POST['title'], $_POST['newscontent'], $usr->getProperty('user_id'));
}
}
}
$category = 'general';
if (isset($_GET['mode']) && $_GET['mode'] == "edit") {
if (!isset($_GET['id']) && !is_numeric($_GET['id'])) {
die('Missing news id');
}
$news = getNewsContent($db, $_GET['id']);
} elseif (isset($_GET['mode']) && $_GET['mode'] == "insert") {
$news = getNewsContent($db, 0);
} else {
$news = getNewsList($db, $category);
}
$tpl =& new HTML_Template_IT('./');
$tpl->loadTemplatefile('admin.tpl', true, true);
// assign the content to the vars
$tpl->setVariable('USER', $usr->getProperty('handle'));
$tpl->setVariable('NEWS', $news);
$tpl->show();
/**
* Returns news list
* for a given category
*
* @param object &$db a reference to a db connection object
* @param string $category news category
示例2: gettext
break;
case 'search.php':
$zpmin_metatitle = gettext('Search') . " | " . html_encode(getSearchWords()) . ' | ';
$galleryactive = true;
$cbscript = true;
$zpmin_social = false;
break;
case 'pages.php':
$zpmin_metatitle = getBarePageTitle() . ' | ';
$zpmin_metadesc = strip_tags(truncate_string(getPageContent(), 150, '...'));
$cbscript = true;
break;
case 'news.php':
if (is_NewsArticle()) {
$zpmin_metatitle = gettext('News') . ' | ' . getBareNewsTitle() . ' | ';
$zpmin_metadesc = strip_tags(truncate_string(getNewsContent(), 150, '...'));
} else {
if ($_zp_current_category) {
$zpmin_metatitle = gettext('News') . ' | ' . $_zp_current_category->getTitle() . ' | ';
$zpmin_metadesc = strip_tags(truncate_string(getNewsCategoryDesc(), 150, '...'));
} else {
if (getCurrentNewsArchive()) {
$zpmin_metatitle = gettext('News') . ' | ' . getCurrentNewsArchive() . ' | ';
} else {
$zpmin_metatitle = gettext('News') . ' | ';
}
}
}
$cbscript = true;
break;
case 'slideshow.php':
示例3: html_encode
<a href="<?php
echo html_encode(jqm_getLink());
?>
" title="<?php
printBareNewsTitle();
?>
">
<?php
printNewsTitle();
?>
<small>(<?php
printNewsDate();
?>
)</small>
<div class="albumdesc"><?php
echo shortenContent(getBare(getNewsContent()), 57, '(...)', false);
?>
</div>
</a>
</li>
<?php
}
?>
</ul>
<?php
printNewsPageListWithNav(gettext('next »'), gettext('« prev'), true, 'pagelist', true, 7);
}
?>
</div>
<div class="content-secondary">
示例4: gettext
?>
</span><?php
if (function_exists('printCommentForm')) {
?>
<span><?php
echo gettext("Comments:");
?>
<?php
echo getCommentCount();
?>
</span><?php
}
?>
</div>
<?php
echo preg_replace("/<img[^>]+\\>/i", " [image removed] ", getNewsContent());
printCodeblock();
?>
</div>
<?php
}
?>
</div>
</div>
<?php
if ($zpmas_infscroll) {
?>
<div id="page_nav">
<?php
if (getNextNewsPageURL()) {
示例5: gettext
$zpfocus_metatitle = gettext("Archive View") . ' | ' . getBareGalleryTitle();
$zpfocus_metadesc = shortenContent(getBareGalleryDesc(), 150, '...');
break;
case 'search.php':
$zpfocus_metatitle = gettext('Search') . ' | ' . html_encode(getSearchWords()) . ' | ' . getBareGalleryTitle();
$zpfocus_metadesc = shortenContent(getBareGalleryDesc(), 150, '...');
$galleryactive = true;
break;
case 'pages.php':
$zpfocus_metatitle = getBarePageTitle() . ' | ' . getBareGalleryTitle();
$zpfocus_metadesc = strip_tags(shortenContent(getPageContent(), 150, '...'));
break;
case 'news.php':
if (is_NewsArticle()) {
$zpfocus_metatitle = gettext('News') . ' | ' . getBareNewsTitle() . ' | ' . getBareGalleryTitle();
$zpfocus_metadesc = strip_tags(shortenContent(getNewsContent(), 150, '...'));
} else {
if ($_zp_current_category) {
$zpfocus_metatitle = gettext('News') . ' | ' . $_zp_current_category->getTitle() . ' | ' . getBareGalleryTitle();
$zpfocus_metadesc = strip_tags(shortenContent(getNewsCategoryDesc(), 150, '...'));
} else {
if (getCurrentNewsArchive()) {
$zpfocus_metatitle = gettext('News') . ' | ' . getCurrentNewsArchive() . ' | ' . getBareGalleryTitle();
$zpfocus_metadesc = shortenContent(getBareGalleryDesc(), 150, '...');
} else {
$zpfocus_metatitle = gettext('News') . ' | ' . getBareGalleryTitle();
$zpfocus_metadesc = shortenContent(getBareGalleryDesc(), 150, '...');
}
}
}
break;
示例6: zpFormattedDate
<div class='date' day="<?php
echo zpFormattedDate('%e', $dt);
?>
"
month="<?php
echo zpFormattedDate('%b', $dt);
?>
"
year="<?php
echo zpFormattedDate('%Y', $dt);
?>
"/>
<div class='content'><?php
echo getNewsContent();
?>
</div>
<div class='categories'><?php
echo ThemeUtil::clean(NewsUtil::printNewsCategories(',', false, false), FALSE);
?>
</div>
<div class='preview'><?php
echo ThemeUtil::clean(getNewsContent(), FALSE, 120, FALSE);
?>
</div>
</div>
<?php
$u++;
}
?>
</div>
示例7: while
</small></h5>
<ul class="searchresults">
<?php
while (next_news()) {
$c++;
?>
<li<?php
printZDToggleClass('news', $c, $number_to_show);
?>
>
<h6><?php
printNewsURL();
?>
</h6>
<p class="zenpageexcerpt"><?php
echo html_encodeTagged(shortenContent(strip_tags(getNewsContent()), 80, getOption("zenpage_textshorten_indicator")));
?>
</p>
</li>
<?php
}
?>
</ul>
<hr />
<?php
}
?>
</div>
<?php
}
?>
示例8: printNewsContent
/**
* Prints the news article content. Note: TinyMCE used by Zenpage for news articles may already add a surrounding <p></p> to the content.
*
* If using the CombiNews feature this prints the thumbnail or sized image for a gallery item.
* If using the 'CombiNews sized image' mode it shows movies directly and the description below.
*
* @param int $shorten $shorten The lengths of the content for the news main page for example (only for video/audio descriptions, not for normal image descriptions)
* @param string $shortenindicator The placeholder to mark the shortening (e.g."(...)"). If empty the Zenpage option for this is used.
* @param string $readmore The text for the "read more" link. If empty the term set in Zenpage option is used.
*/
function printNewsContent($shorten = false, $shortenindicator = NULL, $readmore = NULL)
{
global $_zp_current_zenpage_news, $_zp_page;
echo getNewsContent($shorten, $shortenindicator, $readmore);
}
示例9: insertNews
if ($id == 0) {
insertNews($db, $title, $newscontent, $usr->getProperty('perm_user_id'));
} else {
updateNewsContent($db, $id, $title, $newscontent, $usr->getProperty('perm_user_id'));
}
}
}
$category = 'general';
if (array_key_exists('mode', $_GET) && $_GET['mode'] == 'edit') {
if (!array_key_exists('id', $_GET) && !is_numeric($_GET['id'])) {
die('Missing news id');
}
$id = (int) $_GET['id'];
$news = getNewsContent($db, $id);
} elseif (array_key_exists('mode', $_GET) && $_GET['mode'] == 'insert') {
$news = getNewsContent($db);
} else {
$news = getNewsList($db, $category);
}
$tpl =& new HTML_Template_IT('./');
$tpl->loadTemplatefile('admin.tpl');
// assign the content to the vars
$tpl->setVariable('USER', $usr->getProperty('handle'));
$tpl->setVariable('NEWS', $news);
$tpl->show();
/**
* Returns news list
* for a given category
*
* @param object &$db a reference to a db connection object
* @param string $category news category
示例10: printf
<div>
<ul class="search-item"><li><?php
printf(gettext('Articles (%s)'), $numnews);
?>
</li></ul>
<?php
while (next_news()) {
?>
<div class="news-truncate clearfix">
<h3 class="search-title"><?php
printNewsURL();
?>
</h3>
<div class="search-content clearfix">
<?php
echo html_encodeTagged(shortenContent(getBare(getNewsContent()), 100, getOption("zenpage_textshorten_indicator")));
?>
</div>
</div>
<?php
}
?>
</div>
<?php
}
if ($numpages > 0) {
?>
<div>
<ul class="search-item"><li><?php
printf(gettext('Pages (%s)'), $numpages);
?>
示例11: printNewsContent
/**
* Prints the news article content. Note: TinyMCE used by Zenpage for news articles may already add a surrounding <p></p> to the content.
*
* If using the CombiNews feature this prints the thumbnail or sized image for a gallery item.
* If using the 'CombiNews sized image' mode it shows movies directly and the description below.
*
* @param int $shorten $shorten The lengths of the content for the news main page for example (only for video/audio descriptions, not for normal image descriptions)
* @param string $shortenindicator The placeholder to mark the shortening (e.g."(...)"). If empty the Zenpage option for this is used.
* @param string $readmore The text for the "read more" link. If empty the term set in Zenpage option is used.
*/
function printNewsContent($shorten = false, $shortenindicator = NULL, $readmore = NULL)
{
$newscontent = getNewsContent($shorten, $shortenindicator, $readmore);
echo html_encodeTagged($newscontent);
}
示例12: getHTMLMetaData
/**
* Prints html meta data to be used in the <head> section of a page
*
*/
function getHTMLMetaData()
{
global $_zp_gallery, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery_page, $_zp_current_category, $_zp_authority;
$url = sanitize("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
// Convert locale shorttag to allowed html meta format
$locale = getOption("locale");
$locale = strtr($locale, "_", "-");
// generate page title, get date
$pagetitle = "";
$date = strftime(DATE_FORMAT);
// if we don't have a item date use current date
$desc = getBareGalleryDesc();
if (is_object($_zp_current_image) and is_object($_zp_current_album)) {
$pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
$date = getImageDate();
$desc = getBareImageDesc();
}
if (is_object($_zp_current_album) and !is_object($_zp_current_image)) {
$pagetitle = getBareAlbumTitle() . " - ";
$date = getAlbumDate();
$desc = getBareAlbumDesc();
}
if (function_exists("is_NewsArticle")) {
if (is_NewsArticle()) {
$pagetitle = getBareNewsTitle() . " - ";
$date = getNewsDate();
$desc = strip_tags(getNewsContent());
} else {
if (is_NewsCategory()) {
$pagetitle = $_zp_current_category->getTitlelink() . " - ";
$date = strftime(DATE_FORMAT);
$desc = "";
} else {
if (is_Pages()) {
$pagetitle = getBarePageTitle() . " - ";
$date = getPageDate();
$desc = strip_tags(getPageContent());
}
}
}
}
// shorten desc to the allowed 200 characters if necesssary.
if (strlen($desc) > 200) {
$desc = substr($desc, 0, 200);
}
$pagetitle = $pagetitle . getBareGalleryTitle();
// get master admin
$admin = $_zp_authority->getAnAdmin(array('`user`=' => $_zp_authority->master_user, '`valid`=' => 1));
$author = $admin->getName();
$meta = '';
if (getOption('htmlmeta_http-equiv-language')) {
$meta .= '<meta http-equiv="language" content="' . $locale . '" />' . "\n";
}
if (getOption('htmlmeta_name-language')) {
$meta .= '<meta name="language" content="' . $locale . '" />' . "\n";
}
if (getOption('htmlmeta_name-content-language')) {
$meta .= '<meta name="content-language" content="' . $locale . '" />' . "\n";
}
if (getOption('htmlmeta_http-equiv-imagetoolbar')) {
$meta .= '<meta http-equiv="imagetoolbar" content="false" />' . "\n";
}
if (getOption('htmlmeta_http-equiv-cache-control')) {
$meta .= '<meta http-equiv="cache-control" content="' . getOption("htmlmeta_cache_control") . '" />' . "\n";
}
if (getOption('htmlmeta_http-equiv-pragma')) {
$meta .= '<meta http-equiv="pragma" content="' . getOption("htmlmeta_pragma") . '" />' . "\n";
}
if (getOption('htmlmeta_http-equiv-content-style-type')) {
$meta .= '<meta http-equiv="Content-Style-Type" content="text/css" />' . "\n";
}
if (getOption('htmlmeta_name-title')) {
$meta .= '<meta name="title" content="' . $pagetitle . '" />' . "\n";
}
if (getOption('htmlmeta_name-keywords')) {
$meta .= '<meta name="keywords" content="' . getMetaKeywords() . '" />' . "\n";
}
if (getOption('htmlmeta_name-description')) {
$meta .= '<meta name="description" content="' . $desc . '" />' . "\n";
}
if (getOption('htmlmeta_name-page-topic')) {
$meta .= '<meta name="page-topic" content="' . $desc . '" />' . "\n";
}
if (getOption('htmlmeta_name-robots')) {
$meta .= '<meta name="robots" content="' . getOption("htmlmeta_robots") . '" />' . "\n";
}
if (getOption('htmlmeta_name-publisher')) {
$meta .= '<meta name="publisher" content="' . FULLWEBPATH . '" />' . "\n";
}
if (getOption('htmlmeta_name-creator')) {
$meta .= '<meta name="creator" content="' . FULLWEBPATH . '" />' . "\n";
}
if (getOption('htmlmeta_name-author')) {
$meta .= '<meta name="author" content="' . $author . '" />' . "\n";
}
if (getOption('htmlmeta_name-copyright')) {
//.........这里部分代码省略.........
示例13: zpFormattedDate
echo zpFormattedDate('%b', $dt);
?>
</span>
<span class="day"><?php
echo date('jS', $dt);
?>
</span>
</div>
<div class="news-info">
<div class="news-title"><?php
echo getNewsTitle();
?>
</div>
<div class="news-categories">In: <?php
printNewsCategories(',', false, false);
?>
</div>
</div>
</div>
<div class="news-content">
<?php
$c = getNewsContent();
if (defined('CROP_NEWS')) {
$c = Utils::crop($c, 200, '<p><a>', '<a href="' . getNewsURL(getNewsTitleLink()) . '">(...)</a>');
}
echo $c;
?>
</div>
</div>
示例14: while
}
}
if ($numnews > 0) {
while (next_news()) {
?>
<div class="one-half column">
<div class="news-clip">
<div class="bold-header"><?php
printNewsURL();
?>
<small><em><i title="<?php
echo gettext('News Result');
?>
" class="fa fa-newspaper-o fa-fw"></i></em></small></div>
<div class="search-excerpt"><?php
echo shortenContent(strip_tags(getNewsContent()), 200, getOption('zenpage_textshorten_indicator'));
?>
</div>
</div>
</div>
<?php
$c++;
if ($c == 2) {
echo '</div><div class="row">';
$c = 0;
}
}
}
?>
</div>
<?php
示例15: getHTMLMetaData
/**
* Prints html meta data to be used in the <head> section of a page
*
*/
static function getHTMLMetaData()
{
global $_zp_gallery, $_zp_galley_page, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery_page, $_zp_current_category, $_zp_authority, $_zp_conf_vars, $_myFavorites, $htmlmetatags_need_cache, $_zp_page;
zp_register_filter('image_processor_uri', 'htmlmetatags::ipURI');
$host = sanitize("http://" . $_SERVER['HTTP_HOST']);
$url = $host . getRequestURI();
// Convert locale shorttag to allowed html meta format
$locale = str_replace("_", "-", getUserLocale());
$canonicalurl = '';
// generate page title, get date
$pagetitle = "";
// for gallery index setup below switch
$date = strftime(DATE_FORMAT);
// if we don't have a item date use current date
$desc = getBareGalleryDesc();
$thumb = '';
if (getOption('htmlmeta_sitelogo')) {
$thumb = getOption('htmlmeta_sitelogo');
}
if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
$ogimage_width = getOption('htmlmeta_ogimage_width');
$ogimage_height = getOption('htmlmeta_ogimage_height');
if (empty($ogimage_width)) {
$ogimage_width = 1280;
}
if (empty($ogimage_height)) {
$ogimage_height = 900;
}
}
$type = 'article';
switch ($_zp_gallery_page) {
case 'index.php':
$desc = getBareGalleryDesc();
//$canonicalurl = $host . getGalleryIndexURL();
$canonicalurl = $host . getPageNumURL($_zp_page);
$type = 'website';
break;
case 'album.php':
$pagetitle = getBareAlbumTitle() . " - ";
$date = getAlbumDate();
$desc = getBareAlbumDesc();
$canonicalurl = $host . getPageNumURL($_zp_page);
if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
$thumbimg = $_zp_current_album->getAlbumThumbImage();
getMaxSpaceContainer($ogimage_width, $ogimage_height, $thumbimg, false);
$thumb = $host . html_encode(pathurlencode($thumbimg->getCustomImage(NULL, $ogimage_width, $ogimage_height, NULL, NULL, NULL, NULL, false, NULL)));
}
break;
case 'image.php':
$pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
$date = getImageDate();
$desc = getBareImageDesc();
$canonicalurl = $host . getImageURL();
if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
$thumb = $host . html_encode(pathurlencode(getCustomSizedImageMaxSpace($ogimage_width, $ogimage_height)));
}
break;
case 'news.php':
if (function_exists("is_NewsArticle")) {
if (is_NewsArticle()) {
$pagetitle = getBareNewsTitle() . " - ";
$date = getNewsDate();
$desc = trim(getBare(getNewsContent()));
$canonicalurl = $host . $_zp_current_zenpage_news->getLink();
} else {
if (is_NewsCategory()) {
$pagetitle = $_zp_current_category->getTitlelink() . " - ";
$date = strftime(DATE_FORMAT);
$desc = trim(getBare($_zp_current_category->getDesc()));
$canonicalurl = $host . $_zp_current_category->getLink();
$type = 'category';
} else {
$pagetitle = gettext('News') . " - ";
$desc = '';
$canonicalurl = $host . getNewsIndexURL();
$type = 'website';
}
}
if ($_zp_page != 1) {
$canonicalurl .= '/' . $_zp_page;
}
}
break;
case 'pages.php':
$pagetitle = getBarePageTitle() . " - ";
$date = getPageDate();
$desc = trim(getBare(getPageContent()));
$canonicalurl = $host . $_zp_current_zenpage_page->getLink();
break;
default:
// for all other possible static custom pages
$custompage = stripSuffix($_zp_gallery_page);
$standard = array('contact' => gettext('Contact'), 'register' => gettext('Register'), 'search' => gettext('Search'), 'archive' => gettext('Archive view'), 'password' => gettext('Password required'));
if (is_object($_myFavorites)) {
$standard['favorites'] = gettext('My favorites');
}
//.........这里部分代码省略.........