NogDog;10890283 wrote:There is no parse error in the code that coldwerturkey posted, so you'll need to show us line 2171 ( :eek: ) of the class_bbcode.php file along with a few lines before it in order for us to determine if it's some simple syntax error there.
Thank you here is the code:
/**
* Returns whether this parser is a WYSIWYG parser. Useful to change
* behavior slightly for a WYSIWYG parser without rewriting code.
*
* @return bool True if it is; false otherwise
*/
function is_wysiwyg()
{
return false;
}
}
// ####################################################################
if (!function_exists('stripos'))
//line 2171{
/**
* Case-insensitive version of strpos(). Defined if it does not exist.
*
* @param string Text to search for
* @param string Text to search in
* @param int Position to start search at
*
* @param int|false Position of text if found, false otherwise
*/
function stripos($haystack, $needle, $offset = 0)
{
$foundstring = stristr(substr($haystack, $offset), $needle);
return $foundstring === false ? false : strlen($haystack) - strlen($foundstring);
}
}
Here is where i"m posting the code starting line 1776
/**
* Handles a [url] tag. Creates a link to another web page.
*
* @param string If tag has option, the displayable name. Else, the URL.
* @param string If tag has option, the URL.
*
* @return string HTML representation of the tag.
*/
function handle_bbcode_url($text, $link)
{
$rightlink = trim($link);
if (empty($rightlink))
{
// no option -- use param
$rightlink = trim($text);
}
$rightlink = str_replace(array('`', '"', "'", '['), array('`', '"', ''', '['), $this->strip_smilies($rightlink));
// remove double spaces -- fixes issues with wordwrap
$rightlink = str_replace(' ', '', $rightlink);
if (!preg_match('#^[a-z0-9]+(?<!about|javascript|vbscript|data):#si', $rightlink))
{
$rightlink = "http://$rightlink";
}
if (!trim($link) OR str_replace(' ', '', $text) == $rightlink)
{
$tmp = unhtmlspecialchars($rightlink);
if (vbstrlen($tmp) > 55 AND $this->is_wysiwyg() == false)
{
$text = htmlspecialchars_uni(substr($tmp, 0, 36) . '...' . substr($tmp, -14));
}
else
{
// under the 55 chars length, don't wordwrap this
$text = str_replace(' ', '', $text);
}
}
//Get path, ie www.domain.com
$urlpath = parse_url($rightlink);
//domains not to be used with domainname.com
$exception = "123.com";
//If the path of the url contains or matches the exception.. don't use domain.com link
if(strpos($urlpath['path'], $exception) || $urlpath['path'] === $exception) {
return "<a href=\"$rightlink\">$text</a>";
} else {
//If the path of the url doesn't matches the exception.. make link a domain.com link
$rightlink='http://www.domianname.com?GO*'.bin2hex($rightlink);
return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";
}
i replaced the originals domain names and left 123.com as an example.
Thank you