本文整理汇总了PHP中TPL::manageTAG方法的典型用法代码示例。如果您正苦于以下问题:PHP TPL::manageTAG方法的具体用法?PHP TPL::manageTAG怎么用?PHP TPL::manageTAG使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPL
的用法示例。
在下文中一共展示了TPL::manageTAG方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderWidget
/**
* Will render a requested widget;
*
* This method is used to render a widget that usually is used in the frontend part of any website done with the help of this
* platform. What are widgets you ask?! Well, it's quite simple. They are pieces of PHP code, usually tied to some
* configuration options that control the way the widget functions or showns;
*
* Usually, configured widgets have enough power to be used in any way you want or need. For most of the times, the widgets
* are called in the proper section of the frontend, but this method must permit the use of widgets, independent of the place
* the developer needs them;
*
* @param $objWidgetToRender The widget to render;
* @return mixed Depends on the widget;
*/
public function renderWidget(S $objW, A $objWA = NULL)
{
// Make a default ...
if ($objWA == NULL) {
$objWA = new A();
}
// Do a switch ...
switch ($objW) {
case 'widgetContactForm':
// Set some requirements ...
isset($_GET[CONTACT_STATUS_URL]) ? $objBIT = new B(FALSE) : ($objBIT = new B(TRUE));
isset($_GET[CONTACT_STATUS_URL]) ? $objTXT = $this->getConfigKey(new S('contact_page_message_content_ok')) : ($objTXT = $this->getConfigKey(new S('contact_page_message_content')));
// Set the template file ...
$tpF = new FilePath($this->getPathToSkin()->toRelativePath() . $objW . TPL_EXTENSION);
TPL::tpSet($objTXT->entityDecode(ENT_QUOTES), new S('objContactText'), $tpF);
TPL::tpSet($objWA, new S('objWidgetArray'), $tpF);
TPL::tpSet($objBIT, new S('objShowForm'), $tpF);
TPL::tpSet($this, new S('CNT'), $tpF);
TPL::tpExe($tpF);
// Do me SEO, yah baby! ...
TPL::manageTTL(new S($objWA['page_title']));
TPL::manageTAG(new S('description'), $this->getConfigKey(new S('contact_page_message_content'))->entityDecode(ENT_QUOTES)->stripTags()->doSubStr(0, META_DESCRIPTION_MAX)->appendString(_DTE));
break;
}
}
示例2: renderWidget
//.........这里部分代码省略.........
} else {
// Get the category LIST;
$objCategoryList = $this->getCategories(NULL, NULL);
}
// Set the template file ...
TPL::tpSet($objCategoryList, new S('objCategoryList'), $tpF);
TPL::tpSet($objWA, new S('objWidgetArray'), $tpF);
TPL::tpSet($this, new S('ART'), $tpF);
TPL::tpExe($tpF);
TPL::tpEnd($cId);
}
// BK;
break;
case 'widgetList':
// Check some needed requirements ...
if ($_GET[FRONTEND_SECTION_URL] == FRONTEND_ARTICLE_URL) {
// Set some requirements ...
$objPag = isset($_GET[ARTICLES_PAGE_URL]) ? $_GET[ARTICLES_PAGE_URL] : new S((string) 1);
if (isset($_GET[ARTICLES_ARTICLES_URL])) {
// Check that the article exists, before doing anything stupid ...
if ($this->checkArticleURLIsUnique($objURL = $_GET[ARTICLES_ARTICLES_URL])->toBoolean() == TRUE) {
// Make the proper header, at first ...
$this->setHeaderStr(new S(HDR::HEADER_404_NOT_FOUND));
// Give me back my free hardcore, Quoth the server, '404' ...
$this->setHeaderKey(URL::staticURL(new A(array(FRONTEND_ERROR_URL)), new A(array('404'))), new S('Location'));
} else {
// Update them views ...
$this->_Q(_QS('doUPDATE')->doToken('%table', self::$objArticleTable)->doToken('%condition', _S('%objArticleTableFViews = %objArticleTableFViews + 1
WHERE %objArticleTableFSEO = "%Id"')->doToken('%Id', $_GET[ARTICLES_ARTICLES_URL])));
// Do me SEO, yah baby! ... (add title and category name, cause we need it)
TPL::manageTTL($this->getArticleInfoByURL($objURL, self::$objArticleTableFTitle));
TPL::manageTTL(MPTT::mpttRemoveUnique($this->getCategoryInfoById($this->getArticleInfoByURL($objURL, self::$objArticleTableFCategoryId), self::$objCategoryTableFName)));
// Do me SEO, yah baby! ... (add keywords and description, for something extra)
TPL::manageTAG(new S('keywords'), $this->getArticleInfoByURL($objURL, self::$objArticleTableFTags));
TPL::manageTAG(new S('description'), $this->getArticleInfoByURL($objURL, self::$objArticleTableFTitle)->appendString(_DCSP)->appendString($this->getArticleInfoByURL($objURL, self::$objArticleTableFExcerpt))->doToken(_QOT, _NONE));
// Set the template file ...
$tpF = new FilePath($this->getPathToSkin()->toRelativePath() . $objW . '-Item.tp');
TPL::tpSet($objWA, new S('objWidgetArray'), $tpF);
TPL::tpSet($this->ATH, new S('ATH'), $tpF);
TPL::tpSet($this->STG, new S('STG'), $tpF);
TPL::tpSet($objURL, new S('objURL'), $tpF);
TPL::tpSet($this, new S('ART'), $tpF);
TPL::tpExe($tpF);
}
} else {
if (isset($_GET[ARTICLES_CATEGORY_URL])) {
// Check that the category exists, before doing anything stupid ...
if ($this->checkCategoryURLIsUnique($objCat = $_GET[ARTICLES_CATEGORY_URL])->toBoolean() == TRUE) {
// Make the proper header, at first ...
$this->setHeaderStr(new S(HDR::HEADER_404_NOT_FOUND));
// Give me back my free hardcore, Quoth the server, '404' ...
$this->setHeaderKey(URL::staticURL(new A(array(FRONTEND_ERROR_URL)), new A(array('404'))), new S('Location'));
} else {
// Do me SEO, yah baby! ... (title and pagination to prev. duplicates)
TPL::manageTTL(_S(ARTICLES_PAGE_URL)->appendString(_SP)->appendString($objPag));
TPL::manageTTL(MPTT::mpttRemoveUnique($this->getCategoryInfoByURL($objCat, self::$objCategoryTableFName)));
// Do me SEO, yah baby! ... (add cat. descr)
if ($this->getCategoryInfoByURL($objCat, self::$objCategoryTableFDescription)->toLength()->toInt() != 0) {
TPL::manageTAG(new S('description'), $this->getCategoryInfoByURL($objCat, self::$objCategoryTableFDescription)->entityDecode(ENT_QUOTES)->stripTags()->doToken(_QOT, _NONE)->doSubStr(0, META_DESCRIPTION_MAX)->appendString(_SP)->appendString(_DTE));
}
// Set some requirements ...
$objCnt = $this->getPublishedArticleCountForCategoryURL($objCat);
$objStk = $this->getStickyArticlesByCategoryURLAndPage($objCat, $objPag);
$objArt = $this->getPublishedArticlesByCategoryURLAndPage($objCat, $objPag);
$objInC = new B(TRUE);
}
示例3: renderWidget
/**
* Will render a requested widget;
*
* This method is used to render a widget that usually is used in the frontend part of any website done with the help of this
* platform. What are widgets you ask?! Well, it's quite simple. They are pieces of PHP code, usually tied to some
* configuration options that control the way the widget functions or showns;
*
* Usually, configured widgets have enough power to be used in any way you want or need. For most of the times, the widgets
* are called in the proper section of the frontend, but this method must permit the use of widgets, independent of the place
* the developer needs them;
*
* @param $objW The widget to render;
* @return mixed Depends on the widget;
*/
public function renderWidget(S $objW, A $objWA = NULL)
{
// Make an empty array if NULL ...
if ($objWA == NULL) {
$objWA = new A();
}
// XML & RSS: Do a switch ...
switch ($objW) {
case 'widgetXML':
// BK;
break;
case 'widgetRSS':
// BK;
break;
}
// HTML: Do a switch ...
switch ($objW) {
case 'widgetCategoryList':
// Set some requirements ...
if ($objWA == NULL) {
$objWA = new A();
}
// Get the category to start from ...
if (isset($objWA['start_from_category'])) {
// Get the category LIST;
$objCategoryList = $this->getCategories(NULL, $objWA['start_from_category']);
} else {
// Get the category LIST;
$objCategoryList = $this->getCategories(NULL, NULL);
}
// Set the template file ...
$tpF = new FilePath($this->getPathToSkin()->toRelativePath() . $objW . TPL_EXTENSION);
TPL::tpSet($objCategoryList, new S('objCategoryList'), $tpF);
TPL::tpSet($objWA, new S('objWidgetArray'), $tpF);
TPL::tpSet($this, new S('ART'), $tpF);
TPL::tpExe($tpF);
break;
case 'widgetList':
// Check some needed requirements ...
if ($_GET[FRONTEND_SECTION_URL] == FRONTEND_PRODUCTS_URL) {
// Set some requirements ...
$objPag = isset($_GET[PRODUCTS_PAGE_URL]) ? $_GET[PRODUCTS_PAGE_URL] : new S((string) 1);
if (isset($_GET[PRODUCTS_ITEM_URL])) {
// Check that the article exists, before doing anything stupid ...
if ($this->checkProductURLIsUnique($objURL = $_GET[PRODUCTS_ITEM_URL])->toBoolean() == TRUE) {
// Make the proper header, at first ...
$this->setHeaderStr(new S(HDR::HEADER_404_NOT_FOUND));
// Give me back my free hardcore, Quoth the server, '404' ...
$this->setHeaderKey(URL::staticURL(new A(array(FRONTEND_ERROR_URL)), new A(array('404'))), new S('Location'));
} else {
// Do me SEO, yah baby! ...
TPL::manageTTL($this->getProductInfoByURL($objURL, self::$objProductsTableFName));
TPL::manageTAG(new S('description'), $this->getProductInfoByURL($objURL, self::$objProductsTableFDescription)->entityDecode(ENT_QUOTES)->stripTags()->doToken(_QOT, _NONE));
// Set some requirements ...
$objPathToItem = self::$objMPTT->mpttGetSinglePath($this->getCategoryInfoById($this->getProductInfoByURL($objURL, self::$objProductsTableFCategoryId), self::$objCategoryTableFName));
$objItemPpties = $this->getPropertiesByProductURL($objURL);
$objItemImages = $this->getImagesByProductURL($objURL);
if ($objItemImages->doCount()->toInt() != 0) {
$objItemHasImg = new B(TRUE);
} else {
$objItemHasImg = new B(FALSE);
}
// Set the template file ...
$tpF = new FilePath($this->getPathToSkin()->toRelativePath() . $objW . '-Item.tp');
TPL::tpSet($objPathToItem, new S('objPathToItem'), $tpF);
TPL::tpSet($objItemPpties, new S('objItemPpties'), $tpF);
TPL::tpSet($objItemImages, new S('objItemImages'), $tpF);
TPL::tpSet($objItemHasImg, new S('objItemHasImg'), $tpF);
TPL::tpSet($objWA, new S('objWidgetArray'), $tpF);
TPL::tpSet($objURL, new S('objURL'), $tpF);
TPL::tpSet($this->ATH, new S('ATH'), $tpF);
TPL::tpSet($this->STG, new S('STG'), $tpF);
TPL::tpSet($this, new S('PRD'), $tpF);
TPL::tpExe($tpF);
}
} else {
if (isset($_GET[PRODUCTS_CATEGORY_URL])) {
// Check that the category exists, before doing anything stupid ...
if ($this->checkCategoryURLIsUnique($objCat = $_GET[PRODUCTS_CATEGORY_URL])->toBoolean() == TRUE) {
// Make the proper header, at first ...
$this->setHeaderStr(new S(HDR::HEADER_404_NOT_FOUND));
// Give me back my free hardcore, Quoth the server, '404' ...
$this->setHeaderKey(URL::staticURL(new A(array(FRONTEND_ERROR_URL)), new A(array('404'))), new S('Location'));
} else {
// Do me SEO, yah baby! ...
err('Here');
//.........这里部分代码省略.........
示例4: renderWidget
//.........这里部分代码省略.........
// Cut it down to size ...
if ($objDSC->toLength()->toInt() > META_DESCRIPTION_MAX) {
$objDSC->doSubStr(0, META_DESCRIPTION_MAX)->appendString(_SP)->appendString(_DTE);
}
if ($objKEY->toLength()->toInt() > META_DESCRIPTION_MAX) {
$objKEY->doSubStr(0, META_DESCRIPTION_MAX)->appendString(_SP)->appendString(_DTE);
}
// Only description if it's bigger ...
if ($objDSC->toLength()->toInt() != 0) {
$objDSC = $objDSC->prependString($objWA['audio_description'])->prependString(', ');
}
// Get the description ... but prepend it with the Title, Artist, Album ...
$objDSC->prependString($objPBL)->prependString($objWA['audio_uploaded_at'])->prependString(', ')->prependString($objCAT)->prependString($objWA['audio_genre'])->prependString(', ')->prependString($objALB)->prependString($objWA['audio_album'])->prependString(', ')->prependString($objART)->prependString($objWA['audio_artist'])->prependString(', ')->prependString($objTTL)->prependString($objWA['audio_title']);
// Add them LYRICS ...
if ($this->getAudioFileInfoByURL($objURL, self::$objAudioTableFLyrics)->toLength()->toInt() != 0) {
// Yes ...
$objHasLrc = new S('Da');
} else {
// Nop ...
$objHasLrc = new S('Nu');
}
// Add them DESCRIPTIONS ...
if ($this->getAudioFileInfoByURL($objURL, self::$objAudioTableFDescription)->toLength()->toInt() != 0) {
// Yes ...
$objHasDsc = new S('Da');
} else {
// Nop ...
$objHasDsc = new S('Nu');
}
// Modify the DESCRIPTION ...
$objDSC->appendString(', ')->appendString($objWA['audio_lyrics'])->appendString($objHasLrc);
$objDSC->appendString(', ')->appendString($objWA['audio_description'])->appendString($objHasDsc);
// Add the TAG, as we have description ...
TPL::manageTAG(new S('description'), $objDSC->entityEncode(ENT_QUOTES));
// Add the TAG, as we have keywords ...
if ($objKEY->toLength()->toInt() != 0) {
TPL::manageTAG(new S('keywords'), $objKEY->eregReplace('[^a-zA-Z0-9 -]', _NONE)->eregReplace(_SP, ', ')->eregReplace(', ,', ',')->entityEncode(ENT_QUOTES));
}
// Set some requirements ...
$objPathToItem = self::$objMPTT->mpttGetSinglePath($this->getCategoryInfoById($this->getAudioFileInfoByURL($objURL, self::$objAudioTableFCategoryId), self::$objCategoryTableFName));
// Update them views ...
$this->_Q(_QS('doUPDATE')->doToken('%table', self::$objAudioTable)->doToken('%condition', new S('%objAudioTableFViews = %objAudioTableFViews + 1
WHERE %objAudioTableFSEO = "%Id"'))->doToken('%Id', $objURL));
// Set the template file ...
$tpF = new FilePath($this->getPathToSkin()->toRelativePath() . $objW . '-Item' . TPL_EXTENSION);
TPL::tpSet($objPathToItem, new S('objPathToItem'), $tpF);
TPL::tpSet($objWA, new S('objWidgetArray'), $tpF);
TPL::tpSet($objURL, new S('objURL'), $tpF);
TPL::tpSet($this->ATH, new S('ATH'), $tpF);
TPL::tpSet($this->STG, new S('STG'), $tpF);
TPL::tpSet($this, new S('AUD'), $tpF);
TPL::tpExe($tpF);
}
} else {
if (isset($_GET[AUDIO_CATEGORY_URL])) {
// Check that the category exists, before doing anything stupid ...
if ($this->checkCategoryURLIsUnique($objCat = $_GET[AUDIO_CATEGORY_URL])->toBoolean() == TRUE) {
// Make the proper header, at first ...
$this->setHeaderStr(new S(HDR::HEADER_404_NOT_FOUND));
// Give me back my free hardcore, Quoth the server, '404' ...
$this->setHeaderKey(URL::staticURL(new A(array(FRONTEND_ERROR_URL)), new A(array('404'))), new S('Location'));
} else {
// Do me SEO, yah baby! ...
TPL::manageTTL(MPTT::mpttRemoveUnique($this->getCategoryInfoByURL($objCat, self::$objCategoryTableFName)));
// Make a condition to avoid dup. title tags on different pages ...
if ((int) $objPag->toString() >= 1 && isset($_GET[AUDIO_PAGE_URL])) {
示例5: renderWidget
//.........这里部分代码省略.........
$objWA = new A();
}
// Get the category to start from ...
if (isset($objWA['start_from_category'])) {
// Get the category LIST;
$objCategoryList = $this->getCategories(NULL, $objWA['start_from_category']);
} else {
// Get the category LIST;
$objCategoryList = $this->getCategories(NULL, NULL);
}
// Set the template file ...
$tpF = new FilePath($this->getPathToSkin()->toRelativePath() . $objW . TPL_EXTENSION);
TPL::tpSet($objCategoryList, new S('objCategoryList'), $tpF);
TPL::tpSet($objWA, new S('objWidgetArray'), $tpF);
TPL::tpSet($this, new S('TXT'), $tpF);
TPL::tpExe($tpF);
break;
case 'widgetList':
// Do some checking ... before anything ...
if (isset($_GET[TEXTS_TEXTS_URL])) {
// Check or redirect ...
if ($this->checkTextExistsByURL($_GET[TEXTS_TEXTS_URL])->toBoolean() == FALSE) {
// The text does not exist, than redirect to 404;
$this->setHeaderStr(new S(HDR::HEADER_MOVED_PERMANENTLY));
$this->setHeaderKey(URL::staticURL(new A(array(FRONTEND_ERROR_URL)), new A(array('404'))), new S('Location'));
} else {
// Get the TEXT ...
$objTextCNT = $this->getTextInfoByURL($_GET[TEXTS_TEXTS_URL], self::$objTextTableFContent);
$objTextTTL = $this->getTextInfoByURL($_GET[TEXTS_TEXTS_URL], self::$objTextTableFTitle);
$objTextKEY = $this->getTextInfoByURL($_GET[TEXTS_TEXTS_URL], self::$objTextTableFTags);
$objTextDSC = clone $objTextTTL;
// Set the title, keywords, description ...
TPL::manageTTL($objTextTTL);
TPL::manageTAG(new S('keywords'), $objTextKEY->entityEncode(ENT_QUOTES));
TPL::manageTAG(new S('description'), $objTextDSC->entityEncode(ENT_QUOTES));
// Set the template file ...
$tpF = new FilePath($this->getPathToSkin()->toRelativePath() . $objW . '-Item' . TPL_EXTENSION);
TPL::tpSet($objTextTTL, new S('objTextTTL'), $tpF);
TPL::tpSet($objTextCNT, new S('objTextCNT'), $tpF);
TPL::tpSet($this, new S('TXT'), $tpF);
TPL::tpExe($tpF);
}
} else {
// Get the CATEGORY ...
if ($this->checkCategoryExistsByURL($_GET[FRONTEND_SECTION_URL])->toBoolean() == FALSE) {
// The category does not exist, than redirect to 404;
$this->setHeaderStr(new S(HDR::HEADER_MOVED_PERMANENTLY));
$this->setHeaderKey(URL::staticURL(new A(array(FRONTEND_ERROR_URL)), new A(array('404'))), new S('Location'));
} else {
// Get something from db ...
$objCategoryArray = $this->getTextsByCategoryURL($_GET[FRONTEND_SECTION_URL]);
// Check how many texts are defined for it ...
switch ($objCategoryArray->doCount()->toInt()) {
// If we have only ONE text, defined for a category,
// we then recommend moving to that text ...
case 1:
// MOVED ... permanently ...
$this->setHeaderStr(new S(HDR::HEADER_MOVED_PERMANENTLY));
$this->setHeaderKey(URL::rewriteURL(new A(array(TEXTS_TEXTS_URL, FRONTEND_SECTION_URL)), new A(array($objCategoryArray[0][self::$objTextTableFSEO], $_GET[FRONTEND_SECTION_URL]))), new S('Location'));
break;
// In case we don't have any text defined,
// we recommend showing a default message.
// In case we don't have any text defined,
// we recommend showing a default message.
case 0:
break;
示例6: renderWidget
/**
* Will render a requested widget;
*
* This method is used to render a widget that usually is used in the frontend part of any website done with the help of this
* platform. What are widgets you ask?! Well, it's quite simple. They are pieces of PHP code, usually tied to some
* configuration options that control the way the widget functions or showns;
*
* Usually, configured widgets have enough power to be used in any way you want or need. For most of the times, the widgets
* are called in the proper section of the frontend, but this method must permit the use of widgets, independent of the place
* the developer needs them;
*
* @param $objWidgetToRender The widget to render;
* @return mixed Depends on the widget;
*/
public function renderWidget(S $objW, A $objWA = NULL)
{
// Make an empty array if NULL ...
if ($objWA == NULL) {
$objWA = new A();
}
// XML & RSS: Do a switch ...
switch ($objW) {
case 'widgetXML':
// Yo man ... woohoooooo ...
foreach ($this->getLyrics(_S('ORDER
BY %objLyricsTableFDateAdded DESC LIMIT %LowerLimit, %UpperLimit')->doToken('%LowerLimit', ((int) $objWA['objId']->toString() - 1) * 25000)->doToken('%UpperLimit', 25000)) as $k => $v) {
// Set some requirements ...
$objDTE = date('Y-m-d', (int) $v[self::$objLyricsTableFDateAdded]->toString());
$objLOC = URL::staticURL(new A(array(LYRICS_ITEM_URL, FRONTEND_SECTION_URL)), new A(array($v[self::$objLyricsTableFSEO], FRONTEND_LYRICS_URL)));
// Get the (INNER) CHILD of every young SEO freak ...
$objURL = $objWA['objXML']->addCHILD(Frontend::XML_URL);
// Set the XML Sitemap kids ...
$objURL->addCHILD(Frontend::XML_LOCATION, $objLOC);
$objURL->addCHILD(Frontend::XML_LAST_MOD, $objDTE);
$objURL->addCHILD(Frontend::XML_CHANGE_FREQ, self::XML_SITEMAP_FREQUENCY);
$objURL->addCHILD(Frontend::XML_PRIORITY, self::XML_SITEMAP_PRIORITY);
}
// BK;
break;
case 'widgetRSS':
// Yo man ... woohoooooo ...
if ($_GET[FRONTEND_FEED_URL] == __CLASS__) {
// Get'em 30 ...
foreach ($this->getApprovedAudioFiles(new S('ORDER BY %objAudioTableFUploadedDate
DESC LIMIT 0, 30')) as $k => $v) {
// Set some requirements ...
$objDTE = date(DATE_RFC822, (int) $v[self::$objAudioTableFUploadedDate]->toString());
$objLOC = URL::staticURL(new A(array(AUDIO_ITEM_URL, FRONTEND_SECTION_URL)), new A(array($v[self::$objAudioTableFSEO], FRONTEND_AUDIO_URL)));
$objTTL = $v[self::$objAudioTableFTitle]->appendString(_DCSP)->appendString($v[self::$objAudioTableFArtist])->appendString(_DCSP)->appendString($v[self::$objAudioTableFAlbum]);
$objDSC = $v[self::$objAudioTableFDescription]->entityEncode(ENT_QUOTES)->entityDecode(ENT_QUOTES)->stripTags();
// Get the (INNER) CHILD of every young SEO freak ...
$objURL = $objWA['objXML']->addCHILD(Frontend::RSS_ITEM);
// Set the RSS kids ...
$objURL->addCHILD(Frontend::RSS_TITLE, $objTTL);
$objURL->addCHILD(Frontend::RSS_LINK, $objLOC);
$objURL->addCHILD(Frontend::RSS_GUID, $objLOC);
$objURL->addCHILD(Frontend::RSS_PUBLISHED_DATE, $objDTE);
$objURL->addCHILD(Frontend::RSS_DESCRIPTION, $objDSC);
}
}
// BK;
break;
}
// Do a switch ...
switch ($objW) {
case 'widgetList':
// Check some needed requirements ...
if ($_GET[FRONTEND_SECTION_URL] == FRONTEND_LYRICS_URL) {
// Set some requirements ...
$objPag = isset($_GET[LYRICS_PAGE_URL]) ? $_GET[LYRICS_PAGE_URL] : new S((string) 1);
$objPag = new I((int) $objPag->toString());
// Fixes for a bugged user ...
if ($objPag->toInt() == 0) {
// Make the proper header, at first ...
$this->setHeaderStr(new S(HDR::HEADER_404_NOT_FOUND));
// Give me back my free hardcore, Quoth the server, '404' ...
$this->setHeaderKey(URL::staticURL(new A(array(FRONTEND_ERROR_URL)), new A(array('404'))), new S('Location'));
} else {
// Make it a string again ...
$objPag = new S((string) $objPag->toInt());
}
// Get your switches on ...
if (isset($_GET[LYRICS_ITEM_URL])) {
// Check that the article exists, before doing anything stupid ...
if ($this->checkLyricURLIsUnique($objURL = $_GET[LYRICS_ITEM_URL])->toBoolean() == TRUE) {
// Make the proper header, at first ...
$this->setHeaderStr(new S(HDR::HEADER_404_NOT_FOUND));
// Give me back my free hardcore, Quoth the server, '404' ...
$this->setHeaderKey(URL::staticURL(new A(array(FRONTEND_ERROR_URL)), new A(array('404'))), new S('Location'));
} else {
// Make me SEO ... yah!
TPL::manageTTL($objTTL = $this->getLyricInfoByURL($objURL, self::$objLyricsTableFTitle));
TPL::manageTTL($objART = $this->getLyricInfoByURL($objURL, self::$objLyricsTableFArtist));
TPL::manageTTL($objALB = $this->getLyricInfoByURL($objURL, self::$objLyricsTableFAlbum));
TPL::manageTAG(new S('description'), new S('Titlu: ' . $objTTL . ', Artist: ' . $objART . ', Album: ' . $objALB . ', Lyrics: ' . $this->getLyricInfoByURL($objURL, self::$objLyricsTableFLyrics)->entityDecode(ENT_QUOTES)->doToken('<br />', _SP)->stripTags()->doSubStr(0, 128)));
// Set the template file ...
$tpF = new FilePath($this->getPathToSkin()->toRelativePath() . $objW . '-Item' . TPL_EXTENSION);
TPL::tpSet($objWA, new S('objWidgetArray'), $tpF);
TPL::tpSet($objURL, new S('objURL'), $tpF);
TPL::tpSet($this->ATH, new S('ATH'), $tpF);
//.........这里部分代码省略.........
示例7: doFooterCommonRequirements
/**
* Will execute the footer, and do additional clean-up that are common to the platform;
*
* This method will execute the necessary footer templates, and do clean-up operations common for the whole website. It's a
* way to avoid having to write files with that code, and link'em in every page. We try to avoid such redundant operations as
* much as we can, thus mappings like this are a good way to get to that ...
*/
public function doFooterCommonRequirements()
{
// The TITLE, per-se ... as we need. It says who we are, what we do ...
TPL::manageTTL($this->STG->getConfigKey(new S('settings_website_default_title')));
// HTTP-EQUIVs ... as per HTTP/1.1
TPL::manageEQV(new S('Content-Type'), new S('text/html; charset=UTF-8'));
TPL::manageEQV(new S('Content-Script-Type'), new S('text/javascript'));
TPL::manageEQV(new S('Content-Style-Type'), new S('text/css'));
// Add'em defaults ... and specifics ... if they need to be added ...
TPL::manageTAG(new S('copyright'), new S('KIT Software CAZ SRL on the RA PHP Framework code ONLY!'));
TPL::manageTAG(new S('author'), new S('Catalin Alexandru Zamfir, KIT Software CAZ SRL'));
TPL::manageTAG(new S('generator'), new S('RA PHP Framework.ro Platform'));
TPL::manageTAg(new S('robots'), new S('index, follow'));
TPL::manageTAG(new S('revisit-after'), new S('1 days'));
// Google, Yahoo, MSN, RA PHP Framework WBMs ...
TPL::manageTAG(new S('y_key'), new S(YAHOO__WBM_KEY));
TPL::manageTAG(new S('verify-v1'), new S(GOOGLE_WBM_KEY));
TPL::manageTAG(new S('msvalidate.01'), new S(BING___WBM_KEY));
TPL::manageTAG(new S('ra_key'), new S(SHA1(DOCUMENT_HOST)));
// Add'em DEFAULTS ... forever ...
TPL::manageCSS(new FilePath($this->objPathToSkinCSS . 'default.css'), new S('default_css'));
// Check for some IEs, Operas and others ...
if ($this->getUserAgentProperty(new S('browser')) == 'ie') {
// Specific IE CSS (believe it ...)
TPL::manageCSS(new FilePath($this->objPathToSkinCSS . 'default_ie.css'), new S('default_ie'));
// Specific IE jQuery JSS (ya! ...)
TPL::manageJSS(new FilePath($this->objPathToSkinJSS . 'jQuery/jQExeIE.js'), new S('jQExeIE'));
}
// Set the execution time ...
TPL::setExeTime(new S('finish'));
}