Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Feb 2007
Posts: 329
Yarp™
Yarp™
Offline
Joined: Feb 2007
Posts: 329
I would like it if images are converted to normal links when you quote a message. Quote on quote on quote looks pretty horrible, and with images, even worse.

I have the PHP part...

Just before

Code
		$QuoteBody = "
Originally Posted by $ResUsername
$RawBody
";

in /scripts/newreply.inc.php

add

Code
		$RawBody=preg_replace("#\[img\]([^?\['\"]+?)\.(gif|png|jpg|jpeg)\[/img\]#i", '\1.\2 ',$RawBody);
$RawBody=preg_replace("#\[image\]([^?\['\"]+?)\.(gif|png|jpg|jpeg)\[/image\]#i", '\1.\2 ',$RawBody);
$RawBody=preg_replace("#\[img:(left|right|center)\]([^?\['\"]+?)\.(gif|png|jpg|jpeg)\[/img\]#i", '\2.\3 ',$RawBody);
$RawBody=preg_replace("#\[image:(left|right|center)\]([^?\['\"]+?)\.(gif|png|jpg|jpeg)\[/image\]#i", '\2.\3 ',$RawBody);

But I also need to hack ubb_js/quickquote.js just before the line

Code
			obj.Body.value += '
Originally Posted by ' + quoted + '
' + postBody + '
';

But javascript and me are not best friends (in fact, we met 5 minutes ago laugh ). Can anyone help me port above code to javascript?

Above expressions remove the [img] tags, and add a space behind. Just in case somebody put some images right next to each other.

Sponsored Links
Entire Thread
Subject Posted By Posted
Remove [img] tags when quoting a message... blaaskaak 04/28/2007 11:29 PM
Re: Remove [img] tags when quoting a message... sirdude 08/27/2007 9:07 AM
Re: Remove [img] tags when quoting a message... sirdude 08/27/2007 11:12 PM
Re: Remove [img] tags when quoting a message... blaaskaak 08/27/2007 11:18 PM
Re: Remove [img] tags when quoting a message... sirdude 08/27/2007 11:22 PM
Re: Remove [img] tags when quoting a message... sirdude 08/27/2007 11:26 PM
Re: Remove [img] tags when quoting a message... sirdude 08/27/2007 11:31 PM
Re: Remove [img] tags when quoting a message... blaaskaak 08/27/2007 11:46 PM
Re: Remove [img] tags when quoting a message... sirdude 08/27/2007 11:52 PM
Re: Remove [img] tags when quoting a message... sirdude 08/28/2007 12:09 AM
Re: Remove [img] tags when quoting a message... blaaskaak 08/28/2007 7:33 AM
Re: Remove [img] tags when quoting a message... sirdude 08/28/2007 7:56 AM
Re: Remove [img] tags when quoting a message... blaaskaak 08/28/2007 8:47 AM
Re: Remove [img] tags when quoting a message... sirdude 08/28/2007 6:42 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Posts: 70
Joined: January 2007
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)