Birthdays

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
151
66%
Very Good
39
17%
Good
21
9%
Fair
5
2%
Poor
12
5%
 
Total votes: 228

tony44
Registered User
Posts: 232
Joined: Sun Apr 17, 2005 4:34 pm

Post by tony44 » Sat Dec 03, 2005 9:43 pm

The mod is Top X posters by John Adela

Let me know if you need to see anything else!

Code: Select all

## easymod compliant
########################################################################################################
## MOD Title: Top X Posters 
## MOD Author: AbelaJohnB < abela@johnabela.com > (John B. Abela) http://www.johnabela.com/mods/
## MOD Description: Allows you to post the "Top 'x'" members of your forum on your forum.
## MOD Version: 1.0.2
## 
## Installation Level: Easy
## Installation Time: ~5 Minutes 
## Files To Edit: 
##					index.php
##					includes/functions.php
##					templates/subSilver/index_body.tpl
## Included Files:
##					templates/subSilver/images/top_posters.gif
########################################################################################################
## Author Notes:
## Copyright © John B. Abela, < abela@johnabela.com >
##
## I do not support my MOD's anywhere except at http://www.johnabela.com/mods/ so please
## visit there for support. If you intend to take my work and modify it, you must retain my above
## Copyright within any install file. This does not mean you have to ask me to -use- this MOD,
## but that does mean you cannot -distribute- this MOD, in modified or non-modified format,
## without my copyright left intact. Contact me at: abela@johnabela.com - www.JohnAbela.Com
##
## This MOD, like all phpBB MOD's, is released under the GNU/GPL License. A copy of this license
## should have been included with the distribution package that included this install.txt file.
## If it was not, chances are you are using a version of this MOD that very likely has been edited
## by someone other than myself, and thus, perhaps, a greater security risk to you.
## 
## Possible Future Plans:
##                  I have been told my SQL statements do not work for PostGreSQL.
##                  It has been a long time since I worked with that SQL db. If someone knows the fix I
##                  will correct my MOD and release a new version with credit given where credit is due.
## 
##
## ~ John B. Abela - (aka: AbelaJohnB) http://www.johnabela.com/mods/  - abela@johnabela.com
##
##   Stop By And Say Hello If You Feel Like It :)
##   
##   I maintain a "Mailing Group" for email notification of any new/updated MOD's. Just stop by my
##   forum, register, than join the Group within the Usersgroup section of my MOD Forums!
########################################################################################################
##   Usage Notes:
##
##   You can specific the amount of members it returns by chaning the function input string.
##
##   Example:
##		top_posters('10', x, x) will return Top Ten Members
##		top_posters('5', x, x) will return Top Five Members
##
##   If you want to limit ADMIN and/or MOD from showing, use the following methods:
##  
##   Example:
##		top_posters('10', 1, 1) Top Ten Members, Show both ADMIN & MOD
##		top_posters('10', 1, 0) Top Ten Members, Show both ADMIN, but not MOD
##		top_posters('10', 0, 1) Top Ten Members, Show both MOD, but not ADMIN
##		top_posters('10', 0, 0) Top Ten Members, Show neither ADMIN nor MOD
## 
########################################################################################################
##   Issues Beyond My Control:
##   
##   Now, a note about "post counts not matching" that everybody complains to me about....
##
##   This is NOT a bug in MY CODE. Rather it is a situation caused by normal forum usage.
##   What you need to do to keep the post-counts syncronized is install and regularly run a
##   MOD by R45 called: Resync User Post Count
##   You can download this MOD at:
##   http://prdownloads.sourceforge.net/r45phpbbmods/resync_user_pcounts-1.2.1.zip?download
##   I have no idea if it is updated for the latest version of phpBB. I do not maintain this
##   MOD and have no intention of doing so. Hound on R45 about any outdatedness, not me!
##  
########################################################################################################
## MOD History: 
## 
##   2005-01-13 - Version 1.0.2
##      - Updated For phpBB 2.0.11
##
##   2003-07-16 - Version 1.0.1 
##      - Added Style Features and Limiting ADMIN/MOD AUTH
## 
##   2003-07-14 - Version 1.0.0 
##      - Initial Release
## 
########################################################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
########################################################################################################

