Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #31  
Old 12-03-2002, 01:59 AM
Diva's Avatar
Diva Diva is offline
 
Join Date: Oct 2001
Location: CA, USA
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I take out moderated users? Forgive me, I am not php saavy... at all.
Reply With Quote
  #32  
Old 12-03-2002, 02:01 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #33  
Old 12-03-2002, 02:02 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use the code from the previous posts - I have modified it to work for usergroupid 4. And also the above post.
Reply With Quote
  #34  
Old 12-03-2002, 02:13 AM
Diva's Avatar
Diva Diva is offline
 
Join Date: Oct 2001
Location: CA, USA
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #35  
Old 12-03-2002, 02:24 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #36  
Old 12-03-2002, 02:35 AM
Diva's Avatar
Diva Diva is offline
 
Join Date: Oct 2001
Location: CA, USA
Posts: 311
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #37  
Old 12-03-2002, 04:05 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #38  
Old 12-03-2002, 07:56 PM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Xenon, you can't unless you include a SELECT * as well - but I'm no expert.
Reply With Quote
  #39  
Old 12-04-2002, 11:34 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #40  
Old 12-05-2002, 01:55 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:45 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05756 seconds
  • Memory Usage 2,280KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete