vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Not Show New Member Name Right Away (https://vborg.vbsupport.ru/showthread.php?t=46300)

Diva 12-02-2002 12:24 PM

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:
PHP Code:

// 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
PHP Code:

// 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..

Diva 12-02-2002 07:15 PM

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.

Diva 12-02-2002 09:19 PM

Hi Erwin! My hero arrives. :) I could only find this 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?

Diva 12-02-2002 10:25 PM

Hi Erwin. I found the hack... but it doesn't work :( It's this thread.

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...

Diva 12-02-2002 11:49 PM

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.

Diva 12-03-2002 12:17 AM

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.

Diva 12-03-2002 12:31 AM

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:

PHP Code:

// 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:

PHP Code:

// 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. :)

Diva 12-03-2002 12:33 AM

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.

Diva 12-03-2002 12:40 AM

Sigh... Nope. Now no one shows up.... My luck, eh?

Erwin 12-03-2002 01:03 AM

Try this:

PHP Code:

// 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']; 


Diva 12-03-2002 01:06 AM

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. :)

Diva 12-03-2002 01:10 AM

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.

Diva 12-03-2002 01:14 AM

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:

PHP Code:

     if (($userinfo["$key"]['lastactivity'] < $user['lastactivity']) or !$userinfo["$key"]['lastactivity']) { 

CHANGE to:

PHP Code:

     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:

PHP Code:

 $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:

PHP Code:

 $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...

Diva 12-03-2002 01:41 AM

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.

Diva 12-03-2002 01:57 AM

4 is moderation

Diva 12-03-2002 01:59 AM

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:

PHP Code:

// 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. :)

Diva 12-03-2002 02:13 AM

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:

PHP Code:

// 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:

PHP Code:

// 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:

PHP Code:

$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:

PHP Code:

$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:

PHP Code:

  $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:

PHP Code:

  $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! :)

Diva 12-03-2002 02:35 AM

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)

PHP Code:

    $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.


All times are GMT. The time now is 05:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03317 seconds
  • Memory Usage 1,867KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (17)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete