UBB.Dev
Posted By: JoshPet Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/15/2003 7:09 AM
Mod Name / Version: Recent Top Posters 1.0

Description: The current "Top Posters" addon (or Pal Box) only goes by total post count. Your large numbers will always be on top. This is an alternative which allows it to show the top (active) posters within the last X number of days.
Included in the ZIP is an addon file (recenttopposts.php) and a Pal box for IIP (custombox1pal.php). Use whichever you prefer.

Working Under: UBB.Threads 6.2-6.3

Mod Status: Beta

Any pre-requisites: IIP if you want to use the Pal Box

Author(s): JoshPet

Date: 06/14/03

Credits: Musky & JC for requesting it.

Files Altered: none

New Files: recenttopposters.php, custombox1pal.php

Database Altered: none

Info/Instructions: If you are using the Pal Box with IIP - upload to your pals directory. It works with page caching to save load time, so you can configure it as Custom Box 1 in the IIP setup. Upload the pal script to your pals folder, edit the variables at the top - and activate it/position it as Custom Box 1.

If using the addon script, upload and include in your page.

NOTE: For BOTH scripts - there are variables near the top of the files to edit. You can determine the number of top posters to show and how many days it will go back to check.
There is even an option to exclude certain forums (like a test forum). This is especially useful if users bogus post in test forums just for the sake of appearing on the top poster's list.

Also Note: This may be a high-load query on forums with a large number of posts. If it slows down your IIP page - I would recommend increasing the cache time so it doesn't update as refreently. Use at your own risk.

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.




Attached File
Posted By: J.C. Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/15/2003 7:13 AM
Finally Rick Add it!
Works Greattttttt!! Awesome Josh! Major Kudos to you!
Posted By: ericgtr Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/24/2003 6:34 PM
Just out of curiousity, since sidepal isn't working for 6.2 ( See Here) is there another way to inlude this on the main page of the forums?
Posted By: Ian_W Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/24/2003 8:11 PM
Err.. upgrade to 6.3?
Posted By: omegatron Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/24/2003 9:47 PM
sidebarpal worked in 6.2 for me.
Posted By: JoshPet Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/25/2003 3:50 AM

This mod doesn't really have anything to do with the sidebar mod.

This is an addon (like the other addons included with threads) that you can include into a regular php page - and there's a Pal box to act as one of the custom boxes in IIP.

We used the sidebar mod here the whole time we ran 6.2 - so it'll work just fine. However the instructions that I have released were written for 6.3. I didn't want to waste my time writing instructions and trying to support for a old version. So I usually post stuff for the latest version.

If you've had a good bit of experience applying hacks to threads - you could adapt it to 6.2. But I'm sure you'll want 6.3 eventually.

If you needed to run it under 6.2. Myself or one of the other Developers for Hire could be enlisted to install this into 6.2.
Posted By: ericgtr Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/25/2003 5:37 AM
I am probably going to wait a while on 6.3 because of all I have done with 6.2.3. One thing I have learned from installing all the hacks I have is that I should have created my own little change log

As far as the sidebar hack goes, for all intesive purposes it does work with the exception of this last snag which doesn't appear to be major enough for me to need to hire someone to fix, is this issue what you are refering to Josh? I realize I ask a lot of questions here and figure this is why I haven't received a response to my last issue regarding sidebar so I have decided to leave it be.

My biggest concern for a hack was to get the Uploads to a remote server and I have pulled it off all on my own, not a real hack by your standards but it does work and is user friendly. Had I not been able to I can assure you I would have hired someone from here for help. You guys are busy people and I understand that, all the help you guys have provided me is appreciated.
Posted By: JoshPet Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/25/2003 5:48 AM
Let me check that thread - last I remember you wern't able to get in installed under 6.2.

Glad you did. Let me go check that thread.
Posted By: JoshPet Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/25/2003 5:52 AM
https://www.ubbdev.com/forum/showflat.php?Number=77855

There's no replies to that mod? Were you having trouble with it?
Where's the thread where you asked for help.... I must have missed it?
Posted By: ericgtr Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/25/2003 5:55 AM
Actually I posted it under the thread that it's discussion is under Here (last post on the page)
Posted By: AKD96 Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/28/2003 2:13 AM
Works great!
Posted By: ericgtr Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/28/2003 3:47 PM
I wasn't quite sure what I needed to do to add this in my sidepal, I read the instructions and still wasn't quite sure I have it working just fine but am not sure about how often it will cache? It was at 30 days by default and I changed it to 5, uploaded again and even though the header (Top 10 active posters in the last 5 days) the post amount didn't, it's been over an hour also. Here is what I did to install it (6.2.3) BTW Great hack!

I opened up sidabarpal.php and added this:
Code
				if ($sidebar_include['tenrecent'] == $x && !$xused) {<br />					include "$thispath/pals/custombox1pal.php";<br />					$xused = 1;<br />				}

And then added this near the top:
Code
$sidebar_include['tenrecent'] = "4";
Posted By: JoshPet Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/29/2003 5:27 AM
Much easier than that. The functionality to turn on/off pal boxes is built in already. So your code is not needed.

Since it's "custombox1"

just open the sidebarpal.php script and near the top - there are settings to turn on/off and arrange all the pal boxes.

All you need to do is turn custom box 1 on in the sidebar.

Then in your normal IIP settings (click the dave lozier copyright notice at the bottom of your page) - you can set the cache time for custombox 1.
Posted By: ericgtr Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/29/2003 6:37 AM
I see, I guess my confusion is that there wasn't an actual custombox1pal.php just custombox1.php and that's why I added it in that way.
Posted By: dimopoulos Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 06/30/2003 2:37 PM
Also if you want your top posters for the calendar month you need to do the following:

Find:

$tString = str_replace("<<NUMPOSTERS>>",$topposters,$pal_TopPosters[0]);

Below it add

$tString .= " (";
$tString .= date("F");
$tString .= ")";

and change the query to:

$FirstOfMonth = mktime(0,0,0, date("m"),1,date("Y"));
$LastOfMonth = mktime(0,0,0, date("m")+1,1,date("Y")) - 86400;

$strWhere = "AND B_Posted BETWEEN '$FirstOfMonth' AND '$LastOfMonth' ";

$query = "
SELECT U_Username,
COUNT( B_Number ) AS TotalPosts,
U_Number
FROM w3t_Users,
w3t_Posts
WHERE U_Number > 1
AND U_Number = B_PosterId
$strWhere
GROUP BY U_Username
ORDER BY TotalPosts DESC
$limit
";

This should give you the top posters of the calendar month. With a small adaptation of the SQL query to Josh's pal box you can set this up.
Posted By: AKD96 Re: Beta-[6.2-6.3] Recent Top Posters 1.0 - 07/16/2003 10:48 PM
Hey Josh, I don't mean to step on your toes, but I made the recenttopposter.php file more compliant and added some classes that prevented the text from being displayed disproportioned in comparison with other sidepals. For my board, at least, some themes were displaying the text at a larger size. The small changes I made fixed it.

Attached File
89143-recenttopposters.txt  (54 downloads)
© UBB.Developers