php forum
php mysql forum
php mysql smarty
 
Page 1 of 2 1 2 >
Topic Options
#43366 - 06/28/01 07:12 PM Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
Something that always bothered me was when you go to "Today's Active Topics", one of the columns was the date which was of course...TODAY! LOL. It didn't make much sense so I've made some modifications to take out that column and I've changed it to "Last Response By". I've also taken out the "Forum" column and instead made it a row with the respective topics underneath it. It now looks a TON better.
http://www.baylorfans.com/cgi-bin/search.cgi?action=getdaily

Here are the instructions (my version is 5.46 but it will probably work with most of the 5.4* series). Make a backup before doing this of course!

Modified files: search.cgi only

Find:
Code:
code:


Paste ABOVE:
Code:
code:


Find and REMOVE:
Code:
code:


Find:
Code:
code:


Paste ABOVE:
Code:
code:


Find:
Code:
code:


REPLACE with:
Code:
code:

Top
#43367 - 06/28/01 08:48 PM Re: Today's Active Topics Beautification Hack
Lord Dexter Offline
Member

Registered: 05/25/01
Posts: 6503
Loc: Melbourne, Australia
Hmm...I might try it but I don't really care about Todays active topics but, what the heck...I'll try it later. wink

Top
#43368 - 07/02/01 05:09 PM Re: Today's Active Topics Beautification Hack
Thermit Offline
Member

Registered: 10/09/00
Posts: 69
Thanks! laugh laugh laugh laugh laugh

frown frown But you left off where you change the column names, and my last poster is only right about 25% percent of the time.

<FONT COLOR="#000000" SIZE="1">[ July 02, 2001 05:27 PM: Message edited by: Thermit ]</font>

Top
#43369 - 07/03/01 12:58 AM Re: Today's Active Topics Beautification Hack
Lord Dexter Offline
Member

Registered: 05/25/01
Posts: 6503
Loc: Melbourne, Australia
What do you mean by 25% right sometimes?

Top
#43370 - 07/03/01 01:45 PM Re: Today's Active Topics Beautification Hack
Thermit Offline
Member

Registered: 10/09/00
Posts: 69
I can't see any pattern to it, but it is mostly wrong.

Top
#43371 - 07/03/01 02:04 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
I just did a quick check on my board and they all seem to be correct. Maybe it's another hack you have installed?

Top
#43372 - 07/03/01 02:38 PM Re: Today's Active Topics Beautification Hack
Thermit Offline
Member

Registered: 10/09/00
Posts: 69
treszoks, I just did a quick check of your board too and they are mostly all wrong too.

For example, in "Was Jesus a Sinner?", it says last posted by Bear1969, but it was really last posted by Phil320. Although Bear1969 does post in that thread.

This is exactly what I'm seeing too.

Driving me crazy cause I can't see the pattern...

Top
#43373 - 07/03/01 03:14 PM Re: Today's Active Topics Beautification Hack
Thermit Offline
Member

Registered: 10/09/00
Posts: 69
Well, looked at it some more and realized that the bug is due to the fact that the last poster needs to be derived from the order of the entries in the daily log, but that is messed-up when the sort function is called to group the array entries by forum.

The following change corrects the last person bug, but doesn't necessarily group all the posts from the same forum together.


Code:
code:


<FONT COLOR="#000000" SIZE="1">[ July 03, 2001 03:16 PM: Message edited by: Thermit ]</font>

Top
#43374 - 07/03/01 07:52 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
Well at least it's not a problem with my mod;) I'll have to take a look at it later and see if I can figure out a fix. Maybe you'll come up with something.

Top
#43375 - 07/03/01 09:58 PM Re: Today's Active Topics Beautification Hack
Lord Dexter Offline
Member

Registered: 05/25/01
Posts: 6503
Loc: Melbourne, Australia
Yeah, I checked too and It seems to be stuffed, Try looking around the code a bit in forumdisplay.cgi since thats where the last poster is installed.

Top
#43376 - 07/05/01 07:23 PM Re: Today's Active Topics Beautification Hack
Thermit Offline
Member

Registered: 10/09/00
Posts: 69
Well, I decided to take the easy road and just let the posts be in time-order instead of forum-grouped. (Which I did basically with the small hack shown above and some table formatting).

treszoks, I appreciate you jump starting me on this hack. Here's my version:


Active Topics

