رفتن به مطلب
hadi20

ماژول نظرات

پست های پیشنهاد شده

سلام دوستان

من می خواهم لینک های ماژول آخرین نظرات mod_jcomments در صفحه جدید باز بشه !

لطفا راهنمایی کنید

یا علی

><?php
/**
* JComments Latest - show latest comments or latest commented content items items
*
* @version 2.2.9
* @package JComments
* @author smart (smart@joomlatune.ru)
* @copyright (C) 2006-2009 by smart (http://www.joomlatune.ru)
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
*
**/

// ensure this file is being included by a parent file
(defined('_VALID_MOS') OR defined('_JEXEC')) or die('Direct Access to this location is not allowed.');

// define directory separator short constant
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}

global $mainframe;

$comments = $mainframe->getCfg('absolute_path') . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once ($comments);
} else {
return;
}

if ( !defined( '_JCOMMENTS_MODULE' ) ) {
define( '_JCOMMENTS_MODULE', 1 );

class modJCommentsHelper
{
	function getList($params, $unpublished = false, $orderby = 'date')
	{
		global $mainframe, $my;

		$dbo = & JCommentsFactory::getDBO();
		$acl = & JCommentsFactory::getACL();
		$config = & JCommentsFactory::getConfig();

		$object_group = trim($params->get('object_group', 'com_content'));

		switch($orderby)
		{
		        case 'vote':
		        	$orderby = '(cc.isgood-cc.ispoor) DESC';
		        	break;
			case 'date':
			default:
		        	$orderby = 'cc.date DESC';
				break;
		}

		if ( $object_group == 'com_content' ) {

			$sectionid = intval($params->get('sectionid'));
			$exclude_sectionid = trim($params->get('exclude_sectionid', ''));
			$exclude_sections = array();
			if ($exclude_sectionid != '') {
				$exclude_sections = explode(',', $exclude_sectionid);
			}

			$catid = intval($params->get('catid'));
			$exclude_catid = trim($params->get('exclude_catid', ''));
			$exclude_catids = array();
			if ($exclude_catid != '') {
				$exclude_catids = explode(',', $exclude_catid);
			}

			$query = "SELECT cc.id, cc.userid, cc.comment, cc.name, cc.username, cc.email, cc.date, cc.object_id, cc.object_group, '' as avatar "
				. "\n FROM #__jcomments AS cc"
				. "\n LEFT JOIN #__content AS c ON c.id = cc.object_id"
				. "\n WHERE cc.published = " . ($unpublished ? '0' : '1')
				. "\n   AND c.access <= '$my->gid'"
				. "\n   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= NOW())"
				. "\n   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= NOW())"
				. "\n   AND cc.object_group = 'com_content'"
				. ((!$catid && $sectionid) ? "\n   AND (c.sectionid IN ($sectionid) )" : '')
				. (count($exclude_sections) ? "\n AND (c.sectionid NOT IN (".implode(',', $exclude_sections).") )" : '')
				. ($catid ? "\n   AND (c.catid IN ($catid) )" : '')
				. (count($exclude_catids) ? "\n AND (c.catid NOT IN (".implode(',', $exclude_catids).") )" : '')
				. (JCommentsMultilingual::isEnabled() ? "\nAND cc.lang = '" . JCommentsMultilingual::getLanguage() . "'" : "")
				. "\n ORDER BY " . $orderby
				. "\n LIMIT " . intval( $params->get( 'count' ) )
				;
		} else {

			$groups = explode( ',', $object_group );

			$query = "SELECT cc.id, cc.userid, cc.comment, cc.name, cc.username, cc.email, cc.date, cc.object_id, cc.object_group, '' as avatar "
				. "\n FROM #__jcomments AS cc"
				. "\n WHERE cc.published = " . ($unpublished ? '0' : '1')
				. (count($groups) ? "\n   AND (cc.object_group = '" . implode( "' OR cc.object_group='", $groups ) . "')" : '')
				. (JCommentsMultilingual::isEnabled() ? "\nAND cc.lang = '" . JCommentsMultilingual::getLanguage() . "'" : "")
				. "\n ORDER BY " . $orderby
				. "\n LIMIT " . intval( $params->get( 'count' ) )
				;
		}

		$dbo->setQuery( $query );
		$rows = $dbo->loadObjectList();

		return $rows;
	}

	function getContentLink(&$row)
	{
		global $mainframe, $Itemid;

		if (JCOMMENTS_JVERSION == '1.5') {
			require_once (JPATH_ROOT.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
			$link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)) . '#comments';
		} else {
			$compat = $mainframe->getCfg('itemid_compat');

			if ( $compat == null ) {
				// Joomla 1.0.12 or below
				if ( $Itemid && $Itemid != 99999999 ) {
					$_Itemid = $Itemid;
				} else {
					$_Itemid = $mainframe->getItemid( $row->id );
				}
			} else if ( (int) $compat > 0 && (int) $compat <= 11) {
				// Joomla 1.0.13 or higher and Joomla 1.0.11 compability
				$_Itemid = $mainframe->getItemid( $row->id, 0, 0  );
			} else {
				// Joomla 1.0.13 or higher and new Itemid algoritm
				$_Itemid = $Itemid;
			}

			$link = sefRelToAbs( 'index.php?option=com_content&task=view&id='. $row->id .'&Itemid='. $_Itemid );
		}
		return $link;
	}

	function getModuleStyles($params)
	{
	        $moduleclass_sfx = $params->get('moduleclass_sfx');
		$avatar_size = intval($params->get('avatar_size', 32));
		$showgravatars = intval($params->get('avatar'));

		if ($avatar_size <= 0) {
			$avatar_size = 32;
		}

	        ob_start();
?>
ul.jclist<?php echo $moduleclass_sfx;?> { padding: 0; list-style-image: none; list-style-type: none; }
ul.jclist<?php echo $moduleclass_sfx;?> li {background-image: none; list-style: none; list-style-image: none; margin-left: 5px !important; margin-left: 0; display: block; overflow: hidden; }
<?php 
		if ($showgravatars == 1) {
?>
ul.jclist<?php echo $moduleclass_sfx;?> img { width: <?php echo $avatar_size; ?>px; height: <?php echo $avatar_size; ?>px; margin: 0 5px 5px 0;	float: left;}
<?php 
		}
?>
ul.jclist<?php echo $moduleclass_sfx;?> span img {width: auto; height: auto; float: none;}
<?php
		$_css = ob_get_contents();
		ob_end_clean();

		if (JCOMMENTS_JVERSION == '1.5') {
			$document = & JFactory::getDocument();
			$document->addStyleDeclaration($_css);
		} else {
			echo '';
		}
	}
}


function modJCommentsLatestCommented( &$params ) {
	global $mainframe, $my, $Itemid;

	$dbo = & JCommentsFactory::getDBO();

	$sectionid = intval($params->get('sectionid'));
	$exclude_sectionid = trim($params->get('exclude_sectionid', ''));
	$exclude_sections = array();
	if ($exclude_sectionid != '') {
		$exclude_sections = explode(',', $exclude_sectionid);
	}

	$catid = intval($params->get('catid'));
	$exclude_catid = trim($params->get('exclude_catid', ''));
	$exclude_catids = array();
	if ($exclude_catid != '') {
		$exclude_catids = explode(',', $exclude_catid);
	}

	$query = "SELECT c.id AS id, c.title AS title, c.sectionid"
		. ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug' : '')
		. ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(ct.alias) THEN CONCAT_WS(":", ct.id, ct.alias) ELSE ct.id END as catslug' : '')
		. "\n, COUNT(cc.id) AS comments, MAX(cc.date) AS commentdate"
		. "\n FROM #__content AS c"
		. "\n LEFT JOIN #__jcomments AS cc ON c.id = cc.object_id"
		. "\n LEFT JOIN #__categories AS ct ON ct.id = c.catid"
		. "\n WHERE c.state = 1"
		. "\n   AND c.access <= '$my->gid'"
		. "\n   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= NOW())"
		. "\n   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= NOW())"
		. "\n   AND cc.published = 1"
		. "\n   AND cc.object_group = 'com_content'"
		. ((!$catid && $sectionid) ? "\n   AND (c.sectionid IN ($sectionid) )" : '')
		. (count($exclude_sections) ? "\n AND (c.sectionid NOT IN (".implode(',', $exclude_sections).") )" : '')
		. ($catid ? "\n   AND (c.catid IN ($catid) )" : '')
		. (count($exclude_catids) ? "\n AND (c.catid NOT IN (".implode(',', $exclude_catids).") )" : '')
		. "\n GROUP BY c.id, c.title, c.sectionid"
		. ((JCOMMENTS_JVERSION == '1.5') ? ", slug, catslug" : '')
		. "\n ORDER BY commentdate DESC"
		. "\n LIMIT " . intval( $params->get( 'count' ) )
		;
	$dbo->setQuery( $query );
	$rows = $dbo->loadObjectList();
	echo $dbo->getErrorMsg();

	if ( sizeof( $rows ) ) {
		echo '</pre>
<ul>'."\n";

		foreach( $rows as $row ) {

			$link = modJCommentsHelper::getContentLink($row);
			$link_title = $row->title;
			$link_text = $row->title;

			if ( $params->get( 'showcomments' ) ) { 
				$link_text .= ' (' . $row->comments . ')'; 
			}

			echo '"'.$link.'" title="'.$link_title.'">'.$link_text.''."\n";
		}
		echo '</ul>'."\n";<br>	}<br>}<br><br>function modJCommentsMostCommented( &$params )<br>{<br>	global $mainframe, $my, $Itemid;<br><br>	$dbo = & JCommentsFactory::getDBO();<br><br>	$sectionid = intval($params->get('sectionid'));<br>	$exclude_sectionid = trim($params->get('exclude_sectionid', ''));<br>	$exclude_sections = array();<br>	if ($exclude_sectionid != '') {<br>		$exclude_sections = explode(',', $exclude_sectionid);<br>	}<br><br>	$catid = intval($params->get('catid'));<br>	$exclude_catid = trim($params->get('exclude_catid', ''));<br>	$exclude_catids = array();<br>	if ($exclude_catid != '') {<br>		$exclude_catids = explode(',', $exclude_catid);<br>	}<br><br>	$query = "SELECT c.id AS id, c.title AS title, c.sectionid"<br>		. ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug' : '')<br>		. ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(ct.alias) THEN CONCAT_WS(":", ct.id, ct.alias) ELSE ct.id END as catslug' : '')<br>		. "\n, COUNT(cc.id) AS comments, MAX(cc.date) AS commentdate"<br>		. "\n FROM #__content AS c"<br>		. "\n LEFT JOIN #__categories AS ct ON ct.id = c.catid"<br>		. "\n LEFT JOIN #__jcomments AS cc ON c.id = cc.object_id"<br>		. "\n WHERE c.state = 1"<br>		. "\n   AND c.access <= '$my->gid'"<br>		. "\n   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= NOW())"<br>		. "\n   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= NOW())"<br>		. "\n   AND cc.published = 1"<br>		. "\n   AND cc.object_group = 'com_content'"<br>		. ((!$catid && $sectionid) ? "\n   AND (c.sectionid IN ($sectionid) )" : '')<br>		. (count($exclude_sections) ? "\n AND (c.sectionid NOT IN (".implode(',', $exclude_sections).") )" : '')<br>		. ($catid ? "\n   AND (c.catid IN ($catid) )" : '')<br>		. (count($exclude_catids) ? "\n AND (c.catid NOT IN (".implode(',', $exclude_catids).") )" : '')<br>		. "\n GROUP BY c.id, c.title, c.sectionid"<br>		. ((JCOMMENTS_JVERSION == '1.5') ? ", slug, catslug" : '')<br>		. "\n ORDER BY comments DESC, c.created DESC"<br>		. "\n LIMIT " . intval( $params->get( 'count' ) )<br>		;<br>	$dbo->setQuery( $query );<br>	$rows = $dbo->loadObjectList();<br><br>	if ( sizeof( $rows ) ) {<br>		echo '<ul>'."\n";

		foreach( $rows as $row ) {

			$link = modJCommentsHelper::getContentLink($row);
			$link_title = $row->title;
			$link_text = $row->title;

			if ($params->get('showcomments')) {
				$link_text .= ' (' . $row->comments . ')';
			}

			echo '"'.$link.'" title="'.$link_title.'">'.$link_text.''."\n";
		}
		echo '</ul>'."\n";<br>	}<br>}<br><br>function modJCommentsLatest( &$params, $unpublished = false, $order = 'date' ) {<br>	global $mainframe, $my;<br><br>	$dbo = & JCommentsFactory::getDBO();<br>	$acl = & JCommentsFactory::getACL();<br>	$config = & JCommentsFactory::getConfig();<br><br>	$rows = modJCommentsHelper::getList($params, $unpublished, $order);<br><br>	if ( sizeof( $rows ) ) {<br>		$show_date = intval($params->get('show_date', 0));<br>		$show_author = intval($params->get('show_author', 0));<br>		$show_object_title = intval($params->get('show_object_title', 0));<br>		$show_comment_text = intval($params->get('show_comment_text', 1));<br>		$label4more = $params->get('label4more', 'More...');<br>		$label4author = $params->get('label4author', '');<br>		$dateformat = $params->get('dateformat', '%d.%m.%y %H:%M');<br>		$limit_object_title = $params->get('limit_object_title', 10);<br><br>		$showsmiles = intval($params->get('showsmiles'));<br>		$showgravatars = intval($params->get('avatar'));<br>		$avatar_size = intval($params->get('avatar_size', 32));<br>		$mambots = intval($params->get('mambots'));<br><br>		if ($avatar_size <= 0) {<br>			$avatar_size = 32;<br>		}<br><br>		if ($mambots) {<br>			require_once (JCOMMENTS_HELPERS . DS . 'plugin.php');<br>			JCommentsPluginHelper::importPlugin('jcomments');<br>			JCommentsPluginHelper::trigger('onBeforeDisplayCommentsList', array(&$rows));<br><br>			if ($acl->check('enable_gravatar')) {<br>				JCommentsPluginHelper::trigger('onPrepareAvatars', array(&$rows));<br>			}<br>		}<br><br>		modJCommentsHelper::getModuleStyles($params);<br><br>		echo '<ul>'."\n";

		$bbcode = & JCommentsFactory::getBBCode();
		$smiles = & JCommentsFactory::getSmiles();
		$acl = & JCommentsFactory::getACL();

		$maxlen = intval( $params->get( 'length' ));

		foreach( $rows as $row ) {

			$link  = JCommentsObjectHelper::getLink( $row->object_id, $row->object_group);
			$title = JCommentsText::censor($row->comment );
			$title = $bbcode->filter( $title, true );
			$title = JCommentsText::fixLongWords( $title, $config->getInt('word_maxlength') );

			if ($acl->check('autolinkurls')) {
				$title = preg_replace_callback( _JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $title);
			}

			$title = JCommentsText::cleanText($title);
			$title = JCommentsText::substr($title, $maxlen);

			$link_title = str_replace( '"', '', $title );
			$link_text = $title;

			switch($showsmiles) {
				case 1:
					$link_text = $smiles->replace($link_text);
					break;
				case 2:
					$link_text = $smiles->strip($link_text);
					break;
			}

			echo '';

			if ($showgravatars == 1) {
				if ($row->avatar == '') {
					echo '';
				} else {
					echo $row->avatar;
				}						
			}

			if ($show_object_title == 1) {
				$title = JCommentsObjectHelper::getTitle( $row->object_id, $row->object_group );
				$title = JCommentsText::substr($title, $limit_object_title);
				$title = str_replace( '"', '', $title );

				echo ''.$title.'
';
			}

			switch( $show_comment_text ) {
				case 0:
					echo ''.$link_text.'';
					break;
				case 1:
					echo ''.$link_text.'';
					break;
				case 2:
					echo ''.$link_text.' ';
					echo ''.$label4more.'';
					break;
			}

			if ($show_date == 1) {
				echo '
' . JCommentsText::formatDate( $row->date, $dateformat ) . '';
			}


			switch( $show_author ) {
				case 0:
					break;
				case 1:
					echo '
' . ($label4author != '' ?  $label4author . ' ' : '') . $row->name;
					break;
				case 2:
					echo '
' . ($label4author != '' ?  $label4author . ' ' : '') . ($row->username ? $row->username : $row->name);
					break;
			}

			echo ''."\n";
		}
		echo '</ul>'."\n";<br><br>		$show_full_rss = intval( $params->get( 'show_full_rss', 0 ) );<br>		$label4rss = $params->get( 'label4rss', '' );<br><br>		if ( $show_full_rss == 1 ) {<br>			if (JCOMMENTS_JVERSION == '1.5') {<br>				$rss_link = JoomlaTuneRoute::_('index.php?option=com_jcomments&task=rss_full&tmpl=component');<br>				$rss_icon_link = JURI::base() . 'modules/mod_jcomments/images/rss.gif';<br>			} else {<br>				$rss_link = $mainframe->getCfg( 'live_site' ) . '/index2.php?option=com_jcomments&task=rss_full&no_html=1';<br>				$rss_icon_link = $mainframe->getCfg('live_site') . '/modules/jcomments/rss.gif';<br>			}<br>?><br><div align="center"></div>
<br><?php<br>		}<br>	}<br>}<br>}<br><br>// Set default values for all possible module parameters.<br>$params->def( 'moduleclass_sfx', '' );<br>$params->def( 'count', 5 );<br>$params->def( 'length', 20 );<br>$params->def( 'type', 1 );<br>$params->def( 'showcomments', 0 );<br><br>switch ( intval( $params->get( 'type' ) ) ) {<br>case 1:<br>	modJCommentsLatest( $params );<br>	break;<br>case 2:<br>	modJCommentsLatestCommented( $params );<br>	break;<br>case 3:<br>	modJCommentsMostCommented( $params );<br>	break;<br>case 4:<br>	modJCommentsLatest( $params, true, 'date' );<br>	break;<br>case 5:<br>	modJCommentsLatest( $params, false, 'vote' );<br>	break;<br>default:<br>	modJCommentsLatest( $params );<br>	break;<br>}<br>?&gt

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

