Page 3 of 5

Posted: Wed Sep 20, 2006 3:43 am
by Dann0
edit

Posted: Wed Sep 20, 2006 11:12 am
by 3Di
sergemeister wrote: If in a previous post, a user has multiple past quotes and has text inserted between these multiple quotes, this mod will only quote the last portion of text after the last quote. It will not quote all the text from the previous post. Feature, bug or unique characteristic of this mod?


call it whatever you want but bug, yes

Posted: Wed Sep 20, 2006 11:14 am
by 3Di
xpider wrote: Hi, first, sorry for my bad english.

If I quote a mensage with img like this

Code: Select all

[img]http://www.xgn.com.br/fr/img/4416bd81c8346.jpg[/img]
The quoted msg replaces img codes with url, like this:

Code: Select all

[quote]Image Replaced With URL For Only One Quote MOD: http://www.xgn.com.br/fr/url/4416bd81c8346.jpg
[/quote]
The correct msg:

Code: Select all

[quote]
Image Replaced With URL For Only One Quote MOD: http://www.xgn.com.br/fr/img/4416bd81c8346.jpg
[/quote]

Any suggestion??

[]s


Yes, rename your img folder whit another name, img is automatically replaced by the code.

IE:
this
http://www.xgn.com.br/fr/img/4416bd81c8346.jpg
with
http://www.xgn.com.br/fr/images/4416bd81c8346.jpg

greets

Re: [2.0.18] This is Only One Quote

Posted: Sun May 13, 2007 11:28 am
by 3Di
http://www.phpbb.com/community/viewtopi ... 4#p1848564

The above link leads to a post of mine where you'll find the phpBB 2.0.22 compatible script, not yet validated by the MOD Team though. No changes to the code, just amended the script (FIND actions).

Greets

Re: [2.0.18] This is Only One Quote

Posted: Mon Jul 23, 2007 4:51 pm
by NOOF
Hello, I've installed this mod, and I'm trying to understand one part of it.

Part of the MOD has a language file edited so that sometimes when a user quotes it will come back with 'quote does not exist!'. What I'm trying to figure out is why that actually comes up? I thought I saw where it said that will come up if the user is not quoting any content. On my forum, it seems like it will come up if there is a message with quoted text, followed by fairly lengthy text in the next message and then someone hits quote on that one.

In other words.
QUOTED text
New Message

Now someone comes along and hits quote on that one. It should only quote the new message text, which is what the mod is for, but instead gives this 'quote does not exist' message.

Any thoughts?

Thanks

Re: [2.0.18] This is Only One Quote

Posted: Mon Jul 23, 2007 7:09 pm
by 3Di
NOOF wrote:Hello, I've installed this mod, and I'm trying to understand one part of it.

Part of the MOD has a language file edited so that sometimes when a user quotes it will come back with 'quote does not exist!'. What I'm trying to figure out is why that actually comes up? I thought I saw where it said that will come up if the user is not quoting any content. On my forum, it seems like it will come up if there is a message with quoted text, followed by fairly lengthy text in the next message and then someone hits quote on that one.

In other words.
QUOTED text
New Message

Now someone comes along and hits quote on that one. It should only quote the new message text, which is what the mod is for, but instead gives this 'quote does not exist' message.

Any thoughts?

Thanks
There should be a problem into yours posting.php file, also privmsg.php needs a check then. Please provide via PM those two files, I'll give them a shot.

Re: [2.0.18] This is Only One Quote

Posted: Sat Sep 01, 2007 4:28 pm
by Jochser1
Great MOD; works fine on my 2.0.22 board. For those who, like me, want to stop people from quoting images, but keep the nested quoting, here's the slightly altered code. Thanks to my co-admin who did the alterations :p

Code: Select all

