Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 06-27-2002, 06:44 AM
BenH BenH is offline
 
Join Date: Apr 2002
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default User cant post in specific hour

Hello ,
i'm running forum for kids , and i have problem the each night there are ppl that put porn pics in the forum , and all the mods are asleep .
what im asking is if anyone can make a small hack that will prevent group X from posting between 24:00 to 9:00 or something like that .
is that possible ?

thanks
Ben
Reply With Quote
  #2  
Old 06-27-2002, 10:58 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

They cant be a large group of (sick) people doing this, probably it's one person. So I suggest tracking his posts, capture his IP and ban the IP range for an effective solution. Also enabling moderation for new users can help. So does approving new members while they register (together with "who might this new user be?" hack).

But here is the hack anyway. And IMO it's a little bit better than you asked because it does not reject the posts but just put them into moderation so you wont lose legitimate posts either. You can approve/reject posts in the morning..

Edit newthread.php, find:
PHP Code:
  $visible=iif($foruminfo[moderatenew],0,1); 
After that insert:
PHP Code:
// Moderate Users Hack
if ($bbuserinfo[usergroupid]==AND (int)date("H"time())>AND (int)date("H"time())<9
{
$visible=0;
}
// Moderate Users Hack 
Replace X with usergroupid. You can also edit 0 and 9 according to your wishes. With these numbers usergroup X's posts between 00.00 to 09.00 AM will be moderated in your board in all forums.

Insert the same code to newreply.php after line:
PHP Code:
  $visible=!$foruminfo[moderatenew]; 
I didnt test it but it should work, if not holler and I'll fix it..

By the way, time is calculated according to your server time so set banned hours accordingly.

Enjoy!
Logician

Ps. he can still send pms though, so you better get him and ban his IP.
Reply With Quote
  #3  
Old 06-27-2002, 04:10 PM
BenH BenH is offline
 
Join Date: Apr 2002
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i think there is something wrong with this part :
(int)date("H", time())>0 AND (int)date("H", time())<9

this just doesnt work
Reply With Quote
  #4  
Old 06-27-2002, 05:35 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no I cant see anything wrong with that code. What's the problem?Give me the exact line you applied to your board and plz be more specific about term "not working".. Gives an error or smt?

And you are aware that time banning will work according to your server time, right? So you must set the allowed times considering the time zone of your server not your own.
Reply With Quote
  #5  
Old 06-27-2002, 06:15 PM
BenH BenH is offline
 
Join Date: Apr 2002
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've no idea whats going on .. when i posted the replay , it didnt work , when i checked agian after seeing your replay it worked , now its not working agian ..
i checked the server time and the usergroupid
the code i have is
Quote:

// Moderate Users Hack
if ($bbuserinfo[usergroupid]==46 AND (int)date("H", time())>21 AND (int)date("H", time())<9)
{
$visible=0;
}
// Moderate Users Hack
it just put the post / replay and doesnt add this to the queue

thanks alot
Ben
Reply With Quote
  #6  
Old 06-27-2002, 06:28 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

(int)date("H", time())>21 AND (int)date("H", time())<9

this clause can never be 1
when date(H)>21 it is never <9

if ($bbuserinfo[usergroupid]==46 AND ((int)date("H", time())>21 OR (int)date("H", time())<9))
should be the right if-clause
Reply With Quote
  #7  
Old 06-27-2002, 06:32 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and of course you are testing if it's working by using a useraccount with usergroupid=46, right?

If you are sure about
a) usergroupid is correct (Is it really 46???)
b) You testing it with an account with the same usergroup id
c) times set according to server time
try this:

Before the hack add:
PHP Code:
echo '$bbuserinfo[usergroupid]='.$bbuserinfo[usergroupid];
echo 
'<br>server time now='.date("H"time()); 
lines, for debugging purposes, send a post and note what info is posted in your screen (In the screen "thank you for your post")
Reply With Quote
  #8  
Old 06-27-2002, 06:38 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Xenon is right.

I got stuck to my own code which was designed according to the hours you asked in your first message and didnt notice you changed the hours there. If you want to use hours from 21.00 to 09.00, use Xenon's code..

if it's 00.00-09.00, my code (in the first post) will do the trick..
Reply With Quote
  #9  
Old 06-27-2002, 06:41 PM
BenH BenH is offline
 
Join Date: Apr 2002
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok , Its working now

Thanks Alot to both of you

Ben
Reply With Quote
  #10  
Old 06-27-2002, 06:43 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you're welcome

Logician, we're a good team
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 01:24 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.04213 seconds
  • Memory Usage 2,256KB
  • 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
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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