View Full Version : Not Show New Member Name Right Away
Hi. I have a guy that's been harassing me. He signs up with derogatory remarks towards members. My board is on moderation at this point.
Is there a way to not show the new member on the front page until I okay the membership? {Where it says Newest Member}
Thanks bunches!
Xenon
12-02-2002, 01:14 PM
hmm, not sure, but you can try this:
open index.php
find:
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
and change it to
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid<=$numbersmembers[max] AND usergroupid=2 ORDER BY userid DESC");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
i think it should work..
It doesn't work. :(
Any way to do this for whosonline, too?
Erwin
12-02-2002, 08:52 PM
I think there's a hack that does this already - look in Full Releases. It stops new members usernames from showing up until they are approved.
Hi Erwin! My hero arrives. :) I could only find this (https://vborg.vbsupport.ru/showthread.php?s=&threadid=16140&highlight=username+show) in the search. But it's a year old and the last post looks as if it didn't work. Is there another one that you know off?
Hi Erwin. I found the hack... but it doesn't work :( It's this thread (https://vborg.vbsupport.ru/showthread.php?s=&postid=327362#post327362).
Erwin
12-02-2002, 10:28 PM
No, it's not that one... I can't find it either... but I am certain I saw it - I posted in that thread as well. :) Keep looking...
You mean you posted in the one that I am looking for?
The last one does exactly what I want... if only it would work. *pouts* Right now I have to periodically turn off the signups because he's gotten so bad with the names. I guess I never thought anyone would use such words.... :(
Erwin
12-02-2002, 11:55 PM
Yeah, that's the one actually. :)
Instead of stopping signups, ban his IP address.
Or to prevent him from using free email addresses to register, ban free email addresses.
If I ban his IP, he just goes with AOL. Then I won't know which one he is. Unfortunately he is also posting my personal info. It's a mess. Is there a way to help me with that hack?
Erwin
12-03-2002, 12:30 AM
I agree you can't ban AOL's IPs (though I wish I can sometimes).
Unfortunately, AOL let's their users have multiple email addresses.
Report him to abuse@aol.com
Install hellban, or something similar to ban him.
I don't have time to look at this hack unfortunately.
Okay. Thank you very much for showing me the hack. That's half the battle. Take care.
Erwin
12-03-2002, 12:32 AM
Try this:
Change:
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
to this:
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username,usergroupid FROM user WHERE userid=$numbersmembers[max] AND usergroupid=2 ORDER BY userid DESC");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
It should work. Xenon forgot to make the query look up usergroupid as well. :)
Is this in the index.php?
Erwin
12-03-2002, 12:34 AM
Refresh the screen, I made a typo. :)
Erwin
12-03-2002, 12:34 AM
Yes, it's in the index.php - it should work - only registered members will show up as newest members.
Sigh... Nope. Now no one shows up.... My luck, eh?
Erwin
12-03-2002, 01:03 AM
Try this:
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username,usergroupid FROM user WHERE userid<=$numbersmembers[max] AND usergroupid=2 ORDER BY userid DESC");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
AAAAA!!!!!! You RULE, Erwin!!!!! Now all I need is the whosonline part and he can sign up til the cows come home!!!
***BIG HUG***
Erwin
12-03-2002, 01:08 AM
Who's Online part in index.php or in online.php? Also, credit goes to Xenon - I just fixed up his small mistake. :)
Thank you, Xenon!!!!!!! Yay!
I think it's both. I need to make it so only registered users names show in the whosonline section.
Erwin
12-03-2002, 01:13 AM
I'm busy at work at the moment... when I have time, I will take a look... it's a matter of just adding a
AND usergroupid=2
to the WHERE section of the query statements to find the usernames, making sure that usergroupid is being obtained in the query as a variable.
I really appreciate this, Erwin. You have no idea how much this means to me. Thank you for helping me this much.
Erwin
12-03-2002, 01:37 AM
In online.php,
find:
if (($userinfo["$key"]['lastactivity'] < $user['lastactivity']) or !$userinfo["$key"]['lastactivity']) {
CHANGE to:
if ((($userinfo["$key"]['lastactivity'] < $user['lastactivity']) or !$userinfo["$key"]['lastactivity']) AND $user['usergroupid'] != 4) {
Erwin
12-03-2002, 01:39 AM
In index.php.
Find:
$loggedins=$DB_site->query("SELECT DISTINCT session.userid,username,invisible,usergroupid
FROM session
LEFT JOIN user ON (user.userid=session.userid)
WHERE session.userid>0 AND session.lastactivity>$datecut
ORDER BY invisible ASC, username ASC");
Change to:
$loggedins=$DB_site->query("SELECT DISTINCT session.userid,username,invisible,usergroupid
FROM session
LEFT JOIN user ON (user.userid=session.userid)
WHERE session.userid>0 AND session.lastactivity>$datecut AND user.usergroupid<>4
ORDER BY invisible ASC, username ASC");
Erwin
12-03-2002, 01:40 AM
Hope that works! This excludes usergroupid 3, members awaiting email verification, from showing up in Who's Online. I assume that is what you want...
I don't know what you mean. I know that the only members names that I want shown online, or in new members is the ones who I said yes to moderated. Is that what you mean?
Erwin
12-03-2002, 01:56 AM
What is the usergroupid of unmoderated members? Is it 3? 2 is for registered, 3 is for those waiting email verification.
Erwin
12-03-2002, 01:57 AM
The first code mod to stop newest member showing up only shows up usergroupid 2 - registered members. We cannot do the same for Who's Online, because mods, admins etc. would be excluded, so we will just go and exclude unmoderated users.
How do I take out moderated users? Forgive me, I am not php saavy... at all.
Erwin
12-03-2002, 02:01 AM
Okay, I've changed my code to reflect that. Try to change index.php and online.php using the above code.
Also, instead of using the original index.php code for newest member, use this:
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username,usergroupid FROM user WHERE userid<=$numbersmembers[max] AND usergroupid<>4 ORDER BY userid DESC");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
This way you don't exclude valid members who are just waiting for email verification. :)
Erwin
12-03-2002, 02:02 AM
Use the code from the previous posts - I have modified it to work for usergroupid 4. :) And also the above post. :)
Umm... I don't any names of members waiting for email notification or moderation showing up. If they do, then his insulting username shows. See, first it goes to email validation. Then It goes into moderation. How can I get it back so that only registered members who I have sent an email to okay show?
That means usergroup 3 and 4 doesnt show... How do I do that?
Erwin
12-03-2002, 02:24 AM
Do this:
In index.php, find:
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
Replace with:
// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username,usergroupid FROM user WHERE userid<=$numbersmembers[max] AND usergroupid<>3 AND usergroupid <>4 ORDER BY userid DESC");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
Then, find:
$loggedins=$DB_site->query("SELECT DISTINCT session.userid,username,invisible,usergroupid
FROM session
LEFT JOIN user ON (user.userid=session.userid)
WHERE session.userid>0 AND session.lastactivity>$datecut
ORDER BY invisible ASC, username ASC");
Replace with:
$loggedins=$DB_site->query("SELECT DISTINCT session.userid,username,invisible,usergroupid
FROM session
LEFT JOIN user ON (user.userid=session.userid)
WHERE session.userid>0 AND session.lastactivity>$datecut AND user.usergroupid<>3 AND user.usergroupid<>4
ORDER BY invisible ASC, username ASC");
In online.php (I'm going to try a different approach),
Find:
$allusers= $DB_site->query("SELECT user.username, session.location, session.lastactivity, user.userid, user.usergroupid, user.invisible, session.host, user.showemail, user.receivepm
FROM session
". iif($WOLguests, " LEFT JOIN user USING (userid) ", ",user") ."
WHERE session.lastactivity > $datecut
". iif(!$WOLguests, " AND session.userid = user.userid", "") ."
ORDER BY user.username
");
Replace with:
$allusers= $DB_site->query("SELECT user.username, session.location, session.lastactivity, user.userid, user.usergroupid, user.invisible, session.host, user.showemail, user.receivepm
FROM session
". iif($WOLguests, " LEFT JOIN user USING (userid) ", ",user") ."
WHERE session.lastactivity > $datecut AND user.usergroupid <>3 AND user.usergroupid <>4
". iif(!$WOLguests, " AND session.userid = user.userid", "") ."
ORDER BY user.username
");
See if that works.
I am leaving for home now, and won't check this thread until tomorrow, so I hope it works! :)
Hi. The index part works great. Unfortunately the online part also wipes out the guests.
I took the online part of one of the hacks and it worked. Yay! Thank you sooo much.
Xenon
12-03-2002, 04:05 PM
Erwin, that's new to me here...
normally you can use fields in where clause without include them into the select clause...
How old's your MySQL Diva? :D
Erwin
12-03-2002, 07:56 PM
Xenon, you can't unless you include a SELECT * as well - but I'm no expert.
Xenon
12-04-2002, 11:34 AM
im sure you can erwin, here's a part of an original vb code (index.php)
$birthdays = $DB_site->query_first("SELECT template FROM template WHERE title='birthdays' and templatesetid = -2");
you can see templatesetid and title are not included in the select, but they are in where :P
Erwin
12-05-2002, 01:55 AM
Mmm... maybe templates are different as they are made global... I know when I write my own hacks, I have to SELECT the variable for it to be used as a conditional.
Xenon
12-05-2002, 01:02 PM
well, all my hacks work without selecting the conditional variable.
maybe we should ask at mysql.org ;)
Erwin
12-06-2002, 02:47 AM
Hey, you are they PHP guru, not me. :) I believe you if you say it, my friend. :)
Xenon
12-06-2002, 11:28 AM
good to here, we should leave this status ;)
maybe it was just something other, upload was incorrect or something like that....
can happen sometimes..
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.