[RC] Reply To Specific Post - v1.0.2

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Red_5
Registered User
Posts: 65
Joined: Fri Nov 15, 2002 1:53 pm
Contact:

Post by Red_5 » Wed Jun 04, 2003 6:21 pm

Ok, tonileung, this is what I have:

In the instructions for this mod there is a section which says:
#
#-----[ FIND ]------------------------------------------
#

$quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>';

#
#-----[ AFTER, ADD ]------------------------------------------
#

$temp_url = append_sid("posting.$phpEx?mode=reply_post&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$reply_post_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_reply_post'] . '" alt="' . $lang['Reply_Post'] . '" title="' . $lang['Reply_Post'] . '" border="0" /></a>';

if ( empty($postrow[$i]['in_reply_to']))
{
$Post_in_reply_to = '';
$Reply_post = '';
$View_post = '';
}
else
{
$Post_in_reply_to = $lang['In_reply_to'];
$Reply_post = 'this message';
$View_post = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['in_reply_to']) . '#' . $postrow[$i]['in_reply_to'] . '">' . $Reply_post . '</a>';
}


To get the original poster's name appearing, you need to do the following instead:
#
#-----[ FIND ]------------------------------------------
#

$quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>';

#
#-----[ AFTER, ADD ]------------------------------------------
#

$temp_url = append_sid("posting.$phpEx?mode=quote&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$quote_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_quote'] . '" alt="' . $lang['Reply_with_quote'] . '" title="' . $lang['Reply_with_quote'] . '" border="0" /></a>';
$quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>';

$temp_url = append_sid("posting.$phpEx?mode=reply_post&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$reply_post_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_reply_post'] . '" alt="' . $lang['Reply_Post'] . '" title="' . $lang['Reply_Post'] . '" border="0" /></a>';

if ( empty($postrow[$i]['in_reply_to']))
{
$Post_in_reply_to = '';
$Reply_post = '';
$View_post = '';
}
else
{
$Post_in_reply_to = $lang['In_reply_to'];

$nReplyPost = -1;

for($nPost = 0; $nPost < $total_posts; $nPost++)
{
if ( $postrow[$nPost]['post_id'] == $postrow[$i]['in_reply_to'] )
{
$nReplyPost = $nPost;
break;
}
}

if ( $nReplyPost == -1 )
{
$Reply_post = 'this message';
}
else
{
if ( $postrow[$nReplyPost]['poster_id'] == ANONYMOUS )
{
if ( $postrow[$nReplyPost]['post_username'] != '' )
{
$Reply_post = $postrow[$nReplyPost]['post_username'];
}
else
{
$Reply_post = $lang['Guest'];
}
}
else
{
$Reply_post = $postrow[$nReplyPost]['username'];
}
}
$View_post = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $postrow[$i]['in_reply_to']) . '#' . $postrow[$i]['in_reply_to'] . '">' . $Reply_post . '</a>';
}


For some reason, it has a couple of problems finding the poster's username (in which case it just puts the old 'this message' text up), but it works on about 95% of the posts in my test forum.

If anyone can check this code and fix this minor error, I'd be very happy. :lol: :o :D 8O :wink:

tonileung
Registered User
Posts: 43
Joined: Mon Mar 17, 2003 4:16 am
Location: HongKong

Post by tonileung » Mon Jun 09, 2003 7:18 pm

Red_5,

This is reeeeeally GREAT!! Thanks a million for you help!! :twisted: :twisted: :twisted:

Sorry for just one more thing. How could I reply with "In reply to", but without "quote"? :roll:

And one comment. The following is repeated?
$temp_url = append_sid("posting.$phpEx?mode=reply_post&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$reply_post_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_reply_post'] . '" alt="' . $lang['Reply_Post'] . '" title="' . $lang['Reply_Post'] . '" border="0" /></a>';
Last edited by tonileung on Mon Jun 09, 2003 7:57 pm, edited 1 time in total.

User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley » Mon Jun 09, 2003 7:45 pm

Where is that repeated? That's not repeated anywhere....

tonileung
Registered User
Posts: 43
Joined: Mon Mar 17, 2003 4:16 am
Location: HongKong

Post by tonileung » Mon Jun 09, 2003 7:51 pm

I mean it appeared twice if I follow this:
#
#-----[ FIND ]------------------------------------------
#

$quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>';

#
#-----[ AFTER, ADD ]------------------------------------------
#

$temp_url = append_sid("posting.$phpEx?mode=quote&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$quote_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_quote'] . '" alt="' . $lang['Reply_with_quote'] . '" title="' . $lang['Reply_with_quote'] . '" border="0" /></a>';
$quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>';

Red_5
Registered User
Posts: 65
Joined: Fri Nov 15, 2002 1:53 pm
Contact:

Post by Red_5 » Mon Jun 09, 2003 9:33 pm

That section is not a repeat (if I understand you correctly). Both of those do different things:
$temp_url = append_sid("posting.$phpEx?mode=quote&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$quote_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_quote'] . '" alt="' . $lang['Reply_with_quote'] . '" title="' . $lang['Reply_with_quote'] . '" border="0" /></a>';
$quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>';

$temp_url = append_sid("posting.$phpEx?mode=reply_post&" . POST_POST_URL . "=" . $postrow[$i]['post_id']);
$reply_post_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_reply_post'] . '" alt="' . $lang['Reply_Post'] . '" title="' . $lang['Reply_Post'] . '" border="0" /></a>';

:D

Red_5
Registered User
Posts: 65
Joined: Fri Nov 15, 2002 1:53 pm
Contact:

Post by Red_5 » Mon Jun 09, 2003 9:34 pm

>>How could I reply with "In reply to", but without "quote"?
I don't know, at the moment - when I have time, maybe. :roll:

charboy
Registered User
Posts: 22
Joined: Fri May 16, 2003 5:04 pm

Re: [BETA] In Reply To - v1.0.0

Post by charboy » Thu Jul 03, 2003 3:39 pm

I installed this MOD and the "Alternate view lastest posts" mod at the same time, and I just realized that since I did that the number of topics on the main page does not get updated, it's stuck at 19 on my board. What's worse is that once the number of topics exceeded 50 it only shows 50 but it does not give a link to a second page so those topics are unreachable, I had to increase the number of toipcs per page to 100 to get them back, but obviously that's not a viable long term solution.

I guess I shouldn't have installed beta mods, have I totally hosed my board? Or could this bug be due to something else?

Please help!

My board is:

www.wackypacks.org/phpbb/

Red_5
Registered User
Posts: 65
Joined: Fri Nov 15, 2002 1:53 pm
Contact:

Post by Red_5 » Thu Jul 03, 2003 5:18 pm

First thought - have you tried resync-ing your boards?

I've just taken a look at the source for the other mod and I can't see anything there that would conflict with this one. :!:

Are you sure you didn't make any typos when installing it? Why not try removing this mod and installing it from scratch again? :D

I wish you luck, and keep us updated on your progess - I'll help all I can! ;-)

charboy
Registered User
Posts: 22
Joined: Fri May 16, 2003 5:04 pm

Post by charboy » Fri Jul 04, 2003 9:17 am

Red_5 wrote: First thought - have you tried resync-ing your boards?

Okay, I feel stupid now, resync-ing did fix it! I don't even know what resync-ing is, but I'm glad for it! I will sleep better tongight, thanks again for your help and sorry for the false alarm!!

By the way, how does it work with MODs when we upgrade to 2.2? Do all MODs have to be rewritten? If so that's kind of a disincentive to switch because your In Reply To MOD is indispesible as far as I'm concerned, and I don't believe they are implementing this in 2.2 (or am I just being supid again?).

Thanks again!!! :D :D

Red_5
Registered User
Posts: 65
Joined: Fri Nov 15, 2002 1:53 pm
Contact:

Post by Red_5 » Sun Aug 03, 2003 10:32 pm

To get this mod to work with the new phpBB verson 2.0.5, there are 2 small changes to the mod instructions:

Where it says:

Code: Select all

# 
#-----[ FIND ]------------------------------------------
#

$hidden_form_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" /><input type="hidden" name="mode" value="' . $mode . '" />';

#
#-----[ REPLACE WITH ]------------------------------------------
#

$hidden_form_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" /><input type="hidden" name="mode" value="' . $mode . '" /><input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '" />';
Instead of the above instructions, use (this is compatible with 2.0.5 and 2.0.4):

Code: Select all

# 
#-----[ FIND ]------------------------------------------
#

$hidden_form_fields = '

#
#-----[ AFTER ADD ]------------------------------------------
#

<input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '" />
Also, an additional instruction specific to version 2.0.5 is required:

Code: Select all

# 
#-----[ FIND ]------------------------------------------
#
	case 'quote':
	case 'editpost':
	case 'delete':
	case 'poll_delete':
		if ( empty($post_id) )
		{
			message_die(GENERAL_MESSAGE, $lang['No_post_id']);
		}

#
#-----[ BEFORE, ADD ]------------------------------------------
#

	case 'reply_post':
That's it! Simple, eh. ;-)

charboy
Registered User
Posts: 22
Joined: Fri May 16, 2003 5:04 pm

Post by charboy » Mon Aug 04, 2003 1:56 am

Red_5 wrote: To get this mod to work with the new phpBB verson 2.0.5, there are 2 small changes to the mod instructions:

Does it also work with 2.0.6?

Red_5
Registered User
Posts: 65
Joined: Fri Nov 15, 2002 1:53 pm
Contact:

Post by Red_5 » Mon Aug 04, 2003 8:27 am

Um - I only just finished upgrading to 2.0.5. 8O

I'll see what's changed in the latest, latest release and get back to you. ;-)

Thanks for the head-up!

Red_5
Registered User
Posts: 65
Joined: Fri Nov 15, 2002 1:53 pm
Contact:

Post by Red_5 » Mon Aug 04, 2003 9:00 am

I've just updated my dev forum and I can confirm that it does indeed work with 2.0.6.

The only file affected by the new version which In_Reply_To uses is viewtopic.php, and there are no differences to the instructions when re-installing the section of the mod for this file.

;-)
Last edited by Red_5 on Sun Jul 20, 2008 10:37 am, edited 1 time in total.

Red_5
Registered User
Posts: 65
Joined: Fri Nov 15, 2002 1:53 pm
Contact:

Post by Red_5 » Mon Aug 04, 2003 12:17 pm

I have now updated the zip files for this mod to include the additional instructions.

Please see: http://www.phpbb.com/phpBB/viewtopic.php?t=101634

User avatar
Jamy
Registered User
Posts: 429
Joined: Mon Mar 24, 2003 12:02 pm
Location: Mississippi

Post by Jamy » Fri Oct 31, 2003 2:06 pm

Forgive me I'm a little slow with some of this where it says
#
#-----[ SQL ]------------------------------------------
#

ALTER TABLE phpbb_posts ADD in_reply_to MEDIUMINT (8) unsigned

what do I do ?


NVM I read further :roll:

Post Reply

Return to “[2.0.x] MODs in Development”