• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Meta类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Meta的典型用法代码示例。如果您正苦于以下问题:PHP Meta类的具体用法?PHP Meta怎么用?PHP Meta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Meta类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: upgrade_module_1_3_2_11

function upgrade_module_1_3_2_11($object)
{
    $themes = Theme::getThemes();
    $theme_meta_value = array();
    foreach ($object->controllers as $controller) {
        $page = 'module-' . $object->name . '-' . $controller;
        $result = Db::getInstance()->getValue('SELECT * FROM ' . _DB_PREFIX_ . 'meta WHERE page="' . pSQL($page) . '"');
        if ((int) $result > 0) {
            continue;
        }
        $meta = new Meta();
        $meta->page = $page;
        $meta->configurable = 0;
        $meta->save();
        if ((int) $meta->id > 0) {
            foreach ($themes as $theme) {
                $theme_meta_value[] = array('id_theme' => $theme->id, 'id_meta' => $meta->id, 'left_column' => (int) $theme->default_left_column, 'right_column' => (int) $theme->default_right_column);
            }
        } else {
            $object->_errors[] = sprintf(Tools::displayError('Unable to install controller: %s'), $controller);
        }
    }
    if (count($theme_meta_value) > 0) {
        return Db::getInstance()->insert('theme_meta', $theme_meta_value);
    }
    return true;
}
开发者ID:evgrishin,项目名称:se1614,代码行数:27,代码来源:install-1.3.2.11.php


示例2: CatalogPage

 public function CatalogPage()
 {
     $this->APagesCreator();
     $this->updateTitleTagChildren(["Каталог - "]);
     $this->setPageCode("catalog_page");
     $this->setIsTreeVisible(true);
     $this->setIsStatusBarVisible(true);
     $this->setIsViewModeBlockVisible(true);
     $this->setPathLinkForTree(PathLinks::getDOMForTree());
     if (array_key_exists(UrlParameters::KEY, $_GET)) {
         $this->key = Utils::getFromGET(UrlParameters::KEY);
         $this->setTreeKey($this->key);
         $this->setPathLinkForMainBlock(PathLinks::getDOMForTreeCatalog($this->key, $this));
     } else {
         $this->setPathLinkForMainBlock(PathLinks::getDOMForCatalog());
     }
     $this->setViewModeBlock(PathLinks::getDOMForViewModeSelector());
     $metaDesc = new Meta();
     $metaDesc->addAttributes(["name" => "description", "content" => "в каталоге augustova.by вы  найдете спецодежду для вашей работы"]);
     $treeView = new TreeView();
     $treeLabels = implode(", ", $treeView->getAllLabels());
     $metaKeyWords = new Meta();
     $metaKeyWords->addAttributes(["name" => "keywords", "content" => $treeLabels]);
     $this->addMetaTags($metaDesc, $metaKeyWords);
     $html = $this->getHtml();
     echo $html;
 }
开发者ID:gingerP,项目名称:shop,代码行数:27,代码来源:CatalogPage.php


示例3: handle_request_models_meta

 public static function handle_request_models_meta(\WP_REST_Request $request)
 {
     $controller = new Meta();
     $matches = $controller->parse_route($request->get_route(), '~' . \EED_Core_Rest_Api::ee_api_namespace_for_regex . 'resources~', array('version'));
     if ($matches instanceof \WP_REST_Response) {
         return $matches;
     }
     $controller->set_requested_version($matches['version']);
     return $controller->send_response($controller->_get_models_metadata_entity());
 }
开发者ID:teemuoksanen,项目名称:event-espresso-core,代码行数:10,代码来源:Meta.php


