Version: , by Urban51
Developer Last Online: Sep 2007
Version: Unknown
Rating:
Released: 05-20-2006
Last Update: Never
Installs: 0
No support by the author.
I am running 3.5.4 and have upgraded to the lastest arcade. I've set the post requirement to 5 posts per day before people can play in the arcade however, I'm finding that it's counting posts from non-post counting rooms to be included in that requirement.
How can I fix that?
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
This is possible, but would procude more load on SQL because of additional things to be done... Problem is that vBulletin does not store information about "this post counts to the counter" in the posts-table, so every post has to be checked for its forumid and there its settings ...
Possible, but will slow down the Arcade I think:
THE FOLLOWING CODE IS UNTESTED AND PROVIDED JUST OUT OF MIND
open /modules/mod_arcade.php
search for
Code:
if( $this->user['ppd_require'] )
{
$posts_today_time = mktime(0,0,0,date("m"),date("d"),date("Y"));
$DB->query("SELECT COUNT(postid) AS amount FROM ibf_post WHERE dateline>".$posts_today_time." AND userid=".$this->user['id']);
$posts_today = $DB->fetch_row();
$this->user['posts_today'] = $posts_today['amount'];
}
and replace with
Code:
if( $this->user['ppd_require'] )
{
$posts_today_time = mktime(0,0,0,date("m"),date("d"),date("Y"));
$postcounter=0;
// get todays posts that are in forums where postcounting is active
$countquery = $DB->query("SELECT p.userid, f.options
FROM ibf_post AS p, ibf_thread AS t, ibf_forum AS f
WHERE dateline>".$posts_today_time."
AND p.userid=".$this->user['id']."
AND p.threadid=t.threadid
AND t.forumid=f.forumid");
while ($counter=$DB->fetch_row($countquery))
{
if (substr($counter['options'],4,1)=="1") { $postcounter++; }
}
$this->user['posts_today'] = $postcounter;
}
mySQL query error: SELECT p.userid, f.options
FROM vb3_post AS p, vb3_thread AS t, vb3_forum AS f
WHERE dateline>1149307200
AND p.userid=709
AND p.threadid=t.threadid
AND t.forumid=f.forumid
mySQL error: Column 'dateline' in where clause is ambiguous
mySQL error code:
Date: Saturday 03rd of June 2006 11:04:54 AM
if( $this->user['ppd_require'] )
{
$posts_today_time = mktime(0,0,0,date("m"),date("d"),date("Y"));
$postcounter=0;
// get todays posts that are in forums where postcounting is active
$countquery = $DB->query("SELECT p.userid, f.options
FROM ibf_post AS p, ibf_thread AS t, ibf_forum AS f
WHERE p.dateline>".$posts_today_time."
AND p.userid=".$this->user['id']."
AND p.threadid=t.threadid
AND t.forumid=f.forumid");
while ($counter=$DB->fetch_row($countquery))
{
if (substr($counter['options'],4,1)=="1") { $postcounter++; }
}
$this->user['posts_today'] = $postcounter;
}