# 
#-----[ COPY ]------------------------------------------ 
#
copy top_users.gif to templates/subSilver/images/top_users.gif

# 
#-----[ OPEN ]------------------------------------------ 
#
index.php

# 
#-----[ FIND ]------------------------------------------ 
#
		'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
        //
        // START MOD: TOP 'X' USERS (AbelaJohnB)
        //
        // PLEASE SEE THE INSTALL FILE FOR FURTHER INFORMATION ON WHAT TO DISPLAY AND HOW MANY TO DISPLAY.
        //
        'TOP_POSTERS' => top_posters('10', 1, 1), // Replace This Line If You Want Alternative Settings Displayed
        'L_TOP_POSTERS' => $lang['Top_Posters'],
        //
        // END MOD: TOP 'X' USERS (AbelaJohnB)
        //

# 
#-----[ OPEN ]------------------------------------------ 
#
includes/functions.php

# 
#-----[ FIND ]------------------------------------------ 
#
?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//
//////////////////////////////////////////////////////////////////////////////////////////////////
// START MOD: TOP 'X' USERS (AbelaJohnB)
//
//		This function will be used to acquire the "Top 'x'" members of your forum.
//		It can be called on any page that this file is included on.
//		You can specific the amount of members it returns by chaning the function input string.
//		Example:
//					top_posters('10', x, x) will return Top Ten Members
//					top_posters('5', x, x) will return Top Five Members
//
//		If you want to limit ADMIN and/or MOD from showing, use the following methods:
//
//					top_posters('10', 1, 1) Top Ten Members, Show both ADMIN & MOD
//					top_posters('10', 1, 0) Top Ten Members, Show both ADMIN, but not MOD
//					top_posters('10', 0, 1) Top Ten Members, Show both MOD, but not ADMIN
//					top_posters('10', 0, 0) Top Ten Members, Show neither ADMIN nor MOD
//
//////////////////////////////////////////////////////////////////////////////////////////////////
function top_posters($str_input, $show_admin, $show_mod)
{
	global $db, $phpEx, $theme;
	// Show All
	if ( ( $show_admin == '1' ) && ( $show_mod == '1' ) )
	{
		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts
		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 
		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) 
		GROUP BY user_id, username
		ORDER BY user_posts DESC
		LIMIT $str_input";
	}
	// Show Admin But Not Moderators
	elseif ( ( $show_admin == '1' ) && ( $show_mod == '0' ) )
	{
		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts
		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 
		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . MOD . ") 
		GROUP BY user_id, username
		ORDER BY user_posts DESC
		LIMIT $str_input";
	}
	// Show Moderators But Not Admins
	elseif ( ( $show_admin == '0' ) && ( $show_mod == '1' ) )
	{
		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts
		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 
		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . ADMIN . ") 
		GROUP BY user_id, username
		ORDER BY user_posts DESC
		LIMIT $str_input";
	}
	// Show Neither Admins Nor Moderators
	else/// ( ( $show_admin == '0' ) && ( $show_mod == '0' ) )
	{
		$sql = "SELECT u.user_id, u.username, u.user_posts, u.user_level, count(u.user_id) as user_posts
		FROM " . USERS_TABLE . " u, " . POSTS_TABLE . " p 
		WHERE (u.user_id <> " . ANONYMOUS . ") AND (u.user_id = p.poster_id) AND (u.user_level != " . ADMIN . ") AND (u.user_level != " . MOD . ") 
		GROUP BY user_id, username
		ORDER BY user_posts DESC
		LIMIT $str_input";
	}
	//
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, 'Could not query forum top poster information', '', __LINE__, __FILE__, $sql);
	}
	// $top_posters = array();
	while( $row = $db->sql_fetchrow($result) )
	{
				$style_color = '';
				if ( $row['user_level'] == ADMIN )
				{
					$row['username'] = '<b>' . $row['username'] . '</b>';
					$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
				}
				else if ( $row['user_level'] == MOD )
				{
					$row['username'] = '<b>' . $row['username'] . '</b>';
					$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
				}
		$top_posters .= '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>&nbsp;(' . $row['user_posts'] . '), ';
	}
  // return $top_posters;
  return substr($top_posters,0,strlen($top_posters)-2); // strip last comma and space
}
//
// END MOD: TOP 'X' USERS (AbelaJohnB)
//

# 
#-----[ OPEN ]------------------------------------------ 
#
templates/subSilver/index_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
#
</table>

<table width="100%" cellpadding="1" cellspacing="1" border="0">

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
  <tr> 
	<td class="catHead" colspan="2" height="28"><span class="cattitle">{L_TOP_POSTERS}</span></span></td>
  </tr>
  <tr> 
	<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/top_users.gif" alt="{L_TOP_POSTERS}" /></td>
	<td class="row1" align="left" width="100%"><span class="gensmall">{TOP_POSTERS}</span></td>
  </tr>

# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_main.php

# 
#-----[ FIND ]------------------------------------------ 
#
?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#
//
// START MOD: TOP 'X' USERS (AbelaJohnB)
//
$lang['Top_Posters'] = 'Top Posting Members';
//
// END MOD: TOP 'X' USERS (AbelaJohnB)
//

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
Last edited by tony44 on Tue Jun 06, 2006 2:58 am, edited 1 time in total.

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Sun Dec 04, 2005 1:39 am

tony44 - the fix for the problem you're experiencing is as follows:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
	<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_VIEW_BIRTHDAYS}" /></td>
#
#-----[ REPLACE WITH ]----------------------------------
#
	<td class="row1" align="center" valign="middle"><img src="templates/subSilver/images/whosonline.gif" alt="{L_VIEW_BIRTHDAYS}" /></td>
AbelaJohnB's code has the same problem. The fix for his code is as follows:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
	<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/top_users.gif" alt="{L_TOP_POSTERS}" /></td>
#
#-----[ REPLACE WITH ]----------------------------------
#
	<td class="row1" align="center" valign="middle"><img src="templates/subSilver/images/top_users.gif" alt="{L_TOP_POSTERS}" /></td>
The fix is to basically remove the rowspan="2". There aren't two rows, so if anything, rowspan should be 1 (which I think it is, by default) - not 2.

Also, PTRACER - I just tested it out, and it does indeed work. That said, I'm not going to test this MOD out on other versions of phpBB. It (and my other MODs) should work. Whether or not they actually do can be verified by installing with EasyMOD. If it does install, that's a fair indication that it'll work. If, despite having installed, something is broken, then just restore the backups that EasyMOD made.

tony44
Registered User
Posts: 232
Joined: Sun Apr 17, 2005 4:34 pm

Post by tony44 » Sun Dec 04, 2005 2:42 am

Perfect! Thanks so much!

bas_dodger
Registered User
Posts: 14
Joined: Mon Nov 21, 2005 8:37 pm

Post by bas_dodger » Sun Dec 04, 2005 12:24 pm

hi there, I installed this great mod to.
but no I have the following problem, namely: it shows 4 times in a row the same name from the one who's birthday it is...

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Sun Dec 04, 2005 7:07 pm

