本文整理汇总了PHP中JCommentsFactory::getLink方法的典型用法代码示例。如果您正苦于以下问题:PHP JCommentsFactory::getLink方法的具体用法?PHP JCommentsFactory::getLink怎么用?PHP JCommentsFactory::getLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JCommentsFactory
的用法示例。
在下文中一共展示了JCommentsFactory::getLink方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
$this->item = $this->get('Item');
$this->reports = $this->get('Reports');
$this->form = $this->get('Form');
$this->state = $this->get('State');
$this->ajax = JCommentsFactory::getLink('ajax-backend');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
if (version_compare(JVERSION, '3.0', 'ge')) {
JHtml::_('formbehavior.chosen', 'select');
$this->bootstrap = true;
} else {
JHtml::_('jcomments.bootstrap');
}
JHtml::_('jcomments.stylesheet');
$this->addToolbar();
parent::display($tpl);
}
示例2: 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++) {
//.........这里部分代码省略.........
示例3: prepareComment
public static function prepareComment(&$comment)
{
if (isset($comment->_skip_prepare) && $comment->_skip_prepare == 1) {
return;
}
JCommentsEventHelper::trigger('onJCommentsCommentBeforePrepare', array(&$comment));
$config = JCommentsFactory::getConfig();
$acl = JCommentsFactory::getACL();
// run autocensor
if ($acl->check('enable_autocensor')) {
$comment->comment = JCommentsText::censor($comment->comment);
if ($comment->title != '') {
$comment->title = JCommentsText::censor($comment->title);
}
}
// replace deleted comment text with predefined message
if ($comment->deleted == 1) {
$comment->comment = JText::_('COMMENT_TEXT_COMMENT_HAS_BEEN_DELETED');
$comment->username = '';
$comment->name = '';
$comment->email = '';
$comment->homepage = '';
$comment->userid = 0;
$comment->isgood = 0;
$comment->ispoor = 0;
}
// replace BBCode tags
$comment->comment = JCommentsFactory::getBBCode()->replace($comment->comment);
if ($config->getInt('enable_custom_bbcode')) {
$comment->comment = JCommentsFactory::getCustomBBCode()->replace($comment->comment);
}
// fix long words problem
$word_maxlength = $config->getInt('word_maxlength');
if ($word_maxlength > 0) {
$comment->comment = JCommentsText::fixLongWords($comment->comment, $word_maxlength);
if ($comment->title != '') {
$comment->title = JCommentsText::fixLongWords($comment->title, $word_maxlength);
}
}
if ($acl->check('emailprotection')) {
$comment->comment = JComments::maskEmail($comment->id, $comment->comment);
}
// autolink urls
if ($acl->check('autolinkurls')) {
$comment->comment = preg_replace_callback(_JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $comment->comment);
if ($acl->check('emailprotection') != 1) {
$comment->comment = preg_replace(_JC_REGEXP_EMAIL, '<a href="mailto:\\1@\\2">\\1@\\2</a>', $comment->comment);
}
}
// replace smilies' codes with images
if ($config->get('enable_smilies') == '1') {
$comment->comment = JCommentsFactory::getSmilies()->replace($comment->comment);
}
$comment->author = JComments::getCommentAuthorName($comment);
// Gravatar support
$comment->gravatar = md5(strtolower($comment->email));
if (empty($comment->avatar)) {
$comment->avatar = '<img src="http://www.gravatar.com/avatar/' . $comment->gravatar . '?d=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="' . htmlspecialchars($comment->author) . '" />';
}
JCommentsEventHelper::trigger('onJCommentsCommentAfterPrepare', array(&$comment));
}
示例4: getTemplate
/**
* Returns a reference to the global {@link JoomlaTuneTemplateRender} object,
* only creating it if it doesn't already exist.
*
* @param int $object_id
* @param string $object_group
* @param bool $needThisUrl
* @return JoomlaTuneTemplateRender
*/
public static function getTemplate($object_id = 0, $object_group = 'com_content', $needThisUrl = true)
{
global $Itemid;
ob_start();
$app = JCommentsFactory::getApplication();
$config = JCommentsFactory::getConfig();
$templateName = $config->get('template');
if (empty($templateName)) {
$templateName = 'default';
$config->set('template', $templateName);
}
include_once JCOMMENTS_LIBRARIES . '/joomlatune/template.php';
$templateDefaultDirectory = JCOMMENTS_BASE . '/tpl/' . $templateName;
$templateDirectory = $templateDefaultDirectory;
$templateUrl = $app->getCfg('live_site') . '/components/com_jcomments/tpl/' . $templateName;
if (JCOMMENTS_JVERSION != '1.0') {
$templateOverride = JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $templateName;
if (is_dir($templateOverride)) {
$templateDirectory = $templateOverride;
$templateUrl = JURI::root() . 'templates/' . $app->getTemplate() . '/html/com_jcomments/' . $templateName;
}
}
$tmpl = JoomlaTuneTemplateRender::getInstance();
$tmpl->setRoot($templateDirectory);
$tmpl->setDefaultRoot($templateDefaultDirectory);
$tmpl->setBaseURI($templateUrl);
$tmpl->addGlobalVar('siteurl', $app->getCfg('live_site'));
$tmpl->addGlobalVar('charset', strtolower(preg_replace('/charset=/', '', _ISO)));
$tmpl->addGlobalVar('ajaxurl', JCommentsFactory::getLink('ajax', $object_id, $object_group));
$tmpl->addGlobalVar('smilesurl', JCommentsFactory::getLink('smiles', $object_id, $object_group));
if ($config->getInt('enable_rss') == 1) {
$tmpl->addGlobalVar('rssurl', JCommentsFactory::getLink('rss', $object_id, $object_group));
}
$tmpl->addGlobalVar('template', $templateName);
$tmpl->addGlobalVar('template_url', $templateUrl);
$tmpl->addGlobalVar('itemid', $Itemid ? $Itemid : 1);
if (JCOMMENTS_JVERSION == '1.0') {
$tmpl->addGlobalVar('direction', 'ltr');
} else {
$language = JFactory::getLanguage();
$tmpl->addGlobalVar('direction', $language->isRTL() ? 'rtl' : 'ltr');
}
$lang = $app->getCfg('lang');
if ($lang == 'russian' || $lang == 'ukrainian' || $lang == 'belorussian' || $lang == 'ru-RU' || $lang == 'uk-UA' || $lang == 'be-BY') {
$tmpl->addGlobalVar('support', base64_decode('PGEgaHJlZj0iaHR0cDovL3d3dy5qb29tbGF0dW5lLnJ1IiB0aXRsZT0iSkNvbW1lbnRzIiB0YXJnZXQ9Il9ibGFuayI+SkNvbW1lbnRzPC9hPg=='));
} else {
$tmpl->addGlobalVar('support', base64_decode('PGEgaHJlZj0iaHR0cDovL3d3dy5qb29tbGF0dW5lLmNvbSIgdGl0bGU9IkpDb21tZW50cyIgdGFyZ2V0PSJfYmxhbmsiPkpDb21tZW50czwvYT4='));
}
$tmpl->addGlobalVar('comment-object_id', $object_id);
$tmpl->addGlobalVar('comment-object_group', $object_group);
if ($needThisUrl == true) {
$tmpl->addGlobalVar('thisurl', JCommentsObjectHelper::getLink($object_id, $object_group));
}
ob_end_clean();
return $tmpl;
}
示例5: show
function show($object_id, $object_group = 'com_content', $object_title = '', $search_text = '')
{
$object_id = (int) $object_id;
$object_group = trim($object_group);
$object_title = trim($object_title);
$acl =& JCommentsFactory::getACL();
$config =& JCommentsFactory::getConfig();
$JLMS_CONFIG =& JLMSFactory::getConfig();
$app =& JFactory::getApplication();
$tmpl =& JCommentsFactory::getTemplate($object_id, $object_group);
$tmpl->load('tpl_index');
if ($config->getInt('object_locked', 0) == 1) {
$config->set('enable_rss', 0);
$tmpl->addVar('tpl_index', 'comments-form-locked', 1);
}
if (JCOMMENTS_JVERSION == '1.5') {
$document =& JFactory::getDocument();
}
if (!defined('JCOMMENTS_CSS')) {
include_once JCOMMENTS_HELPERS . DS . 'system.php';
if ($app->isAdmin()) {
$tmpl->addVar('tpl_index', 'comments-css', 1);
} else {
$link = JCommentsSystemPluginHelper::getCSS();
$document->addStyleSheet($link);
}
}
if (!defined('JCOMMENTS_JS')) {
include_once JCOMMENTS_HELPERS . DS . 'system.php';
if ($config->getInt('gzip_js') == 1) {
$document->addScript(JCommentsSystemPluginHelper::getCompressedJS());
} else {
$document->addScript(JCommentsSystemPluginHelper::getCoreJS());
if (!defined('JOOMLATUNE_AJAX_JS')) {
$document->addScript(JCommentsSystemPluginHelper::getAjaxJS());
define('JOOMLATUNE_AJAX_JS', 1);
}
}
}
$tmpl->addVar('tpl_index', 'comments-form-captcha', $acl->check('enable_captcha'));
$tmpl->addVar('tpl_index', 'comments-form-link', $config->getInt('form_show') ? 0 : 1);
if ($config->getInt('enable_rss') == 1) {
$link = JCommentsFactory::getLink('rss', $object_id, $object_group);
$attribs = array('type' => 'application/rss+xml', 'title' => strip_tags($object_title));
$document->addHeadLink($link, 'alternate', 'rel', $attribs);
}
$cacheEnabled = intval($JLMS_CONFIG->get('caching')) == 1;
if ($cacheEnabled == 0) {
$jrecache = $JLMS_CONFIG->get('absolute_path') . DS . 'components' . DS . 'com_jrecache' . DS . 'jrecache.config.php';
if (is_file($jrecache)) {
$cfg = new _JRECache_Config();
$cacheEnabled = $cacheEnabled && $cfg->enable_cache;
}
}
$load_cached_comments = $config->getInt('load_cached_comments', 0);
if ($cacheEnabled) {
$tmpl->addVar('tpl_index', 'comments-anticache', 1);
}
if (!$cacheEnabled || $load_cached_comments === 1) {
if ($config->get('template_view') == 'tree' && !strlen($search_text)) {
$tmpl->addVar('tpl_index', 'comments-list', JLMS_JComments::getCommentsTree($object_id, $object_group, $search_text));
} else {
$tmpl->addVar('tpl_index', 'comments-list', JLMS_JComments::getCommentsList($object_id, $object_group, $search_text));
}
}
$needScrollToComment = $cacheEnabled || $config->getInt('comments_per_page') > 0;
$tmpl->addVar('tpl_index', 'comments-gotocomment', (int) $needScrollToComment);
$tmpl->addVar('tpl_index', 'comments-form', JComments::getCommentsForm($object_id, $object_group, $config->getInt('form_show') == 1));
$result = $tmpl->renderTemplate('tpl_index');
$tmpl->freeAllTemplates();
return $result;
}
示例6: getCommentsFormFull
function getCommentsFormFull()
{
$object_id = $this->getVar('comment-object_id');
$object_group = $this->getVar('comment-object_group');
$htmlBeforeForm = $this->getVar('comments-form-html-before');
$htmlAfterForm = $this->getVar('comments-form-html-after');
?>
<h4><?php
echo JText::_('FORM_HEADER');
?>
</h4>
<?php
if ($this->getVar('comments-form-policy', 0) == 1) {
?>
<div class="comments-policy"><?php
echo $this->getVar('comments-policy');
?>
</div>
<?php
}
echo $htmlBeforeForm;
?>
<a id="addcomments" href="#addcomments"></a>
<form id="comments-form" name="comments-form" action="javascript:void(null);">
<?php
if ($this->getVar('comments-form-user-name', 1) == 1) {
?>
<p>
<input id="comments-form-name" type="text" name="name" value="" maxlength="<?php
echo $this->getVar('comment-name-maxlength');
?>
" size="22" tabindex="1" />
<label for="comments-form-name"><?php
echo JText::_('FORM_NAME');
?>
</label>
</p>
<?php
}
if ($this->getVar('comments-form-user-email', 1) == 1) {
$text = $this->getVar('comments-form-email-required', 1) == 0 ? JText::_('FORM_EMAIL') : JText::_('FORM_EMAIL_REQUIRED');
?>
<p>
<input id="comments-form-email" type="text" name="email" value="" size="22" tabindex="2" />
<label for="comments-form-email"><?php
echo $text;
?>
</label>
</p>
<?php
}
if ($this->getVar('comments-form-user-homepage', 0) == 1) {
$text = $this->getVar('comments-form-homepage-required', 1) == 0 ? JText::_('FORM_HOMEPAGE') : JText::_('FORM_HOMEPAGE_REQUIRED');
?>
<p>
<input id="comments-form-homepage" type="text" name="homepage" value="" size="22" tabindex="3" />
<label for="comments-form-homepage"><?php
echo $text;
?>
</label>
</p>
<?php
}
if ($this->getVar('comments-form-title', 0) == 1) {
$text = $this->getVar('comments-form-title-required', 1) == 0 ? JText::_('FORM_TITLE') : JText::_('FORM_TITLE_REQUIRED');
?>
<p>
<input id="comments-form-title" type="text" name="title" value="" size="22" tabindex="4" />
<label for="comments-form-title"><?php
echo $text;
?>
</label>
</p>
<?php
}
?>
<p>
<textarea id="comments-form-comment" name="comment" cols="65" rows="8" tabindex="5"></textarea>
</p>
<?php
if ($this->getVar('comments-form-subscribe', 0) == 1) {
?>
<p>
<input class="checkbox" id="comments-form-subscribe" type="checkbox" name="subscribe" value="1" tabindex="5" />
<label for="comments-form-subscribe"><?php
echo JText::_('FORM_SUBSCRIBE');
?>
</label><br />
</p>
<?php
}
if ($this->getVar('comments-form-captcha', 0) == 1) {
$html = $this->getVar('comments-form-captcha-html');
if ($html != '') {
echo $html;
} else {
$link = JCommentsFactory::getLink('captcha');
?>
<p>
<img class="captcha" onclick="jcomments.clear('captcha');" id="comments-form-captcha-image" name="captcha-image" src="<?php
//.........这里部分代码省略.........
示例7: getTemplate
/**
* Returns a reference to the global {@link JoomlaTuneTemplateRender} object, only creating it if it does not already exist.
*
* @param int $object_id
* @param string $object_group
* @param bool $needThisUrl
*
* @return JoomlaTuneTemplateRender
*/
public static function getTemplate($object_id = 0, $object_group = 'com_content', $needThisUrl = true)
{
global $Itemid;
ob_start();
$app = JFactory::getApplication();
$language = JFactory::getLanguage();
$config = JCommentsFactory::getConfig();
$templateName = $config->get('template');
if (empty($templateName)) {
$templateName = 'default';
$config->set('template', $templateName);
}
include_once JCOMMENTS_LIBRARIES . '/joomlatune/template.php';
$templateDefaultDirectory = JCOMMENTS_SITE . '/tpl/' . $templateName;
$templateDirectory = $templateDefaultDirectory;
$templateUrl = JURI::root() . 'components/com_jcomments/tpl/' . $templateName;
$templateOverride = JPATH_SITE . '/templates/' . $app->getTemplate() . '/html/com_jcomments/' . $templateName;
if (is_dir($templateOverride)) {
$templateDirectory = $templateOverride;
$templateUrl = JURI::root() . 'templates/' . $app->getTemplate() . '/html/com_jcomments/' . $templateName;
}
$tmpl = JoomlaTuneTemplateRender::getInstance();
$tmpl->setRoot($templateDirectory);
$tmpl->setDefaultRoot($templateDefaultDirectory);
$tmpl->setBaseURI($templateUrl);
$tmpl->addGlobalVar('siteurl', JURI::root());
$tmpl->addGlobalVar('charset', 'utf-8');
$tmpl->addGlobalVar('ajaxurl', JCommentsFactory::getLink('ajax', $object_id, $object_group));
$tmpl->addGlobalVar('smilesurl', JCommentsFactory::getLink('smilies', $object_id, $object_group));
if ($config->getInt('enable_rss') == 1) {
$tmpl->addGlobalVar('rssurl', JCommentsFactory::getLink('rss', $object_id, $object_group));
}
$tmpl->addGlobalVar('template', $templateName);
$tmpl->addGlobalVar('template_url', $templateUrl);
$tmpl->addGlobalVar('itemid', $Itemid ? $Itemid : 1);
$tmpl->addGlobalVar('direction', $language->isRTL() ? 'rtl' : 'ltr');
$lang = $language->getTag();
$domain = $lang == 'ru-RU' || $lang == 'uk-UA' || $lang == 'be-BY' ? 'ru' : 'com';
$tmpl->addGlobalVar('comment-object_id', $object_id);
$tmpl->addGlobalVar('comment-object_group', $object_group);
if ($needThisUrl == true) {
$tmpl->addGlobalVar('thisurl', JCommentsObjectHelper::getLink($object_id, $object_group, $lang));
}
ob_end_clean();
return $tmpl;
}
示例8: prepareComment
function prepareComment(&$comment)
{
if (isset($comment->_skip_prepare) && $comment->_skip_prepare == 1) {
return;
}
$config =& JCommentsFactory::getConfig();
$bbcode =& JCommentsFactory::getBBCode();
$acl =& JCommentsFactory::getACL();
// convert to datetime if variable contains string value
if (is_string($comment->datetime)) {
$comment->datetime = strtotime($comment->datetime);
}
// run autocensor
if ($acl->check('enable_autocensor')) {
$comment->comment = JCommentsText::censor($comment->comment);
}
// replace BBCode tags
$comment->comment = $bbcode->replace($comment->comment);
if ($config->getInt('enable_custom_bbcode')) {
$customBBCode =& JCommentsFactory::getCustomBBCode();
$comment->comment = $customBBCode->replace($comment->comment);
}
// fix long words problem
$word_maxlength = $config->getInt('word_maxlength');
if ($word_maxlength > 0) {
$comment->comment = JCommentsText::fixLongWords($comment->comment, $word_maxlength);
if ($comment->title != '') {
$comment->title = JCommentsText::fixLongWords($comment->title, $word_maxlength);
}
}
if ($acl->check('emailprotection')) {
$comment->comment = JComments::maskEmail($comment->id, $comment->comment);
}
// autolink urls
if ($acl->check('autolinkurls')) {
$comment->comment = preg_replace_callback(_JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $comment->comment);
if ($acl->check('emailprotection') != 1) {
$comment->comment = preg_replace(_JC_REGEXP_EMAIL, '<a href="mailto:\\1@\\2">\\1@\\2</a>', $comment->comment);
}
}
// replace smile codes with images
if ($config->get('enable_smiles') == '1') {
$smiles =& JCommentsFactory::getSmiles();
$comment->comment = $smiles->replace($comment->comment);
}
// Gravatar support
$comment->gravatar = md5(strtolower($comment->email));
if (empty($comment->avatar)) {
$comment->avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id=' . $comment->gravatar . '&default=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="" />';
}
$comment->author = JComments::getCommentAuthorName($comment);
if ($config->getInt('enable_mambots') == 1) {
JCommentsPluginHelper::trigger('onAfterPrepareComment', array(&$comment));
}
}
示例9: getList
//.........这里部分代码省略.........
if (count($source) == 1 && $source[0] == 'com_content') {
$joins[] = 'JOIN #__content AS cc ON cc.id = o.object_id';
$joins[] = 'LEFT JOIN #__categories AS ct ON ct.id = cc.catid';
$where[] = "c.object_group = " . $db->Quote($source[0]);
$where[] = "(cc.publish_up = '0000-00-00 00:00:00' OR cc.publish_up <= '{$now}')";
$where[] = "(cc.publish_down = '0000-00-00 00:00:00' OR cc.publish_down >= '{$now}')";
$categories = $params->get('catid', array());
if (!is_array($categories)) {
$categories = explode(',', $categories);
}
JArrayHelper::toInteger($categories);
$categories = implode(',', $categories);
if (!empty($categories)) {
$where[] = "cc.catid IN (" . $categories . ")";
}
} else {
if (count($source)) {
$where[] = "c.object_group in ('" . implode("','", $source) . "')";
}
}
$query = "SELECT c.id, c.userid, c.comment, c.title, c.name, c.username, c.email, c.date, c.object_id, c.object_group, '' as avatar" . ", o.title AS object_title, o.link AS object_link, o.access AS object_access, o.userid AS object_owner" . " FROM #__jcomments AS c" . " JOIN #__jcomments_objects AS o ON c.object_id = o.object_id AND c.object_group = o.object_group AND c.lang = o.lang" . (count($joins) ? ' ' . implode(' ', $joins) : '') . (count($where) ? ' WHERE ' . implode(' AND ', $where) : '') . " ORDER BY " . $orderBy;
$db->setQuery($query, 0, $params->get('count'));
$list = $db->loadObjectList();
if (!is_array($list)) {
$list = array();
}
if (count($list)) {
$show_date = $params->get('show_comment_date', 0);
$date_type = $params->get('date_type', '');
$date_format = $params->get('date_format', 'd.m.Y H:i');
$show_author = $params->get('show_comment_author', 0);
$show_object_title = $params->get('show_object_title', 0);
$show_comment_title = $params->get('show_comment_title', 0);
$show_smiles = $params->get('show_smiles', 0);
$show_avatar = $params->get('show_avatar', 0);
$limit_comment_text = (int) $params->get('limit_comment_text', 0);
$config = JCommentsFactory::getConfig();
$bbcode = JCommentsFactory::getBBCode();
$smiles = JCommentsFactory::getSmiles();
$acl = JCommentsFactory::getACL();
if ($show_avatar) {
JPluginHelper::importPlugin('jcomments');
if (version_compare(JVERSION, '3.0', 'ge')) {
$dispatcher = JEventDispatcher::getInstance();
} else {
$dispatcher = JDispatcher::getInstance();
}
$dispatcher->trigger('onPrepareAvatars', array(&$list));
}
foreach ($list as &$item) {
$item->displayDate = '';
if ($show_date) {
if ($date_type == 'relative') {
$item->displayDate = modJCommentsLatestHelper::getRelativeDate($item->date);
} else {
$item->displayDate = JHTML::_('date', $item->date, $date_format);
}
}
$item->displayAuthorName = '';
if ($show_author) {
$item->displayAuthorName = JComments::getCommentAuthorName($item);
}
$item->displayObjectTitle = '';
if ($show_object_title) {
$item->displayObjectTitle = $item->object_title;
}
$item->displayCommentTitle = '';
if ($show_comment_title) {
$item->displayCommentTitle = $item->title;
}
$item->displayCommentLink = $item->object_link . '#comment-' . $item->id;
$text = JCommentsText::censor($item->comment);
$text = preg_replace('#\\[quote[^\\]]*?\\](((?R)|.)*?)\\[\\/quote\\]#ismu', '', $text);
$text = $bbcode->filter($text, true);
$text = JCommentsText::fixLongWords($text, $config->getInt('word_maxlength'), ' ');
if ($acl->check('autolinkurls')) {
$text = preg_replace_callback(_JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $text);
}
$text = JCommentsText::cleanText($text);
if ($limit_comment_text && JString::strlen($text) > $limit_comment_text) {
$text = self::truncateText($text, $limit_comment_text - 1);
}
switch ($show_smiles) {
case 1:
$text = $smiles->replace($text);
break;
case 2:
$text = $smiles->strip($text);
break;
}
$item->displayCommentText = $text;
if ($show_avatar && empty($item->avatar)) {
$gravatar = md5(strtolower($item->email));
$item->avatar = '<img src="http://www.gravatar.com/avatar.php?gravatar_id=' . $gravatar . '&default=' . urlencode(JCommentsFactory::getLink('noavatar')) . '" alt="' . htmlspecialchars(JComments::getCommentAuthorName($item)) . '" />';
}
$item->readmoreText = JText::_('MOD_JCOMMENTS_LATEST_READMORE');
}
}
return $list;
}
示例10: showImport
function showImport()
{
global $mainframe;
$CommentSystems = array();
$CommentSystems[] = new JOtherCommentSystem('AkoComment', 'AkoComment', 'Arthur Konze', 'http://www.konze.de/content/view/8/26/', 'http://www.konze.de/content/view/8/26/', 'http://mamboportal.com', '#__akocomment');
$CommentSystems[] = new JOtherCommentSystem('MosCom', 'MosCom', 'Chanh Ong', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://ongetc.com', '#__content_comments');
$CommentSystems[] = new JOtherCommentSystem('ComboMax', 'ComboMax', 'Phil Taylor', 'Commercial (22.50 GPB)', '', 'http://www.phil-taylor.com/Joomla/Components/ComboMAX/', '#__combomax');
$CommentSystems[] = new JOtherCommentSystem('JoomlaComment', 'JoomlaComment', 'Frantisek Hliva', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://cavo.co.nr', '#__comment');
$CommentSystems[] = new JOtherCommentSystem('mXcomment', 'mXcomment', 'Bernard Gilly', 'Creative Commons', '', 'http://www.visualclinic.fr', '#__mxc_comments');
$CommentSystems[] = new JOtherCommentSystem('JomComment', 'JomComment', 'Azrul Rahim', 'Commercial/Free', '', 'http://www.azrul.com', '#__jomcomment');
$CommentSystems[] = new JOtherCommentSystem('jxtendedcomments', 'JXtended Comments', 'JXtended LLC', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://jxtended.com/products/comments.html', '#__jxcomments_comments');
$CommentSystems[] = new JOtherCommentSystem('chronocomments', 'Chrono Comments', 'Chronoman', 'CC', '', 'http://www.chronoengine.com/', '#__chrono_comments');
$CommentSystems[] = new JOtherCommentSystem('jacomment', 'JA Comment', 'JoomlArt', 'Copyrighted Commercial Software', '', 'www.joomlart.com', '#__jacomment_items');
$CommentSystems[] = new JOtherCommentSystem('DatsoGallery', 'DatsoGallery comments', 'Andrey Datso', 'Free', '', 'http://www.datso.fr', '#__datsogallery_comments');
$CommentSystems[] = new JOtherCommentSystem('JoomGallery', 'JoomGallery comments', 'M. Andreas Boettcher', 'Free', '', 'http://www.joomgallery.net', '#__joomgallery_comments');
$CommentSystems[] = new JOtherCommentSystem('IceGallery', 'IceGallery comments', 'Markus Donhauser', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://joomlacode.org/gf/project/ice/', '#__ice_comments');
$CommentSystems[] = new JOtherCommentSystem('Remository', 'Remository file reviews', 'Martin Brampton', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.remository.com', '#__downloads_reviews');
$CommentSystems[] = new JOtherCommentSystem('PAXXGallery', 'PAXXGallery comments', 'Tobias Floery', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.paxxgallery.com', '#__paxxcomments');
$CommentSystems[] = new JOtherCommentSystem('PhocaGallery', 'PhocaGallery comments', 'Jan Pavelka', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.phoca.cz', '#__phocagallery_comments');
$CommentSystems[] = new JOtherCommentSystem('JMovies', 'JMovies comments', 'Luscarpa & Vamba', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.jmovies.eu/', '#__jmovies_comments');
$CommentSystems[] = new JOtherCommentSystem('Cinema', 'Cinema comments', 'Vamba', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.joomlaitalia.com', '#__cinema_comments');
$CommentSystems[] = new JOtherCommentSystem('MosetsTree', 'Mosets Tree reviews', 'Mosets Consulting', 'Commercial', '', 'http://www.mosets.com', '#__mt_reviews');
$CommentSystems[] = new JOtherCommentSystem('LinkDirectory', 'LinkDirectory link comments', 'Soner Ekici', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.sonerekici.com/', '#__ldcomment');
$CommentSystems[] = new JOtherCommentSystem('zOOmMediaGallery', 'zOOm Media Gallery comments', 'Mike de Boer', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.zoomfactory.org/', '#__zoom_comments');
$CommentSystems[] = new JOtherCommentSystem('rsgallery2', 'RSGallery2 comments', 'rsgallery2.net', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://rsgallery2.net/', '#__rsgallery2_comments');
$CommentSystems[] = new JOtherCommentSystem('hotornot2', 'Hotornot2 comments', 'Aron Watson', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://joomlacode.org/gf/project/com_hotornot2/frs/', '#__hotornot_comments');
$CommentSystems[] = new JOtherCommentSystem('easycomments', 'EasyComments (www.easy-joomla.org)', 'EasyJoomla', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.easy-joomla.org/', '#__easycomments');
$CommentSystems[] = new JOtherCommentSystem('musicbox', 'MusicBox', 'Vamba', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.joomlaitalia.com', '#__musicboxrewiev');
$CommentSystems[] = new JOtherCommentSystem('jreviews', 'JReviews', 'Alejandro Schmeichler', 'Commercial', '', 'http://www.reviewsforjoomla.com', '#__jreviews_comments');
$CommentSystems[] = new JOtherCommentSystem('tutorials', 'Tutorials (comments for items)', 'NSOrg Project', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.nsorg.com', '#__tutorials_comments');
$CommentSystems[] = new JOtherCommentSystem('idoblog', 'IDoBlog', 'Sunshine studio', 'GNU/GPL', '', 'http://idojoomla.com', '#__idoblog_comments');
$CommentSystems[] = new JOtherCommentSystem('sobi2reviews', 'SOBI2 Reviews', 'SOBI2 Developer Team', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.sigsiu.net', '#__sobi2_plugin_reviews');
$CommentSystems[] = new JOtherCommentSystem('jreactions', 'J! Reactions', 'SDeCNet Software', '', '', 'http://jreactions.sdecnet.com', '#__jreactions');
$CommentSystems[] = new JOtherCommentSystem('virtuemart', 'VirtueMart product reviews', 'The VirtueMart Development Team', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.virtuemart.net', '#__vm_product_reviews');
$CommentSystems[] = new JOtherCommentSystem('akobook', 'AkoBook', 'Arthur Konze', '', '', 'http://mamboportal.com', '#__akobook');
$CommentSystems[] = new JOtherCommentSystem('jambook', 'JamBook', 'Olle Johansson', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.jxdevelopment.com/', '#__jx_jambook');
$CommentSystems[] = new JOtherCommentSystem('k2', 'K2 Comments', 'JoomlaWorks', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://k2.joomlaworks.gr/', '#__k2_comments');
$CommentSystems[] = new JOtherCommentSystem('smartblog', 'SmartBlog Comments', 'Aneesh S', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.aarthikaindia.com', '#__blog_comment');
$CommentSystems[] = new JOtherCommentSystem('urcomment', 'UrComment', 'Comdev Software Sdn Bhd', 'GPL, Commercial Software', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://joomla.comdevweb.com', '#__urcomment');
$CommentSystems[] = new yvCommentSystem('yvcomment', 'yvComment', 'Yuri Volkov', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://yurivolkov.com/Joomla/yvComment/index_en.html', '#__yvcomment');
$CommentSystems[] = new JOtherCommentSystem('zimb', 'ZiMB Comment', 'ZiMB LLC', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.zimbllc.com/Software/zimbcomment', '#__zimbcomment_comment');
$CommentSystems[] = new JOtherCommentSystem('rdbscomment', 'RDBS Commment', 'Robert Deutz', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.rdbs.de', '#__rdbs_comment_comments');
$CommentSystems[] = new JOtherCommentSystem('lyftenbloggie', 'LyftenBloggie', 'Lyften Designs', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.lyften.com', '#__bloggies_comments');
$CommentSystems[] = new JOtherCommentSystem('webee', 'Webee Comment', 'Onno Groen', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.onnogroen.nl/webee/', '#__webeecomment_comment');
$CommentSystems[] = new JOtherCommentSystem('resource', 'MightyExtensions Resource comments', 'MightyExtensions', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://mightyextensions.com/', '#__js_res_comments');
$CommentSystems[] = new JOtherCommentSystem('tpdugg', 'TPDugg', 'TemplatePlazza', '', '', 'http://templateplazza.com/', '#__tpdugg_comments');
$CommentSystems[] = new JOtherCommentSystem('zoo', 'ZOO Comments', 'YOOtheme', 'GNU/GPLv2', 'http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only', 'http://zoo.yootheme.com', '#__zoo_comment');
$CommentSystems[] = new JOtherCommentSystem('beeheard', 'BeeHeard Comments', 'Kaysten Mazerino', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://www.cmstactics.com', '#__beeheard_comments');
$CommentSystems[] = new JOtherCommentSystem('jmylife', 'JMyLife Comments', 'Jeff Channell', 'GNU/GPL', 'http://www.gnu.org/copyleft/gpl.html', 'http://jeffchannell.com', '#__jmylife_comments');
$CommentSystems[] = new JOtherCommentSystem('muscol', 'Music Colllection Comments', 'Germinal Camps', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.joomlamusicsolutions.com', '#__muscol_comments');
$CommentSystems[] = new JOtherCommentSystem('rscomments', 'RSComments', 'RSJoomla', 'GNU/GPL', 'http://www.gnu.org/licenses/gpl-2.0.html', 'http://www.rsjoomla.com/joomla-components/joomla-comments.html', '#__rscomments_comments');
$db =& JCommentsFactory::getDBO();
$db->setQuery("SHOW tables");
$tables = $db->loadResultArray();
foreach ($tables as $tblval) {
for ($i = 0, $n = count($CommentSystems); $i < $n; $i++) {
$table_mask = str_replace('#_', '', $CommentSystems[$i]->table);
if (preg_match('/' . $table_mask . '$/i', $tblval)) {
$CommentSystems[$i]->found = true;
$CommentSystems[$i]->UpdateCount();
}
}
}
$languages = array();
$joomfish = JOOMLATUNE_JPATH_SITE . DS . 'components' . DS . 'com_joomfish' . DS . 'joomfish.php';
if (is_file($joomfish)) {
$db =& JCommentsFactory::getDBO();
$db->setQuery("SELECT name, `code` as value FROM #__languages WHERE active = 1");
$languages = $db->loadObjectList();
}
if (JCOMMENTS_JVERSION == '1.5') {
$params = JComponentHelper::getParams('com_languages');
$lang = $params->get("site", 'en-GB');
} else {
$lang = JCommentsMultilingual::getLanguage();
}
$ajaxUrl = JCommentsFactory::getLink('ajax-backend');
?>
<script type="text/javascript" src="<?php
echo $mainframe->getCfg('live_site');
?>
/components/com_jcomments/libraries/joomlatune/ajax.js?v=2"></script>
<script type="text/javascript" src="<?php
echo $mainframe->getCfg('live_site');
?>
/administrator/components/com_jcomments/assets/jcomments-backend-v2.1.js"></script>
<script type="text/javascript">
<!--
function JCommentsImportCommentsAJAX() {
try{
jtajax.setup({url:'<?php
echo $ajaxUrl;
?>
'});
return jtajax.call('JCommentsImportCommentsAjax',null,'post','adminForm');
}catch(e){
return false;
}
}
//.........这里部分代码省略.........
示例11: getCommentsFormFull
//.........这里部分代码省略.........
<label for="comments-form-title"><?php
echo $text;
?>
</label>
</span>
</p>
<?php
}
?>
<p>
<span>
<textarea id="comments-form-comment" name="comment" cols="205" rows="5" tabindex="5" class="blog-comment-text"></textarea>
</span>
</p>
<?php
if ($this->getVar('comments-form-subscribe', 0) == 1) {
?>
<p>
<span>
<input class="checkbox" id="comments-form-subscribe" type="checkbox" name="subscribe" value="1" tabindex="5" />
<label for="comments-form-subscribe"><?php
echo JText::_('FORM_SUBSCRIBE');
?>
</label><br />
</span>
</p>
<?php
}
if ($this->getVar('comments-form-captcha', 0) == 1) {
$html = $this->getVar('comments-form-captcha-html');
if ($html != '') {
echo $html;
} else {
$link = JCommentsFactory::getLink('captcha');
?>
<p>
<span>
<img class="captcha" onclick="jcomments.clear('captcha');" id="comments-form-captcha-image" src="<?php
echo $link;
?>
" width="121" height="60" alt="<?php
echo JText::_('FORM_CAPTCHA');
?>
" /><br />
<span class="captcha" onclick="jcomments.clear('captcha');">Pulsa para mostrar otra imagen</span><br />
<input class="captcha" id="comments-form-captcha" type="text" name="captcha_refid" value="" size="5" tabindex="6" /><br />
</span>
</p>
<?php
}
}
?>
<div id="comments-form-buttons">
<div id="comments-form-send" class="contenidonivel2-lateralderecho-boton-interno" style="background-image:url(http://www.cesae.es/images/btnpeq.png);cursor:hand;" onmouseover="JavaScript:this.style.backgroundImage='url(http://www.cesae.es/images/btnpeqon.png)'" onmouseout="JavaScript:this.style.backgroundImage='url(http://www.cesae.es/images/btnpeq.png)'" ontouchstart="JavaScript:this.style.backgroundImage='url(http://www.cesae.es/images/btnpeqon.png)'" ontouchend="JavaScript:this.style.backgroundImage='url(http://www.cesae.es/images/btnpeq.png)'">
<a href="#" onclick="jcomments.saveComment();return false;" title="CESAE ENVIAR COMENTARIO" id="contenidonivel2-lateralderecho-boton-interno-btn" >ENVIAR COMENTARIO</a>
</div>
<div class="btn" id="comments-form-cancel" style="display:none;"><div><a href="#" tabindex="8" onclick="return false;" title="<?php
echo JText::_('FORM_CANCEL');
?>
"><?php
echo JText::_('FORM_CANCEL');
?>
</a></div></div>
<div style="clear:both;"></div>