示例4: fbapps

 /**
  * @before _secure, changeLayout, _admin
  */
 public function fbapps()
 {
     $this->seo(array("title" => "FBApps", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     if (RequestMethods::post("action") == "fbapps") {
         $fbapp = new Meta(array("user_id" => $this->user->id, "property" => "fbapp", "value" => RequestMethods::post("fbapp")));
         $fbapp->save();
         $view->set("message", "FBApp Added Successfully");
     }
     $fbapps = Meta::all(array("property=?" => "fbapp"));
     $view->set("fbapps", $fbapps);
 }
开发者ID:SwiftDeal,项目名称:fbfunapp,代码行数:15,代码来源:items.php


示例5: install

 /**
  * Install Procedure
  */
 public function install()
 {
     // Set an url rewriting for prediggo search page
     $oMeta = new Meta();
     $oMeta->page = 'search_prediggo';
     $oMeta->title = array(1 => '', 2 => '');
     $oMeta->description = array(1 => '', 2 => '');
     $oMeta->keywords = array(1 => '', 2 => '');
     $oMeta->url_rewrite = array(1 => 'prediggo_search', 2 => 'prediggo_recherche');
     // Set the hook registration
     return $oMeta->save() && Db::getInstance()->autoExecute(_DB_PREFIX_ . 'meta', array('page' => 'modules/prediggo/prediggo_search'), 'UPDATE', '`page` = "search_prediggo"') && Tools::generateHtaccess(dirname(__FILE__) . '/../../.htaccess', Configuration::get('PS_REWRITING_SETTINGS'), Configuration::get('PS_HTACCESS_CACHE_CONTROL'), Configuration::get('PS_HTACCESS_SPECIFIC')) && parent::install() && $this->oPrediggoConfig->install() && $this->oPrediggoExportConfig->install() && $this->oPrediggoRecommendationConfig->install() && $this->oPrediggoSearchConfig->install() && $this->registerHook('header') && $this->registerHook('top') && $this->registerHook('leftColumn') && $this->registerHook('rightColumn') && $this->registerHook('footer') && $this->registerHook('authentication') && $this->registerHook('createAccount') && $this->registerHook('backOfficeHeader') && $this->registerHook('paymentTop');
 }
开发者ID:rtajmahal,项目名称:PrestaShop-modules,代码行数:15,代码来源:prediggo.php


示例6: MainPage

 public function MainPage()
 {
     $this->APagesCreator();
     $this->setPageCode("main_page");
     $this->setIsStatusBarVisible(false);
     $this->setIsViewModeBlockVisible(false);
     $this->setIsPathLinkVisible(false);
     $metaDesc = new Meta();
     $metaDesc->addAttributes(["name" => "description", "content" => "на augustova.by вы найдете спецодежду для вашей работы, а юридические лица смогут приобрести лакокрасочные материалы, чистящие и моющие ср-ва, канцтовары, строительный инструмент и другое "]);
     $metaKeyword = new Meta();
     $metaKeyword->addAttributes(["name" => "keywords", "content" => ""]);
     $this->addMetaTags($metaDesc, $metaKeyword);
     $html = $this->getHtml();
     echo $html;
 }
开发者ID:gingerP,项目名称:shop,代码行数:15,代码来源:MainPage.php


示例7: action_view

 /**
  * List of pages (blogs/posts/etc.) with a specific tag
  *
  * @throws  HTTP_Exception_404
  *
  * @uses    Log::add
  * @uses    Text::ucfirst
  * @uses    ACL::check
  * @uses    Meta::links
  * @uses    URL::canonical
  * @uses    Route::url
  */
 public function action_view()
 {
     $id = (int) $this->request->param('id', 0);
     $tag = ORM::factory('tag', $id);
     if (!$tag->loaded()) {
         throw HTTP_Exception::factory(404, 'Tag :tag not found!', array(':tag' => $id));
     }
     $this->title = __(':title', array(':title' => Text::ucfirst($tag->name)));
     $view = View::factory('tag/view')->set('teaser', TRUE)->bind('pagination', $pagination)->bind('posts', $posts);
     $posts = $tag->posts;
     if (!ACL::check('administer tags') and !ACL::check('administer content')) {
         $posts->where('status', '=', 'publish');
     }
     $total = $posts->reset(FALSE)->count_all();
     if ($total == 0) {
         Log::info('No posts found.');
         $this->response->body(View::factory('page/none'));
         return;
     }
     $pagination = Pagination::factory(array('current_page' => array('source' => 'cms', 'key' => 'page'), 'total_items' => $total, 'items_per_page' => 15, 'uri' => $tag->url));
     $posts = $posts->order_by('created', 'DESC')->limit($pagination->items_per_page)->offset($pagination->offset)->find_all();
     $this->response->body($view);
     // Set the canonical and shortlink for search engines
     if ($this->auto_render === TRUE) {
         Meta::links(URL::canonical($tag->url, $pagination), array('rel' => 'canonical'));
         Meta::links(Route::url('tag', array('action' => 'view', 'id' => $tag->id)), array('rel' => 'shortlink'));
     }
 }
开发者ID:MenZil-Team,项目名称:cms,代码行数:40,代码来源:tag.php


示例8: authenticate

 public function authenticate()
 {
     // Special case for admin account
     if ($this->username == 'ccplus1') {
         $model = Meta::model()->findByAttributes(array('field' => 'adminpass'));
         if ($this->password == $model->value) {
             $this->errorCode = self::ERROR_NONE;
         } else {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         }
     } else {
         $user = Customer::model()->findByAttributes(array('billogin' => $this->username));
         if ($user === null) {
             $this->errorCode = self::ERROR_USERNAME_INVALID;
         } else {
             if ($user->bilpass !== $this->password) {
                 $this->errorCode = self::ERROR_PASSWORD_INVALID;
             } else {
                 $this->_id = $user->bilkey;
                 $this->errorCode = self::ERROR_NONE;
             }
         }
     }
     return !$this->errorCode;
 }
开发者ID:E-SOFTinc,项目名称:Mailnetwork_Yii,代码行数:25,代码来源:UserIdentity.php


示例9: ContactsPage

 public function ContactsPage()
 {
     $this->APagesCreator();
     $this->setPageCode("contacts_page");
     $this->setIsTreeVisible(false);
     $this->setIsStatusBarVisible(true);
     $this->setIsViewModeBlockVisible(false);
     $this->setIsPathLinkVisible(false);
     $this->setPathLinkForTree(PathLinks::getDOMForContacts());
     $this->updateTitleTagChildren(["Контакты - "]);
     $metaDesc = new Meta();
     $metaDesc->addAttributes(["name" => "description", "content" => "на этой странице Вы найдете наши контакты, торговые точки на рынках и как всегда - электронная почта [email protected] - ждем ваших писем!"]);
     $this->addMetaTags($metaDesc);
     $html = $this->getHtml();
     echo $html;
 }
开发者ID:gingerP,项目名称:shop,代码行数:16,代码来源:ContactsPage.php


示例10: process

 public function process()
 {
     if ($this->table === null) {
         $this->add_error(ErrorApi::INCORRECT_URL);
         return;
     }
     $ids = (array) $this->get('id');
     foreach ($ids as &$id) {
         if (!is_numeric($id)) {
             $id = null;
         }
     }
     $ids = array_filter($ids);
     if (empty($ids)) {
         $this->add_error(ErrorApi::INCORRECT_INPUT);
         return;
     }
     $data = $this->get_data($ids);
     if ($this->get('add_tags')) {
         $tags = $this->db->join('art_tag', 'at.id = m.meta')->join($this->table . '_tag_count', 'at.id = id_tag')->get_table('meta', array('m.id_item', 'at.*', 'count'), 'm.item_type = ' . Meta::parse(strtoupper($this->table)) . ' and m.meta_type = ' . Meta::ART_TAG . ' and ' . $this->db->array_in('m.id_item', $ids), $ids);
         foreach ($data as &$item) {
             $item['tag'] = array();
         }
         unset($item);
         foreach ($tags as $tag) {
             $link =& $data[$tag['id_item']]['tag'];
             unset($tag['id_item']);
             unset($tag['id']);
             $link[] = $tag;
         }
     }
     $this->add_answer('data', $data);
     $this->set_success(true);
 }
开发者ID:4otaku,项目名称:api,代码行数:34,代码来源:Pool.php


示例11: process

 public function process()
 {
     $id = $this->get('id');
     $state = (string) $this->get('state');
     if (!$this->is_moderator()) {
         throw new ErrorApi(ErrorApi::INSUFFICIENT_RIGHTS);
     }
     if (empty($id) || empty($state)) {
         throw new ErrorApi(ErrorApi::MISSING_INPUT);
     }
     $state = Meta::parse($state);
     if (empty($state)) {
         throw new ErrorApi(ErrorApi::INCORRECT_INPUT);
     }
     $this->db->update('art', array('sortdate' => $this->db->unix_to_date()), $id);
     $this->remove_meta(Meta::ART, $id, Meta::STATE, Meta::STATE_APPROVED);
     $this->remove_meta(Meta::ART, $id, Meta::STATE, Meta::STATE_UNAPPROVED);
     $this->remove_meta(Meta::ART, $id, Meta::STATE, Meta::STATE_DISAPPROVED);
     $this->remove_meta(Meta::ART, $id, Meta::STATE, Meta::STATE_DELETED);
     $this->add_meta(Meta::ART, $id, Meta::STATE, $state);
     $cache = new \Memcached("access_checker");
     $cache->addServer("localhost", 11211);
     $cache->delete('is_pic_safe_' . $this->db->get_field('art', 'md5', $id));
     $this->set_success(true);
 }
开发者ID:4otaku,项目名称:api,代码行数:25,代码来源:Approve.php


示例12: process

 public function process()
 {
     $id = $this->get('id');
     if (!$this->is_moderator() && $this->get('remove')) {
         throw new ErrorApi(ErrorApi::INSUFFICIENT_RIGHTS);
     }
     if (empty($id) || !$this->have_changes()) {
         throw new ErrorApi(ErrorApi::MISSING_INPUT);
     }
     if (!$this->check_pool($id)) {
         throw new ErrorApi(ErrorApi::INCORRECT_INPUT);
     }
     $meta = Meta::parse($this->table);
     foreach ((array) $this->get('add') as $item) {
         if (!$this->in_pool($id, $item['id'])) {
             if ($this->add_item($id, $item)) {
                 $this->add_meta(Meta::ART, (int) $item['id'], $meta, $id);
             }
         }
     }
     foreach ((array) $this->get('remove') as $item) {
         if ($this->remove_item($id, (int) $item)) {
             $this->remove_meta(Meta::ART, (int) $item, $meta, $id);
         }
     }
     if ($this->get('title')) {
         $this->db->update($this->table, array('title' => $this->get('title')), $id);
     }
     if ($this->get('text') !== null) {
         $this->db->update($this->table, array('text' => $this->get('text')), $id);
     }
     $this->set_success(true);
 }
开发者ID:4otaku,项目名称:api,代码行数:33,代码来源:Pool.php


示例13: get_filters

 protected function get_filters($params)
 {
     if (!empty($params['filter']) && is_array($params['filter'])) {
         $this->parse_date_filters($params['filter'], array('date'));
         foreach ($params['filter'] as &$filter) {
             if (!isset($filter['name']) || !isset($filter['type']) || !isset($filter['value'])) {
                 continue;
             }
             if (in_array($filter['name'], $this->local_filtered_variables) && Meta::parse($filter['type'])) {
                 if ($filter['name'] == 'date') {
                     $filter['name'] = 'sortdate';
                     $filter['value'] = $this->db->unix_to_date($filter['value']);
                 }
                 if ($filter['name'] == 'user') {
                     $filter['name'] = 'id_user';
                     $value = $this->db->get_field('user', 'id', 'login = ?', $filter['value']);
                     if (empty($value) && Meta::parse($filter['type']) == Meta::IS) {
                         throw new ErrorApi('Пользователя ' . $filter['value'] . ' не существует.', ErrorApi::INCORRECT_INPUT);
                     }
                     $filter['value'] = $value;
                 }
                 $this->local_filters[] = $filter['name'] . ' ' . Meta::parse($filter['type']) . ' ?';
                 $this->local_filter_vars[] = $filter['value'];
                 $filter = null;
             }
         }
         unset($filter);
     }
     return parent::get_filters($params);
 }
开发者ID:4otaku,项目名称:api,代码行数:30,代码来源:Art.php


示例14: registerUrls

 /**
  * Registers rewrite urls for frontend controller
  * @return bool
  */
 public function registerUrls()
 {
     try {
         foreach (Language::getLanguages() as $language) {
             $data = Meta::getMetaByPage('module-newsletter2go-Export', $language['id_lang']);
             $meta = new Meta($data['id_meta']);
             if ($meta && $meta->id) {
                 $meta->url_rewrite = 'n2go-export';
                 $meta->save();
             }
         }
     } catch (Exception $e) {
         return false;
     }
     return true;
 }
开发者ID:newsletter2go,项目名称:newsletter2go-prestashop-plugin,代码行数:20,代码来源:newsletter2go.php


示例15: set_post_view

function set_post_view($ID)
{
    $count = Meta::get($ID, 'post_views_count');
    if (empty($count)) {
        add_post_meta($ID, 'post_views_count', 1);
    } else {
        update_post_meta($ID, 'post_views_count', $count++);
    }
}
开发者ID:andrijdavid,项目名称:wordpress,代码行数:9,代码来源:application.php


示例16: loadMeta

 public function loadMeta()
 {
     // Get meta data for loaded content
     if (!$this->id) {
         throw new Exception("Cannot get meta data! No content set!");
         return;
     }
     return Meta::load("content", $this->id);
 }
开发者ID:julianburr,项目名称:project-nutmouse,代码行数:9,代码来源:Content.php


示例17: makeStaticLinks

 private function makeStaticLinks($staticIds)
 {
     $staticLinks = array();
     foreach ($staticIds as $staticId) {
         if (false !== $staticId) {
             $meta = Meta::getMetaByPage($staticId, (int) $this->language->id);
             $staticLinks[] = array('id' => 'link-static-page-' . $staticId, 'class' => 'cms-page-link', 'title' => $meta['title'], 'description' => $meta['description'], 'url' => $this->link->getPageLink($staticId, true));
         }
     }
     return $staticLinks;
 }
开发者ID:prestashop,项目名称:ps_linklist,代码行数:11,代码来源:LinkBlockPresenter.php


示例18: slhb_set_title

function slhb_set_title($post_id, $post, $update)
{
    $dateStr = Meta::get($post_id, 'match_date');
    $title = $dateStr . ' - ' . Meta::get($post_id, 'match_team_dom') . ' - ' . Meta::get($post_id, 'match_team_ext');
    $date = date($dateStr);
    //This temporarily removes filter to prevent infinite loops
    remove_action('save_post_slhb_match', __FUNCTION__);
    wp_update_post(array('ID' => $post_id, 'post_title' => $title, 'match_date' => $date));
    //redo filter
    add_action('save_post_slhb_match', __FUNCTION__, 10, 3);
}
开发者ID:J0hnRoger,项目名称:SLHB,代码行数:11,代码来源:ct-match.php


示例19: getCurrent

 public static function getCurrent()
 {
     $team = get_queried_object();
     #add custom properties
     $bannerId = Meta::get($team->ID, 'profile', $single = true);
     $image_attributes = wp_get_attachment_image_src($bannerId, "full");
     if ($image_attributes) {
         $image_attributes[0];
         $team->banner = $image_attributes[0];
     }
     return $team;
 }
开发者ID:J0hnRoger,项目名称:SLHB,代码行数:12,代码来源:TeamModel.php


示例20: getNextMatch

 /**
  * Return only the last match played, with additional informations (teams and scores included)
  *
  * @return Match Object
  */
 public static function getNextMatch()
 {
     $matchs = MatchModel::getNextMatchs(1);
     if (count($matchs) == 1) {
         $match = $matchs[0];
         $matchId = $match->ID;
         $match->match_date = Meta::get($matchId, 'match_date');
         $match->match_team_dom = Meta::get($matchId, 'match_team_dom');
         $match->match_team_ext = Meta::get($matchId, 'match_team_ext');
         return $match;
     }
 }
开发者ID:J0hnRoger,项目名称:SLHB,代码行数:17,代码来源:MatchModel.php



注:本文中的Meta类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP MetaModel类代码示例发布时间:2022-05-23
下一篇:
PHP Messages类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap