Ошибки вообще не выдаёт, совсем не грузятся страницы с СВ.
<?php
/**
* LastView Tab Class for handling the CB tab api
* @version $Id$
* @package Community Builder
* @subpackage lastviews.php
* @author Trail
* @copyright (C) 2005-2006 Trail, www.djtrail.nl
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
class getLastViewsTab extends cbTabHandler {
/**
* Constructor
*/
function getLastViewsTab() {
$this->cbTabHandler();
}
КОД, КОТОРЫЙ ВСТАВЛЯЮ:
________________________________________________________________________
<?php
$isModerator=isModerator($_CB_framework->myId());
if(($_CB_framework->myId()!= $user->id) && !$isModerator) {
$isME=false;
} else {
if ($_CB_framework->myId() == $user->id) {
$isME=true;
} else {
$isME=false;
}
?>
______________________________________________________________________________
КОНЕЦ КОДА, КОТОРЫЙ ВСТАВЛЯЮ
function getDisplayTab($tab,$user,$ui) {
global $mosConfig_lang, $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_offset, $database, $my;
$return = "";
$params = $this->params;
$LVexclusionlist = $params->get('LVexclusionlistTXT', '0');
$LVdateformat = $params->get('LVdateformatOPTION', '0');
$LVadmingroup = $params->get('LVadmingroupTXT', '18');
$LVhideadmin = $params->get('LVhideadminOPTION', '1');
$LVhideguests = $params->get('LVhideguestsOPTION', '1');
$listlimit = $params->get('LVlistlimit', '10');
$LVthelast = $params->get('LVthelastTXT', 'The Last');
$LVadmin = $params->get('LVadminTXT', '(admin)');
$LVviews = $params->get('LVviewsTXT', 'views');
$LVavatar = $params->get('LVavatarTXT', 'Avatar');
$LVname = $params->get('LVnameTXT', 'Name');
$LVtime = $params->get('LVtimeTXT', 'Time');
$LVtotal = $params->get('LVtotalTXT', 'Total');
$LVguests = $params->get('LVguestsTXT', 'Guests have visited this profile.');
$LVshowtotal = $params->get('LVshowtotalOPTION', '0');
$LVhidetotal = $params->get('LVhidetotalOPTION', '0');
$LVusername = $params->get('LVusernameOPTION', '0');
$JPKarmaWare = $params->get('JPKarmaWareOPTION', '0');
if (trim($LVexclusionlist == '')) $LVexclusionlist = '0';
$dateFormat = '';
if ($LVdateformat == '0') {
$dateFormat = '%d/%m %H:%M';
} elseif ($LVdateformat == '1') {
$dateFormat = '%d-%m %H:%M';
} elseif ($LVdateformat == '2') {
$dateFormat = '%d/%m/%Y %H:%M';
} elseif ($LVdateformat == '3') {
$dateFormat = '%d-%m-%Y %H:%M';
} elseif ($LVdateformat == '4') {
$dateFormat = '%m/%d %H:%M';
} elseif ($LVdateformat == '5') {
$dateFormat = '%m-%d %H:%M';
} elseif ($LVdateformat == '6') {
$dateFormat = '%m/%d/%Y %H:%M';
} elseif ($LVdateformat == '7') {
$dateFormat = '%m-%d-%Y %H:%M';
} elseif ($LVdateformat == '98') {
$dateFormat = _DATE_FORMAT_LC;
} elseif ($LVdateformat == '99') {
$dateFormat = _DATE_FORMAT_LC2;
}
$sql =
"SELECT "
. "\n v.viewer_id, "
. "lastview, "
. "\n v.viewscount, c.avatar, c.avatarapproved, c.banned, u.username, u.name "
. "\n FROM "
. "\n `#__comprofiler_views` v, `#__comprofiler` c, `#__users` u "
. "\n WHERE "
. "\n v.profile_id = " . $database->getEscaped($user->id)
. "\n AND c.id=v.viewer_id "
. "\n AND u.id=c.id "
. "\n AND c.id NOT IN (" . $database->getEscaped($LVexclusionlist). ") "
. "\n ORDER BY "
. "\n v.lastview DESC "
. "\n LIMIT " . $database->getEscaped($listlimit);
$database->setQuery($sql);
$lastviews = $database->loadObjectList();
$viewercount=count($lastviews);
if($tab->description != null) {
$return .=
"<div class=\"tab_Description\">"
. unHtmlspecialchars(getLangDefinition($tab->description))
. "</div>";
}
$return =
"<table cellpadding=\"0\" cellspacing=\"2\" border=\"0\" width=\"95%\" align=\"center\">";
$colspan = 0;
$text = '';
$showLVtotal = true;
if (($my->id == $user->id || $LVshowtotal == '1') && $LVhidetotal != '0') {
$colspan = 4;
$text = htmlspecialchars("$LVthelast $viewercount $LVviews");
$showLVtotal = true;
} elseif ($my->id && ($my->gid == 2 || $my->gid > $LVadmingroup) && ($LVhideadmin != '0')) {
$colspan = 4;
$text = htmlspecialchars("$LVthelast $viewercount $LVviews $LVadmin");
$showLVtotal = true;
} else {
$colspan = 3;
$text = htmlspecialchars("$LVthelast $viewercount $LVviews");
$showLVtotal = false;
}
$return .=
"<tr>"
. "<td class=\"sectiontableheader\" colspan=\"$colspan\" align=\"center\">"
. "<nobr>"
. "<font size=\"4\">$text</font>"
. "</nobr>"
. "</td>"
. "</tr>"
. "<tr>"
. "<td colspan=\"$colspan\" height=\"1\"> </td>"
. "</tr>"
. "<tr>"
. "<td class=\"sectiontableheader\" align=\"center\">"
. "<b>" . htmlspecialchars($LVavatar). "</b>"
. "</td>"
. "<td class=\"sectiontableheader\" align=\"center\">"
. "<b>" . htmlspecialchars($LVname). "</b>"
. "</td>"
. "<td class=\"sectiontableheader\" align=\"center\">"
. "<b>" . htmlspecialchars($LVtime). "</b>"
. "</td>";
if ($showLVtotal) {
$return .=
"<td class=\"sectiontableheader\" align=\"center\">"
. "<b>" . htmlspecialchars($LVtotal). "</b>"
. "</td>";
}
$return .=
"</tr>";
if ( $LVhideguests != '0') {
$sql =
"SELECT "
. "\n count(viewer_id) "
. "\n FROM "
. "\n `#__comprofiler_views` "
. "\n WHERE "
. "\n profile_id = " . $database->getEscaped($user->id). " AND viewer_id = 0";
$database->setQuery($sql);
$guestscount = $database->loadResult();
}
if ($viewercount > 0) {
foreach ($lastviews as $lastview) {
//this cool sectiontableentry switch code line was contributed by viames :)
$class = (is_int(@$counter++ / 2)? 'sectiontableentry1' : 'sectiontableentry2');
if ($LVusername == '0') { $viewername = $lastview->username; }
if ($LVusername == '1') { $viewername = $lastview->name; }
if ($LVusername == '2') { $viewername = '' . $lastview->username . ' (' . $lastview->name . ')'; }
if ($LVusername == '3') { $viewername = '' . $lastview->name . ' (' . $lastview->username . ')'; }
if ($lastview->avatar && $lastview->banned != '1' && $lastview->avatarapproved !='0') {
$testimage = "/images/comprofiler/tn$lastview->avatar";
if (file_exists($mosConfig_absolute_path.$testimage)) {
$image = $mosConfig_live_site.$testimage;
} else {
$testimage = "/components/com_comprofiler/plugin/language/$mosConfig_lang/images/tnnophoto.jpg";
if (file_exists($mosConfig_absolute_path.$testimage)) {
$image = $mosConfig_live_site.$testimage;
} else {
$image = "$mosConfig_live_site/components/com_comprofiler/plugin/language/default_language/images/tnnophoto.jpg";
}
}
} else {
$testimage = "/components/com_comprofiler/plugin/language/$mosConfig_lang/images/tnnophoto.jpg";
if (file_exists($mosConfig_absolute_path.$testimage)) {
$image = $mosConfig_live_site.$testimage;
} else {
$image = "$mosConfig_live_site/components/com_comprofiler/plugin/language/default_language/images/tnnophoto.jpg";
}
}
$return.=
"<tr>"
. "<td class=\"$class\" width=\"1%\" align=\"center\">"
. "<font size=\"-3\">"
. "<nobr> "
. "<a href=\""
. JRoute::_("index.php?option=com_comprofiler&task=userProfile&user=$lastview->viewer_id")
. "\">"
. "<img border=\"0\" height=\"40\" src=\"$image\">"
. "</a>"
. " </nobr>"
. "</font>"
. "</td>"
. "<td class=\"$class\" align=\"center\">"
. "<font size=\"-3\">"
. "<nobr> "
. "<a href=\""
. JRoute::_("index.php?option=com_comprofiler&task=userProfile&user=$lastview->viewer_id")
. "\">"
. "<b>" . htmlspecialchars($viewername). "</b>"
. "</a>"
. " </nobr>"
. "</font>"
. "</td>"
. "<td class=\"$class\" align=\"center\">"
. "<font size=\"-3\">"
. "<nobr> "
. "<b>" . JHTML::_('date', $lastview->lastview, $dateFormat, "1"). "</b>"
. " </nobr>"
. "</font>"
. "</td>";
if ( $showLVtotal ) {
$return .=
"<td class=\"$class\" width=\"1%\" align=\"center\">"
. "<font size=\"-3\">"
. "<nobr> "
. "<b>$lastview->viewscount</b>"
. " </nobr>"
. "</font>"
. "</td>";
}
$return.="</tr>";
}
if ( $LVhideguests != '0') {
$return .=
"<tr>"
. "<td colspan=\"$colspan\" height=\"1\"> </td>"
. "</tr>"
. "<tr>"
. "<td colspan=\"$colspan\" class=\"sectiontableheader\" align=\"center\">"
. "<font size=\"2\">"
. "<nobr> "
. "<b>$guestscount " . htmlspecialchars($LVguests). "</b>"
. " </nobr>"
. "</font>"
. "</td>"
. "</tr>";
}
if ($JPKarmaWare != '1') {
}
$return .=
"</table>";
return $return;
}
} //end getDisplayTab
} //end class getLastViewsTab.
?>
находятся внутри такого же блока? Однако пробовал вставить кусок данного кода без них - результат тот же, пробовал вставить кусок кода целиком как есть только в самый верх файла - тот же самый результат
.