Page 2 of 3

Posted: Wed Jun 04, 2003 6:21 pm
by Red_5
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:

Posted: Mon Jun 09, 2003 7:18 pm
by tonileung
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>';

Posted: Mon Jun 09, 2003 7:45 pm
by GPHemsley
Where is that repeated? That's not repeated anywhere....

Posted: Mon Jun 09, 2003 7:51 pm
by tonileung
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>';

Posted: Mon Jun 09, 2003 9:33 pm
by Red_5
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

Posted: Mon Jun 09, 2003 9:34 pm
by Red_5
>>How could I reply with "In reply to", but without "quote"?
I don't know, at the moment - when I have time, maybe. :roll:

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

Posted: Thu Jul 03, 2003 3:39 pm
by charboy
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/

Posted: Thu Jul 03, 2003 5:18 pm
by Red_5
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! ;-)

Posted: Fri Jul 04, 2003 9:17 am
by charboy
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

Posted: Sun Aug 03, 2003 10:32 pm
by Red_5
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. ;-)

Posted: Mon Aug 04, 2003 1:56 am
by charboy
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?

Posted: Mon Aug 04, 2003 8:27 am
by Red_5
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!

Posted: Mon Aug 04, 2003 9:00 am
by Red_5
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.

;-)

Posted: Mon Aug 04, 2003 12:17 pm
by Red_5
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

Posted: Fri Oct 31, 2003 2:06 pm
by Jamy
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: