In quote link back to original post

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Suggested Hosts
marcotics
Registered User
Posts: 58
Joined: Fri Sep 02, 2005 1:33 pm

In quote link back to original post

Post by marcotics »

I would think this would be doe already, but i can't find it.

I would like the function that, in a quote, there is a link to the original post, on the original page, so you can easyly read the post ahead of it.
Last edited by marcotics on Sun Dec 06, 2009 2:26 am, edited 2 times in total.
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Re: In quote link back to original post

Post by stickerboy »

Try this - it's not my code, but was posted on these forums somewhere. I have cleaned it up a little ;)

Posting.php - round about line 1151

Code: Select all

        $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n" 
;
Replace with:

Code: Select all

//        $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
        $message_parser->message = '[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $post_data['quote_username'] . ' » ' . $user->format_date($post_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";     
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
marcotics
Registered User
Posts: 58
Joined: Fri Sep 02, 2005 1:33 pm

Re: In quote link back to original post

Post by marcotics »

Works like a charm, thanks! :idea:
marcotics
Registered User
Posts: 58
Joined: Fri Sep 02, 2005 1:33 pm

Re: In quote link back to original post

Post by marcotics »

How do i get it to work with Prime Multi Quote? The coding is a bit diffrent :(

Code: Select all

//-- mod: Prime Multi-Quote -------------------------------------------------//
// Add the additional quotes to the message.
	if ($prime_multi_quotes)
	{
		$current_quoted_message = $message_parser->message;
		foreach ($prime_multi_quotes as $quote_data)
		{
			$message_parser->message = &$quote_data['post_text'];
			unset($quote_data['post_text']);
			$message_parser->decode_message($quote_data['bbcode_uid']);
			$current_quoted_message .= "\n[quote="" . $quote_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
		}
		$message_parser->message = $current_quoted_message;
	}
//-- end: Prime Multi-Quote -------------------------------------------------//	
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Re: In quote link back to original post

Post by stickerboy »

I haven't used it and have not tested this, but it should work ok. Make a back up of your file before making changes though ;)

Code: Select all

//-- mod: Prime Multi-Quote -------------------------------------------------//
// Add the additional quotes to the message.
    if ($prime_multi_quotes)
    {
        $current_quoted_message = $message_parser->message;
        foreach ($prime_multi_quotes as $quote_data)
        {
            $message_parser->message = &$quote_data['post_text'];
            unset($quote_data['post_text']);
            $message_parser->decode_message($quote_data['bbcode_uid']);
            $current_quoted_message .= '\n[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $quote_data['quote_username'] . ' » ' . $user->format_date($quote_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";  
        }
        $message_parser->message = $current_quoted_message;
    }
//-- end: Prime Multi-Quote -------------------------------------------------//    
 
If it doesn't, you be better asking the MOD author if they can merge the changes :)
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
marcotics
Registered User
Posts: 58
Joined: Fri Sep 02, 2005 1:33 pm

Re: In quote link back to original post

Post by marcotics »

Thanks for the efford. Unfortunately, it doesn't work. The first post get's done correct, but the rest get the same links. i've used four quotes, so the first is correct, the other 3 get this:

Code: Select all

viewtopic.php?p=1476#p1476]KletsMajoor » do 01 jan 1970, 01:00[/url]"]
viewtopic.php?p=1476#p1476]Kevin » do 01 jan 1970, 01:00[/url]"]
viewtopic.php?p=1476#p1476]KletsMajoor » do 01 jan 1970, 01:00[/url]"]
Where the name is correct, the p=1476#p1476 is identical to the first post, and the date and time obviously don't match the actual post date /time.

Be believe it is a rather complicated question :lol: I'll ask for help in the mods topic too.

Thanks anyway, for single quotes the code you gave works great!
Komanche
Registered User
Posts: 249
Joined: Thu Aug 02, 2007 10:49 am
Location: Czech Republic

Re: In quote link back to original post

Post by Komanche »

cherokee red wrote:Try this - it's not my code, but was posted on these forums somewhere. I have cleaned it up a little ;)

Posting.php - round about line 1151

Code: Select all

        $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n" 
;
Replace with:

Code: Select all

//        $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
        $message_parser->message = '[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $post_data['quote_username'] . ' » ' . $user->format_date($post_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";     
great!!! thank you
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Re: In quote link back to original post

Post by stickerboy »

If you use relative dates, there is a fix here: http://www.sixstringmods.co.uk/viewtopi ... 1280#p1280 :)
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
User avatar
Garret_Dark
Registered User
Posts: 14
Joined: Fri Jan 16, 2009 11:29 am
Location: Russia

Re: In quote link back to original post

Post by Garret_Dark »

marcotics wrote:How do i get it to work with Prime Multi Quote? The coding is a bit diffrent :(
Solutions are not found. Made for himself.
Maybe someone else is looking. :)

After all these changes
open posting.php

FIND

Code: Select all

$prime_multi_quotes[] = array('post_text' => $row['post_text'],
In line add after

Code: Select all

 'post_ids' => $row['post_id'],
FIND

Code: Select all

$message_parser->message = &$quote_data['post_text'];
add after

Code: Select all

			$post_ids = &$quote_data['post_ids'];
FIND (After correction by cherokee red!!!)

Code: Select all

$current_quoted_message .= '\n[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_id#p$post_id" . ']' . $quote_data['quote_username'] . ' » ' . $user->format_date($quote_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
Replace with

Code: Select all

$current_quoted_message .= '\n[quote="' . '[url=' . generate_board_url() . "/viewtopic.$phpEx?p=$post_ids#p$post_ids" . ']' . $quote_data['quote_username'] . ' » ' . $user->format_date($quote_data['post_time']) . '[/url]' . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
Enjoy :)
Komanche
Registered User
Posts: 249
Joined: Thu Aug 02, 2007 10:49 am
Location: Czech Republic