Top
#43377 - 07/05/01 09:57 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
Try this fix out and let me know how it goes.

Find this:
@daily = sort(@daily2);

And change to this:
@daily = reverse(@daily2);

Now find this:
$MatchTotal = @good;

And add right above it this:
@good = sort(@good);

Top
#43378 - 07/23/01 09:31 PM Re: Today's Active Topics Beautification Hack
kshock Offline
Junior Member

Registered: 03/06/01
Posts: 13
Loc: NYC
How can I add a column for total number of replies to a post and total views in the Active Topics list like Thermit has done? I do have the Views hack intalled already.

Top
#43379 - 07/24/01 10:20 AM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
kshock,

Those items aren't part of the normal index used for today's active topics so you'll have to ask Thermit for documentation. It will add more load to your server however because you'll have to open the file with the views in it plus another file to find out the number of replies.

Top
#43380 - 07/24/01 06:00 PM Re: Today's Active Topics Beautification Hack
kshock Offline
Junior Member

Registered: 03/06/01
Posts: 13
Loc: NYC
Thanks for the info on that. As my server is already taxed with traffic, it might be better to leave off the views and reply counts.

Top
#43381 - 07/25/01 01:38 PM Re: Today's Active Topics Beautification Hack
kshock Offline
Junior Member

Registered: 03/06/01
Posts: 13
Loc: NYC
This is a nice hack as I've never liked the Active Topics screen. I like this layout a lot better. Just one thing I'd like to change...

Right now the topics are listed within each message board from oldest to newest. I'd like to reverse the order so that the newest topic is at the top of the list instead of the bottom. What would I change in the code to accomplish this?

Also, another cool thing I'd really like to see is a simple total of the number of new posts for that day as well. Maybe at the top, just a simple line that reads... Total Posts Today: 168. Can this be done fairly easily??

Thanks!

<FONT COLOR="#000000" SIZE="1">[ July 25, 2001 03:23 PM: Message edited by: kshock ]</font>

Top
#43382 - 07/25/01 05:12 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
kshock,

Find this:
@daily = reverse(@daily2);

Add below it:
$total_posts = $#daily;

Now just put $total_posts further below where you'd like it to be displayed. For example, find $MatchTotal and place it near that.

Top
#43383 - 07/25/01 11:34 PM Re: Today's Active Topics Beautification Hack
kshock Offline
Junior Member

Registered: 03/06/01
Posts: 13
Loc: NYC
I got the display to work, but, it always says 0 messages wherever I use $total_posts, but, there are messages there.

Top
#43384 - 07/25/01 11:50 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
Where exactly are you placing it? Make sure you're doing it within the other plain HTML stuff.

Top
#43385 - 07/26/01 12:20 AM Re: Today's Active Topics Beautification Hack
kshock Offline
Junior Member

Registered: 03/06/01
Posts: 13
Loc: NYC
That's where I put it, right near the $MatchTotal variable within the HTML as you suggested.

Top
#43386 - 07/26/01 12:23 AM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
The only thing I can think of is make sure you put the
"$total_posts = $#daily;" in the right spot. What version are you using?

Top
#43387 - 07/26/01 12:59 AM Re: Today's Active Topics Beautification Hack
kshock Offline
Junior Member

Registered: 03/06/01
Posts: 13
Loc: NYC
Here's how it looks in my code:

Code:
code:


Here's where the variable is used...

Code:
code:


But even with new messages, the total keeps coming up Zero. I'm using version 5.47a.

<FONT COLOR="#000000" SIZE="1">[ July 26, 2001 01:00 AM: Message edited by: kshock ]</font>

Top
#43388 - 07/26/01 02:13 AM Re: Today's Active Topics Beautification Hack
Lord Dexter Offline
Member

Registered: 05/25/01
Posts: 6503
Loc: Melbourne, Australia
Just an Idea, Link the Last Reponse by member and link it to there profile. That might be a good idea. smile

Top
#43389 - 07/26/01 10:18 AM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
kshock,

Well everything looks okay from what you posted. I'm not for sure what the deal is. It may have something to do with your version but I don't know. I'm using 5.46 which really shouldn't be too much different from yours. Try changing "$total_posts = $#daily;" to "$total_posts = $#daily2;"

You might also look to see if the variable $total_posts is used anywhere else to make sure it isn't an already existing variable.

Lord Dexter,

Not a bad idea and would be easy to do. Find this:
$LastPerson = "$goodline[2]";