خیلی وقته که منتظریم اما کسی جواب نداده !

از مدیران کسی هست راهنماییمون بکنه ؟

این هم آدرس سایت :

www.m-fatemiyeh.com

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

سلام

دوست عزیز اگر در تنظیمات خود افزونه چنین امکانی وجود ندارد باید کدهای افزونه بررسی و ویرایش بشه

بهتر با دوستان برنامه نویس مشورت کنید

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

ممنونم .... اما نمی خواهم همه لینک ها در صفحه جدید باز بشه

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

سلام

دمو از سایتتون قرار میدادید بهتر میشد بررسی کرد

ولی شما این کد رو جایگزین کد قبلی کنید:

><?php
/**
* JComments Latest - show latest comments or latest commented content items items
*
* @version 2.2.9
* @package JComments
* @author smart (smart@joomlatune.ru)
* @copyright (C) 2006-2009 by smart (http://www.joomlatune.ru)
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
*
**/

// ensure this file is being included by a parent file
(defined('_VALID_MOS') OR defined('_JEXEC')) or die('Direct Access to this location is not allowed.');

// define directory separator short constant
if (!defined('DS')) {
   define('DS', DIRECTORY_SEPARATOR);
}

global $mainframe;

$comments = $mainframe->getCfg('absolute_path') . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
   require_once ($comments);
} else {
   return;
}

