UBB.Dev
Posted By: JustDave [6.2] Reply to Who - 01/02/2003 3:55 AM
This will add the "Re: Username" replied to post link back into showflat mode for .threads 6.2

Mod Name: Reply To Who 1.0

Description: This will add the "Re: Username" information back to posts in showflat mode.

Author: JustDave www.chattersonline.com
           For discussion and bug reports go to www.ubbdev.com

Date: 01/01/03

Working Under: 6.2

Files Modified: showflat.php, /templates/default/showflat.tmpl

New Files: None

Database Modifications: None

Notes: Restores functionality from 6.1. Adds only 2 queries.


Ummm... download zip, open, read, follow instructions, upload and go.







Edit Note: Last updated 01/02/03 8:21 AM CST

Attached File
63321-replytowho.6.2.zip  (173 downloads)
Posted By: JoshPet Re: [6.2] Reply to Who - 01/02/2003 6:31 AM
Hmmmm...

Something doesn't work right with this. It makes all showflat show blank.

I'm looking to see if I missed something.
Posted By: JoshPet Re: [6.2] Reply to Who - 01/02/2003 6:43 AM
I can't figure it out. I follow the directions carefully... and the showflat mode just has no posts.... the page is there, it's just not showing any of the posts.

Must be a step missed.
Posted By: JustDave Re: [6.2] Reply to Who - 01/02/2003 2:30 PM
I'll look again but I don't think I missed anything. Perhaps another modification is causing problems? I'll have to check things over but there wasn't much to modify.
Posted By: Maze Re: [6.2] Reply to Who - 01/02/2003 3:42 PM
Just installed your Hack. Great! Thanks a lot!!!

There's just one small bug:

[]### Find this:
$postrowsize = $i;
$dbh -> finish_sth($sth);[/]

Keep the line
$postrowsize = $i;
and it will work.


Another thing: It displays [[:"blue"]Re:**DONOTDELETE**[/]] if replying to an anonymous user.
Posted By: JustDave Re: [6.2] Reply to Who - 01/02/2003 4:23 PM
I forgot to add the line being replaced in the last showflat.php step back in with what's being added. The zip has the updated instructions. Also, I had left the <span id=... portion of code around the subject which didn't need to be in there for this mod so I took that out as well.

It *will* work now.
Posted By: Ian_W Re: [6.2] Reply to Who - 01/02/2003 9:08 PM
Dave - I am getting the following error...

Parse error: parse error in /home/sites/site30/web/forums/showflat.php on line 956

Which seems to be this section...

$postrow[$i]['Subject'] = $Subject;
$postrow[$i]['replyto_link'] = "<a href="{$config['phpurl']}/showthreaded.php?Cat=$Cat&Board=$Board&Number=$ParentPost&page=$page&view=$view&sb=$sb&o=$o&vc=1" target="_new" title="{$ubbt_lang['RESPONSE_TO']}$ParentPost" alt="{$ubbt_lang['RESPONSE_TO']}$ParentPost">";

Any thoughts? Re-checked the few alterations all okay.

Ian
Posted By: JoshPet Re: [6.2] Reply to Who - 01/03/2003 4:50 AM
Works Great Now!!! Awesome Dave!
Posted By: JustDave Re: [6.2] Reply to Who - 01/03/2003 5:07 PM
What you posted looks to be ok. I'm not sure what may be going on...

Perhaps a template error? Make sure you have the backets {} around the variable.
Posted By: sportbikes Re: [6.2] Reply to Who - 01/04/2003 7:56 AM
Is this the hack that was noted to increase the load significantly for large databases?
Posted By: JoshPet Re: [6.2] Reply to Who - 01/04/2003 9:55 AM
No.... this is better. Only 2 queries. Mine was 2 per post. Dave's is 2 total. Almost no load.