##############################################################
## MOD Title:		This is Only One Quote
## MOD Author:		3Di < threed3di@users.sourceforge.net > (Marco) http://threed.5gbfree.com/ipcf/index.php
## MOD Description:	No more nested quotes.
##			Only the last message quoted it is shown in Topics and PMs.
##			BBcode it is always ON to prevent broken layouts if users might want to disallow it.
##			Quoted images are converted to URLs.
##			If no content is quoted then the MOD puts a standard (customizable) message into that quote.
##			SQL added to set the BBcode ON for all Users in one shot.
##
## MOD Version: 1.0.2a
## 
## Installation Level: Easy
## Installation Time: 5 minutes
## Files To Edit: 
##
## posting.php
## privmsg.php
## language/lang_english/lang_main.php
## templates/subSilver/profile_add_body.tpl
##
## Included Files: N/A
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: 
##
## DISABLE your board before to MOD it!
##
##############################################################
## MOD History:
##
## 2007-05-13 - Version 1.0.2a
## - small change to a FIND and a fake FIND added, for phpBB 2.0.22's compatibility
## - the code is still the same, so no changes
##
## 2005-11-05 - Version 1.0.2
## - cosmetic changes to template
## - fixed an erroneous FIND
## - tested on 2.0.18
## - The MOD passed the MOD pre-validation process
## - MOD submitted
##
## 2005-10-23 - Version 1.0.1
## - added returns 'Last quote does not exists!' if the last post is empty
## - (tip learnt from the 'Remove quotes from Search Results' MOD)
## - added the whole thing also to PMs
## - tested on localhost 2.0.17 phpBB
## - The MOD passed the MOD pre-validation process
## - MOD submitted
##
## 2005-10-21 - Version 1.0.0
## - changed version number to submitt
## - The MOD passed the MOD pre-validation process
## - MOD submitted
##
## 2005-10-15 - Version 0.5.0 BETA
## - script reviewed
## - added image quoted converted as URL (thanks poyntesm)
## - added the whole thing also to PMs
## - tested on localhost 2.0.17 phpBB
## - 
## 2005-10-12 - Version 0.1.0 BETA
## - code re written
## - added SQL 
##
## 2005-08-24 - Version 0.0.1
## - first release
## 
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
##############################################################
#
#-----[ DIY INSTRUCTIONS ]------------------------------------
#
If you're MODding your Forum manually please follow this:

1 - DISABLE YOUR BOARD FIRST!

2 - RUN THE QUERY VIA PHPMYADMIN OR SIMILAR TOOL

3 - MOD THE FILES AND UPLOAD THE STUFF

#
#-----[ SQL ]-------------------------------------------------
#
UPDATE phpbb_users SET user_allowbbcode = 1;

#
#-----[ OPEN ]------------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------------
#
# The line to search is longer.. 
#
			// Use trim to get rid of spaces placed there by MS-SQL 2000
			$quote_username = 
#
#-----[ AFTER, ADD ]------------------------------------------
#
// + This is Only One Quote MOD
			{  
				$message = ( !empty($message) ) ? preg_replace('[/img]', '/url', $message) : '';
				$message = ( !empty($message) ) ? preg_replace('/\[img]/', $lang['Image_url'], $message) : '';
			}
			if ( trim($message) == '' )
			{
				$message = $lang['No_quote_inside'];
			}
// - This is Only One Quote MOD
#
#-----[ OPEN ]------------------------------------------------
#
privmsg.php
#
#-----[ FIND ]------------------------------------------------
#
			if ( $mode == 'quote' )
#
# no further action here, just go to the next FIND ;)
#
#-----[ FIND ]------------------------------------------
#
				$privmsg_message = str_replace('<br />', "\n", $privmsg_message);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// + This is Only One Quote MOD
				{  
					$privmsg_message = ( !empty($privmsg_message) ) ? preg_replace('[/img]', '/url', $privmsg_message) : '';
					$privmsg_message = ( !empty($privmsg_message) ) ? preg_replace('/\[img]/', $lang['Image_url'], $privmsg_message) : '';
				}
				if ( trim($privmsg_message) == '' )
				{
					$privmsg_message = $lang['No_quote_inside'];
				}
// - This is Only One Quote MOD
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
$lang['Reply_with_quote'] = 'Reply with quote';
#
#-----[ AFTER, ADD ]------------------------------------------
#
// + This is Only One Quote MOD
$lang['Image_url'] = '[b][i]Image: [/i][/b] [url]';
$lang['No_quote_inside'] = '';
// - This is Only One Quote MOD
#
#-----[ OPEN ]------------------------------------------------
#
#	we do also this stuff.. ;)
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------------
# the line is longer..
#
		<input type="radio" name="allowbbcode" value="0"
#
#-----[ IN-LINE FIND ]------------------------------------------
#
value="0"
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
value="1"
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM

This is Only One Quote

