Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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:

Sponsored Links
Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
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

Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
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.

[ July 02, 2001 05:27 PM: Message edited by: Thermit ]

Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
What do you mean by 25% right sometimes?

Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
I can't see any pattern to it, but it is mostly wrong.

Sponsored Links
Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
I just did a quick check on my board and they all seem to be correct. Maybe it's another hack you have installed?

Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
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...

Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
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:

[ July 03, 2001 03:16 PM: Message edited by: Thermit ]

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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.

Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
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.

Sponsored Links
Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
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

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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);

Joined: Mar 2001
Posts: 13
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 13
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.

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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.

Joined: Mar 2001
Posts: 13
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 13
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.

Joined: Mar 2001
Posts: 13
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 13
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!

[ July 25, 2001 03:23 PM: Message edited by: kshock ]

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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.

Joined: Mar 2001
Posts: 13
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 13
I got the display to work, but, it always says 0 messages wherever I use $total_posts, but, there are messages there.

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
Where exactly are you placing it? Make sure you're doing it within the other plain HTML stuff.

Joined: Mar 2001
Posts: 13
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 13
That's where I put it, right near the $MatchTotal variable within the HTML as you suggested.

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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?

Joined: Mar 2001
Posts: 13
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 13
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.

[ July 26, 2001 01:00 AM: Message edited by: kshock ]

Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
Just an Idea, Link the Last Reponse by member and link it to there profile. That might be a good idea. smile

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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 = "$LastPerson";

[ July 26, 2001 10:21 AM: Message edited by: treszoks ]

Joined: Mar 2001
Posts: 13
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 13
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 = "$LastPerson";

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

Thanks!

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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.

[ July 27, 2001 12:20 AM: Message edited by: treszoks ]

Joined: Mar 2001
Posts: 13
Junior Member
Junior Member
Offline
Joined: Mar 2001
Posts: 13
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?

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
Yes there is, but you would probably have to run a cron script once every night to save the info.

Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
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.

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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.

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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!

Joined: May 2001
Posts: 6,708
Member
Member
Offline
Joined: May 2001
Posts: 6,708
Thats great, Hope the hack works out good for you. smile

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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:
https://www.ubbdev.com/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=7&t=000606

Joined: Oct 2000
Posts: 49
Member
Member
Offline
Joined: Oct 2000
Posts: 49
Good work dude. That's pretty cool.
I think posts/topics are reversed in dailies.cgi chart.
Thanks again.

Joined: Apr 2001
Posts: 57
Member
Member
Offline
Joined: Apr 2001
Posts: 57
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.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)