Can you post a screenshot or a link? 'cause I'm not really sure what you mean :(

abouhuraira
Registered User
Posts: 1
Joined: Sun Dec 04, 2005 8:05 pm

Post by abouhuraira » Sun Dec 04, 2005 8:39 pm

merci

User avatar
SaltAquatics
Registered User
Posts: 22
Joined: Sun Oct 09, 2005 2:08 am
Location: Portland, OR
Contact:

Post by SaltAquatics » Mon Dec 05, 2005 3:21 am

Great mod. But it doesn't seem to work well with the descriptive time zone mod. http://www.phpbb.com/phpBB/viewtopic.ph ... viewresult

Notice in the pic (ive included the link), that after i put in the fix for the avatar, this happens. http://img213.imageshack.us/my.php?imag ... lem1xd.jpg

Any thoughts on how we can get these two to behave together? Thanks in advance.
--Javier--

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Mon Dec 05, 2005 6:12 am

The problem in the pic doesn't look to be caused by a MOD incompatability - it looks to be caused by not all the modifications being installed. I assume you installed by hand?

Anyway, the first file I'd look at is usercp_register.php. Make sure all the changes were made to that file. If it looks like they were, try posting it here. Maybe I'll notice something.

That said, it's also possible that functions_selects.php and lang_main.php were also not modified correctly, but the first thing to look at is usercp_register.php.

User avatar
SaltAquatics
Registered User
Posts: 22
Joined: Sun Oct 09, 2005 2:08 am
Location: Portland, OR
Contact:

Post by SaltAquatics » Mon Dec 05, 2005 6:38 am

Thanks for the response. I actually used EasyMod for the installation. I looked at all the files and EVERYTHING is there. I just don't get it. I looked it over twice even. I uninstalled both mods (this is the 3rd time). What I found is that I can install the B-Day one and the fixes, and they work just fine. When I install this other mod, that mod works fine, but then messes up the birthday mod. In the same sense, i can install the time mod first, then the birthday mod, along with the fix for the -1 day on the bday in the profile. Then when i add the avatar fix on the mod, it messes up again. Hope im making sense to you. The only file that the time mod configures is the language/langenglish/lang_main.php file. I think the problem is there. I will look at it again.
--Javier--

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Mon Dec 05, 2005 7:28 am

That's really weird. I just installed both MODs (this one and the timezone mod) and experienced no such problems.

One thing that you might want to try doing is installing 1.0.1, which includes all the updates presented in this thread:

http://www.frostjedi.com/terra/scripts/ ... thdays.zip

If that doesn't help, then I guess the next step is to (if you're willing) provide me (via PM) with a temp. FTP account such that I might better diagnose / fix the problem.

User avatar
SaltAquatics
Registered User
Posts: 22
Joined: Sun Oct 09, 2005 2:08 am
Location: Portland, OR
Contact:

Post by SaltAquatics » Mon Dec 05, 2005 7:30 am

I'll try that link you put up. If that doesn't work, I will def. set you up with an FTP account and I would be most appreciative. Thanks for the help. I'll let you know if it works or not.
--Javier--

User avatar
SaltAquatics
Registered User
Posts: 22
Joined: Sun Oct 09, 2005 2:08 am
Location: Portland, OR
Contact:

Post by SaltAquatics » Mon Dec 05, 2005 8:42 am

Ok. So i backed out all the previous code for both mods. I installed the time zone mod, and then the new version of the birthday mod that you provided, and whamo! It all worked perfectly. Thanks for your help TerraFrost. It was greatly appreciated. :D
--Javier--

duena
Registered User
Posts: 6
Joined: Sun May 02, 2004 2:58 pm
Contact:

Post by duena » Mon Dec 05, 2005 4:20 pm

Hello

I have another problem and this is, if I change anything in the administration panel concerning a user who has not filled out the birthday fields, it announces "You didn't specify a valid Birthday."

How can I avoid this so that is optional for users to fill out these fields?

Thanks.
Duena

TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost » Mon Dec 05, 2005 7:04 pm

That's a problem that's exclusive to the ACP (apparently). Here's the fix:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
admin/admin_users.php
#
#-----[ FIND ]------------------------------------------
#
		if ( !checkdate((int) $bday_month, (int) $bday_day, (((int) $bday_year) == 0) ? 4 : $bday_year ) )
#
#-----[ REPLACE WITH ]-----------------------------------
#
		if ( ($bday_month != 0 || trim($bday_day) != $lang['Default_Day'] || trim($bday_year) != $lang['Default_Year']) && !@checkdate( $bday_month, $bday_day, (trim($bday_year) == $lang['Default_Year']) ? 4 : $bday_year ) )

PTRACER
Registered User
Posts: 166
Joined: Sun Dec 07, 2003 2:54 am

Post by PTRACER » Mon Dec 05, 2005 11:48 pm

Thanks for testing it out for me TerraFrost :) I'll get it installed on my forum sometime tomorrow.

Post Reply

Return to “[2.0.x] MOD Database Releases”