Add this below it:
$goodline[2] =~ tr/ /+/;
$LastPerson = "<A HREF="$CGIURL/ubbmisc.cgi?action=getbio&UserName=$goodline[2]">$LastPerson</A>";

<FONT COLOR="#000000" SIZE="1">[ July 26, 2001 10:21 AM: Message edited by: treszoks ]</font>

Top
#43390 - 07/26/01 02:29 PM Re: Today's Active Topics Beautification Hack
kshock Offline
Junior Member

Registered: 03/06/01
Posts: 13
Loc: NYC
Treszoks, it's working now! But, strangely, it works either way now whether I use $#daily or $#daily2 as the variable.

Because I first tested this just after midnight when there was only one message listed in the Daily Active Topics, I'm wondering if the $#daily variable needs a +1 added to make it truly accurate. For example, if there were two messages, maybe it would have indicated 1 instead of Zero as it was with only 1 message. Does this make sense?

Anyway, it seems to be working now, thank you VERY much for your fast feedback and assistance. I also added the link to the profiles that you told Lord Dexter how to do. I made a small change...

$LastPerson = "<A HREF="$CGIURL/ubbmisc.cgi?action=getbio&UserName=$goodline[2]" TARGET=_blank>$LastPerson</A>";

I just added the target=_blank part so that it pops open a new window when viewing the profile.

Thanks!

Top
#43391 - 07/26/01 05:27 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
Yep, I bet you are right!

Edit: Make that "$total_posts = $#daily + 1;"

Don't use the ++ in this instance because it increments the array itself as well.

<FONT COLOR="#000000" SIZE="1">[ July 27, 2001 12:20 AM: Message edited by: treszoks ]</font>

Top
#43392 - 07/28/01 01:54 AM Re: Today's Active Topics Beautification Hack
kshock Offline
Junior Member

Registered: 03/06/01
Posts: 13
Loc: NYC
Had another idea...

Is there a way to somehow store total posts for the previous day so you could show how many new messages there were yesterday, as well as the message count for the current day on the Today's Active Topics screen?

Top
#43393 - 07/28/01 10:00 AM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
Yes there is, but you would probably have to run a cron script once every night to save the info.

Top
#43394 - 07/28/01 02:01 PM Re: Today's Active Topics Beautification Hack
Thermit Offline
Member

Registered: 10/09/00
Posts: 69
It seems to me cron wouldn't be necessary, because the UBB already has some function which deletes the old "daily index" read by Active Topics and starts a new one. If this true, then some extra code could probably be added to save yesterdays count before it gets removed.

Top
#43395 - 07/28/01 02:12 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
You're right, I forgot that the daily index filename was changed everyday. Look in "ubb_library2.pl" for "sub cleandailies". That's the subroutine that deletes all old daily indexes. Just add in your own code there to store the info before it gets deleted.

This sounds like something I might be interested in doing after thinking about it...I'll try to cook something up.

Top
#43396 - 07/28/01 03:19 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
Okay, I wrote some stuff but I won't know if it works until it's a new day of course. I'll post tomorrow with the results!

Top
#43397 - 07/28/01 08:53 PM Re: Today's Active Topics Beautification Hack
Lord Dexter Offline
Member

Registered: 05/25/01
Posts: 6503
Loc: Melbourne, Australia
Thats great, Hope the hack works out good for you. smile

Top
#43398 - 07/29/01 01:45 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
Well my new script worked fine. I've made a new topic since it's a new hack. Thanks to kshock and Thermit for the ideas! Here's the link for instructions:
http://www.ubbdev.com/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=7&t=000606

Top
#43399 - 07/29/01 07:54 PM Re: Today's Active Topics Beautification Hack
Thermit Offline
Member

Registered: 10/09/00
Posts: 69
Good work dude. That's pretty cool.
I think posts/topics are reversed in dailies.cgi chart.
Thanks again.

Top
#43400 - 07/29/01 09:26 PM Re: Today's Active Topics Beautification Hack
treszoks Offline
Member

Registered: 04/29/01
Posts: 58
You're right. I fixed that plus I added some date checking since it turns out the date placed is actually the next day. The code I put in will work most of the time except for special years when dealing with the number of days in February. It'd be more of a hassle to figure out the code for those few instances every few years so I'm just leaving it as is smile I've uploaded the fixes.

Top
Page 1 of 2 1 2 >