本文整理汇总了PHP中e107::meta方法的典型用法代码示例。如果您正苦于以下问题:PHP e107::meta方法的具体用法?PHP e107::meta怎么用?PHP e107::meta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类e107
的用法示例。
在下文中一共展示了e107::meta方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processViewPage
function processViewPage()
{
if ($this->checkCache()) {
return;
}
$sql = e107::getDb();
$query = "SELECT p.*, u.user_id, u.user_name, user_login FROM #page AS p\n\t\tLEFT JOIN #user AS u ON p.page_author = u.user_id\n\t\tWHERE p.page_id=" . intval($this->pageID);
// REMOVED AND p.page_class IN (".USERCLASS_LIST.") - permission check is done later
if (!$sql->gen($query)) {
header("HTTP/1.0 404 Not Found");
// exit;
/*
$ret['title'] = LAN_PAGE_12; // ***** CHANGED
$ret['sub_title'] = '';
$ret['text'] = LAN_PAGE_3;
$ret['comments'] = '';
$ret['rating'] = '';
$ret['np'] = '';
$ret['err'] = TRUE;
$ret['cachecontrol'] = false;
*/
// ---------- New (to replace values above) ----
$this->page['page_title'] = LAN_PAGE_12;
// ***** CHANGED
$this->page['sub_title'] = '';
$this->page['page_text'] = LAN_PAGE_3;
$this->page['comments'] = '';
$this->page['rating'] = '';
$this->page['np'] = '';
$this->page['err'] = TRUE;
$this->page['cachecontrol'] = false;
// -------------------------------------
$this->authorized = 'nf';
$this->template = e107::getCoreTemplate('page', 'default');
// $this->batch = e107::getScBatch('page',null,'cpage')->setVars(new e_vars($ret))->setScVar('page', array()); ///Upgraded to setVars() array. (not using '$this->page')
$this->batch = e107::getScBatch('page', null, 'cpage')->setVars($this->page);
define("e_PAGETITLE", $this->page['page_title']);
return;
}
$this->page = $sql->fetch();
// setting override to true breaks default.
$this->template = e107::getCoreTemplate('page', vartrue($this->page['page_template'], 'default'), true, true);
if (!$this->template) {
// switch to default
$this->template = e107::getCoreTemplate('page', 'default', false, false);
}
if (empty($this->template)) {
$this->template = e107::getCoreTemplate('page', 'default');
}
$this->batch = e107::getScBatch('page', null, 'cpage');
$this->pageText = $this->page['page_text'];
$this->pageCheckPerms($this->page['page_class'], $this->page['page_password'], $this->page['page_title']);
if ($this->debug) {
echo "<b>pageText</b> " . $this->pageText . " <br />";
}
$this->parsePage();
$pagenav = $rating = $comments = '';
if ($this->authorized === true) {
$pagenav = $this->pageIndex();
$rating = $this->pageRating($this->page['page_rating_flag']);
$comments = $this->pageComment($this->page['page_comment_flag']);
}
/*
$ret['title'] = $this->page['page_title'];
$ret['sub_title'] = $this->title;
$ret['text'] = $this->pageToRender;
$ret['np'] = $pagenav;
$ret['rating'] = $rating;
$ret['comments'] = $comments;
$ret['err'] = FALSE;
$ret['cachecontrol'] = (isset($this->page['page_password']) && !$this->page['page_password'] && $this->authorized === true); // Don't cache password protected pages
*/
// $this->batch->setVars(new e_vars($ret))->setScVar('page', $this->page); // Removed in favour of $this->var (cross-compatible with menus and other parts of e107 that use the same shortcodes)
// ---- New --- -
$this->page['page_text'] = $this->pageToRender;
$this->page['np'] = $pagenav;
$this->page['rating'] = $rating;
$this->page['comments'] = $comments;
$this->page['err'] = FALSE;
$this->page['cachecontrol'] = isset($this->page['page_password']) && !$this->page['page_password'] && $this->authorized === true;
// -----------------
$this->batch->setVars($this->page);
define('e_PAGETITLE', eHelper::formatMetaTitle($this->page['page_title']));
if ($this->page['page_metadscr']) {
define('META_DESCRIPTION', eHelper::formatMetaDescription($this->page['page_metadscr']));
}
if ($this->page['page_metakeys']) {
define('META_KEYWORDS', eHelper::formatMetaKeys($this->page['page_metakeys']));
}
$tp = e107::getParser();
if ($tp->isImage($this->page['menu_image'])) {
$mimg = $tp->thumbUrl($this->page['menu_image'], 'w=800', false, true);
e107::meta('og:image', $mimg);
}
//return $ret;
}
示例2: vartrue
<?php
if (USER_AREA) {
e107::css('social', 'css/fontello.css');
$social = e107::pref('core', 'social_login');
if (!empty($social) && is_array($social)) {
$appID = vartrue($social['Facebook']['keys']['id']);
}
if (!empty($appID)) {
e107::meta('fb:app_id', $appID);
$locale = strtolower(CORE_LC) . "_" . strtoupper(CORE_LC2);
$init = "\n\n\t\t\twindow.fbAsyncInit = function() {\n\t FB.init({\n\t appId : '" . $appID . "',\n\t xfbml : true,\n\t version : 'v2.3'\n\t });\n\t\t\t};\n\n\t\t\t(function(d, s, id){\n\t var js, fjs = d.getElementsByTagName(s)[0];\n\t if (d.getElementById(id)) {return;}\n\t js = d.createElement(s); js.id = id;\n\t js.src = '//connect.facebook.net/" . $locale . "/sdk.js';\n\t fjs.parentNode.insertBefore(js, fjs);\n\t }(document, 'script', 'facebook-jssdk'));\n\n\t ";
define('SOCIAL_FACEBOOK_INIT', $init);
} else {
define('SOCIAL_FACEBOOK_INIT', false);
}
}
示例3: setNewsFrontMeta
function setNewsFrontMeta($news, $type = 'news')
{
$tp = e107::getParser();
if ($type == 'news') {
if ($news['news_title'] && !defined('e_PAGETITLE')) {
define('e_PAGETITLE', $news['news_title']);
e107::meta('og:title', $news['news_title']);
e107::meta('og:type', 'article');
}
if ($news['news_meta_description'] && !defined('META_DESCRIPTION')) {
e107::meta('description', $news['news_meta_description']);
e107::meta('og:description', $news['news_meta_description']);
//define('META_DESCRIPTION', $news['news_meta_description']); // deprecated
} elseif ($news['news_summary']) {
e107::meta('og:description', $news['news_summary']);
}
// grab all images in news-body and add to meta.
$images = e107::getBB()->getContent('img', $news['news_body'], SITEURL . e_IMAGE . "newspost_images/");
foreach ($images as $im) {
e107::meta('og:image', $im);
}
// grab all youtube videos in news-body and add thumbnails to meta.
$youtube = e107::getBB()->getContent('youtube', $news['news_body']);
foreach ($youtube as $yt) {
list($img, $tmp) = explode("?", $yt);
e107::meta('og:image', "http://img.youtube.com/vi/" . $img . "/0.jpg");
}
// include news-thumbnail/image in meta.
if ($news['news_thumbnail']) {
$iurl = substr($news['news_thumbnail'], 0, 3) == "{e_" ? $tp->replaceConstants($news['news_thumbnail'], 'full') : SITEURL . e_IMAGE . "newspost_images/" . $news['news_thumbnail'];
$tmp = explode(",", $iurl);
foreach ($tmp as $mimg) {
if (substr($mimg, -8) == '.youtube') {
continue;
}
e107::meta('og:image', $mimg);
}
}
$url = e107::getUrl()->create('news/view/item', $news, 'full=1');
e107::meta('og:url', $url);
e107::meta('article:section', $news['category_name']);
if ($news['news_meta_keywords'] && !defined('META_KEYWORDS')) {
e107::meta('keywords', $news['news_meta_keywords']);
$tmp = explode(",", $news['news_meta_keywords']);
foreach ($tmp as $t) {
e107::meta('article:tag', trim($t));
}
// define('META_KEYWORDS', $news['news_meta_keywords']); // deprecated
}
/* Facebook reference.
* http://developers.facebook.com/docs/opengraph/objects/builtin/
*/
return;
}
if ($news['category_name'] && !defined('e_PAGETITLE')) {
define('e_PAGETITLE', $tp->toHtml($news['category_name'], false, 'TITLE_PLAIN'));
}
if ($news['category_meta_keywords'] && !defined('META_KEYWORDS')) {
define('META_KEYWORDS', $news['category_meta_keywords']);
}
if ($news['category_meta_description'] && !defined('META_DESCRIPTION')) {
define('META_DESCRIPTION', $news['category_meta_description']);
}
}
示例4: defined
echo defined("CORE_LC") ? "<meta http-equiv='content-language' content='" . CORE_LC . "' />\n" : "";
}
//
// C: Send start of HTML
//
if (vartrue($pref['meta_copyright'][e_LANGUAGE])) {
e107::meta('dcterms.rights', $pref['meta_copyright'][e_LANGUAGE]);
}
if (vartrue($pref['meta_author'][e_LANGUAGE])) {
e107::meta('author', $pref['meta_author'][e_LANGUAGE]);
}
if ($pref['sitebutton']) {
e107::meta('og:image', $tp->replaceConstants($pref['sitelogo'], 'full'));
}
if (defined("VIEWPORT")) {
e107::meta('viewport', VIEWPORT);
}
//BC ONLY
// Load Plugin Header Files, allow them to load CSS/JSS/Meta via JS Manager early enouhg
// NOTE: e_header.php should not output content, it should only register stuff!
// e_meta.php is more appropriate for outputting header content.
$e_headers = e107::pref('core', 'e_header_list');
if ($e_headers && is_array($e_headers)) {
foreach ($e_headers as $val) {
// no checks fore existing file - performance
e107_include(e_PLUGIN . $val . "/e_header.php");
}
}
unset($e_headers);
echo e107::getUrl()->response()->renderMeta() . "\n";
// render all the e107::meta() entries.
示例5: define
$caption = FAQLAN_FAQ;
}
$pageTitle = '';
// define("e_PAGETITLE", $ftmp['caption']);
if (vartrue($faqpref['page_title'])) {
$pageTitle = $faqpref['page_title'][e_LANGUAGE];
} else {
$pageTitle = $ftmp['caption'];
}
if (!empty($ftmp['pagetitle'])) {
$pageTitle .= ": " . $ftmp['pagetitle'];
}
e107::getMessage()->addDebug("TITLE: " . $pageTitle);
e107::meta('og:title', $pageTitle);
if (!empty($ftmp['pagedescription'])) {
e107::meta('og:description', $ftmp['pagedescription']);
}
define('e_PAGETITLE', $pageTitle);
require_once HEADERF;
$ns->tablerender($ftmp['caption'], $ftmp['text']);
}
if ($action == "cat" && $idx) {
$ftmp = $faq->view_faq($idx);
define("e_PAGETITLE", FAQLAN_FAQ . " - " . $ftmp['title']);
require_once HEADERF;
$ns->tablerender($ftmp['caption'], $ftmp['text']);
}
if ($action == "cat") {
$ftmp = $faq->view_cat_list($action, $id);
define("e_PAGETITLE", strip_tags($ftmp['title'] . $ftmp['caption']));
require_once HEADERF;
示例6: database
<?php
require_once "../../class2.php";
e107::js('test', 'js/my.js', 'jquery');
e107::css('test', 'css/my.css');
e107::lan('test');
e107::meta('keywords', 'some words');
require_once HEADERF;
$sql = e107::getDB();
$tp = e107::getParser();
$frm = e107::getForm();
$ns = e107::getRender();
require_once "functions.php";
require_once "database.php";
$text = "";
if (isset($_POST['required_amount'])) {
$db_class = new database();
$db_class->setDb($sql);
$today = date("Y-m-d H:i:s");
$db_class->setDate($today);
$db_class->setEmail($_POST['email']);
$db_class->setDiscount($_POST['discount']);
$db_class->setCurrency($_POST['select_currency']);
$db_class->setExchangerate($_POST['exchange_rate']);
$db_class->setSurchargepercent($_POST['surcharge_percentage']);
$db_class->setPurchasedcurrency($_POST['required_amount']);
if ($_POST['select_currency'] == 'EUR') {
$extrainfo = 'We have applied a 2.0% discount';
$newprice = $_POST['due_amount'] * ((100 - $_POST['discount']) / 100);
$db_class->setAmountdue($newprice);
} else {
示例7: tablestyle
<?php
if (!defined('e107_INIT')) {
exit;
}
e107::lan('theme', 'English');
e107::meta('viewport', 'width=device-width, initial-scale=1.0');
//e107::meta('apple-mobile-web-app-capable','yes');
e107::js('core', 'bootstrap/js/bootstrap.min.js');
//e107::js('theme', 'js/theme.js');
e107::css('core', 'bootstrap/css/bootstrap-responsive.min.css');
//e107::css('theme','assets/css/style.css');
//e107::css('url', 'external url ');
// Custom Shortcodes.
//$register_sc[]='BLANK';
function tablestyle($caption, $text, $mode = '')
{
global $style;
if ($mode == 'wmessage') {
$style = '';
}
switch ($style) {
case 'home':
echo $caption;
echo $text;
break;
case 'menu':
echo $caption;
echo $text;
break;
case 'full':