if ( !defined( '_JCOMMENTS_MODULE' ) ) {
   define( '_JCOMMENTS_MODULE', 1 );

   class modJCommentsHelper
   {
       function getList($params, $unpublished = false, $orderby = 'date')
       {
           global $mainframe, $my;

           $dbo = & JCommentsFactory::getDBO();
           $acl = & JCommentsFactory::getACL();
           $config = & JCommentsFactory::getConfig();

           $object_group = trim($params->get('object_group', 'com_content'));

           switch($orderby)
           {
                   case 'vote':
                       $orderby = '(cc.isgood-cc.ispoor) DESC';
                       break;
               case 'date':
               default:
                       $orderby = 'cc.date DESC';
                   break;
           }

           if ( $object_group == 'com_content' ) {

               $sectionid = intval($params->get('sectionid'));
               $exclude_sectionid = trim($params->get('exclude_sectionid', ''));
               $exclude_sections = array();
               if ($exclude_sectionid != '') {
                   $exclude_sections = explode(',', $exclude_sectionid);
               }

               $catid = intval($params->get('catid'));
               $exclude_catid = trim($params->get('exclude_catid', ''));
               $exclude_catids = array();
               if ($exclude_catid != '') {
                   $exclude_catids = explode(',', $exclude_catid);
               }

               $query = "SELECT cc.id, cc.userid, cc.comment, cc.name, cc.username, cc.email, cc.date, cc.object_id, cc.object_group, '' as avatar "
                   . "\n FROM #__jcomments AS cc"
                   . "\n LEFT JOIN #__content AS c ON c.id = cc.object_id"
                   . "\n WHERE cc.published = " . ($unpublished ? '0' : '1')
                   . "\n   AND c.access <= '$my->gid'"
                   . "\n   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= NOW())"
                   . "\n   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= NOW())"
                   . "\n   AND cc.object_group = 'com_content'"
                   . ((!$catid && $sectionid) ? "\n   AND (c.sectionid IN ($sectionid) )" : '')
                   . (count($exclude_sections) ? "\n AND (c.sectionid NOT IN (".implode(',', $exclude_sections).") )" : '')
                   . ($catid ? "\n   AND (c.catid IN ($catid) )" : '')
                   . (count($exclude_catids) ? "\n AND (c.catid NOT IN (".implode(',', $exclude_catids).") )" : '')
                   . (JCommentsMultilingual::isEnabled() ? "\nAND cc.lang = '" . JCommentsMultilingual::getLanguage() . "'" : "")
                   . "\n ORDER BY " . $orderby
                   . "\n LIMIT " . intval( $params->get( 'count' ) )
                   ;
           } else {

               $groups = explode( ',', $object_group );

               $query = "SELECT cc.id, cc.userid, cc.comment, cc.name, cc.username, cc.email, cc.date, cc.object_id, cc.object_group, '' as avatar "
                   . "\n FROM #__jcomments AS cc"
                   . "\n WHERE cc.published = " . ($unpublished ? '0' : '1')
                   . (count($groups) ? "\n   AND (cc.object_group = '" . implode( "' OR cc.object_group='", $groups ) . "')" : '')
                   . (JCommentsMultilingual::isEnabled() ? "\nAND cc.lang = '" . JCommentsMultilingual::getLanguage() . "'" : "")
                   . "\n ORDER BY " . $orderby
                   . "\n LIMIT " . intval( $params->get( 'count' ) )
                   ;
           }

           $dbo->setQuery( $query );
           $rows = $dbo->loadObjectList();

           return $rows;
       }

       function getContentLink(&$row)
       {
           global $mainframe, $Itemid;

           if (JCOMMENTS_JVERSION == '1.5') {
               require_once (JPATH_ROOT.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
               $link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)) . '#comments';
           } else {
               $compat = $mainframe->getCfg('itemid_compat');

               if ( $compat == null ) {
                   // Joomla 1.0.12 or below
                   if ( $Itemid && $Itemid != 99999999 ) {
                       $_Itemid = $Itemid;
                   } else {
                       $_Itemid = $mainframe->getItemid( $row->id );
                   }
               } else if ( (int) $compat > 0 && (int) $compat <= 11) {
                   // Joomla 1.0.13 or higher and Joomla 1.0.11 compability
                   $_Itemid = $mainframe->getItemid( $row->id, 0, 0  );
               } else {
                   // Joomla 1.0.13 or higher and new Itemid algoritm
                   $_Itemid = $Itemid;
               }

               $link = sefRelToAbs( 'index.php?option=com_content&task=view&id='. $row->id .'&Itemid='. $_Itemid );
           }
           return $link;
       }

       function getModuleStyles($params)
       {
               $moduleclass_sfx = $params->get('moduleclass_sfx');
           $avatar_size = intval($params->get('avatar_size', 32));
           $showgravatars = intval($params->get('avatar'));

           if ($avatar_size <= 0) {
               $avatar_size = 32;
           }

               ob_start();
?>
ul.jclist<?php echo $moduleclass_sfx;?> { padding: 0; list-style-image: none; list-style-type: none; }
ul.jclist<?php echo $moduleclass_sfx;?> li {background-image: none; list-style: none; list-style-image: none; margin-left: 5px !important; margin-left: 0; display: block; overflow: hidden; }
<?php
           if ($showgravatars == 1) {
?>
ul.jclist<?php echo $moduleclass_sfx;?> img { width: <?php echo $avatar_size; ?>px; height: <?php echo $avatar_size; ?>px; margin: 0 5px 5px 0;    float: left;}
<?php
           }
?>
ul.jclist<?php echo $moduleclass_sfx;?> span img {width: auto; height: auto; float: none;}
<?php
           $_css = ob_get_contents();
           ob_end_clean();

           if (JCOMMENTS_JVERSION == '1.5') {
               $document = & JFactory::getDocument();
               $document->addStyleDeclaration($_css);
           } else {
               echo '';
           }
       }
   }


   function modJCommentsLatestCommented( &$params ) {
       global $mainframe, $my, $Itemid;

       $dbo = & JCommentsFactory::getDBO();

       $sectionid = intval($params->get('sectionid'));
       $exclude_sectionid = trim($params->get('exclude_sectionid', ''));
       $exclude_sections = array();
       if ($exclude_sectionid != '') {
           $exclude_sections = explode(',', $exclude_sectionid);
       }

       $catid = intval($params->get('catid'));
       $exclude_catid = trim($params->get('exclude_catid', ''));
       $exclude_catids = array();
       if ($exclude_catid != '') {
           $exclude_catids = explode(',', $exclude_catid);
       }

       $query = "SELECT c.id AS id, c.title AS title, c.sectionid"
           . ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug' : '')
           . ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(ct.alias) THEN CONCAT_WS(":", ct.id, ct.alias) ELSE ct.id END as catslug' : '')
           . "\n, COUNT(cc.id) AS comments, MAX(cc.date) AS commentdate"
           . "\n FROM #__content AS c"
           . "\n LEFT JOIN #__jcomments AS cc ON c.id = cc.object_id"
           . "\n LEFT JOIN #__categories AS ct ON ct.id = c.catid"
           . "\n WHERE c.state = 1"
           . "\n   AND c.access <= '$my->gid'"
           . "\n   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= NOW())"
           . "\n   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= NOW())"
           . "\n   AND cc.published = 1"
           . "\n   AND cc.object_group = 'com_content'"
           . ((!$catid && $sectionid) ? "\n   AND (c.sectionid IN ($sectionid) )" : '')
           . (count($exclude_sections) ? "\n AND (c.sectionid NOT IN (".implode(',', $exclude_sections).") )" : '')
           . ($catid ? "\n   AND (c.catid IN ($catid) )" : '')
           . (count($exclude_catids) ? "\n AND (c.catid NOT IN (".implode(',', $exclude_catids).") )" : '')
           . "\n GROUP BY c.id, c.title, c.sectionid"
           . ((JCOMMENTS_JVERSION == '1.5') ? ", slug, catslug" : '')
           . "\n ORDER BY commentdate DESC"
           . "\n LIMIT " . intval( $params->get( 'count' ) )
           ;
       $dbo->setQuery( $query );
       $rows = $dbo->loadObjectList();
       echo $dbo->getErrorMsg();

       if ( sizeof( $rows ) ) {
           echo '</pre>
<ul>'."\n";

           foreach( $rows as $row ) {

               $link = modJCommentsHelper::getContentLink($row);
               $link_title = $row->title;
               $link_text = $row->title;

               if ( $params->get( 'showcomments' ) ) {
                   $link_text .= ' (' . $row->comments . ')';
               }

               echo '"'.$link.'" title="'.$link_title.'">'.$link_text.''."\n";
           }
           echo '</ul>'."\n";<br>       }<br>   }<br><br>   function modJCommentsMostCommented( &$params )<br>   {<br>       global $mainframe, $my, $Itemid;<br><br>       $dbo = & JCommentsFactory::getDBO();<br><br>       $sectionid = intval($params->get('sectionid'));<br>       $exclude_sectionid = trim($params->get('exclude_sectionid', ''));<br>       $exclude_sections = array();<br>       if ($exclude_sectionid != '') {<br>           $exclude_sections = explode(',', $exclude_sectionid);<br>       }<br><br>       $catid = intval($params->get('catid'));<br>       $exclude_catid = trim($params->get('exclude_catid', ''));<br>       $exclude_catids = array();<br>       if ($exclude_catid != '') {<br>           $exclude_catids = explode(',', $exclude_catid);<br>       }<br><br>       $query = "SELECT c.id AS id, c.title AS title, c.sectionid"<br>           . ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug' : '')<br>           . ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(ct.alias) THEN CONCAT_WS(":", ct.id, ct.alias) ELSE ct.id END as catslug' : '')<br>           . "\n, COUNT(cc.id) AS comments, MAX(cc.date) AS commentdate"<br>           . "\n FROM #__content AS c"<br>           . "\n LEFT JOIN #__categories AS ct ON ct.id = c.catid"<br>           . "\n LEFT JOIN #__jcomments AS cc ON c.id = cc.object_id"<br>           . "\n WHERE c.state = 1"<br>           . "\n   AND c.access <= '$my->gid'"<br>           . "\n   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= NOW())"<br>           . "\n   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= NOW())"<br>           . "\n   AND cc.published = 1"<br>           . "\n   AND cc.object_group = 'com_content'"<br>           . ((!$catid && $sectionid) ? "\n   AND (c.sectionid IN ($sectionid) )" : '')<br>           . (count($exclude_sections) ? "\n AND (c.sectionid NOT IN (".implode(',', $exclude_sections).") )" : '')<br>           . ($catid ? "\n   AND (c.catid IN ($catid) )" : '')<br>           . (count($exclude_catids) ? "\n AND (c.catid NOT IN (".implode(',', $exclude_catids).") )" : '')<br>           . "\n GROUP BY c.id, c.title, c.sectionid"<br>           . ((JCOMMENTS_JVERSION == '1.5') ? ", slug, catslug" : '')<br>           . "\n ORDER BY comments DESC, c.created DESC"<br>           . "\n LIMIT " . intval( $params->get( 'count' ) )<br>           ;<br>       $dbo->setQuery( $query );<br>       $rows = $dbo->loadObjectList();<br><br>       if ( sizeof( $rows ) ) {<br>           echo '<ul>'."\n";

           foreach( $rows as $row ) {

               $link = modJCommentsHelper::getContentLink($row);
               $link_title = $row->title;
               $link_text = $row->title;

               if ($params->get('showcomments')) {
                   $link_text .= ' (' . $row->comments . ')';
               }

               echo '"'.$link.'" title="'.$link_title.'">'.$link_text.''."\n";
           }
           echo '</ul>'."\n";<br>       }<br>   }<br><br>   function modJCommentsLatest( &$params, $unpublished = false, $order = 'date' ) {<br>       global $mainframe, $my;<br><br>       $dbo = & JCommentsFactory::getDBO();<br>       $acl = & JCommentsFactory::getACL();<br>       $config = & JCommentsFactory::getConfig();<br><br>       $rows = modJCommentsHelper::getList($params, $unpublished, $order);<br><br>       if ( sizeof( $rows ) ) {<br>           $show_date = intval($params->get('show_date', 0));<br>           $show_author = intval($params->get('show_author', 0));<br>           $show_object_title = intval($params->get('show_object_title', 0));<br>           $show_comment_text = intval($params->get('show_comment_text', 1));<br>           $label4more = $params->get('label4more', 'More...');<br>           $label4author = $params->get('label4author', '');<br>           $dateformat = $params->get('dateformat', '%d.%m.%y %H:%M');<br>           $limit_object_title = $params->get('limit_object_title', 10);<br><br>           $showsmiles = intval($params->get('showsmiles'));<br>           $showgravatars = intval($params->get('avatar'));<br>           $avatar_size = intval($params->get('avatar_size', 32));<br>           $mambots = intval($params->get('mambots'));<br><br>           if ($avatar_size <= 0) {<br>               $avatar_size = 32;<br>           }<br><br>           if ($mambots) {<br>               require_once (JCOMMENTS_HELPERS . DS . 'plugin.php');<br>               JCommentsPluginHelper::importPlugin('jcomments');<br>               JCommentsPluginHelper::trigger('onBeforeDisplayCommentsList', array(&$rows));<br><br>               if ($acl->check('enable_gravatar')) {<br>                   JCommentsPluginHelper::trigger('onPrepareAvatars', array(&$rows));<br>               }<br>           }<br><br>           modJCommentsHelper::getModuleStyles($params);<br><br>           echo '<ul>'."\n";

           $bbcode = & JCommentsFactory::getBBCode();
           $smiles = & JCommentsFactory::getSmiles();
           $acl = & JCommentsFactory::getACL();

           $maxlen = intval( $params->get( 'length' ));

           foreach( $rows as $row ) {

               $link  = JCommentsObjectHelper::getLink( $row->object_id, $row->object_group);
               $title = JCommentsText::censor($row->comment );
               $title = $bbcode->filter( $title, true );
               $title = JCommentsText::fixLongWords( $title, $config->getInt('word_maxlength') );

               if ($acl->check('autolinkurls')) {
                   $title = preg_replace_callback( _JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $title);
               }


               $title = JCommentsText::cleanText($title);
               $title = JCommentsText::substr($title, $maxlen);

               $link_title = str_replace( '"', '', $title );
               $link_text = $title;

               switch($showsmiles) {
                   case 1:
                       $link_text = $smiles->replace($link_text);
                       break;
                   case 2:
                       $link_text = $smiles->strip($link_text);
                       break;
               }

               echo '';

               if ($showgravatars == 1) {
                   if ($row->avatar == '') {
                       echo '';
                   } else {
                       echo $row->avatar;
                   }                        
               }

               if ($show_object_title == 1) {
                   $title = JCommentsObjectHelper::getTitle( $row->object_id, $row->object_group );
                   $title = JCommentsText::substr($title, $limit_object_title);
                   $title = str_replace( '"', '', $title );

                   echo ''.$title.'
';
               }

               switch( $show_comment_text ) {
                   case 0:
                       echo ''.$link_text.'';
                       break;
                   case 1:
                       echo ''.$link_text.'';
                       break;
                   case 2:
                       echo ''.$link_text.' ';
                       echo ''.$label4more.'';
                       break;
               }

               if ($show_date == 1) {
                   echo '
' . JCommentsText::formatDate( $row->date, $dateformat ) . '';
               }


               switch( $show_author ) {
                   case 0:
                       break;
                   case 1:
                       echo '
' . ($label4author != '' ?  $label4author . ' ' : '') . $row->name;
                       break;
                   case 2:
                       echo '
' . ($label4author != '' ?  $label4author . ' ' : '') . ($row->username ? $row->username : $row->name);
                       break;
               }

               echo ''."\n";
           }
           echo '</ul>'."\n";<br><br>           $show_full_rss = intval( $params->get( 'show_full_rss', 0 ) );<br>           $label4rss = $params->get( 'label4rss', '' );<br><br>           if ( $show_full_rss == 1 ) {<br>               if (JCOMMENTS_JVERSION == '1.5') {<br>                   $rss_link = JoomlaTuneRoute::_('index.php?option=com_jcomments&task=rss_full&tmpl=component');<br>                   $rss_icon_link = JURI::base() . 'modules/mod_jcomments/images/rss.gif';<br>               } else {<br>                   $rss_link = $mainframe->getCfg( 'live_site' ) . '/index2.php?option=com_jcomments&task=rss_full&no_html=1';<br>                   $rss_icon_link = $mainframe->getCfg('live_site') . '/modules/jcomments/rss.gif';<br>               }<br>?><br><div align="center"></div>
<br><?php<br>           }<br>       }<br>   }<br>}<br><br>// Set default values for all possible module parameters.<br>$params->def( 'moduleclass_sfx', '' );<br>$params->def( 'count', 5 );<br>$params->def( 'length', 20 );<br>$params->def( 'type', 1 );<br>$params->def( 'showcomments', 0 );<br><br>switch ( intval( $params->get( 'type' ) ) ) {<br>   case 1:<br>       modJCommentsLatest( $params );<br>       break;<br>   case 2:<br>       modJCommentsLatestCommented( $params );<br>       break;<br>   case 3:<br>       modJCommentsMostCommented( $params );<br>       break;<br>   case 4:<br>       modJCommentsLatest( $params, true, 'date' );<br>       break;<br>   case 5:<br>       modJCommentsLatest( $params, false, 'vote' );<br>       break;<br>   default:<br>       modJCommentsLatest( $params );<br>       break;<br>}<br

