当前位置: 首页>>代码示例>>PHP>>正文


PHP JCommentsFactory::getApplication方法代码示例

本文整理汇总了PHP中JCommentsFactory::getApplication方法的典型用法代码示例。如果您正苦于以下问题:PHP JCommentsFactory::getApplication方法的具体用法?PHP JCommentsFactory::getApplication怎么用?PHP JCommentsFactory::getApplication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JCommentsFactory的用法示例。


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

示例1: getInstance

 /**
  * Returns a reference to a language object.
  * 
  * @param string $language The language to use.
  * @param string $component The component name.
  * @return JCommentsCfg
  */
 public static function getInstance($language = '', $component = '')
 {
     static $instance = null;
     $app = JCommentsFactory::getApplication();
     if (JCOMMENTS_JVERSION == '1.7') {
         $multilingual_support = $app->isSite() && $app->getLanguageFilter();
     } else {
         $multilingual_support = $app->getCfg('multilingual_support') == 1;
     }
     if (!is_object($instance)) {
         $instance = new JCommentsCfg();
         if ($language == '') {
             $language = $multilingual_support ? JCommentsMultilingual::getLanguage() : '';
         }
         $instance->load($language, $component);
     } else {
         if ($language != $instance->_current && $instance->_current == '') {
             if ($language != '') {
                 $instance->load($language, $component);
             } else {
                 $language = $multilingual_support ? JCommentsMultilingual::getLanguage() : '';
                 if ($language != '') {
                     $instance->load($language, $component);
                 }
             }
         }
     }
     return $instance;
 }
开发者ID:carmerin,项目名称:cesae-web,代码行数:36,代码来源:jcomments.config.php

示例2: getObjectLink

 function getObjectLink($id)
 {
     $app = JCommentsFactory::getApplication();
     $myBlogFunctions = $app->getCfg('absolute_path') . DS . 'components' . DS . 'com_myblog' . DS . 'functions.myblog.php';
     if (is_file($myBlogFunctions)) {
         require_once $myBlogFunctions;
         $_Itemid = myGetItemId();
     } else {
         $_Itemid = self::getItemid('com_myblog');
     }
     $db = JCommentsFactory::getDBO();
     $db->setQuery('SELECT permalink FROM #__myblog_permalinks WHERE contentid=' . $id);
     $permalink = $db->loadResult();
     $link = JoomlaTuneRoute::_('index.php?option=com_myblog&show=' . $permalink . '&Itemid=' . $_Itemid);
     return $link;
 }
开发者ID:enjoy2000,项目名称:smcd,代码行数:16,代码来源:com_myblog.plugin.php

示例3: show

 public static function show()
 {
     $app = JCommentsFactory::getApplication('administrator');
     $config = JCommentsFactory::getConfig();
     if ($config->getInt('enable_blacklist') == 0) {
         if (JCOMMENTS_JVERSION != '1.0') {
             JError::raiseWarning(500, JText::_('A_BLACKLIST_WARNING_BLACKLIST_IS_DISABLED'));
         }
     }
     $context = 'com_jcomments.blacklist.';
     $limit = intval($app->getUserStateFromRequest($context . 'limit', 'limit', $app->getCfg('list_limit')));
     $limitstart = intval($app->getUserStateFromRequest($context . 'limitstart', 'limitstart', 0));
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'bl.created');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', 'desc');
     $search = trim($app->getUserStateFromRequest($context . 'search', 'search', ''));
     if (JCOMMENTS_JVERSION == '1.0') {
         $search = strtolower($search);
     } else {
         $search = JString::strtolower($search);
     }
     if ($filter_order == '') {
         $filter_order = 'bl.created';
     }
     if ($filter_order_Dir == '') {
         $filter_order_Dir = 'desc';
     }
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['search'] = $search;
     $db = JCommentsFactory::getDBO();
     $where = array();
     if ($search != '') {
         $where[] = '(LOWER(bl.ip) like "%' . $db->getEscaped($search, true) . '%")' . ' OR LOWER(bl.reason) like "%' . $db->getEscaped($search, true) . '%"' . ' OR LOWER(bl.notes) like "%' . $db->getEscaped($search, true) . '%"';
     }
     $query = "SELECT COUNT(*)" . " FROM #__jcomments_blacklist AS bl" . (count($where) ? " WHERE " . implode(' AND ', $where) : "");
     $db->setQuery($query);
     $total = $db->loadResult();
     $lists['pageNav'] = JCommentsAdmin::getPagination($total, $limitstart, $limit);
     $query = "SELECT bl.*, u.name AS editor" . " FROM #__jcomments_blacklist AS bl" . " LEFT JOIN #__users AS u ON u.id = bl.checked_out" . (count($where) ? " WHERE " . implode(' AND ', $where) : "") . " ORDER BY " . $filter_order . ' ' . $filter_order_Dir;
     $db->setQuery($query, $lists['pageNav']->limitstart, $lists['pageNav']->limit);
     $lists['rows'] = $db->loadObjectList();
     HTML_JCommentsAdminBlacklistManager::show($lists);
 }