JustDave rules.
Posted By: Dalantech Re: [6.2] Reply to Who - 01/04/2003 11:12 AM
I added this one and it works great!
Posted By: sportbikes Re: [6.2] Reply to Who - 01/04/2003 11:38 AM
Added it to mine and I'm sure it will make a lot of members happy! Doesn't seem to create a server burden either
Posted By: Ian_W Re: [6.2] Reply to Who - 01/04/2003 4:08 PM
For some reason, I had the following code in showflat.php - I am not sure where that came from, as I do not recognise it from any mod installed since 6.2. I checked it against a copy from the members area at Infopop. I also noticed that all files on there are dated 30/12/02 - have they been updated????

Code
  		 else {<br />		 	 $postrow[$i]['Subject'] = "<span id=\"subject$i\">$Subject</span>";<br />		 }


So I can only assume this is from the origianl copy and since been removed

Strange, as I wasn't getting any errors until I installed your mod - which works fine once I take out the code above.

Just posting this in case anyone else gets a similar problem.

Ian

Posted By: JustDave Re: [6.2] Reply to Who - 01/04/2003 4:18 PM
That code is from your quick reply modification.
Posted By: Ian_W Re: [6.2] Reply to Who - 01/04/2003 6:07 PM
Darn it - for the benefit of anyone who has the quick reply mod installed, the installation should look like this...

Code
 <br /><br /><br /><br />### In showflat.php find this:<br /><br /><br />         $Parentlink = "";<br />         if ($ParentPost) {<br />             $postrow[$i]['Subject'] = "<a href=\"{$config['phpurl']}/showthreaded.php?Cat=$Cat&amp;Board=$Board&amp;Number=$ParentPost&amp;page=$page&amp;view=$view&amp;sb=$sb&amp;o=$o&amp;vc=1\" target=\"_new\" title=\"{$ubbt_lang['RESPONSE_TO']}$ParentPost\" alt=\"{$ubbt_lang['RESPONSE_TO']}$ParentPost\">$Subject</a>";<br />         }<br /><br />else <br />{		 	 <br />$postrow[$i]['Subject'] = "<span id=\"subject$i\">$Subject</span>";<br />		 }<br /><br /><br />### and change it to this:<br /><br /><br />		 $postrow[$i]['Subject'] = $Subject;<br />         $postrow[$i]['replyto_link'] = "<a href=\"{$config['phpurl']}/showthreaded.php?Cat=$Cat&amp;Board=$Board&amp;Number=$ParentPost&amp;page=$page&amp;view=$view&amp;sb=$sb&amp;o=$o&amp;vc=1\" target=\"_new\" title=\"{$ubbt_lang['RESPONSE_TO']}$ParentPost\" alt=\"{$ubbt_lang['RESPONSE_TO']}$ParentPost\">";<br />$postrow[$i]['Subject'] = "<span id=\"subject$i\">$Subject</span>";<br /><br />  


This ensures that both the 'Reply to Who' and the 'Quick Reply' mods both work

Ian
Posted By: JoshPet Re: [6.2] Reply to Who - 01/15/2003 4:27 AM
Will work in 6.2.1.
Posted By: Sat4all Re: [6.2] Reply to Who - 01/15/2003 4:31 PM
I just installed this 2 times 100% according to the instructions on a clean 6.2 install with some design changes. (not in the showflat files)
I have the same problem. Blank screen.

Regards,

Ron.
www.sat4all.com
Posted By: JoshPet Re: [6.2] Reply to Who - 01/18/2003 1:23 PM
Same thing needs to be done here...

If it's a reply to user number 1... then it needs to fetch the anonname from the posts table. Otherwise you get "Re: ***DONOTDELETE***" if it's a reply to an anon post.

Tried to fix this one too....but it stumped me. If I do it, it'll probably use unneeded queries.
Posted By: JustDave Re: [6.2] Reply to Who - 01/18/2003 3:32 PM
I'll get this worked on sometime today. There should be no extra queries needed.
Posted By: JustDave Re: [6.2] Reply to Who - 01/19/2003 9:55 PM
*bump*

