Hiro
04-08-2005, 09:36 AM
################################################## ###
# Require X posts in the last Y hours to use arcade #
################################################## ###
# ~ by 006 #
############
// official support thread available at vbulletin.org
https://vborg.vbsupport.ru/showthread.php?p=518221#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_permiss ion'));
}
//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_miscactions.php?do=installhack&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 :o
# Require X posts in the last Y hours to use arcade #
################################################## ###
# ~ by 006 #
############
// official support thread available at vbulletin.org
https://vborg.vbsupport.ru/showthread.php?p=518221#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_permiss ion'));
}
//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_miscactions.php?do=installhack&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 :o