开发者ID:sergy444,项目名称:joomla,代码行数:43,代码来源:admin.jcomments.blacklist.php

示例4: getObjectInfo

 function getObjectInfo($id, $language = null)
 {
     $info = new JCommentsObjectInfo();
     $app = JCommentsFactory::getApplication();
     if (!$app->isAdmin()) {
         $db = JFactory::getDBO();
         $query = "SELECT o.id, o.name, o.owner, o.parent, fd.baseData" . " FROM #__sobipro_object as o" . " LEFT JOIN #__sobipro_field_data AS fd ON o.id = fd.sid" . " JOIN #__sobipro_field AS f ON fd.fid = f.fid AND f.nid = 'field_name'" . " WHERE o.id = " . $id . " AND o.oType = 'entry'";
         $db->setQuery($query);
         $row = $db->loadObject();
         if (!empty($row)) {
             $sobiCore = JPATH_SITE . '/components/com_sobipro/lib/base/fs/loader.php';
             if (is_file($sobiCore)) {
                 if (!defined('SOBIPRO')) {
                     $ver = new JVersion();
                     $ver = str_replace('.', null, $ver->RELEASE);
                     define('SOBI_CMS', 'joomla' . $ver);
                     define('SOBIPRO', true);
                     define('SOBI_TASK', 'task');
                     define('SOBI_DEFLANG', JFactory::getLanguage()->getDefault());
                     define('SOBI_ACL', 'front');
                     define('SOBI_ROOT', JPATH_ROOT);
                     define('SOBI_MEDIA', implode(DS, array(JPATH_ROOT, 'media', 'sobipro')));
                     define('SOBI_MEDIA_LIVE', JURI::root() . '/media/sobipro');
                     define('SOBI_PATH', JPATH_ROOT . '/components/com_sobipro');
                     define('SOBI_LIVE_PATH', 'components/com_sobipro');
                     require_once JPATH_ROOT . '/components/com_sobipro/lib/base/fs/loader.php';
                 }
                 SPLoader::loadClass('cms.base.lang');
                 SPLoader::loadClass('base.factory');
                 SPLoader::loadClass('base.request');
                 SPLoader::loadClass('base.object');
                 SPLoader::loadClass('sobi');
                 $info->title = empty($row->name) ? isset($row->baseData) ? $row->baseData : '' : $row->name;
                 $info->access = NULL;
                 $info->userid = $row->owner;
                 $info->link = Sobi::Url(array('title' => $row->name, 'pid' => $row->parent, 'sid' => $row->id));
             }
         }
     }
     return $info;
 }
开发者ID:carmerin,项目名称:cesae-web,代码行数:41,代码来源:com_sobipro.plugin.php

示例5: getCSS

 public static function getCSS($isRTL = false, $template = '')
 {
     if (empty($template)) {
         $config = JCommentsCfg::getInstance();
         $template = $config->get('template');
     }
     $cssName = $isRTL ? 'style_rtl.css' : 'style.css';
     $cssFile = $cssName . '?v=21';
     if (JCOMMENTS_JVERSION == '1.0') {
         $cssUrl = JCommentsSystemPluginHelper::getBaseUrl() . '/components/com_jcomments/tpl/' . $template . '/' . $cssFile;
     } else {
         $app = JCommentsFactory::getApplication('site');
         $cssPath = JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $template . '/' . $cssName;
         $cssUrl = JURI::root(true) . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $template . '/' . $cssFile;
         if (!is_file($cssPath)) {
             $cssPath = JPATH_SITE . '/components/com_jcomments/tpl/' . $template . '/' . $cssName;
             $cssUrl = JURI::root(true) . '/components/com_jcomments/tpl/' . $template . '/' . $cssFile;
             if ($isRTL && !is_file($cssPath)) {
                 $cssUrl = '';
             }
         }
     }
     return $cssUrl;
 }
开发者ID:sergy444,项目名称:joomla,代码行数:24,代码来源:system.php

