Хак для Datso Gallery 1.6;
Подпись из Fireboard 1.0.3 и выше и из CommunityBuilder 1.0 и выше
sub_viewdetails.php(находится в components/com_datsogallery/) находим:
if ($ad_bbcodesupport){
require_once($mosConfig_absolute_path."/administrator/components/com_datsogallery/images.datsogallery.php");
$origtext=bb_decode($origtext);
}
echo "<td width='70%' valign='top'>";
echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px solid #ccc'>\n";
echo "<tr>\n";
echo "<td width='16'><img src='$gallerypath/images/dgtime.gif' alt='' /></td><td>"._DG_COMM_ADDED.": $signtime </td>\n";
if ($is_editor) {
echo "<td width='16'><img src='$gallerypath/images/ip.gif' title='$row1->cmtip' border='0' alt='' /></td>";
echo "<td width='16'><a href='" . sefRelToAbs("$dgurl&func=deletecomment&catid=$catid&cmtid=$row1->cmtid") . "'>";
echo "<img src='$gallerypath/images/del.gif' title='". _DG_DELETE_COMMENT."' border='0' alt='' /></a></td>";
}
echo "</tr>\n";
echo "</table>";
echo "<p>".$origtext."</p>";
echo "</td>\n</tr>\n";
$line++;
Для Fireboard меняем на:
if ($ad_bbcodesupport){
require_once($mosConfig_absolute_path."/administrator/components/com_datsogallery/images.datsogallery.php");
$origtext=bb_decode($origtext);
}
echo "<td width='70%' valign='top'>";
echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px solid #ccc'>\n";
echo "<tr>\n";
echo "<td width='16'><img src='$gallerypath/images/dgtime.gif' alt='' /></td><td>"._DG_COMM_ADDED.": $signtime </td>\n";
if ($is_editor) {
echo "<td width='16'><img src='$gallerypath/images/ip.gif' title='$row1->cmtip' border='0' alt='' /></td>";
echo "<td width='16'><a href='" . sefRelToAbs("$dgurl&func=deletecomment&catid=$catid&cmtid=$row1->cmtid") . "'>";
echo "<img src='$gallerypath/images/del.gif' title='". _DG_DELETE_COMMENT."' border='0' alt='' /></a></td>";
}
echo "</tr>\n";
echo "</table>";
echo "<p>".$origtext."</p>";
$database->setQuery("select signature from #__fb_users as su "."\nLEFT JOIN #__users as u on u.id=su.userid WHERE u.username='$row1->cmtname'");
$signature = $database->loadResult();
$msg_signature = $signature;
if ($msg_signature) {
?>
<style type="text/css">
div.msgsignature{border-top: dotted 1px #ccc;text-align: left;color:#999;padding-top: 10px;}
</style>
<div class="msgsignature" >
<?php
if ($ad_bbcodesupport){
$msg_signature=bb_decode($msg_signature);
}
echo $msg_signature;
}
echo "</td>\n</tr>\n";
$line++;
Для CommunityBuilder меняем на:
if ($ad_bbcodesupport){
require_once($mosConfig_absolute_path."/administrator/components/com_datsogallery/images.datsogallery.php");
$origtext=bb_decode($origtext);
}
echo "<td width='70%' valign='top'>";
echo "<table width='100%' cellpadding='0' cellspacing='0' style='border-bottom:1px solid #ccc'>\n";
echo "<tr>\n";
echo "<td width='16'><img src='$gallerypath/images/dgtime.gif' alt='' /></td><td>"._DG_COMM_ADDED.": $signtime </td>\n";
if ($is_editor) {
echo "<td width='16'><img src='$gallerypath/images/ip.gif' title='$row1->cmtip' border='0' alt='' /></td>";
echo "<td width='16'><a href='" . sefRelToAbs("$dgurl&func=deletecomment&catid=$catid&cmtid=$row1->cmtid") . "'>";
echo "<img src='$gallerypath/images/del.gif' title='". _DG_DELETE_COMMENT."' border='0' alt='' /></a></td>";
}
echo "</tr>\n";
echo "</table>";
echo "<p>".$origtext."</p>";
$database->setQuery("select fbsignature from #__comprofiler as su "."\nLEFT JOIN #__users as u on u.id=su.user_id WHERE u.username='$row1->cmtname'");
$signature = $database->loadResult();
$msg_signature = $signature;
if ($msg_signature) {
?>
<style type="text/css">
div.msgsignature{border-top: dotted 1px #ccc;text-align: left;color:#999;padding-top: 10px;}
</style>
<div class="msgsignature" >
<?php
if ($ad_bbcodesupport){
$msg_signature=bb_decode($msg_signature);
}
echo $msg_signature;
}
echo "</td>\n</tr>\n";
$line++;
Далее я сделал хак для стандартных ББ кодов, которые поддерживает Fireboard, но не поддерживает Datsogallery 1.6.(Это нужно выполнить, что для Fireboard, что для CommunityBuilder)
images.datsogallery.php(находится в administrator/components/com_datsogallery/) находим:
function bb_decode ($text) {
global $mosConfig_live_site;
$gallerypath = $mosConfig_live_site . "/components/com_datsogallery";
$text = nl2br($text);
static $bbcode_tpl = array();
static $patterns = array();
static $replacements = array();
if ((strpos($text, "[") === false || strpos($text, "]") === false)) {
return $text;
}
И после дописываем:
$text = str_replace("[img]", '<img src="', $text);
$text = str_replace("[/img]", '"/>', $text);
$text = str_replace("[IMG]", '<img src="', $text);
$text = str_replace("[/IMG]", '"/>', $text);
$text = str_replace("[size=1]", "<span style='font-size:1'>", $text);
$text = str_replace("[size=2]", "<span style='font-size:2'>", $text);
$text = str_replace("[size=3]", "<span style='font-size:3'>", $text);
$text = str_replace("[size=4]", "<span style='font-size:4'>", $text);
$text = str_replace("[size=5]", "<span style='font-size:5'>", $text);
$text = str_replace("[size=6]", "<span style='font-size:6'>", $text);
$text = str_replace("[/size]", '</span>', $text);
$text = str_replace("[color=#FF0000]", "<span style='color: #FF0000'>", $text);
$text = str_replace("[color=#800080]", "<span style='color: #800080'>", $text);
$text = str_replace("[color=#0000FF]", "<span style='color: #0000FF'>", $text);
$text = str_replace("[color=#008000]", "<span style='color: #008000'>", $text);
$text = str_replace("[color=#FFFF00]", "<span style='color: #FFFF00'>", $text);
$text = str_replace("[color=#FF6600]", "<span style='color: #FF6600'>", $text);
$text = str_replace("[color=#000080]", "<span style='color: #000080'>", $text);
$text = str_replace("[color=#825900]", "<span style='color: #825900'>", $text);
$text = str_replace("[color=#9A9C02]", "<span style='color: #9A9C02'>", $text);
$text = str_replace("[color=#A7A7A7]", "<span style='color: #A7A7A7'>", $text);
$text = str_replace("[/color]", '</span>', $text);
Наслаждайтесь
P.S.: Исправлена проверка на отображение ББ кодов в комментарии и в подписи. 9.06.2008