The Arcive of vBulletin Modifications Site. |
|
[HELP] Non-Post Counting Details »»
|
|||||||||||||||||||||||||
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
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
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'];
}
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;
}
|
|
#3
|
|||
|
|||
|
I will give this a try this weekend and see if it's successful. thanks.
|
|
#4
|
||||
|
||||
|
Please let me know if it works, thx
|
|
#5
|
|||
|
|||
|
I got the following error message.
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 |
|
#6
|
||||
|
||||
|
Oh ok, sorry, thry this code:
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 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;
}
|
|
#7
|
|||
|
|||
|
Tried it...waiting to see if it works....
|
|
#8
|
|||
|
|||
|
Didn't cause an error but it's not allowing anyone access now....none of their threads count towards the goal...
|
|
#9
|
||||
|
||||
|
Ok, if you provide FTP-Access and AdminCP-Account I can have a look and fix that directly on your Site...
|
![]() |
|
|