示例6: showImport

    public static function showImport($CommentSystems = array())
    {
        $app = JCommentsFactory::getApplication('administrator');
        $db = JCommentsFactory::getDBO();
        $db->setQuery("SHOW TABLES");
        $tables = $db->loadResultArray();
        foreach ($tables as $tableName) {
            for ($i = 0, $n = count($CommentSystems); $i < $n; $i++) {
                $tableMask = str_replace('#__', $app->getCfg('dbprefix'), $CommentSystems[$i]->table);
                if (preg_match('/' . $tableMask . '$/i', $tableName)) {
                    $CommentSystems[$i]->found = true;
                    $CommentSystems[$i]->UpdateCount();
                }
            }
        }
        $languages = JCommentsMultilingual::getLanguages();
        if (JCOMMENTS_JVERSION == '1.0') {
            $lang = JCommentsMultilingual::getLanguage();
        } else {
            $params = JComponentHelper::getParams('com_languages');
            $lang = $params->get("site", 'en-GB');
        }
        $ajaxUrl = JCommentsFactory::getLink('ajax-backend');
        ?>
<link rel="stylesheet" href="<?php 
        echo $app->getCfg('live_site');
        ?>
/administrator/components/com_jcomments/assets/style.css" type="text/css" />
<script type="text/javascript" src="<?php 
        echo $app->getCfg('live_site');
        ?>
/components/com_jcomments/libraries/joomlatune/ajax.js?v=2"></script>
<script type="text/javascript" src="<?php 
        echo $app->getCfg('live_site');
        ?>
/administrator/components/com_jcomments/assets/jcomments-backend-v2.1.js"></script>
<script type="text/javascript">
<!--
function JCommentsImportCommentsAJAX(source, language, start)
{
	try {
		jtajax.setup({url:'<?php 
        echo $ajaxUrl;
        ?>
'});
		return jtajax.call('JCommentsImportCommentsAjax', arguments, 'post');
	} catch (e) {
		return false;
	}
}

function startCommentsImport(source)
{
	var language = '';
	var e=document.getElementById(source.toLowerCase() + '_lang');
	if (e){for (var i=0;i<e.length;i++) {if (e.options[i].selected){language=e.options[i].value;break;}}}
	var b = document.getElementById('btnImport' + source);
	if (b) {b.disabled = true;}
	JCommentsImportCommentsAJAX(source, language, 0);
}

function finishCommentsImport(source) {
	var b=document.getElementById('btnImport'+source);if(b){b.disabled=false;}
}

<?php 
        if (JCOMMENTS_JVERSION == '1.7') {
            ?>
Joomla.submitbutton = function (task) {
	Joomla.submitform(task, document.getElementById('adminForm'));
};
<?php 
        } else {
            ?>
function submitbutton(task)
{
	submitform(task);
}
<?php 
        }
        ?>
//-->
</script>
<script type="text/javascript">
<!--
var jc_comments = new Array(
<?php 
        $jsArray = array();
        foreach ($CommentSystems as $CommentSystem) {
            if ($CommentSystem->found) {
                $jsArray[] = $CommentSystem->code;
            }
        }
        echo "'" . implode("', '", $jsArray) . "'";
        ?>
			);

function importMode( mode ) {
	if(document.getElementById) {
		for(var i=0;i<jc_comments.length;i++) {
//.........这里部分代码省略.........
开发者ID:romuland,项目名称:khparts,代码行数:101,代码来源:admin.jcomments.migration.php

示例7: show

 public static function show()
 {
     $app = JCommentsFactory::getApplication('administrator');
     $context = 'com_jcomments.subscriptions.';
     $object_group = trim($app->getUserStateFromRequest($context . 'fog', 'fog', ''));
     $object_id = intval($app->getUserStateFromRequest($context . 'foid', 'foid', 0));
     $flang = trim($app->getUserStateFromRequest($context . 'flang', 'flang', '-1'));
     $fauthor = trim($app->getUserStateFromRequest($context . 'fauthor', 'fauthor', ''));
     $fstate = trim($app->getUserStateFromRequest($context . 'fstate', 'fstate', '-1'));
     $limit = intval($app->getUserStateFromRequest($context . 'limit', 'limit', $app->getCfg('list_limit')));
     $limitstart = intval($app->getUserStateFromRequest($context . 'limitstart', 'limitstart', 0));
     $filter_order = $app->getUserStateFromRequest($context . 'filter_order', 'filter_order', 'js.name');
     $filter_order_Dir = $app->getUserStateFromRequest($context . 'filter_order_Dir', 'filter_order_Dir', 'asc');
     $search = trim($app->getUserStateFromRequest($context . 'search', 'search', ''));
     if (JCOMMENTS_JVERSION == '1.0') {
         $search = strtolower($search);
     } else {
         $search = JString::strtolower($search);
     }
     if ($filter_order == '') {
         $filter_order = 'js.name';
     }
     if ($filter_order_Dir == '') {
         $filter_order_Dir = 'asc';
     }
     $lists['order'] = $filter_order;
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['search'] = $search;
     $db = JCommentsFactory::getDBO();
     $where = array();
     if ($object_group != '') {
         $where[] = 'js.object_group = "' . $db->getEscaped($object_group, true) . '"';
     }
     if ($object_id != 0) {
         $where[] = 'js.object_id = ' . intval($object_id);
     }
     if ($flang != '-1') {
         $where[] = 'js.lang = "' . $db->getEscaped($flang, true) . '"';
     }
     if ($fauthor != '') {
         $where[] = 'js.name = "' . $db->getEscaped($fauthor, true) . '"';
     }
     if ($fstate != '' && $fstate != '-1') {
         $where[] = 'js.published = ' . intval($fstate);
     }
     if ($search != '') {
         $where[] = '(js.name like "%' . $db->getEscaped($search, true) . '%" OR js.email like "%' . $db->getEscaped($search, true) . '%")';
     }
     $query = "SELECT COUNT(*)" . " FROM #__jcomments_subscriptions AS js" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "");
     $db->setQuery($query);
     $total = $db->loadResult();
     $lists['pageNav'] = JCommentsAdmin::getPagination($total, $limitstart, $limit);
     $query = "SELECT js.*, u.name AS editor" . " FROM #__jcomments_subscriptions AS js" . " LEFT JOIN #__users AS u ON u.id = js.userid" . (count($where) ? " WHERE " . implode(' AND ', $where) : "") . " ORDER BY " . $filter_order . ' ' . $filter_order_Dir;
     $db->setQuery($query, $lists['pageNav']->limitstart, $lists['pageNav']->limit);
     $lists['rows'] = $db->loadObjectList();
     // Filter by object_group (component)
     $query = "SELECT DISTINCT(object_group) AS name, object_group AS value " . " FROM #__jcomments_subscriptions" . " ORDER BY name";
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     $cnt = count($rows);
     if ($cnt > 1 || $cnt == 1 && $total == 0) {
         array_unshift($rows, JCommentsHTML::makeOption('', JText::_('A_FILTER_COMPONENT'), 'name', 'value'));
         $lists['fog'] = JCommentsHTML::selectList($rows, 'fog', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'name', 'value', $object_group);
     } else {
         if ($cnt == 1) {
             if ($object_group == '') {
                 $object_group = $rows[0]->name;
             }
         }
     }
     unset($rows);
     if ($object_group != '') {
         $query = "SELECT DISTINCT object_id AS value, lang " . " FROM #__jcomments_subscriptions " . " WHERE object_group = " . $db->Quote($object_group) . ($flang != '-1' ? " AND lang = " . $db->Quote($flang) : "");
         $db->setQuery($query);
         $rows = $db->loadObjectList();
         for ($i = 0, $n = count($rows); $i < $n; $i++) {
             $rows[$i]->name = JCommentsObjectHelper::getTitle($rows[$i]->value, $object_group, $rows[$i]->lang);
             if ($rows[$i]->name == '') {
                 $rows[$i]->name = 'Untitled' . $rows[$i]->value;
             }
         }
         // Don't show filter if we have more than 100 objects
         if (count($rows) > 1 && count($rows) < 100) {
             usort($rows, create_function('$a, $b', 'return strcasecmp( $a->name, $b->name);'));
             array_unshift($rows, JCommentsHTML::makeOption('', JText::_('A_FILTER_OBJECT'), 'value', 'name'));
             $lists['foid'] = JCommentsHTML::selectList($rows, 'foid', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'value', 'name', $object_id);
             unset($rows);
         }
     }
     // Filter by language
     $query = "SELECT DISTINCT(lang) AS text, lang AS value " . " FROM #__jcomments_subscriptions" . " ORDER BY lang";
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     if (count($rows) > 1) {
         array_unshift($rows, JCommentsHTML::makeOption('-1', JText::_('A_FILTER_LANGUAGE'), 'text', 'value'));
         $lists['flang'] = JCommentsHTML::selectList($rows, 'flang', 'class="inputbox" size="1" onchange="document.adminForm.submit( );"', 'text', 'value', $flang);
     }
     unset($rows);
     // Filter by published state
     $stateOptions = array();
//.........这里部分代码省略.........
开发者ID:sergy444,项目名称:joomla,代码行数:101,代码来源:admin.jcomments.subscription.php

示例8: isEnabled

 public static function isEnabled()
 {
     static $enabled = null;
     if (!isset($enabled)) {
         $app = JCommentsFactory::getApplication();
         $enabled = $app->getCfg('multilingual_support') == 1;
         if (JCOMMENTS_JVERSION == '1.7') {
             if ($app->isSite()) {
                 $enabled = $app->getLanguageFilter();
             } else {
                 $db = JFactory::getDBO();
                 $db->setQuery("SELECT COUNT(*) FROM `#__extensions` WHERE `element` = 'languagefilter' AND `enabled` = 1");
                 $enabled = $db->loadResult() > 0;
             }
         }
         // check if multilingual_support
         if ($enabled) {
             $config = JCommentsFactory::getConfig();
             $enabled = $config->get('multilingual_support', $enabled);
         }
     }
     return $enabled;
 }
开发者ID:carmerin,项目名称:cesae-web,代码行数:23,代码来源:jcomments.class.php

示例9: getPagination

 public static function getPagination($total, $limitstart, $limit)
 {
     if (JCOMMENTS_JVERSION == '1.0') {
         $app = JCommentsFactory::getApplication();
         require_once $app->getCfg('absolute_path') . '/administrator/includes/pageNavigation.php';
         $pagination = new mosPageNav($total, $limitstart, $limit);
     } else {
         jimport('joomla.html.pagination');
         $pagination = new JPagination($total, $limitstart, $limit);
     }
     return $pagination;
 }
开发者ID:xenten,项目名称:swift-kanban,代码行数:12,代码来源:admin.jcomments.php

示例10: redirectToObject

 public static function redirectToObject()
 {
     $app = JCommentsFactory::getApplication('site');
     $object_id = (int) JCommentsInput::getVar('object_id', 0);
     $object_group = trim(strip_tags(JCommentsInput::getVar('object_group', 'com_content')));
     $lang = trim(strip_tags(JCommentsInput::getVar('lang')));
     if ($object_id != 0 && $object_group != '') {
         $link = JCommentsObjectHelper::getLink($object_id, $object_group, $lang);
         $link = str_replace('amp;', '', $link);
         if ($link == '') {
             $link = $app->getCfg('live_site');
         }
     } else {
         $link = $app->getCfg('live_site');
     }
     JCommentsRedirect($link);
 }
开发者ID:sergy444,项目名称:joomla,代码行数:17,代码来源:jcomments.php

示例11: RefreshObjects

 public static function RefreshObjects($hash, $step = 0, $object_group = '', $lang = '')
 {
     if (JCommentsSecurity::badRequest() == 1) {
         JCommentsSecurity::notAuth();
     }
     $response = JCommentsFactory::getAjaxResponse();
     $app = JCommentsFactory::getApplication();
     $count = 50;
     if ($hash === md5($app->getCfg('secret'))) {
         $db = JCommentsFactory::getDBO();
         if ($step == 0) {
             $db->setQuery('DELETE FROM #__jcomments_objects WHERE 1=1');
             $db->query();
         }
         $where = array();
         $where[] = 'IFNULL(c.lang, "") <> ""';
         if (!empty($object_group)) {
             $where[] = 'c.object_group = ' . $db->Quote($object_group);
         }
         // count objects without information
         $query = "SELECT COUNT(DISTINCT c.object_id, c.object_group, c.lang)" . " FROM #__jcomments AS c" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "");
         $db->setQuery($query);
         $objectsCount = (int) $db->loadResult();
         $where[] = 'NOT EXISTS (SELECT o.id FROM #__jcomments_objects AS o WHERE o.object_id = c.object_id AND o.object_group = c.object_group AND o.lang = c.lang)';
         // get list of first objects without information
         $query = "SELECT DISTINCT c.object_id, c.object_group, c.lang" . " FROM #__jcomments AS c" . (count($where) ? "\nWHERE " . implode(' AND ', $where) : "") . " ORDER BY c.object_group, c.lang";
         $db->setQuery($query, 0, $count);
         $rows = $db->loadObjectList();
         $i = 0;
         $multilanguage = JCommentsMultilingual::isEnabled();
         $nextLanguage = $lang;
         if (count($rows)) {
             foreach ($rows as $row) {
                 if ($nextLanguage != $row->lang && $multilanguage) {
                     $nextLanguage = $row->lang;
                     break;
                 }
                 // retrieve and store object information
                 JCommentsObjectHelper::storeObjectInfo($row->object_id, $row->object_group, $row->lang, false, true);
                 $i++;
             }
         }
         $objectsRefreshed = 0;
         if ($i > 0) {
             $db->setQuery("SELECT COUNT(*) FROM #__jcomments_objects");
             $objectsRefreshed = (int) $db->loadResult();
             $response->addScript("JCommentsRefreshObjectsProgress({$objectsRefreshed}, {$objectsCount});");
         }
         if ($objectsCount > $objectsRefreshed && ($i > 0 || $lang != $nextLanguage)) {
             // we need continue refresh
             $step++;
             $response->addScript("JCommentsRefreshObjectsAJAX('{$hash}', '{$step}', '', '{$nextLanguage}');");
         } else {
             $response->addScript("JCommentsRefreshObjectsProgress({$objectsCount}, {$objectsCount});");
             if ($app->getCfg('caching')) {
                 // clean cache for all object groups
                 $db->setQuery('SELECT DISTINCT object_group FROM #__jcomments_objects');
                 $rows = $db->loadResultArray();
                 foreach ($rows as $row) {
                     $cache = JCommentsFactory::getCache('com_jcomments_objects_' . strtolower($row));
                     $cache->clean();
                 }
             }
         }
     }
     return $response;
 }
开发者ID:sergy444,项目名称:joomla,代码行数:67,代码来源:jcomments.ajax.php

示例12: showUserComments

 public static function showUserComments()
 {
     $config = JCommentsFactory::getConfig();
     if ($config->get('enable_rss') == '1') {
         $app = JCommentsFactory::getApplication('site');
         $acl = JCommentsFactory::getACL();
         $userid = (int) JCommentsInput::getVar('userid', 0);
         $limit = (int) JCommentsInput::getVar('limit', $config->getInt('feed_limit', 100));
         $user = JCommentsFactory::getUser($userid);
         if (!isset($user->id)) {
             self::showNotFound();
             return;
         }
         if (JCOMMENTS_JVERSION == '1.0') {
             $offset = $app->getCfg('offset') + date('O') / 100;
         } else {
             $offset = $app->getCfg('offset');
         }
         $lm = $limit != $config->getInt('feed_limit') ? '&amp;limit=' . $limit : '';
         if (JCommentsMultilingual::isEnabled()) {
             $language = JCommentsMultilingual::getLanguage();
             $lp = '&amp;lang=' . $language;
         } else {
             $language = null;
             $lp = '';
         }
         if (JCOMMENTS_JVERSION == '1.0') {
             $syndicationURL = $app->getCfg('live_site') . '/index2.php?option=com_jcomments&amp;task=rss_user&amp;userid=' . $userid . $lm . $lp . '&amp;no_html=1';
         } else {
             $liveSite = str_replace(JURI::root(true), '', $app->getCfg('live_site'));
             $syndicationURL = $liveSite . JRoute::_('index.php?option=com_jcomments&amp;task=rss_user&amp;userid=' . $userid . $lm . $lp . '&amp;tmpl=raw');
         }
         $user->userid = $user->id;
         $username = JComments::getCommentAuthorName($user);
         $rss = new JoomlaTuneFeed();
         $rss->setOffset($offset);
         $rss->encoding = JCOMMENTS_ENCODING;
         $rss->title = JText::sprintf('USER_FEED_TITLE', $username);
         $rss->link = $app->getCfg('live_site');
         $rss->syndicationURL = $syndicationURL;
         $rss->description = JText::sprintf('USER_FEED_DESCRIPTION', $username);
         $options = array();
         $options['lang'] = $language;
         $options['userid'] = $userid;
         $options['published'] = 1;
         $options['filter'] = 'c.deleted = 0';
         $options['orderBy'] = 'c.date DESC';
         $options['votes'] = false;
         $options['limit'] = $limit;
         $options['limitStart'] = 0;
         $options['objectinfo'] = true;
         $options['access'] = $acl->getUserAccess();
         $rows = JCommentsModel::getCommentsList($options);
         $word_maxlength = $config->getInt('word_maxlength');
         $lang = JCommentsMultilingual::isEnabled() ? JCommentsMultilingual::getLanguage() : null;
         foreach ($rows as $row) {
             $comment = JCommentsText::cleanText($row->comment);
             if ($comment != '') {
                 // getting object's information (title and link)
                 $object_title = empty($row->object_title) ? JCommentsObjectHelper::getTitle($row->object_id, $row->object_group, $lang) : $row->object_title;
                 $object_link = empty($row->object_link) ? JCommentsObjectHelper::getLink($row->object_id, $row->object_group, $lang) : $row->object_link;
                 $object_link = JCommentsFactory::getAbsLink(str_replace('amp;', '', $object_link));
                 // apply censor filter
                 $object_title = JCommentsText::censor($object_title);
                 $comment = JCommentsText::censor($comment);
                 // fix long words problem
                 if ($word_maxlength > 0) {
                     $comment = JCommentsText::fixLongWords($comment, $word_maxlength, ' ');
                     if ($object_title != '') {
                         $object_title = JCommentsText::fixLongWords($object_title, $word_maxlength, ' ');
                     }
                 }
                 $author = JComments::getCommentAuthorName($row);
                 $item = new JoomlaTuneFeedItem();
                 $item->title = $object_title;
                 $item->link = $object_link . '#comment-' . $row->id;
                 $item->description = JText::sprintf('USER_FEED_ITEM_DESCRIPTION', $author, $comment);
                 $item->source = $object_link;
                 if (JCOMMENTS_JVERSION == '1.0') {
                     $date = strtotime((string) $row->date) - $offset * 3600;
                     $item->pubDate = date('Y-m-d H:i:s', $date);
                 } else {
                     $item->pubDate = $row->date;
                 }
                 $item->author = $author;
                 $rss->addItem($item);
             }
         }
         $rss->display();
         unset($rows, $rss);
         exit;
     }
 }
开发者ID:sergy444,项目名称:joomla,代码行数:93,代码来源:jcomments.rss.php

示例13: getLink

 /**
  * Returns URI for given object
  *
  * @param int $object_id
  * @param string $object_group
  * @param string $language
  * @return string
  */
 public static function getLink($object_id, $object_group = 'com_content', $language = null)
 {
     $app = JCommentsFactory::getApplication();
     return $app->getCfg('live_site') . '/' . JCOMMENTS_INDEX . '?option=com_jcomments&task=go2object&object_id=' . $object_id . '&object_group=' . $object_group . '&lang=' . $language . (JCOMMENTS_JVERSION == '1.0' ? '&no_html=1' : '&tmpl=raw');
 }
开发者ID:sergy444,项目名称:joomla,代码行数:13,代码来源:object.php

示例14: showInstallLog

    function showInstallLog()
    {
        $app = JCommentsFactory::getApplication('administrator');
        require_once dirname(__FILE__) . DS . 'version.php';
        $version = new JCommentsVersion();
        if (version_compare(phpversion(), '5.1.0') >= 0) {
            date_default_timezone_set('UTC');
        }
        if (JCOMMENTS_JVERSION == '1.7') {
            JHtml::_('behavior.framework');
        }
        ?>
<script type="text/javascript">
<!--
<?php 
        if (JCOMMENTS_JVERSION == '1.7') {
            ?>
Joomla.submitbutton = function (task) {
	Joomla.submitform(task, document.getElementById('adminForm'));
};
<?php 
        } else {
            ?>
function submitbutton(task)
{
	submitform(task);
}
<?php 
        }
        ?>
//-->
</script>
<link rel="stylesheet" href="<?php 
        echo $app->getCfg('live_site');
        ?>
/administrator/components/com_jcomments/assets/style.css?v=<?php 
        echo $version->getVersion();
        ?>
" type="text/css" />

<div id="jc">

<div class="jcomments-box">
<div class="m">

<table width="95%" cellpadding="0" cellspacing="0">
	<tr>
		<td width="50px"><img src="<?php 
        echo $app->getCfg('live_site');
        ?>
/administrator/components/com_jcomments/assets/icon-48-jcomments.png" border="0" alt="" /></td>
		<td><span class="componentname"><?php 
        echo $version->getLongVersion();
        ?>
</span>
		<span class="componentdate">[<?php 
        echo $version->getReleaseDate();
        ?>
]</span><br />
		<span class="copyright">&copy; 2006-<?php 
        echo date('Y');
        ?>
 smart (<a href="http://www.joomlatune.ru" target="_blank">JoomlaTune.ru</a> | <a href="http://www.joomlatune.com" target="_blank">JoomlaTune.com</a>). <?php 
        echo JText::_('A_ABOUT_COPYRIGHT');
        ?>
<br /></span></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
<?php 
        if (count($this->messages)) {
            ?>
	<tr>
		<td>&nbsp;</td>
		<td><span class="installheader"><?php 
            echo JText::_('A_INSTALL_LOG');
            ?>
</span>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td>
			<ul>
<?php 
            foreach ($this->messages as $message) {
                $class = $message['status'] ? 'status-ok' : 'status-error';
                $text = $message['status'] ? JText::_('A_INSTALL_STATE_OK') : JText::_('A_INSTALL_STATE_ERROR');
                ?>
				<li><?php 
                echo $message['text'];
                ?>
: <span class="<?php 
                echo $class;
                ?>
"><?php 
                echo $text;
                ?>
//.........这里部分代码省略.........
开发者ID:carmerin,项目名称:cesae-web,代码行数:101,代码来源:admin.jcomments.installer.php

示例15: show

    public static function show($lists)
    {
        $app = JCommentsFactory::getApplication('administrator');
        include_once JCOMMENTS_HELPERS . DS . 'system.php';
        $link = JCommentsSystemPluginHelper::getCSS();
        if (JCOMMENTS_JVERSION == '1.0') {
            $app->addCustomHeadTag('<link href="' . $link . '" rel="stylesheet" type="text/css" />');
        } else {
            $document = JFactory::getDocument();
            $document->addStyleSheet($link);
        }
        ?>
<form action="<?php 
        echo JCOMMENTS_INDEX;
        ?>
" method="post" name="adminForm" id="adminForm">
<table class="adminheading">
	<tr>
<?php 
        if (JCOMMENTS_JVERSION == '1.0') {
            ?>
	<th style="background-image: none; padding: 0;"><img src="components/com_jcomments/assets/icon-48-custombbcodes.png" width="48" height="48" align="middle" alt="<?php 
            echo JText::_('A_CUSTOM_BBCODE');
            ?>
" />&nbsp;<?php 
            echo JText::_('A_CUSTOM_BBCODE');
            ?>
</th>
<?php 
        }
        ?>
	<td nowrap="nowrap" align="right"></td>
	</tr>
</table>
<table id="jc" class="adminlist" cellspacing="1">
	<thead>
		<tr>
			<th width="1%"><input type="checkbox" id="toggle" name="toggle" value="" onclick="checkAll(<?php 
        echo count($lists['rows']);
        ?>
);" /></th>
			<th width="30%" align="left" nowrap="nowrap"><?php 
        echo JText::_('A_CUSTOM_BBCODE_NAME');
        ?>
</th>
			<th width="50%" class="title"><?php 
        echo JText::_('A_CUSTOM_BBCODE_PATTERN');
        ?>
</th>
			<th width="16" align="center"><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON_ICON');
        ?>
</th>
			<th width="4%"><?php 
        echo JText::_('A_ORDERING');
        ?>
</th>
			<th width="5%"><?php 
        echo JText::_('A_CUSTOM_BBCODE_BUTTON');
        ?>
</th>
			<th width="5%"><?php 
        echo JText::_('A_PUBLISHING');
        ?>
</th>
		</tr>
	</thead>
	<tbody>
<?php 
        for ($i = 0, $k = 0, $n = count($lists['rows']); $i < $n; $i++) {
            $row =& $lists['rows'][$i];
            $buttonStateTask = $row->button_enabled ? 'custombbcodes.disable_button' : 'custombbcodes.enable_button';
            if (JCOMMENTS_JVERSION == '1.7') {
                $buttonStateClass = $row->button_enabled ? 'publish' : 'unpublish';
                $buttonStateText = $row->button_enabled ? JText::_('JENABLED') : JText::_('JDISABLED');
                $buttonStateTitle = addslashes(htmlspecialchars($buttonStateText, ENT_COMPAT, 'UTF-8'));
                $buttonState = '<span class="state ' . $buttonStateClass . '"><span class="text">' . $buttonStateText . '</span></span>';
            } else {
                $buttonStateTitle = $row->button_enabled ? JText::_('A_DISABLE') : JText::_('A_ENABLE');
                $buttonState = '<img src="images/' . ($row->button_enabled ? 'tick.png' : 'publish_x.png') . '" border="0" alt="' . $buttonStateTitle . '" />';
            }
            $icon = '';
            if ($row->button_image != '') {
                $icon = '<img src="' . $app->getCfg('live_site') . '/' . $row->button_image . '" alt="' . $row->name . '" />';
            } else {
                if ($row->button_css != '') {
                    $icon = '<span class="bbcode" style="width: 23px;"><a href="#" onclick="return false;" class="' . $row->button_css . '"></a></span>';
                }
            }
            $link = JCOMMENTS_INDEX . '?option=com_jcomments&task=custombbcodes.edit&hidemainmenu=1&cid=' . $row->id;
            ?>
<tr valign="middle" class="<?php 
            echo "row{$k}";
            ?>
">
	<td align="center"><?php 
            echo JCommentsHTML::_('grid.id', $row, $i);
            ?>
</td>
	<td align="left"><a href="<?php 
//.........这里部分代码省略.........
开发者ID:carmerin,项目名称:cesae-web,代码行数:101,代码来源:admin.jcomments.custombbcodes.php


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