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

PHP cmsFramework类代码示例

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

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



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

示例1: __construct

 function __construct()
 {
     parent::__construct();
     Configure::write('Community.profileUrl', $this->profileUrl);
     if (file_exists(PATH_ROOT . 'components' . _DS . 'com_community' . _DS . 'community.php')) {
         $this->community = true;
         $Menu = ClassRegistry::getClass('MenuModel');
         $this->menu_id = $Menu->getComponentMenuId('com_community&view=frontpage');
         if (!$this->menu_id) {
             $this->menu_id = $Menu->getComponentMenuId('com_community&view=profile');
         }
         if (!$this->menu_id) {
             $this->menu_id = $Menu->getComponentMenuId('com_community');
         }
         // For JomSocial <= 2.1
         if (!file_exists(PATH_ROOT . 'components/com_community/assets/user_thumb.png')) {
             $this->default_thumb = 'components/com_community/assets/default_thumb.jpg';
         }
         $cache_key = 'jomsocial_config_' . md5(cmsFramework::getConfig('secret'));
         $JSConfig = S2Cache::read($cache_key);
         if (false == $JSConfig) {
             // Read the JomSocial configuration to determine the storage location for avatars
             $JSConfig = json_decode($this->query("SELECT params FROM #__community_config WHERE name = 'config'", 'loadResult'), true);
             $JSConfigForJReviews = array('user_avatar_storage' => $JSConfig['user_avatar_storage'], 'storages3bucket' => $JSConfig['storages3bucket']);
             S2Cache::write($cache_key, $JSConfigForJReviews);
         }
         $this->avatar_storage = $JSConfig['user_avatar_storage'];
         $this->s3_bucket = $JSConfig['storages3bucket'];
         Configure::write('Community.register_url', sprintf($this->registerUrl, $this->menu_id));
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:31,代码来源:jom_social.php


示例2: reviewVoting

 function reviewVoting($review)
 {
     $review_id = $review['Review']['review_id'];
     $User = cmsFramework::getUser();
     $output = '<div class="reviewHelpful">';
     $output .= '<div class="jrHelpfulTitle">' . __t("Was this review helpful to you?", true) . '&nbsp;</div>';
     $output .= '<div id="jr_reviewVote' . $review_id . '" style="float:left;">';
     if ($this->Access->canVoteHelpful($review['User']['user_id'])) {
         $output .= '<span class="jrVote jrButton" onclick="jreviews.review.voteYes(this,{review_id:' . $review_id . '})">';
     } elseif ($User->id > 0) {
         $output .= '<span class="jrVote jrButton" onclick="s2Alert(\'' . __t("You are not allowed to vote", true, true) . '\');">';
     } else {
         $output .= '<span class="jrVote jrButton" onclick="s2Alert(\'' . __t("Login or register to vote", true, true) . '\');">';
     }
     $output .= '<span class="jrButtonText" style="color: green;">' . $review['Vote']['yes'] . '</span><span class="jrIcon jrIconThumbUp"></span>';
     $output .= '</span>';
     if ($this->Access->canVoteHelpful($review['User']['user_id'])) {
         $output .= '<span class="jrVote jrButton" onclick="jreviews.review.voteNo(this,{review_id:' . $review_id . '})">';
     } elseif ($User->id > 0) {
         $output .= '<span class="jrVote jrButton" onclick="s2Alert(\'' . __t("You are not allowed to vote", true, true) . '\');">';
     } else {
         $output .= '<span class="jrVote jrButton" onclick="s2Alert(\'' . __t("Login or register to vote", true, true) . '\');">';
     }
     $output .= '<span class="jrButtonText" style="color: red;">' . $review['Vote']['no'] . '</span><span class="jrIcon jrIconThumbDown"></span>';
     $output .= '</span>';
     $output .= '<span class="jr_loadingSmall jr_hidden"></span>';
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:30,代码来源:widgets.php


示例3: addFavorite

 function addFavorite($results)
 {
     $listing_ids = array_keys($results);
     if (!isset($this->Config)) {
         App::import('Component', 'config', 'jreviews');
         $this->Config = ClassRegistry::getClass('ConfigComponent');
     }
     if ($this->Config->favorites_enable) {
         # Get favoured count
         $query = "\n                SELECT \n                    content_id AS listing_id, count(*) AS favored FROM #__jreviews_favorites AS Favorite\n\t\t\t    WHERE \n                    Favorite.content_id IN (" . implode(',', $listing_ids) . ")\n\t\t\t    GROUP BY \n                    listing_id\n            ";
         $this->_db->setQuery($query);
         $favored = $this->_db->loadAssocList('listing_id');
         # Check if in user's favorites list
         $User =& cmsFramework::getUser();
         if ($User->id) {
             $query = "\n                    SELECT \n                        Favorite.user_id, Favorite.content_id AS listing_id\n\t\t\t\t    FROM \n                        #__jreviews_favorites AS Favorite\n\t\t\t\t    WHERE \n                        Favorite.content_id IN (" . implode(',', $listing_ids) . ")\n\t\t\t\t        AND Favorite.user_id = " . $User->id;
             $this->_db->setQuery($query);
             $my_favorite = $this->_db->loadAssocList('listing_id');
         }
         foreach ($results as $key => $result) {
             if (isset($favored[$result['Listing']['listing_id']]['favored'])) {
                 $results[$key]['Favorite']['favored'] = $favored[$result['Listing']['listing_id']]['favored'];
             } else {
                 $results[$key]['Favorite']['favored'] = 0;
             }
             if (isset($my_favorite[$result['Listing']['listing_id']]['user_id'])) {
                 $results[$key]['Favorite']['my_favorite'] = 1;
             } else {
                 $results[$key]['Favorite']['my_favorite'] = 0;
             }
         }
     }
     return $results;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:34,代码来源:favorite.php


示例4: reviews

 function reviews()
 {
     $access = $this->cmsVersion == CMS_JOOMLA15 ? $this->Access->getAccessId() : $this->Access->getAccessLevels();
     $feed_filename = PATH_ROOT . 'cache' . DS . 'jreviewsfeed_' . md5($access . $this->here) . '.xml';
     $this->Feeds->useCached($feed_filename, 'reviews');
     $extension = Sanitize::getString($this->params, 'extension', 'com_content');
     $cat_id = Sanitize::getInt($this->params, 'cat');
     $section_id = Sanitize::getInt($this->params, 'section');
     $dir_id = Sanitize::getInt($this->params, 'dir');
     $listing_id = Sanitize::getInt($this->params, 'id');
     $this->encoding = cmsFramework::getCharset();
     $feedPage = null;
     $this->EverywhereAfterFind = true;
     // Triggers the afterFind in the Observer Model
     $this->limit = $this->Config->rss_limit;
     $rss = array('title' => $this->Config->rss_title, 'link' => WWW_ROOT, 'description' => $this->Config->rss_description, 'image_url' => WWW_ROOT . "images/stories/" . $this->Config->rss_image, 'image_link' => WWW_ROOT);
     $queryData = array('conditions' => array('Review.published = 1', "Review.mode = '{$extension}'"), 'fields' => array('Review.mode AS `Review.extension`'), 'limit' => $this->limit, 'order' => array('Review.created DESC'));
     if ($extension == 'com_content') {
         $queryData['conditions'][] = 'Listing.state = 1';
         $queryData['conditions'][] = '( Listing.publish_up = "' . NULL_DATE . '" OR Listing.publish_up <= "' . _CURRENT_SERVER_TIME . '" )';
         $queryData['conditions'][] = '( Listing.publish_down = "' . NULL_DATE . '" OR Listing.publish_down >= "' . _CURRENT_SERVER_TIME . '" )';
         # Shows only links users can access
         if ($this->cmsVersion == CMS_JOOMLA15) {
             $access_id = $this->Access->getAccessId();
             $queryData['conditions'][] = 'Listing.access <= ' . $access_id;
             $queryData['conditions'][] = 'Category.access <= ' . $access_id;
         } else {
             $cat_id > 0 and $cat_id = array_keys($this->Category->getChildren($cat_id));
             $access_id = $this->Access->getAccessLevels();
             $queryData['conditions'][] = 'Listing.access IN ( ' . $access_id . ')';
             $queryData['conditions'][] = 'Category.access IN ( ' . $access_id . ')';
         }
     }
     if (!empty($cat_id) && $extension == 'com_content') {
         // Category feeds only supported for core content
         $queryData['conditions'][] = 'JreviewsCategory.id IN (' . $this->quote($cat_id) . ')';
         $feedPage = 'category';
     } elseif ($section_id > 0 && $extension == 'com_content') {
         $queryData['conditions'][] = 'Listing.sectionid= ' . $section_id;
         $feedPage = 'section';
     } elseif ($dir_id > 0 && $extension == 'com_content') {
         $queryData['conditions'][] = 'JreviewsCategory.dirid= ' . $dir_id;
         $feedPage = 'directory';
     } elseif ($extension != 'com_content') {
         unset($this->Review->joins['listings'], $this->Review->joins['jreviews_categories'], $this->Review->joins['listings']);
         $feedPage = 'everywhere';
     }
     if ($listing_id > 0) {
         $queryData['conditions'][] = 'Review.pid = ' . $listing_id;
         $feedPage = 'listing';
     }
     # Don't run it here because it's run in the Everywhere Observer Component
     $this->Review->runProcessRatings = false;
     $reviews = $this->Review->findAll($queryData);
     $this->set(array('feedPage' => $feedPage, 'encoding' => $this->encoding, 'rss' => $rss, 'reviews' => $reviews));
     return $this->Feeds->saveFeed($feed_filename, 'reviews');
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:57,代码来源:feeds_controller.php


示例5: startup

 function startup(&$controller)
 {
     # Check feed cache
     if (Sanitize::getString($controller->params, 'action') == 'xml') {
         $this->useCached(PATH_ROOT . DS . 'cache' . DS . 'jreviewsfeed_' . md5($controller->here) . '.xml');
     }
     $this->encoding = cmsFramework::getCharset();
     $this->params =& $controller->params;
     $this->c =& $controller;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:10,代码来源:feeds.php


示例6: __construct

 function __construct()
 {
     parent::__construct();
     $User =& cmsFramework::getUser();
     // Used in MyReviews page to differentiate from other component reviews
     $this->tag = __t("MYBLOG_TAG", true);
     // Uncomment line below to show tag in My Reviews page
     $this->fields[] = "'{$this->tag}' AS `Listing.tag`";
     // Set default WHERE statement
     $this->conditions = array('Listing.state = 1', '( Listing.publish_up = "' . NULL_DATE . '" OR Listing.publish_up <= "' . _CURRENT_SERVER_TIME . '" )', '( Listing.publish_down = "' . NULL_DATE . '" OR Listing.publish_down >= "' . _CURRENT_SERVER_TIME . '" )', 'Listing.catid > 0');
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:11,代码来源:everywhere_com_myblog.php


示例7: array

 function &getInstance()
 {
     static $instance = array();
     if (!isset($instance[0]) || !$instance[0]) {
         $instance[0] = new sef_jreviews();
         require dirname(__FILE__) . DS . 'jreviews' . DS . 'framework.php';
         App::import('Model', 'Menu', 'jreviews');
         $instance[0]->__Menu = ClassRegistry::getClass('MenuModel');
         // Read url param style setting from JReviews config cache file
         $cache_file = 'jreviews_config_' . md5(cmsFramework::getConfig('secret'));
         $Config = S2Cache::read($cache_file);
         $instance[0]->joomla_style_params = is_object($Config) and isset($Config->url_param_joomla) ? $Config->url_param_joomla : false;
         $version = new JVersion();
         $instance[0]->cmsVersion = $version->RELEASE;
     }
     return $instance[0];
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:17,代码来源:sef_ext.php


示例8: onProfileDisplay

 function onProfileDisplay()
 {
     if (!file_exists($this->_path . DS . 'admin.jreviews.php')) {
         return JText::_('jReviews is not installed. Please contact site administrator.');
     } else {
         $user = CFactory::getActiveProfile();
         $userId = $user->id;
         $cacheSetting = $this->params->get('cache', 1) ? JApplication::getCfg('caching') : 0;
         # Load CSS stylesheets -- done here because when cache is on css is not loaded
         if ($cacheSetting) {
             # MVC initalization script
             if (!defined('DS')) {
                 define('DS', DIRECTORY_SEPARATOR);
             }
             require 'components' . DS . 'com_jreviews' . DS . 'jreviews' . DS . 'framework.php';
             $cache_file = 'jreviews_config_' . md5(cmsFramework::getConfig('secret'));
             $Config =& S2Cache::read($cache_file);
             if (!is_object($Config)) {
                 //Create config file
                 $eParams['data']['controller'] = 'common';
                 $eParams['data']['action'] = 'index';
                 $Dispatcher = new S2Dispatcher('jreviews', false, true);
                 $Dispatcher->dispatch($eParams);
                 $Config =& S2Cache::read($cache_file);
                 unset($Dispatcher);
             }
             App::import('Helper', 'html');
             $Html =& RegisterClass::getInstance('HtmlHelper');
             $Html->viewTheme = $Config->template;
             $Html->app = 'jreviews';
             $Html->startup();
             App::import('Helper', 'libraries', 'jreviews');
             $Libraries =& RegisterClass::getInstance('LibrariesHelper');
             $Html->css(array('theme', 'plugins', 'paginator'));
             $Html->js(array('jreviews', 'jquery' => 'jquery', 'jq.scrollable'), $Libraries->js());
         }
         $cache =& JFactory::getCache('plgCommunityJreviews_myfavorites');
         $cache->setCaching($cacheSetting);
         $callback = array('plgCommunityJreviews_myfavorites', '_getPage');
         $contents = $cache->call($callback, $userId, $this->params, $cacheSetting);
         return $contents;
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:43,代码来源:jreviews_myfavorites.php


示例9: getVersion

 function getVersion()
 {
     $page = '';
     $new_version = 'none';
     $session_var = cmsFramework::getSessionVar('new_version', 'jreviews');
     if (empty($session_var)) {
         if (function_exists('curl_init')) {
             // Version checker
             $curl_handle = curl_init('http://www.reviewsforjoomla.com/updates_server/files.php');
             curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
             // return instead of echo
             @curl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, 1);
             curl_setopt($curl_handle, CURLOPT_HEADER, 0);
             $data = curl_exec($curl_handle);
             curl_close($curl_handle);
             $current_versions = json_decode($data, true);
             $this->Config->updater_betas and isset($current_versions['jreviews']['beta']) and $current_versions['jreviews'] = array_merge($current_versions['jreviews'], $current_versions['jreviews']['beta']);
             $remoteVersion = $current_versions['components']['jreviews']['version'];
             $remoteVersion = (int) str_replace('.', '', $remoteVersion);
             $localVersion = (int) str_replace('.', '', strip_tags($this->Config->version));
             if ($remoteVersion > $localVersion) {
                 $new_version = 'new';
             }
         } else {
             $new_version = 'curl';
         }
         cmsFramework::setSessionVar('new_version', $new_version, 'jreviews');
     } else {
         $new_version = $session_var;
     }
     switch ($new_version) {
         case 'new':
             $page = '<a style="font-weight:normal;font-size:13px;color:red;" href="#updater_version_check" id="updater_notification">' . __a("New version available", true) . '</a>';
             break;
         case 'curl':
             $page = '<span style="font-weight:normal;font-size:13px;color:red;">Version checker requires curl</span>';
             break;
         default:
             $page = '';
             break;
     }
     return $this->ajaxResponse(array(), false, compact('page'));
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:43,代码来源:common_controller.php


示例10: __construct

 function __construct()
 {
     parent::__construct();
     $User =& cmsFramework::getUser();
     // Used in MyReviews page to differentiate from other component reviews
     $this->tag = __t("MYBLOG_TAG", true);
     // Uncomment line below to show tag in My Reviews page
     $this->fields[] = "'{$this->tag}' AS `Listing.tag`";
     // Set default WHERE statement
     $this->conditions = array('Listing.state = 1', '( Listing.publish_up = "' . NULL_DATE . '" OR Listing.publish_up <= "' . _CURRENT_SERVER_TIME . '" )', '( Listing.publish_down = "' . NULL_DATE . '" OR Listing.publish_down >= "' . _CURRENT_SERVER_TIME . '" )', 'Listing.catid > 0');
     if (!defined('MVC_FRAMEWORK_ADMIN')) {
         # Shows only links users can access
         $Access = Configure::read('JreviewsSystem.Access');
         if ($this->cmsVersion == CMS_JOOMLA15) {
             $this->conditions[] = 'Listing.access <= ' . $User->gid;
         } else {
             $this->conditions[] = 'Listing.access IN ( ' . $Access->getAccessLevels() . ')';
         }
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:20,代码来源:everywhere_com_myblog.php


示例11: _save

 function _save()
 {
     $response = array();
     $this->data['Vote']['user_id'] = $this->_user->id;
     $this->data['Vote']['review_id'] = (int) $this->data['Vote']['review_id'];
     # Exact vote check to prevent form tampering. User can cheat the js and enter any interger, thus increasing the count
     $this->data['Vote']['vote_yes'] = Sanitize::getInt($this->data['Vote'], 'vote_yes') ? 1 : 0;
     $this->data['Vote']['vote_no'] = Sanitize::getInt($this->data['Vote'], 'vote_no') ? 1 : 0;
     $this->data['Vote']['created'] = gmdate('Y-m-d H:i:s');
     $this->data['Vote']['ipaddress'] = $this->ipaddress;
     if (!$this->data['Vote']['review_id']) {
         return $this->ajaxError(s2Messages::submitErrorGeneric());
     }
     // Find duplicates
     $duplicate = $this->Vote->findCount(array('conditions' => array('review_id = ' . $this->data['Vote']['review_id'], 'ipaddress = ' . $this->Vote->Quote($this->data['Vote']['ipaddress']))));
     // It's a guest so we only care about checking the IP address if this feature is not disabled and
     // server is not localhost
     if (!$this->_user->id) {
         if (!$this->Config->vote_ipcheck_disable && $this->ipaddress != '127.0.0.1') {
             // Do the ip address check everywhere except in localhost
             $duplicate = $this->Vote->findCount(array('conditions' => array('review_id = ' . $this->data['Vote']['review_id'], 'ipaddress = ' . $this->Vote->Quote($this->ipaddress))));
         }
     } else {
         $duplicate = $this->Vote->findCount(array('conditions' => array('review_id = ' . $this->data['Vote']['review_id'], "(user_id = {$this->_user->id}" . ($this->ipaddress != '127.0.0.1' && !$this->Config->vote_ipcheck_disable ? " OR ipaddress = " . $this->Vote->Quote($this->ipaddress) . ") " : ')'))));
     }
     if ($duplicate > 0) {
         # Hides vote buttons and shows message alert
         $response[] = "jQuery('#jr_reviewVote{$this->data['Vote']['review_id']}').fadeOut('medium',function(){\n                jQuery(this).html('" . __t("You already voted.", true, true) . "').fadeIn();\n            });";
         return $this->ajaxResponse($response);
     }
     if ($this->Vote->store($this->data)) {
         # Hides vote buttons and shows message alert
         $response[] = "jQuery('#jr_reviewVote{$this->data['Vote']['review_id']}').fadeOut('medium',function(){\n                jQuery(this).html('" . __t("Thank you for your vote.", true, true) . "').fadeIn();\n            });";
         # Facebook wall integration only for positive votes
         $facebook_integration = Sanitize::getBool($this->Config, 'facebook_enable') && Sanitize::getBool($this->Config, 'facebook_votes');
         $token = cmsFramework::getCustomToken($this->data['Vote']['review_id']);
         $facebook_integration and $this->data['Vote']['vote_yes'] and $response[] = "\n                jQuery.ajax({url:s2AjaxUri+jreviews.ajax_params()+'&url=facebook/_postVote/id:{$this->data['Vote']['review_id']}&{$token}=1',dataType:'script'});\n            ";
         return $this->ajaxResponse($response);
     }
     return $this->ajaxError(s2Messages::submitErrorDb());
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:41,代码来源:votes_controller.php


示例12: _save

 function _save()
 {
     $response = array();
     $formToken = cmsFramework::getCustomToken($this->review_id);
     if ($this->denyAccess == true || !Sanitize::getString($this->params['form'], $formToken)) {
         return $this->ajaxError(s2Messages::accessDenied());
     }
     # Validate form token
     $this->components = array('security');
     $this->__initComponents();
     if ($this->invalidToken) {
         return $this->ajaxError(s2messages::invalidToken());
     }
     // Check if an owner reply already exists
     $this->OwnerReply->fields = array();
     if ($reply = $this->OwnerReply->findRow(array('fields' => array('OwnerReply.owner_reply_text', 'OwnerReply.owner_reply_approved'), 'conditions' => array('OwnerReply.id = ' . $this->review_id)))) {
         if ($reply['OwnerReply']['owner_reply_approved'] == 1) {
             $error_text = __t("A reply for this review already exists.", true);
             $response[] = "jQuery('#jr_ownerReplyLink{$this->review_id}').remove();";
             return $this->ajaxError($error_text, $response);
         }
     }
     if ($this->Config->owner_replies) {
         if ($this->data['OwnerReply']['owner_reply_text'] != '' && $this->data['OwnerReply']['id'] > 0) {
             $this->data['OwnerReply']['owner_reply_created'] = date('Y-m-d H:i:s');
             $this->data['OwnerReply']['owner_reply_approved'] = 1;
             // Replies will be moderated by default
             if ($this->OwnerReply->store($this->data)) {
                 $update_text = $this->data['OwnerReply']['owner_reply_approved'] ? __t("Your reply was submitted and has been approved.", true) : __t("Your reply was submitted and will be published once it is verified.", true);
                 $response[] = "jQuery('#jr_ownerReplyLink{$this->review_id}').remove();";
                 return $this->ajaxUpdateDialog($update_text, $response);
             }
             return $this->ajaxError(s2Messages::submitErrorDb());
         }
         # Validation failed
         if (isset($this->Security)) {
             $reponse[] = "jQuery('s2Token').val('" . $this->Security->reissueToken() . "')";
         }
         return $this->ajaxValidation(__t("The reply is empty.", true), $response);
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:41,代码来源:owner_replies_controller.php


示例13: reviews

 function reviews()
 {
     $extension = Sanitize::getString($this->params, 'extension', 'com_content');
     $cat_id = Sanitize::getInt($this->params, 'cat');
     $section_id = Sanitize::getInt($this->params, 'section');
     $dir_id = Sanitize::getInt($this->params, 'dir');
     $listing_id = Sanitize::getInt($this->params, 'id');
     $this->encoding = cmsFramework::getCharset();
     $feedPage = null;
     $this->EverywhereAfterFind = true;
     // Triggers the afterFind in the Observer Model
     $this->limit = $this->Config->rss_limit;
     $rss = array('title' => $this->Config->rss_title, 'link' => WWW_ROOT, 'description' => $this->Config->rss_description, 'image_url' => WWW_ROOT . "images/stories/" . $this->Config->rss_image, 'image_link' => WWW_ROOT);
     $queryData = array('conditions' => array('Review.published = 1', "Review.mode = '{$extension}'"), 'fields' => array('Review.mode AS `Review.extension`'), 'limit' => $this->limit, 'order' => array('Review.created DESC'));
     if ($cat_id > 0 && $extension == 'com_content') {
         // Category feeds only supported for core content
         $queryData['conditions'][] = 'JreviewsCategory.id= ' . $cat_id;
         //			$queryData['joins'] = $this->Listing->joinsReviews;
         $feedPage = 'category';
     } elseif ($section_id > 0 && $extension == 'com_content') {
         $queryData['conditions'][] = 'Listing.sectionid= ' . $section_id;
         //            $queryData['joins'] = $this->Listing->joinsReviews;
         $feedPage = 'section';
     } elseif ($dir_id > 0 && $extension == 'com_content') {
         $queryData['conditions'][] = 'JreviewsCategory.dirid= ' . $dir_id;
         //            $queryData['joins'] = $this->Listing->joinsReviews;
         $feedPage = 'directory';
     } elseif ($extension != 'com_content') {
         unset($this->Review->joins['listings'], $this->Review->joins['jreviews_categories'], $this->Review->joins['listings']);
         $feedPage = 'everywhere';
     }
     if ($listing_id > 0) {
         $queryData['conditions'][] = 'Review.pid = ' . $listing_id;
         $feedPage = 'listing';
     }
     # Don't run it here because it's run in the Everywhere Observer Component
     $this->Review->runProcessRatings = false;
     $reviews = $this->Review->findAll($queryData);
     $this->set(array('feedPage' => $feedPage, 'encoding' => $this->encoding, 'rss' => $rss, 'reviews' => $reviews));
     return $this->Feeds->saveFeed(PATH_ROOT . DS . 'cache' . DS . 'jreviewsfeed_' . md5($this->here) . '.xml', 'reviews');
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:41,代码来源:feeds_controller.php


示例14: uninstall

 function uninstall()
 {
     $db = cmsFramework::getDB();
     // Delete GeoMaps module
     $query = "DELETE FROM #__modules WHERE module = 'mod_jreviews_geomaps'";
     $db->setQuery($query);
     $db->query();
     if ($this->cmsVersion == CMS_JOOMLA16) {
         $query = "DELETE FROM #__extensions WHERE name = 'mod_jreviews_geomaps'";
         $db->setQuery($query);
         $db->query();
     }
     // Remove GeoMaps module files
     $target = PATH_ROOT . 'modules' . DS . 'mod_jreviews_geomaps';
     $Folder = new Folder();
     if (@$Folder->delete($target)) {
         return '<div style="color:green;">GeoMaps Module successfully uninstalled.</div>';
     } else {
         return '<div style="color:red;">There was a problem uninstalling the GeoMaps module.</div>';
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:21,代码来源:admin_geomaps_uninstall_controller.php


示例15: favorite

 function favorite($listing)
 {
     $output = '';
     $listing_id = $listing['Listing']['listing_id'];
     $User = cmsFramework::getUser();
     $output .= '<span class="jrFavoriteWidget" title="' . __t("Favorites", true) . '">';
     $output .= '<span class="jrIcon jrIconFavorites"></span>';
     $output .= '<span id="jr_favoriteCount' . $listing_id . '">' . $listing['Favorite']['favored'] . '</span>';
     $output .= '</span>';
     if ($listing['Favorite']['my_favorite']) {
         // Already in user's favorites
         $output .= '<span id="jr_favoriteImg' . $listing_id . '" class="jrFavoriteButton jrButton" title="' . __t("Remove from favorites", true) . '" onclick="jreviews.favorite.remove(this,{listing_id:' . $listing_id . '})">' . __t("Remove", true) . '</span>';
     } elseif ($User->id) {
         // Not in user's favorites
         $output .= '<span id="jr_favoriteImg' . $listing_id . '" class="jrFavoriteButton jrButton" title="' . __t("Add to favorites", true) . '" onclick="jreviews.favorite.add(this,{listing_id:' . $listing_id . '})">' . __t("Add", true) . '</span>';
     } else {
         // This is a guest user, needs to register to use the favorites widget
         $output .= '<span id="jr_favoriteImg' . $listing_id . '" class="jrFavoriteButton jrButton" title="' . __t("Add to favorites", true) . '" onclick="s2Alert(\'' . __t("Register to add this entry to your favorites", true) . '\');">' . __t("Add", true) . '</span>';
     }
     return $output;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:21,代码来源:widgets.php


示例16: install

 function install()
 {
     $db = cmsFramework::getDB();
     // Create the marker_icon column in the JReviews categories table
     $cat_table_cols = current($db->getTableFields('#__jreviews_categories'));
     if (!in_array('marker_icon', array_keys($cat_table_cols))) {
         $query = "ALTER TABLE `#__jreviews_categories` ADD `marker_icon` VARCHAR(150) AFTER `tmpl_suffix`;";
         $db->setQuery($query);
         $db->query();
     }
     // Install GeoMaps module
     $query = "SELECT count(*) FROM #__modules WHERE module = 'mod_jreviews_geomaps'";
     $db->setQuery($query);
     $count = $db->loadResult();
     if (!$count) {
         // create module entry in database
         $query = "\r\n                INSERT INTO #__modules \r\n                    (`title`, `module`, `published`, `params`) \r\n                VALUES \r\n                    ('Jreviews GeoMaps Module', 'mod_jreviews_geomaps', 0, '');";
         $db->setQuery($query);
         $db->query();
     }
     if ($this->cmsVersion == CMS_JOOMLA16) {
         // Need to add entry to the extensions table
         $query = "SELECT count(*) FROM #__extensions WHERE name = 'mod_jreviews_geomaps'";
         $db->setQuery($query);
         if (!$db->loadResult()) {
             $query = "\r\n                    INSERT INTO #__extensions\r\n                        (`name`,`type`,`element`,`client_id`,`enabled`,`access`,`protected`)\r\n                    VALUES\r\n                        ('mod_jreviews_geomaps','module','mod_jreviews_geomaps',0,1,1,0)\r\n                ";
             $db->setQuery($query);
             $db->query();
         }
     }
     // First extract packages
     $package = PATH_ROOT . 'components' . DS . 'com_jreviews_addons' . DS . 'geomaps' . DS . 'packages' . DS . 'mod_jreviews_geomaps.zip';
     $target = PATH_ROOT . 'modules';
     if ($this->_extract($package, $target)) {
         @copy(PATH_ROOT . 'modules' . DS . 'mod_jreviews_geomaps' . DS . 'en-GB.mod_jreviews_geomaps.ini', PATH_ROOT . 'language' . DS . 'en-GB' . DS . 'en-GB.mod_jreviews_geomaps.ini');
         return '<div style="color:green;">GeoMaps module was successfully installed/updated. You will find it in modules manager.</div>';
     } else {
         return '<div style="color:red;">There was a problem installing/updating the GeoMaps module.</div>';
     }
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:40,代码来源:admin_geomaps_install_controller.php


示例17: JreviewsParseRoute

function JreviewsParseRoute($segments)
{
    $vars = array();
    # Load own uri to overcome Joomla encoding issues with Greek params
    $uri = cmsFramework::_getUri();
    // Fix for Joomfish. Remove the language segment from the url
    if (class_exists('JoomFishManager')) {
        $lang = JFactory::getLanguage();
        $language = $lang->getTag();
        $jfm = JoomFishManager::getInstance();
        $lang_shortcode = $jfm->getLanguageCode($language);
        if (strstr($uri, '/' . $lang_shortcode . '/')) {
            $uri = str_replace('/' . $lang_shortcode . '/', '/', $uri);
        }
    }
    $new_segments = cmsFramework::_parseSefRoute($uri);
    if (end($new_segments) == 'index.php') {
        $new_segments = $segments;
    }
    // Remove Joomla language segment from url
    if (isset($_GET['language']) && $_GET['language'] != '' && strlen($new_segments[0]) == 2) {
        $new_segments[0] = 'index.php';
    }
    # Fix for sef without mod rewrite. Without it the sort urls don't work.
    // Remove the Itemid related segments when mod rewrite is disabled and Itemid exists
    if ($new_segments[0] == 'index.php' && $new_segments[1] != 'component') {
        foreach ($new_segments as $key => $segment) {
            if (!in_array(str_replace(' ', '+', $segment), $segments) && !in_array(JreviewsStrReplaceOnce('-', ':', urlencode($segment)), $segments)) {
                unset($new_segments[$key]);
            }
        }
    }
    if (count($new_segments) >= 3 && isset($new_segments[0]) && $new_segments[0] == 'index.php' && isset($new_segments[1]) && $new_segments[1] == 'component' && isset($new_segments[2]) && $new_segments[2] == 'jreviews') {
        array_shift($new_segments);
        array_shift($new_segments);
        array_shift($new_segments);
    }
    $vars['url'] = implode('/', $new_segments);
    return $vars;
}
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:40,代码来源:router.php


示例18: socialBookmarks

 function socialBookmarks($listing)
 {
     $googlePlusOne = $twitter = $facebook = '';
     $facebook_xfbml = Sanitize::getBool($this->Config, 'facebook_opengraph') && Sanitize::getBool($this->Config, 'facebook_appid');
     $href = cmsFramework::makeAbsUrl($listing['Listing']['url'], array('sef' => true));
     $twitter = '
         <a href="http://twitter.com/share" data-url="' . $href . '" class="twitter-share-button" data-count="horizontal">Tweet</a>
         <script type="text/javascript">jQuery(document).ready(function(){jQuery.getScript("http://platform.twitter.com/widgets.js");})</script>';
     if ($facebook_xfbml) {
         $facebook = '<fb:like href="' . $href . '" action="like" colorscheme="light" layout="button_count" show_faces="false"></fb:like>';
     } else {
         $facebook = '<script src="http://connect.facebook.net/' . cmsFramework::getLocale() . '/all.js#xfbml=1"></script><fb:like layout="button_count" show_faces="false"></fb:like>';
     }
     if ($this->Config->facebook_send) {
         $facebook .= '<div style="display:inline;margin-right: 15px;"><fb:send href="' . $href . '" colorscheme="light"></fb:send></div>';
     }
     $googlePlusOne = '
         <g:plusone href="' . $href . '" size="medium"></g:plusone>
         <script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
     ';
     return $googlePlusOne . $twitter . $facebook;
 }
开发者ID:atikahmed,项目名称:joomla-probid,代码行数:22,代码来源:community.php


示例19: _postVote

 function _postVote()
 {
     # Check if FB integration for reviews is enabled
     $facebook_integration = Sanitize::getBool($this->Config, 'facebook_enable') && Sanitize::getBool($this->Config, 'facebook_reviews');
     if (!$facebook_integration) {
         return;
     }
     $review_id = Sanitize::getInt($this->params, 'id');
     # First check - review id
     if (!$review_id) {
         return;
     }
     $facebook = $this->_getFBClass();
     # Second check - FB session
     if ($fbsession = $facebook->getSession()) {
         try {
             //get user id
             $uid = $facebook->getUser();
             $user = $facebook->api('/me');
             $fql = "SELECT publish_stream FROM permissions WHERE uid = " . $uid;
             $param = array('method' => 'fql.query', 'query' => $fql, 'callback' => '');
             $fqlResult = $facebook->api($param);
             if (!$fqlResult[0]['publish_stream']) {
                 return false;
             } else {
                 $review = $this->Review->findRow(array('conditions' => array('Review.id = ' . $review_id)), array());
                 $this->Everywhere->loadListingModel($this, $review['Review']['extension']);
                 $listing = $this->Listing->findRow(array('conditions' => array('Listing.' . $this->Listing->realKey . ' = ' . $review['Review']['listing_id'])), array('afterFind'));
                 $listing_url = $this->makeUrl($listing['Listing']['url']);
                 # Publish stream permission granted so we can post on the user's wall!
                 # Begin building the stream $fbArray
                 $fbArray = array();
                 $fbArray['method'] = 'stream.publish';
                 $fbArray['message'] = sprintf($this->activities['vote helpful'], $listing['Listing']['title']);
                 $fbArray['attachment'] = array('name' => $listing['Listing']['title'], 'href' => $listing_url, 'description' => strip_tags($review['Review']['comments']));
                 $fbArray['attachment']['properties'][__t("Website", true)] = array('text' => cmsFramework::getConfig('sitename'), 'href' => WWW_ROOT);
                 $review['Rating']['average_rating'] > 0 and $fbArray['attachment']['properties'][__t("Rating", true)] = sprintf(__t("%s stars", true), round($review['Rating']['average_rating'], 1));
                 isset($listing['Listing']['images'][0]) and $fbArray['attachment']['media'] = array(array('type' => 'image', 'src' => WWW_ROOT . _JR_WWW_IMAGES . $listing['Listing']['images'][0]['path'], 'href' => $listing_url));
                 $fbArray['attachment'] = json_encode($fbArray['attachment']);
                 $fbArray['action_links'] = json_encode(array(array('text' => __t("Read review", true), 'href' => $listing_url)));
                 $fbAr 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP cmsModel类代码示例发布时间:2022-05-23
下一篇:
PHP cmsForm类代码示例发布时间: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