تا به احتمال زیاد درست بشه

در پناه حق...

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

ممنونم ... اما وقتی کد را جایگزین کردم سایت بالا نیومد !

نسخه جدید تر این ماژول را نصب کردم ولی باز هم در صفحه جدید باز نمیشه

این کدش هست :

><?php
/**
* JComments Latest - show latest comments or latest commented content items items
*
* @version 2.2.9
* @package JComments
* @author smart (smart@joomlatune.ru)
* @copyright (C) 2006-2009 by smart (http://www.joomlatune.ru)
* @license GNU/GPL: http://www.gnu.org/copyleft/gpl.html
*
**/

// ensure this file is being included by a parent file
(defined('_VALID_MOS') OR defined('_JEXEC')) or die('Direct Access to this location is not allowed.');

// define directory separator short constant
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}

global $mainframe;

$comments = $mainframe->getCfg('absolute_path') . DS . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
if (file_exists($comments)) {
require_once ($comments);
} else {
return;
}

if ( !defined( '_JCOMMENTS_MODULE' ) ) {
define( '_JCOMMENTS_MODULE', 1 );

class modJCommentsHelper
{
	function getList($params, $unpublished = false, $orderby = 'date')
	{
		global $mainframe, $my;

		$dbo = & JCommentsFactory::getDBO();
		$acl = & JCommentsFactory::getACL();
		$config = & JCommentsFactory::getConfig();

		$object_group = trim($params->get('object_group', 'com_content'));
		$object_group = preg_replace('#[^0-9A-Za-z\-\_\,\.]#is', '', $object_group);

		switch($orderby)
		{
			case 'vote':
				$orderby = '(cc.isgood-cc.ispoor) DESC';
				break;
			case 'date':
			default:
				$orderby = 'cc.date DESC';
				break;
		}

		if ( $object_group == 'com_content' ) {

			$sectionid = intval($params->get('sectionid'));
			$exclude_sectionid = trim($params->get('exclude_sectionid', ''));
			$exclude_sections = array();
			if ($exclude_sectionid != '') {
				$exclude_sections = explode(',', $exclude_sectionid);
			}

			$catid = intval($params->get('catid'));
			$exclude_catid = trim($params->get('exclude_catid', ''));
			$exclude_catids = array();
			if ($exclude_catid != '') {
				$exclude_catids = explode(',', $exclude_catid);
			}

			if (JCOMMENTS_JVERSION == '1.0') {
				$now = date('Y-m-d H:i', time());
			} else {
				$date =& JFactory::getDate();
				$now = $date->toMySQL();
			}

			$query = "SELECT cc.id, cc.userid, cc.comment, cc.name, cc.username, cc.email, cc.date, cc.object_id, cc.object_group, '' as avatar "
				. "\n FROM #__jcomments AS cc"
				. "\n LEFT JOIN #__content AS c ON c.id = cc.object_id"
				. "\n WHERE cc.published = " . ($unpublished ? '0' : '1')
				. "\n   AND c.access <= '$my->gid'"
				. "\n   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= '$now')"
				. "\n   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= '$now')"
				. "\n   AND cc.object_group = 'com_content'"
				. ((!$catid && $sectionid) ? "\n   AND (c.sectionid IN ($sectionid) )" : '')
				. (count($exclude_sections) ? "\n AND (c.sectionid NOT IN (".implode(',', $exclude_sections).") )" : '')
				. ($catid ? "\n   AND (c.catid IN ($catid) )" : '')
				. (count($exclude_catids) ? "\n AND (c.catid NOT IN (".implode(',', $exclude_catids).") )" : '')
				. (JCommentsMultilingual::isEnabled() ? "\nAND cc.lang = '" . JCommentsMultilingual::getLanguage() . "'" : "")
				. "\n ORDER BY " . $orderby
				. "\n LIMIT " . intval( $params->get( 'count' ) )
				;
		} else {

			$groups = explode( ',', $object_group );

			$query = "SELECT cc.id, cc.userid, cc.comment, cc.name, cc.username, cc.email, cc.date, cc.object_id, cc.object_group, '' as avatar "
				. "\n FROM #__jcomments AS cc"
				. "\n WHERE cc.published = " . ($unpublished ? '0' : '1')
				. (count($groups) ? "\n   AND (cc.object_group = '" . implode( "' OR cc.object_group='", $groups ) . "')" : '')
				. (JCommentsMultilingual::isEnabled() ? "\nAND cc.lang = '" . JCommentsMultilingual::getLanguage() . "'" : "")
				. "\n ORDER BY " . $orderby
				. "\n LIMIT " . intval( $params->get( 'count' ) )
				;
		}

		$dbo->setQuery( $query );
		$rows = $dbo->loadObjectList();

		return $rows;
	}

	function getContentLink(&$row)
	{
		global $mainframe, $Itemid;

		if (JCOMMENTS_JVERSION == '1.5') {
			require_once (JPATH_ROOT.DS.'components'.DS.'com_content'.DS.'helpers'.DS.'route.php');
			$link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid)) . '#comments';
		} else {
			$compat = $mainframe->getCfg('itemid_compat');

			if ( $compat == null ) {
				// Joomla 1.0.12 or below
				if ( $Itemid && $Itemid != 99999999 ) {
					$_Itemid = $Itemid;
				} else {
					$_Itemid = $mainframe->getItemid( $row->id );
				}
			} else if ( (int) $compat > 0 && (int) $compat <= 11) {
				// Joomla 1.0.13 or higher and Joomla 1.0.11 compability
				$_Itemid = $mainframe->getItemid( $row->id, 0, 0  );
			} else {
				// Joomla 1.0.13 or higher and new Itemid algoritm
				$_Itemid = $Itemid;
			}

			$link = sefRelToAbs( 'index.php?option=com_content&task=view&id='. $row->id .'&Itemid='. $_Itemid );
		}
		return $link;
	}

	function getModuleStyles($params)
	{
		$moduleclass_sfx = $params->get('moduleclass_sfx');
		$avatar_size = intval($params->get('avatar_size', 32));
		$showgravatars = intval($params->get('avatar'));

		if ($avatar_size <= 0) {
			$avatar_size = 32;
		}

		ob_start();
		?>
ul.jclist<?php echo $moduleclass_sfx;?> { padding: 0; list-style-image: none; list-style-type: none; }
ul.jclist<?php echo $moduleclass_sfx;?> li {background-image: none; list-style: none; list-style-image: none; margin-left: 5px !important; margin-left: 0; display: block; overflow: hidden; }
<?php 
		if ($showgravatars == 1) {
?>
ul.jclist<?php echo $moduleclass_sfx;?> img { width: <?php echo $avatar_size; ?>px; height: <?php echo $avatar_size; ?>px; margin: 0 5px 5px 0;	float: left;}
<?php 
		}
?>
ul.jclist<?php echo $moduleclass_sfx;?> span img {width: auto; height: auto; float: none;}
<?php
		$_css = ob_get_contents();
		ob_end_clean();

		global $mainframe;
		$cacheEnabled = intval($mainframe->getCfg('caching')) == 1;

		if (JCOMMENTS_JVERSION == '1.5' && !$cacheEnabled) {
			$document = & JFactory::getDocument();
			$document->addStyleDeclaration($_css);
		} else {
			echo '';
		}
	}
}