Re: In quote link back to original post

Post by Komanche »

I am using for years this mod... works great :mrgreen:
http://www.phpbbhacks.com/download/8477
User avatar
Garret_Dark
Registered User
Posts: 14
Joined: Fri Jan 16, 2009 11:29 am
Location: Russia

Re: In quote link back to original post

Post by Garret_Dark »

Komanche wrote:I am using for years this mod... works great
This hack provides a link to the reported post from within the report in the Moderator Control Panel
This is not quite
evrus
Registered User
Posts: 15
Joined: Sat Jul 09, 2011 3:30 pm
Location: Moscow, Russian Federation
Contact:

Re: In quote link back to original post

Post by evrus »

cherokee red wrote:If you use relative dates, there is a fix here: http://www.sixstringmods.co.uk/viewtopi ... 1280#p1280 :)
Where?
Please post the fix in this thread.
And thank you very much for this snippet!
Sorry for my English.
User avatar
4_seven
I've Been Banned!
Posts: 5155
Joined: Wed Apr 30, 2008 1:41 am

Re: In quote link back to original post

Post by 4_seven »

site is off, so may another who have this fix, post it.
Current Mods | Mod Base | php(BB) programming | No help via PM
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Re: In quote link back to original post

Post by stickerboy »

Fix for relative dates you say? Good thing I keep a local copy of my work, eh? ;)
Sorry it took so long to post up, but here you go:

Code: Select all

$user->format_date($post_data['post_time'])  
Changing to something like this would work:

Code: Select all

date("jS F Y, G:i:s", $post_data['post_time'])  
This part in quotes - "jS F Y, G:i:s" can be modified to your liking. php.net gives you a breakdown of all the values you can add. The one I included is my personal preference.
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
Knizhnik
Registered User
Posts: 2
Joined: Thu Jul 03, 2014 3:14 pm
Location: Kharkov. Ukraine

Re: In quote link back to original post

Post by Knizhnik »

stickerboy wrote:Fix for relative dates you say? Good thing I keep a local copy of my work, eh? ;)
Sorry it took so long to post up, but here you go:

Code: Select all

$user->format_date($post_data['post_time']) 
Changing to something like this would work:

Code: Select all

date("jS F Y, G:i:s", $post_data['post_time']) 
This part in quotes - "jS F Y, G:i:s" can be modified to your liking. php.net gives you a breakdown of all the values you can add. The one I included is my personal preference.
This fix is incorrect.
Correct fix for date from member of the russian support team Татьяна5:

Open posting.php
FIND

Code: Select all

$prime_multi_quotes[] = array('post_text' => $row['post_text'], 'post_ids' => $row['post_id'], 'quote_username' => $row['username'], 'bbcode_uid' => $row['bbcode_uid']);
Replace with

Code: Select all

$prime_multi_quotes[] = array('post_text' => $row['post_text'], 'post_ids' => $row['post_id'], 'quote_username' => $row['username'], 'bbcode_uid' => $row['bbcode_uid'], 'post_time' => $row['post_time']);
Locked

Return to “[3.0.x] MOD Requests”

cron