Need help modifying "Newest User" field

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
ImFeelingItDawg
Registered User
Posts: 60
Joined: Fri Oct 01, 2004 1:21 pm

Need help modifying "Newest User" field

Post by ImFeelingItDawg »

I am trying to modify the newest user field in the "Who is online" box. Basically, I would like to split it up into two lines. One would show the newest male user and the other line would show the newest female user. We currently have the Gender Mod loaded. I assume I would need to modify functions.php at the following location:

Code: Select all

case 'newestuser':
	$sql = "SELECT user_id, username
	FROM " . USERS_TABLE . "
	WHERE user_id <> " . ANONYMOUS . "
	AND user_active = 1
	ORDER BY user_id DESC
	LIMIT 1";
	break;
Do I need to modify the WHERE statement? Somehow add another variable? Thanks for any help with this.
User avatar
OmegaQuest
Registered User
Posts: 76
Joined: Mon Sep 01, 2003 9:12 pm
Location: Washington, DC

Post by OmegaQuest »

You can try this:

Code: Select all

case 'new_gender_male': 
   $sql = "SELECT *
   FROM " . USERS_TABLE . " 
   WHERE user_gender = 1 
   AND user_active = 1 
   ORDER BY user_regdate ASC
   LIMIT 1"; 
   break;
and

Code: Select all

case 'new_gender_female': 
   $sql = "SELECT *
   FROM " . USERS_TABLE . " 
   WHERE user_gender = 2 
   AND user_active = 1 
   ORDER BY user_regdate ASC
   LIMIT 1"; 
   break;
I hope this will help a little as an Idea
ImFeelingItDawg
Registered User
Posts: 60
Joined: Fri Oct 01, 2004 1:21 pm

Post by ImFeelingItDawg »

Thanks for the help. I tried to plug those two fields in the functions.php file where the other code was I posted and nothing showed up. The line "The newest registered user is" was there but no user.
Post Reply

Return to “[2.0.x] MOD Requests”