Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-08-2005, 09:36 AM
Hiro's Avatar
Hiro Hiro is offline
 
Join Date: Jul 2004
Location: Queensland
Posts: 146
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Running Queries

Code:
#####################################################
# Require X posts in the last Y hours to use arcade #
#####################################################
# ~ by 006 #
############ 
// official support thread available at vbulletin.org
 
https://vborg.vbsupport.ru/showthrea...221#post518221
 
Let me start out by saying that I made this hack for 
the V3Arcade system. All credit for that hack goes to 
John. If you can think of any other pages that this 
limitation hack could be used for, let me know and I 
can code it. 
 
I know ever since the V3Arcade was released, we all have
been noticeing new members signing up only to spend time in 
the arcade. They may post once or twice, but for the most 
part they do not post. Instead they just suck your bandwidth. 
What can you do about this? Well, with this hack you can 
customize the number (x) posts required in the last (y) hours. 
This is all on a per usergroup basis.
 
There are other ways people have been doing this, such as 
base arcade access on postsperday. This is a bad way to do 
this because if somebody goes out of town for a week, their 
posts per day will suffer. Soon it becomes impossible to 
get your posts back to the minimum posts per day level. This 
hack is fair to all members based on usergroups.
 
This hack adds two new usergroup fields, and adds the option 
to edit these fields directly form your admincp. It is very 
self explanatory. 
 
The hack may not seem like much, but I put a lot of time into 
it, so I would appreciate it if everyone would click install! 
 
PLEASE CLICK INSTALL! That's all I ask. :)
 
*Please do not edit or redistribute this hack without my 
permission. Thanks!
 
~006
 
// On to the installation!
 
~~~~~~~~~~~~
Queries: 2
File edits: 2
New Phrases: 1
~~~~~~~~~~~~
 
TOTAL INSTALL TIME: ~5 minutes or less
 
###################
##### Step 1. #####
###################
 
Run the following queries
____________________________________________________
 
ALTER TABLE `usergroup` ADD `arcademinposts` INT( 11 ) DEFAULT '0' NOT NULL ;
____________________________________________________
 
then
 
____________________________________________________
 
ALTER TABLE `usergroup` ADD `arcademintime` INT( 11 ) DEFAULT '0' NOT NULL ;
____________________________________________________
 
###################
##### Step 2. #####
###################
____________________________________________________
 
**************
* FILE EDITS *
**************
// in admincp/usergroup.php
********
* FIND *
********
____________________________________________________
 
'profilepicmaxsize' => 25000
____________________________________________________
 
****************
* REPLACE WITH *
****************
____________________________________________________
 
'profilepicmaxsize' => 25000,
	'arcademinposts' => 2, 'arcademintime' => 24
____________________________________________________
 
********
* FIND *
********
 
____________________________________________________
 
print_yes_no_row("Can Delete Leaderboard Scores? <dfn>Allows usergroup to delete scores and comments left by other members</dfn>", 'usergroup[candelscores]', $ug_bitfield['candelscores']);
____________________________________________________
 
*************
* ADD UNDER *
*************
 
____________________________________________________
 
print_input_row("006's Require X posts in last Y hours to play games in arcade? <dfn>Enter post requirements here</dfn>", 'usergroup[arcademinposts]', $usergroup['arcademinposts']);
print_input_row("006's Require X posts in last Y hours to play games in arcade? <dfn>Enter time requirements here (in hours)</dfn>", 'usergroup[arcademintime]', $usergroup['arcademintime']);
____________________________________________________
 
// SAVE AND UPLOAD admincp/usergroup.php
 
 
// in arcade.php
********
* FIND *
********
 
____________________________________________________
 
// pre-cache templates used by specific actions
$actiontemplates = array();
____________________________________________________
 
*************
* ADD UNDER *
*************
 
____________________________________________________
 
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
____________________________________________________
 
********
* FIND *
********
 
____________________________________________________
 
// ############################ PLAY PAGE ################################
if ($_GET['do']=="play") {
____________________________________________________
 
*************
* ADD UNDER *
*************
 
____________________________________________________
 
//start require x posts in the last y hours to use arcade by 006
$minimumposts = $DB_site->query_first("
SELECT arcademinposts AS number FROM " . TABLE_PREFIX . "usergroup 
WHERE usergroupid=$bbuserinfo[usergroupid] 
");
$minimumtime = $DB_site->query_first("
SELECT arcademintime AS time FROM " . TABLE_PREFIX . "usergroup 
WHERE usergroupid=$bbuserinfo[usergroupid] 
");
 
$definedtime = ($minimumtime[time] * 3600);
$limit = TIMENOW - $definedtime;
$recentpostcount = $DB_site->query_first("
SELECT COUNT(*) AS total
FROM " . TABLE_PREFIX . "post 
WHERE userid=$bbuserinfo[userid] 
AND dateline >= $limit
");
 
if ($recentpostcount[total] < $minimumposts[number]) {
eval(print_standard_error('error_no_arcade_permission'));
}
 
//end require x posts in the last y hours to use arcade by 006
____________________________________________________
 
// SAVE AND UPLOAD arcade.php
 
###################
##### Step 3. #####
###################
 
***************
* New Phrases *
***************
____________________________________________________
 
Type: Front-End Error Messages
VarName: no_arcade_permission
Text: You cannot play games in the arcade unless you have made $minimumposts[number] posts within the last $minimumtime[time] hours.
____________________________________________________
 
###################
##### Step 4. #####
###################
 
***************
* INSTALL ME! *
***************
____________________________________________________
 
Go to vbulletin.org and click INSTALL! :)
____________________________________________________
 
 
Done! I put a lot of time into this. 
 
The least you can do in return is click the install button at vbulletin.org. 
 
PLEASE CLICK INSTALL IF YOU USE THIS HACK :)
 
https://vborg.vbsupport.ru/vborg_mis...threadid=65735
 
Thanks everybody!
 
~006
I don't know how to run queries and add phrases.

Can someone install this for me?

I might pay you
Reply With Quote
 


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 05:08 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.03183 seconds
  • Memory Usage 2,317KB
  • Queries Executed 13 (?)
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)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.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_threaded
  • showthread_threaded_construct_link
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete