本文整理汇总了PHP中Feed::select方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::select方法的具体用法?PHP Feed::select怎么用?PHP Feed::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feed
的用法示例。
在下文中一共展示了Feed::select方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postAllfeeds
public function postAllfeeds()
{
User::onlyHas('feed-view');
$jqgrid = new jQgrid(Feed::getTableName());
$jqgrid->use_populate_count = true;
return $jqgrid->populate(function ($start, $limit) {
$list = Feed::select('id', 'name', 'enabled')->orderBy('name', 'asc');
if ($limit) {
$list = $list->skip($start)->take($limit);
}
return $list->get($list);
});
}
示例2: parsePages
function parsePages($intElmntId, $strCommand)
{
global $objLang, $_CLEAN_POST, $objLiveUser, $_CONF, $_PATHS, $DBAConn, $objMultiUpload;
$objTpl = new HTML_Template_IT($_PATHS['templates']);
$blnUiError = Request::get('err', 0);
switch ($strCommand) {
case CMD_LIST:
$objTpl->loadTemplatefile("multiview.tpl.htm");
$objTpl->setVariable("MAINTITLE", $objLang->get("pcmsElements", "menu"));
$objElement = Element::selectByPK($intElmntId);
if (empty($intElmntId)) {
$strElmntName = "Website";
} else {
if (is_object($objElement)) {
$strElmntName = $objElement->getName();
} else {
$strElmntName = "";
}
}
if (is_object($objElement) || empty($intElmntId)) {
if (empty($intElmntId)) {
$objElements = Elements::getFromParent(0, false);
} else {
$objElements = $objElement->getElements(false);
}
if (is_object($objElements)) {
//*** Initiate child element loop.
$listCount = 0;
$intPosition = request("pos");
$intPosition = !empty($intPosition) && is_numeric($intPosition) ? $intPosition : 0;
$intPosition = floor($intPosition / $_SESSION["listCount"]) * $_SESSION["listCount"];
$objElements->seek($intPosition);
//*** Loop through the elements.
foreach ($objElements as $objSubElement) {
//if (Permissions::hasElementPermission(SPINCMS_ELEMENTS_READ, $objSubElement)) {
$objTemplate = Template::selectByPK($objSubElement->getTemplateId(), array('name'));
$strMeta = $objLang->get("editedBy", "label") . " " . $objSubElement->getUsername() . ", " . Date::fromMysql($objLang->get("datefmt"), $objSubElement->getModified());
$objTpl->setCurrentBlock("multiview-item");
if ($objSubElement->getTypeId() != ELM_TYPE_LOCKED) {
$objTpl->setVariable("BUTTON_DUPLICATE", $objLang->get("duplicate", "button"));
$objTpl->setVariable("BUTTON_DUPLICATE_HREF", "javascript:PElement.duplicate({$objSubElement->getId()});");
$objTpl->setVariable("BUTTON_REMOVE", $objLang->get("delete", "button"));
$objTpl->setVariable("BUTTON_REMOVE_HREF", "javascript:PElement.remove({$objSubElement->getId()});");
}
$objTpl->setVariable("MULTIITEM_VALUE", $objSubElement->getId());
//if (Permissions::hasElementPermission(SPINCMS_ELEMENTS_WRITE, $objSubElement)) {
$objTpl->setVariable("MULTIITEM_HREF", "href=\"?cid=" . NAV_PCMS_ELEMENTS . "&eid={$objSubElement->getId()}&cmd=" . CMD_EDIT . "\"");
//} else {
// $objTpl->setVariable("MULTIITEM_HREF", "");
//}
if ($objSubElement->getActive() < 1) {
$objTpl->setVariable("MULTIITEM_ACTIVE", " class=\"inactive\"");
}
$strValue = htmlspecialchars($objSubElement->getName());
$strShortValue = getShortValue($strValue, 50);
$intSize = strlen($strValue);
$objTpl->setVariable("MULTIITEM_NAME", $intSize > 50 ? $strShortValue : $strValue);
$objTpl->setVariable("MULTIITEM_TITLE", $intSize > 50 ? $strValue : "");
$strTypeClass = "";
if ($objSubElement->getTypeId() == ELM_TYPE_FOLDER) {
$strTypeClass = "folder";
} else {
$objChildElements = $objSubElement->getElements();
if (is_object($objChildElements) && $objChildElements->count() > 0) {
switch ($objSubElement->getTypeId()) {
case ELM_TYPE_DYNAMIC:
$strTypeClass = "widget-dynamic";
break;
case ELM_TYPE_LOCKED:
$strTypeClass = "widget-locked";
break;
default:
$strTypeClass = "widget";
}
} else {
switch ($objSubElement->getTypeId()) {
case ELM_TYPE_DYNAMIC:
$strTypeClass = "element-dynamic";
break;
case ELM_TYPE_LOCKED:
$strTypeClass = "element-locked";
break;
default:
$strTypeClass = "element";
}
}
}
$objTpl->setVariable("MULTIITEM_TYPE_CLASS", $strTypeClass);
if (is_object($objTemplate)) {
$objTpl->setVariable("MULTIITEM_TYPE", ", " . $objTemplate->getName());
}
$objTpl->setVariable("MULTIITEM_META", $strMeta);
$objTpl->parseCurrentBlock();
$listCount++;
if ($listCount >= $_SESSION["listCount"]) {
break;
}
//}
}
//*** Render page navigation.
//.........这里部分代码省略.........
示例3: export
public static function export($intAccountId = 0, $exportFiles = true)
{
global $objLiveAdmin, $_CONF, $_PATHS;
//*** Init DOM object.
$objDoc = new DOMDocument("1.0", "UTF-8");
$objDoc->formatOutput = false;
$objDoc->preserveWhiteSpace = true;
//*** Init Zip archive.
$strZipName = $_PATHS['upload'] . "exportZip_" . rand() . ".zip";
$objZip = new dZip($strZipName, true);
//*** ACL. Users, groups and rights.
$objAcl = self::exportAcl($objDoc, $intAccountId);
//*** Products.
$_CONF['app']['account'] = Account::getById($intAccountId);
$objAccountProducts = AccountProduct::getByAccountId($intAccountId);
$objProducts = $objDoc->createElement('products');
foreach ($objAccountProducts as $objAccountProduct) {
switch ($objAccountProduct->getProductId()) {
case PRODUCT_PCMS:
$arrFiles = array();
//*** Settings.
$objSettings = $objDoc->createElement('settings');
$objDbSettings = SettingTemplate::select("SELECT * FROM pcms_setting_tpl ORDER BY section, sort");
foreach ($objDbSettings as $objDbSetting) {
$objSetting = $objDoc->createElement('setting');
$objSetting->setAttribute("name", $objDbSetting->getName());
$objSetting->setAttribute("value", Setting::getValueByName($objDbSetting->getName(), $intAccountId));
$objSetting->setAttribute("section", $objDbSetting->getSection());
$objSettings->appendChild($objSetting);
}
//*** Languages.
$objLanguages = $objDoc->createElement('languages');
$objContentLangs = ContentLanguage::select();
foreach ($objContentLangs as $objContentLang) {
$objLanguage = $objDoc->createElement('language');
$objLanguage->setAttribute("id", $objContentLang->getId());
$objLanguage->setAttribute("name", $objContentLang->getName());
$objLanguage->setAttribute("abbr", $objContentLang->getAbbr());
$objLanguage->setAttribute("default", $objContentLang->default);
$objLanguage->setAttribute("active", $objContentLang->getActive());
$objLanguage->setAttribute("sort", $objContentLang->getSort());
$objLanguage->setAttribute("username", $objContentLang->getUsername());
$objLanguages->appendChild($objLanguage);
}
//*** External feeds.
$objFeeds = $objDoc->createElement('feeds');
$objDbFeeds = Feed::select();
foreach ($objDbFeeds as $objDbFeed) {
$objFeed = $objDoc->createElement('feed');
$objFeed->setAttribute("id", $objDbFeed->getId());
$objFeed->setAttribute("name", $objDbFeed->getName());
$objFeed->setAttribute("feed", $objDbFeed->getFeed());
$objFeed->setAttribute("basepath", $objDbFeed->getBasepath());
$objFeed->setAttribute("refresh", $objDbFeed->getRefresh());
$objFeed->setAttribute("lastUpdate", $objDbFeed->getLastUpdate());
$objFeed->setAttribute("active", $objDbFeed->getActive());
$objFeed->setAttribute("sort", $objDbFeed->getSort());
$objFeed->setAttribute("created", $objDbFeed->getCreated());
$objFeed->setAttribute("modified", $objDbFeed->getModified());
$objFeeds->appendChild($objFeed);
}
//*** Storage items.
$objStorage = self::exportStorage($objDoc, $intAccountId, 0, $arrFiles);
//*** Templates.
$objTemplates = self::exportTemplate($objDoc, $intAccountId, 0);
//*** Elements.
$objElements = self::exportElement($objDoc, $intAccountId, 0, $arrFiles);
//*** Aliases.
$objAliases = $objDoc->createElement('aliases');
$objDbAliases = Alias::select();
foreach ($objDbAliases as $objDbAlias) {
$objAlias = $objDoc->createElement('alias');
$objAlias->setAttribute("language", $objDbAlias->getLanguageId());
$objAlias->setAttribute("cascade", $objDbAlias->getCascade());
$objAlias->setAttribute("alias", $objDbAlias->getAlias());
$objAlias->setAttribute("url", $objDbAlias->getUrl());
$objAlias->setAttribute("active", $objDbAlias->getActive());
$objAlias->setAttribute("sort", $objDbAlias->getSort());
$objAlias->setAttribute("created", $objDbAlias->getCreated());
$objAlias->setAttribute("modified", $objDbAlias->getModified());
$objAliases->appendChild($objAlias);
}
//*** Product.
$objProduct = $objDoc->createElement('pcms');
$objProduct->setAttribute("version", APP_VERSION);
$objProduct->setAttribute("expires", $objAccountProduct->getExpires());
$objProduct->appendChild($objSettings);
$objProduct->appendChild($objLanguages);
$objProduct->appendChild($objFeeds);
$objProduct->appendChild($objStorage);
$objProduct->appendChild($objTemplates);
$objProduct->appendChild($objElements);
$objProduct->appendChild($objAliases);
$objProducts->appendChild($objProduct);
//*** Files.
if ($exportFiles) {
$strServer = Setting::getValueByName("ftp_server");
if ($strServer != "localhost") {
$strLocation = "http://" . Setting::getValueByName("ftp_server") . Setting::getValueByName("file_folder");
$objZip = self::exportFilesToZip($objZip, $arrFiles, $strLocation);
//.........这里部分代码省略.........