Updated to display anonymous usernames.
Posted By: JoshPet Re: [6.2] Reply to Who - 01/19/2003 10:19 PM
Posted By: Astaran Re: [6.2] Reply to Who - 01/20/2003 12:26 PM
Thx for the update!
You may want to initalize the following variables to avoid warnings, when there are no replies:
$parentinfo[0]['poster_id'] = '';
$parentinfo[0]['post_num'] = '';
$pusername["X$Unum"] = '';

Sorry, i know error level 15 can be annoying.

EDIT: $parentinfo[0]['anon_name'] = ''; is missing in my list.
Posted By: JustDave Re: [6.2] Reply to Who - 01/20/2003 4:49 PM
Thanks Astaran.

Yes 15 can be a pain. (don't look at IIP through them glasses) LoL
Posted By: Poul Re: [6.2] Reply to Who - 02/05/2003 4:07 AM
For change
[Re: Author]- Underline only for Author
to
[re: Author] - underline both re: Author how in 6.1.1

Just find in showflat.php:
$postrow[$i]['replyto_link'] = "<a href="{$config['phpurl']}/showthreaded.php?Cat=$Cat&Board=$Board&Number=$ParentPost&page=$page&view=$view&sb=$sb&o=$o&vc=1" target="_new" title="{$ubbt_lang['RESPONSE_TO']}$ParentPost" alt="{$ubbt_lang['RESPONSE_TO']}$ParentPost"> ";

Change to
$postrow[$i]['replyto_link'] = "<a href="{$config['phpurl']}/showthreaded.php?Cat=$Cat&Board=$Board&Number=$ParentPost&page=$page&view=$view&sb=$sb&o=$o&vc=1" target="_new" title="{$ubbt_lang['RESPONSE_TO']}$ParentPost" alt="{$ubbt_lang['RESPONSE_TO']}$ParentPost">re: ";

Find
$postrow[$i]['replyto_link'] = " [Re:$replytolinkstart" . $parentnum["X$Bnum"] . "</a>]";

Change to
$postrow[$i]['replyto_link'] = " [$replytolinkstart" . $parentnum["X$Bnum"] . "</a>]";


Posted By: Chevy454 Re: [6.2] Reply to Who - 02/15/2003 9:38 PM
I'm guessing this will work on a 6.2.2 board?

Was the upgrade from 6.1 to 6.2 generally aimed at speed? The "re: username", and the "new posts" on the main page were both changed...am I wrong, or were they looking for ways to speed things up?
Posted By: JustDave Re: [6.2] Reply to Who - 02/15/2003 9:41 PM
The upgrade to 6.2.2 is bug fixes. The features of 6.2.1 should be the same for 6.2.2

I haven't tried this with 6.2.2 but it should work or be fairly close to figure it out.
Posted By: Chevy454 Re: [6.2] Reply to Who - 02/15/2003 9:45 PM
Good...this is one of the first things my users noticed. I wasn't 100% what they were referring to, until I stumbled across this thread!
Posted By: JustDave Re: [6.2] Reply to Who - 02/15/2003 9:46 PM
hehe...

If this works with 6.2.2 please post back and let us know.

It should but it would be nice to have a definative answer.
Posted By: Astaran Re: [6.2] Reply to Who - 02/15/2003 9:59 PM
Works well on my 6.2.2 test installation!
Posted By: JustDave Re: [6.2] Reply to Who - 02/15/2003 10:04 PM
Good to hear! Thanks
Posted By: Chevy454 Re: [6.2] Reply to Who - 02/15/2003 11:37 PM
Someone care to help a newbie?

I edited showflat.php fine, but when trying to edit showflat.tmpl, when I save it in NotePad, it scrunches all the code together, like it's doing away with all the formatting? WordPad also has problems working with it. I've never had problems editing any other files...where am I going wrong?
Posted By: JustDave Re: [6.2] Reply to Who - 02/15/2003 11:59 PM
Strange. I don't think I have had any problems like this before. Anyone else?
Posted By: Chevy454 Re: [6.2] Reply to Who - 02/16/2003 12:18 AM
Figures! LOL!

Oh, I went and tried it on another computer...same thing.
Posted By: Dave_L_dup1 Re: [6.2] Reply to Who - 02/16/2003 12:34 AM
I had thought that all the text files were in Unix text format, so I would expect that result if you try to use Notepad. However, I checked a few of the files, and saw that they're inconsistent. Some of them are in Unix text format, and some of them are in DOS text format, which isn't good.
Posted By: dimopoulos Re: [6.2] Reply to Who - 02/17/2003 1:27 AM
It is a well known problem with Notepad. What I do is open Wordpad and that opens the file OK. Then I copy all the content, open the same file in Notepad and paste it back. There seems to be problem with the crlf character that Unix creates and with Notepad translating it.
Posted By: jluerken Re: [6.2] Reply to Who - 02/17/2003 9:00 AM
Best is to take ultraedit for such things. This will not mess up your text and you have a nice highlightning for the code.
Posted By: Chevy454 Re: [6.2] Reply to Who - 02/19/2003 11:08 PM
EDIT: Well, I got it...it seems to be working now!

Another great hack!
Posted By: coloradok5 Re: [6.2] Reply to Who - 02/20/2003 6:37 AM
Very cool, works great, just upgraded to 6.2.2 and after 1 min my users BBQ'ed me because they didn't have the reply to.
Posted By: smilesforu Re: [6.2] Reply to Who - 02/20/2003 10:34 AM
Is this hack different than this one
[6.2] Postlist Last Post By for 6.2 ? (which I have installed)
Posted By: JoshPet Re: [6.2] Reply to Who - 02/20/2003 7:20 PM
Yes.... the last post puts the name of the last poster on the postlist.php screen.

This hack returns the [Re: Username] in the subjects in flat view.... (showflat.php) which was removed in version 6.2. We are using this mod here... if you are in flat mode.... look next to the subject and you'll see [Re: Smilesforu].

That's what this mod adds.
Used to be a standard feature and will probably be again, in the next upgrade that has an altertable.
Posted By: smilesforu Re: [6.2] Reply to Who - 02/21/2003 11:15 AM
Thanks Dave and Canvey for finding that glitch for me... got it working.
Posted By: Rick Re: [6.2] Reply to Who - 03/05/2003 8:09 PM
This will be part of 6.3. Done a bit differently, added a new field into the Posts table to keep this to 1 extra query. Just a heads up so everyone knows this won't need to be rehacked when 6.3 comes out.
Posted By: Dalantech Re: [6.2] Reply to Who - 03/05/2003 9:12 PM
Very !

Thanks Scream!
Posted By: JoshPet Re: [6.2] Reply to Who - 03/05/2003 10:47 PM
God bless you.

I will name my first born "Scream" in your honor.
Posted By: Zackary Re: [6.2] Reply to Who - 03/05/2003 11:31 PM
Very cool!
Posted By: Don Re: [6.2] Reply to Who - 08/19/2003 9:17 PM
There's also an additional unnecessary </a> in there. No biggie but it makes for invalid html and harder to find OTHER errors...

this section:
for($i=0;$i<$postrowsize;$i++) {
$Bnum = $postrow[$i]['parentpost'];
if (!empty($parentnum["X$Bnum"])) {
$replytolinkstart = $postrow[$i]['replyto_link'];
$postrow[$i]['replyto_link'] = " [response to: $replytolinkstart" . $parentnum["X$Bnum"] . "</a>]";

that last </a> is unnecessary - it's already in the $replytolinkstart.
© UBB.Developers