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?
xpider wrote: Hi, first, sorry for my bad english.
If I quote a mensage with img like thisThe quoted msg replaces img codes with url, like this:Code: Select all
[img]http://www.xgn.com.br/fr/img/4416bd81c8346.jpg[/img]
The correct msg:Code: Select all
[quote]Image Replaced With URL For Only One Quote MOD: http://www.xgn.com.br/fr/url/4416bd81c8346.jpg [/quote]
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
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.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
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
I'm not aware of this, I'll give it a shot and fix, in case. Thank you.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...
Code: Select all
$message = preg_replace('/(\[quote=(.*?)\]((.|\n)*)\[\/quote\])/si',"", $message);
Code: Select all
$message = ( !empty($message) ) ? preg_replace('/\[\/img]/', '[/url]', $message) : '';
$message = ( !empty($message) ) ? preg_replace('/\[img]/', '[url]', $message) : '';
Code: Select all
$message = ( !empty($message) ) ? str_ireplace('[/img]', '[/url]', $message) : '';
$message = ( !empty($message) ) ? str_ireplace('[img]', '[url]', $message) : '';
Would you mind please to PM me a link where to see that?dvdd127 wrote:the code above causes a stack overflow.. any ideas how to fix it???Code: Select all
$message = preg_replace('/(\[quote=(.*?)\]((.|\n)*)\[\/quote\])/si',"", $message);
That's the minor bug I was talking about, hopefully I'll fix it soon.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:
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) ) ? preg_replace('/\[\/img]/', '[/url]', $message) : ''; $message = ( !empty($message) ) ? preg_replace('/\[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).Code: Select all
$message = ( !empty($message) ) ? str_ireplace('[/img]', '[/url]', $message) : ''; $message = ( !empty($message) ) ? str_ireplace('[img]', '[url]', $message) : '';
Hope that helps someone.