function modJCommentsLatestCommented( &$params ) {
	global $my;

	$dbo = & JCommentsFactory::getDBO();

	$sectionid = intval($params->get('sectionid'));
	$exclude_sectionid = trim($params->get('exclude_sectionid', ''));
	$exclude_sections = array();
	if ($exclude_sectionid != '') {
		$exclude_sections = explode(',', $exclude_sectionid);
	}

	$catid = intval($params->get('catid'));
	$exclude_catid = trim($params->get('exclude_catid', ''));
	$exclude_catids = array();
	if ($exclude_catid != '') {
		$exclude_catids = explode(',', $exclude_catid);
	}

	if (JCOMMENTS_JVERSION == '1.0') {
		$now = date('Y-m-d H:i', time());
	} else {
		$date =& JFactory::getDate();
		$now = $date->toMySQL();
	}

	$query = "SELECT c.id AS id, c.title AS title, c.sectionid"
		. ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug' : '')
		. ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(ct.alias) THEN CONCAT_WS(":", ct.id, ct.alias) ELSE ct.id END as catslug' : '')
		. "\n, COUNT(cc.id) AS comments, MAX(cc.date) AS commentdate"
		. "\n FROM #__content AS c"
		. "\n LEFT JOIN #__jcomments AS cc ON c.id = cc.object_id"
		. "\n LEFT JOIN #__categories AS ct ON ct.id = c.catid"
		. "\n WHERE c.state = 1"
		. "\n   AND c.access <= '$my->gid'"
		. "\n   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= '$now')"
		. "\n   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= '$now')"
		. "\n   AND cc.published = 1"
		. "\n   AND cc.object_group = 'com_content'"
		. ((!$catid && $sectionid) ? "\n   AND (c.sectionid IN ($sectionid) )" : '')
		. (count($exclude_sections) ? "\n AND (c.sectionid NOT IN (".implode(',', $exclude_sections).") )" : '')
		. ($catid ? "\n   AND (c.catid IN ($catid) )" : '')
		. (count($exclude_catids) ? "\n AND (c.catid NOT IN (".implode(',', $exclude_catids).") )" : '')
		. "\n GROUP BY c.id, c.title, c.sectionid"
		. ((JCOMMENTS_JVERSION == '1.5') ? ", slug, catslug" : '')
		. "\n ORDER BY commentdate DESC"
		. "\n LIMIT " . intval( $params->get( 'count' ) )
		;
	$dbo->setQuery( $query );
	$rows = $dbo->loadObjectList();
	echo $dbo->getErrorMsg();

	if ( sizeof( $rows ) ) {

		modJCommentsHelper::getModuleStyles($params);

		echo '</pre>
<ul>'."\n";

		foreach( $rows as $row ) {

			$link = modJCommentsHelper::getContentLink($row);
			$link_title = $row->title;
			$link_text = $row->title;

			if ( $params->get( 'showcomments' ) ) { 
				$link_text .= ' (' . $row->comments . ')'; 
			}

			echo ''.$link_text.''."\n";
		}
		echo '</ul>'."\n";<br>	}<br>}<br><br>function modJCommentsMostCommented( &$params )<br>{<br>	global $my;<br><br>	$dbo = & JCommentsFactory::getDBO();<br><br>	$sectionid = intval($params->get('sectionid'));<br>	$exclude_sectionid = trim($params->get('exclude_sectionid', ''));<br>	$exclude_sections = array();<br>	if ($exclude_sectionid != '') {<br>		$exclude_sections = explode(',', $exclude_sectionid);<br>	}<br><br>	$catid = intval($params->get('catid'));<br>	$exclude_catid = trim($params->get('exclude_catid', ''));<br>	$exclude_catids = array();<br>	if ($exclude_catid != '') {<br>		$exclude_catids = explode(',', $exclude_catid);<br>	}<br><br>	if (JCOMMENTS_JVERSION == '1.0') {<br>		$now = date('Y-m-d H:i', time());<br>	} else {<br>		$date =& JFactory::getDate();<br>		$now = $date->toMySQL();<br>	}<br><br>	$query = "SELECT c.id AS id, c.title AS title, c.sectionid"<br>		. ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug' : '')<br>		. ((JCOMMENTS_JVERSION == '1.5') ? ', CASE WHEN CHAR_LENGTH(ct.alias) THEN CONCAT_WS(":", ct.id, ct.alias) ELSE ct.id END as catslug' : '')<br>		. "\n, COUNT(cc.id) AS comments, MAX(cc.date) AS commentdate"<br>		. "\n FROM #__content AS c"<br>		. "\n LEFT JOIN #__categories AS ct ON ct.id = c.catid"<br>		. "\n LEFT JOIN #__jcomments AS cc ON c.id = cc.object_id"<br>		. "\n WHERE c.state = 1"<br>		. "\n   AND c.access <= '$my->gid'"<br>		. "\n   AND (c.publish_up = '0000-00-00 00:00:00' OR c.publish_up <= '$now')"<br>		. "\n   AND (c.publish_down = '0000-00-00 00:00:00' OR c.publish_down >= '$now')"<br>		. "\n   AND cc.published = 1"<br>		. "\n   AND cc.object_group = 'com_content'"<br>		. ((!$catid && $sectionid) ? "\n   AND (c.sectionid IN ($sectionid) )" : '')<br>		. (count($exclude_sections) ? "\n AND (c.sectionid NOT IN (".implode(',', $exclude_sections).") )" : '')<br>		. ($catid ? "\n   AND (c.catid IN ($catid) )" : '')<br>		. (count($exclude_catids) ? "\n AND (c.catid NOT IN (".implode(',', $exclude_catids).") )" : '')<br>		. "\n GROUP BY c.id, c.title, c.sectionid"<br>		. ((JCOMMENTS_JVERSION == '1.5') ? ", slug, catslug" : '')<br>		. "\n ORDER BY comments DESC, c.created DESC"<br>		. "\n LIMIT " . intval( $params->get( 'count' ) )<br>		;<br>	$dbo->setQuery( $query );<br>	$rows = $dbo->loadObjectList();<br><br>	if ( sizeof( $rows ) ) {<br><br>		modJCommentsHelper::getModuleStyles($params);<br><br>		echo '<ul>'."\n";

		foreach( $rows as $row ) {

			$link = modJCommentsHelper::getContentLink($row);
			$link_title = $row->title;
			$link_text = $row->title;

			if ($params->get('showcomments')) {
				$link_text .= ' (' . $row->comments . ')';
			}

			echo ''.$link_text.''."\n";
		}
		echo '</ul>'."\n";<br>	}<br>}<br><br>function modJCommentsLatest( &$params, $unpublished = false, $order = 'date' ) {<br>	global $mainframe, $my;<br><br>	$dbo = & JCommentsFactory::getDBO();<br>	$acl = & JCommentsFactory::getACL();<br>	$config = & JCommentsFactory::getConfig();<br><br>	$rows = modJCommentsHelper::getList($params, $unpublished, $order);<br><br>	if ( sizeof( $rows ) ) {<br>		$show_date = intval($params->get('show_date', 0));<br>		$show_author = intval($params->get('show_author', 0));<br>		$show_object_title = intval($params->get('show_object_title', 0));<br>		$show_comment_text = intval($params->get('show_comment_text', 1));<br>		$label4more = $params->get('label4more', 'More...');<br>		$label4author = $params->get('label4author', '');<br>		$dateformat = $params->get('dateformat', '%d.%m.%y %H:%M');<br>		$limit_object_title = $params->get('limit_object_title', 10);<br><br>		$showsmiles = intval($params->get('showsmiles'));<br>		$showgravatars = intval($params->get('avatar'));<br>		$avatar_size = intval($params->get('avatar_size', 32));<br>		$mambots = intval($params->get('mambots'));<br><br>		if ($avatar_size <= 0) {<br>			$avatar_size = 32;<br>		}<br><br>		if ($mambots) {<br>			require_once (JCOMMENTS_HELPERS . DS . 'plugin.php');<br>			JCommentsPluginHelper::importPlugin('jcomments');<br>			JCommentsPluginHelper::trigger('onBeforeDisplayCommentsList', array(&$rows));<br><br>			if ($acl->check('enable_gravatar')) {<br>				JCommentsPluginHelper::trigger('onPrepareAvatars', array(&$rows));<br>			}<br>		}<br><br>		modJCommentsHelper::getModuleStyles($params);<br><br>		echo '<ul>'."\n";

		$bbcode = & JCommentsFactory::getBBCode();
		$smiles = & JCommentsFactory::getSmiles();
		$acl = & JCommentsFactory::getACL();

		$maxlen = intval( $params->get( 'length' ));

		foreach( $rows as $row ) {

			$link  = JCommentsObjectHelper::getLink( $row->object_id, $row->object_group);
			$title = JCommentsText::censor($row->comment );
			$title = $bbcode->filter( $title, true );
			$title = JCommentsText::fixLongWords( $title, $config->getInt('word_maxlength') );

			if ($acl->check('autolinkurls')) {
				$title = preg_replace_callback( _JC_REGEXP_LINK, array('JComments', 'urlProcessor'), $title);
			}

			$title = JCommentsText::cleanText($title);
			$title = JCommentsText::substr($title, $maxlen);

			$link_title = str_replace( '"', '', $title );
			$link_text = $title;

			switch($showsmiles) {
				case 1:
					$link_text = $smiles->replace($link_text);
					break;
				case 2:
					$link_text = $smiles->strip($link_text);
					break;
			}

			echo '';

			if ($showgravatars == 1) {
				if ($row->avatar == '') {
					echo '';
				} else {
					echo $row->avatar;
				}
			}

			if ($show_object_title == 1) {
				$title = JCommentsObjectHelper::getTitle( $row->object_id, $row->object_group );
				$title = JCommentsText::substr($title, $limit_object_title);
				$title = str_replace( '"', '', $title );

				echo ''.$title.'
';
			}

			switch( $show_comment_text ) {
				case 0:
					echo ''.$link_text.'';
					break;
				case 1:
					echo ''.$link_text.'';
					break;
				case 2:
					echo ''.$link_text.' ';
					echo ''.$label4more.'';
					break;
			}

			if ($show_date == 1) {
				echo '
' . JCommentsText::formatDate( $row->date, $dateformat ) . '';
			}

			switch( $show_author ) {
				case 0:
					break;
				case 1:
					echo '
' . ($label4author != '' ?  $label4author . ' ' : '') . $row->name;
					break;
				case 2:
					echo '
' . ($label4author != '' ?  $label4author . ' ' : '') . ($row->username ? $row->username : $row->name);
					break;
			}

			echo ''."\n";
		}
		echo '</ul>'."\n";<br><br>		$show_full_rss = intval( $params->get( 'show_full_rss', 0 ) );<br>		$label4rss = $params->get( 'label4rss', '' );<br><br>		if ( $show_full_rss == 1 ) {<br>			if (JCOMMENTS_JVERSION == '1.5') {<br>				$rss_link = JoomlaTuneRoute::_('index.php?option=com_jcomments&task=rss_full&tmpl=component');<br>				$rss_icon_link = JURI::base() . 'modules/mod_jcomments/images/rss.gif';<br>			} else {<br>				$rss_link = $mainframe->getCfg( 'live_site' ) . '/index2.php?option=com_jcomments&task=rss_full&no_html=1';<br>				$rss_icon_link = $mainframe->getCfg('live_site') . '/modules/jcomments/rss.gif';<br>			}<br>?><br><div align="center"></div>
<br><?php<br>		}<br>	}<br>}<br>}<br><br>// Set default values for all possible module parameters.<br>$params->def( 'moduleclass_sfx', '' );<br>$params->def( 'count', 5 );<br>$params->def( 'length', 20 );<br>$params->def( 'type', 1 );<br>$params->def( 'showcomments', 0 );<br><br>switch ( intval( $params->get( 'type' ) ) ) {<br>case 1:<br>	modJCommentsLatest( $params );<br>	break;<br>case 2:<br>	modJCommentsLatestCommented( $params );<br>	break;<br>case 3:<br>	modJCommentsMostCommented( $params );<br>	break;<br>case 4:<br>	modJCommentsLatest( $params, true, 'date' );<br>	break;<br>case 5:<br>	modJCommentsLatest( $params, false, 'vote' );<br>	break;<br>default:<br>	modJCommentsLatest( $params );<br>	break;<br>}<br>?&gt

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

این کد ربطی به بالا نیومدن سایت نداره

من فقط برای تگ های ،

target="_blank"

اضافه کردم

شاید شما در جایگزینی کد دقت نکردید!

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

من دقیقا همون کد را جایگزین کردم . چندین بار هم این کار را کردم ولی هر بار سایت صفحه سفید نشون میداد !


من دقیقا همون کد را جایگزین کردم . چندین بار هم این کار را کردم ولی هر بار سایت صفحه سفید نشون میداد !

این هم آدرس : www.m-fatemiyeh.com

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

دوستان لطف کنید یه مقدار زودتر راهنمایی کنید .

با تشکر

به اشتراک گذاری این ارسال


لینک به ارسال
به اشتراک گذاری در سایت های دیگر

به گفتگو بپیوندید

هم اکنون می توانید ارسال داشته باشید و بعد ثبت نام خود را در سایت کامل نمایید. اگر حساب کاربری در سایت دارید، جهت ارسال با حساب کاربری خود هم اکنون وارد سایت شوید

مهمان
ارسال پاسخ به این موضوع ...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.


×
×
  • افزودن...