2007-03-24, 03:21 PM
2007-03-24, 06:59 PM
I assume you are talking about post images.
Open ./inc/class_parser.php
Find
Change icons.gif to the name and path of your custom icon.
Open ./inc/class_parser.php
Find
function mycode_parse_img($url, $dimensions=array(), $align='')
{
$url = trim($url);
$url = str_replace("\n", "", $url);
$url = str_replace("\r", "", $url);
if($align == "right")
{
$css_align = " style=\"float: right;\"";
}
else if($align == "left")
{
$css_align = " style=\"float: left;\"";
}
if($dimensions[0] > 0 && $dimensions[1] > 0)
{
return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"\"{$css_align} />";
}
else
{
return "<img src=\"{$url}\" border=\"0\" alt=\"\"{$css_align} />";
}
}
replace with function mycode_parse_img($url, $dimensions=array(), $align='')
{
global $mybb;
if($mybb->user['uid'] > 0)
{
$url = trim($url);
$url = str_replace("\n", "", $url);
$url = str_replace("\r", "", $url);
if($align == "right")
{
$css_align = " style=\"float: right;\"";
}
else if($align == "left")
{
$css_align = " style=\"float: left;\"";
}
if($dimensions[0] > 0 && $dimensions[1] > 0)
{
return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"\"{$css_align} />";
}
else
{
return "<img src=\"{$url}\" border=\"0\" alt=\"\"{$css_align} />";
}
}
else
{
return "<img src=\"icons.gif\" border=\"0\" alt=\"\" />";
}
}
Change icons.gif to the name and path of your custom icon.
2007-03-25, 03:36 AM
Thank you, i'l try first. do you have /know forum that use this script or any others?
zaher1988 Wrote:I assume you are talking about post images.
Open ./inc/class_parser.php
Find
replace withfunction mycode_parse_img($url, $dimensions=array(), $align='') { $url = trim($url); $url = str_replace("\n", "", $url); $url = str_replace("\r", "", $url); if($align == "right") { $css_align = " style=\"float: right;\""; } else if($align == "left") { $css_align = " style=\"float: left;\""; } if($dimensions[0] > 0 && $dimensions[1] > 0) { return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"\"{$css_align} />"; } else { return "<img src=\"{$url}\" border=\"0\" alt=\"\"{$css_align} />"; } }
function mycode_parse_img($url, $dimensions=array(), $align='') { global $mybb; if($mybb->user['uid'] > 0) { $url = trim($url); $url = str_replace("\n", "", $url); $url = str_replace("\r", "", $url); if($align == "right") { $css_align = " style=\"float: right;\""; } else if($align == "left") { $css_align = " style=\"float: left;\""; } if($dimensions[0] > 0 && $dimensions[1] > 0) { return "<img src=\"{$url}\" width=\"{$dimensions[0]}\" height=\"{$dimensions[1]}\" border=\"0\" alt=\"\"{$css_align} />"; } else { return "<img src=\"{$url}\" border=\"0\" alt=\"\"{$css_align} />"; } } else { return "<img src=\"icons.gif\" border=\"0\" alt=\"\" />"; } }
Change icons.gif to the name and path of your custom icon.
2007-03-25, 06:37 PM
dyota Wrote:Thank you, i'l try first. do you have /know forum that use this script or any others?
No on has asked this before as far as i know. I have coded and tested that yesterday. You can try it on a localhosted website in case you are afraid.