Posted: Sat Oct 06, 2007 8:00 am
by Paul
MOD Updated to version 1.0.2a
See first post for Download Link

Re: This is Only One Quote

Posted: Sat Oct 06, 2007 11:35 pm
by 3Di
Thanks MOD Team.

@ all: the next version that fixes a minor bug present into this one and previous version as well of this MOD will be submitted as soon as I can.

Thanks. :)

Re: This is Only One Quote

Posted: Fri Oct 12, 2007 3:08 pm
by Engren
Can't wait for it to be released. I'm suffering from "Last quote does not exists!" when quoting larger posts, and it's such a problem I am unable to keep running this mod until it's been taken care of.

I'm keeping my fingers crossed that this is one of the bugs that'll be solved...

Re: This is Only One Quote

Posted: Fri Oct 12, 2007 4:35 pm
by 3Di
Engren wrote:Can't wait for it to be released. I'm suffering from "Last quote does not exists!" when quoting larger posts, and it's such a problem I am unable to keep running this mod until it's been taken care of.

I'm keeping my fingers crossed that this is one of the bugs that'll be solved...
I'm not aware of this, I'll give it a shot and fix, in case. Thank you.

Re: This is Only One Quote

Posted: Fri Oct 26, 2007 2:23 am
by dvdd127

Code: Select all

$message = preg_replace('/(\[quote=(.*?)\]((.|\n)*)\[\/quote\])/si',"", $message);
the code above causes a stack overflow.. any ideas how to fix it???

Re: This is Only One Quote

Posted: Sat Oct 27, 2007 9:16 am
by securitynut
Just thought I'd mention an issue (also mentioned a page or two back, but with a less than appealing solution...)

If somebody quotes an image that contains 'img' in the url (For example, http://img147.imageshack.us/img147/6931/example.gif has two occurances of 'img') they will be replaced by 'url' which breaks the link. This can easily be fixed by slightly changing the regex:

Code: Select all

$message = ( !empty($message) ) ? preg_replace('/\[\/img]/', '[/url]', $message) : '';
$message = ( !empty($message) ) ? preg_replace('/\[img]/', '[url]', $message) : '';
But by this point we are just doing a simple find and replace for [img]and[/img], so we might as well save resources and just use str_ireplace...

Code: Select all

$message = ( !empty($message) ) ? str_ireplace('[/img]', '[/url]', $message) : '';
$message = ( !empty($message) ) ? str_ireplace('[img]', '[url]', $message) : '';
Note that I am not using some of the extra features of this mod so don't just copy & paste the above unless you want images to be replaced by links without the extra 'This image has been replaced' comment (which personally I don't think is necessary, YMMV).

Hope that helps someone.

Re: This is Only One Quote

Posted: Sun Oct 28, 2007 11:02 am
by 3Di
dvdd127 wrote:

Code: Select all

$message = preg_replace('/(\[quote=(.*?)\]((.|\n)*)\[\/quote\])/si',"", $message);
the code above causes a stack overflow.. any ideas how to fix it???
Would you mind please to PM me a link where to see that?

Re: This is Only One Quote

Posted: Sun Oct 28, 2007 11:03 am
by 3Di
securitynut wrote:Just thought I'd mention an issue (also mentioned a page or two back, but with a less than appealing solution...)

If somebody quotes an image that contains 'img' in the url (For example, http://img147.imageshack.us/img147/6931/example.gif has two occurances of 'img') they will be replaced by 'url' which breaks the link. This can easily be fixed by slightly changing the regex:

Code: Select all

$message = ( !empty($message) ) ? preg_replace('/\[\/img]/', '[/url]', $message) : '';
$message = ( !empty($message) ) ? preg_replace('/\[img]/', '[url]', $message) : '';
But by this point we are just doing a simple find and replace for [img]and[/img], so we might as well save resources and just use str_ireplace...

Code: Select all

$message = ( !empty($message) ) ? str_ireplace('[/img]', '[/url]', $message) : '';
$message = ( !empty($message) ) ? str_ireplace('[img]', '[url]', $message) : '';
Note that I am not using some of the extra features of this mod so don't just copy & paste the above unless you want images to be replaced by links without the extra 'This image has been replaced' comment (which personally I don't think is necessary, YMMV).

Hope that helps someone.
That's the minor bug I was talking about, hopefully I'll fix it soon.
Regards