Code: Select all
/**
* Parse BBCode
*/
function parse_bbcode()
{
if (!$this->bbcodes)
{
$this->bbcode_init();
}
global $user;
Code: Select all
//Start MOD Convert quoted images to url
preg_match_all('#\[quote(.*?)\](.*?)\[/quote\]#si', $this->message, $qmatch );
foreach ($qmatch[2]as $qmatchin){
preg_match_all('#\[code\](.*?)\[/code\]#is', $qmatchin, $qcode);
$crepl = str_replace('[img]', '[img]', $qcode[1]);
$replacement = str_replace($qcode[1], $crepl, $qmatchin);
$replacement = preg_replace('#\[url=\n*(.*(jpg|jpeg|gif|png|bmp))\n*\]\n*\[img\]\n*(.*)\n*\[/img\]\n*\[/url\]#iU', '[ [url=$1]'. $user->lang['IMAGE'] .'[/url] ]', $replacement);
$replacement = preg_replace('#\[url=\n*(.*)\n*\]\n*\[img\]\n*(.*)\n*\[/img\]\n*\[/url\]#iU', '[ [url=$1]'. $user->lang['IMAGE'] .'[/url] ]', $replacement);
$replacement = preg_replace('#\[img\]\n*(.*)\n*\[/img\]#iU', '[ [url=$1]'. $user->lang['IMAGE'] .'[/url] ]', $replacement);
$this->message = str_replace($qmatchin, $replacement, $this->message);
$this->message = str_replace($crepl, $qcode[1], $this->message);
}
//End MOD Convert quoted images to url
Code: Select all
[phpBB Debug] PHP Notice: in file /includes/message_parser.php on line 44: Undefined variable: user
[phpBB Debug] PHP Notice: in file /includes/message_parser.php on line 44: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/message_parser.php on line 45: Undefined variable: user
[phpBB Debug] PHP Notice: in file /includes/message_parser.php on line 45: Trying to get property of non-object
[phpBB Debug] PHP Notice: in file /includes/message_parser.php on line 46: Undefined variable: user
[phpBB Debug] PHP Notice: in file /includes/message_parser.php on line 46: Trying to get property of non-object
Code: Select all
$qres = preg_replace('#\[url=(.*(jpg|jpeg|gif|png|bmp))\]\[img\].*\[/img\]\[/url\]#iU', '[ [url=\1]'. $user->lang['IMAGE'] .'[/url] ]', $qmatchin);
$qres = preg_replace('#\[url=.*\]\[img\](.*)\[/img\]\[/url\]#iU', '[ [url=\1]'. $user->lang['IMAGE'] .'[/url] ]', $qmatchin);
$qres = preg_replace('#\[img\](.*)\[/img\]#iU', '[ [url=\1]'. $user->lang['IMAGE'] .'[/url] ]', $qmatchin);
maverick wrote:test
[ http://www.navone.org/blogger/uploaded_ ... 749751.png ]
Code: Select all
if (!$this->bbcodes)
{
$this->bbcode_init();
}
global $user;
Code: Select all
//Start MOD Convert quoted images to url
preg_match_all('#\[quote(.*?)\](.*?)\[/quote\]#si', $this->message, $qmatch );
foreach ($qmatch[2]as $qmatchin){
$qres = preg_replace('#\[url=(.*(jpg|jpeg|gif|png|bmp))\]\[img\].*\[/img\]\[/url\]#iUs', '[ [url=\1]'. $user->lang['IMAGE'] .'[/url] ]', $qmatchin);
$qres = preg_replace('#\[url=.*\]\[img\](.*)\[/img\]\[/url\]#iUs', '[ [url=\1]'. $user->lang['IMAGE'] .'[/url] ]', $qmatchin);
$qres = preg_replace('#\[img\](.*)\[/img\]#iUs', '[ [url=\1]'. $user->lang['IMAGE'] .'[/url] ]', $qmatchin);
$this->message = str_replace($qmatchin, $qres, $this->message);
}
//End MOD Convert quoted images to url