Page 1 of 8

[MODDB] Quote Post Back Link

Posted: Sun Dec 21, 2008 5:42 pm
by Erik Frèrejean
Modification Name: Quote Post Back Link (QPBL)
Author: Erik Frèrejean

Modification Description:: This MOD adds a post back functionallity to the default quote tag.
It will now allow an aditional ;p= parameter which passes a post id to the bbcode system. When the topic is create this post id will be updated to a link back.
Modification Version:: RC2

Demo URL: N/A

Modification Download: https://github.com/erikfrerejean/quote_ ... ee/2.0.0.2

http://www.phpbb.com/customise/db/mod/q ... nk_(qpbl)/

Re: [RC2] Quote Post Back Link

Posted: Sun Dec 21, 2008 7:36 pm
by Erik Frèrejean
Updated the package, as I found an issue with the installation file and I forgot to include the language changes.

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 12:30 am
by Anyasha
Not only does the quote cut off the first letter of what was quoted, but when I try to preview I get this:

Fatal error: Call to a member function bbcode_tpl() on a non-object in /home/****/public_html/includes/mods/functions_qpbl.php on line 298

And if I submit, the quote looks like this:

Admin& Qpbl Wrote In: Re: test:

I'd like to get rid of the "& Qpbl" gibberish and maintain the ENTIRE quoted post and not lose the first letter.

Did you have a previous version of this a long time ago? Because I think I may have installed it and not liked it because of some discrepancy with the "wrote in" part, and perhaps the remaining code is what is throwing this off.

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 8:11 am
by Erik Frèrejean
I'll have a look at this when I come home this after noon (I must say I haven't seen those issues at all).
Yes I've written once something like this, but they share no code. It is however possible that you've got some remains in the core that causes some issues.

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 11:31 am
by demon327
Cool mod, but there is a replace statement and i dont like replaces in the core code :( maybe you can intrgrate the mod with:
http://www.absoluteanime.com/admin/mods.htm#multi_quote

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 12:03 pm
by Sjaak B
Is it possible for you to add the date and time in the link of the original quote? Then I have two of the most wanted things in one mod. :D

Thanks for your fine mod.

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 12:23 pm
by Erik Frèrejean
demon327 wrote:Cool mod, but there is a replace statement and i dont like replaces in the core code :( maybe you can intrgrate the mod with:
http://www.absoluteanime.com/admin/mods.htm#multi_quote
Small chance that I'll integrate it with that one. I've been planning (for a long time) to create an "advanced quoting" MOD that enhances the whole quote functionality. I've however didn't had the time to do this, there for am I now releasing this in parts and than build one complete package later.
(this will most likely also include a multi quote function).
Sjaak B wrote:Is it possible for you to add the date and time in the link of the original quote? Then I have two of the most wanted things in one mod. :D

Thanks for your fine mod.
That will be included in version 1.2, for now I just want to get this one in the MODDB asap.

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 12:35 pm
by demon327
Erik Frèrejean wrote:
demon327 wrote:Cool mod, but there is a replace statement and i dont like replaces in the core code :( maybe you can intrgrate the mod with:
http://www.absoluteanime.com/admin/mods.htm#multi_quote
Small chance that I'll integrate it with that one. I've been planning (for a long time) to create an "advanced quoting" MOD that enhances the whole quote functionality. I've however didn't had the time to do this, there for am I now releasing this in parts and than build one complete package later.
(this will most likely also include a multi quote function).
then i will wait :D

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 12:37 pm
by Erik Frèrejean
Just noticed this remark:
demon327 wrote:Cool mod, but there is a replace statement and i dont like replaces in the core code :(
You mean in the install.xml? Have you checked what you have to replace there ;)? Those changes can easily be replaced by two edits, a before-add and an after-add.
I always only add lines, if I replace something I only commend out the original line and after that add my own version ;).

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 3:25 pm
by Sjaak B
Erik Frèrejean wrote: That will be included in version 1.2, for now I just want to get this one in the MODDB asap.
That would be great. Maybe I can create something based on your mod because probably the same parts must be edited.

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 3:37 pm
by Erik Frèrejean
The edit will probably be unbelievably easy. At first sight you probably only have to edit:

Code: Select all

    $sql = 'SELECT p.post_id, p.post_subject, t.topic_id, t.forum_id
        FROM (' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t)
        WHERE (p.post_id = ' . (int) $post_id . '
            AND t.topic_id = p.topic_id)';
    $result = $db->sql_query_limit($sql, 1, 0);
    if (false !== ($row = $db->sql_fetchrow($result)))
    {
        $post_uri    = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, array('f' => $row['forum_id'], 't' => $row['topic_id'], 'p' => $row['post_id'])) . '#p' . $row['post_id'];
        $post_title    = censor_text($row['post_subject']);
    }
    $db->sql_freeresult($result); 
in function_qpbl.php so that the query also select the post time and change

Code: Select all

$post_title    = censor_text($row['post_subject']); 
to something like:

Code: Select all

$post_title    = $user->format_date($row['post_time']); 
(untested!)

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 8:32 pm
by Sjaak B
Will test that later, between all other things I have it working without, but with the help of, your mod. :D

Add after:

Code: Select all

	$post_data['quote_username'] = isset($post_data['username']) ? $post_data['username'] : '';
The following lines:

Code: Select all

	$post_data['quote_date'] =  $user->format_date($post_data['post_time']);
	$datime = " @ ";
Replace the line:

Code: Select all

	$message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
by the following line:

Code: Select all

	$message_parser->message = '[quote="' . $post_data['quote_username'] . $datime . $post_data['quote_date'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
It will give output like this:
Sjaak B @ mon 22 dec 2008, 12:00 wrote:
Test

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 10:25 pm
by Anyasha
Erik Frèrejean wrote:Yes I've written once something like this, but they share no code. It is however possible that you've got some remains in the core that causes some issues.
I thought so. Would you happen to have a link to it so I can uninstall it fully? :oops:

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 10:29 pm
by Erik Frèrejean
Advanced Quoting
I hope this topic holds the version you've got installed, otherwise you've to look at one of the other package that you can find at the sourceforge site that is linked in that topic.

Re: [RC2] Quote Post Back Link

Posted: Mon Dec 22, 2008 10:38 pm
by Anyasha
Thanks. Unfortunately I don't have any code from that mod remaining, so I'm not sure why I receive errors on this mod. I'm using 3.0.4 if it matters. :cry: