vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   ibProArcade Archive (https://vborg.vbsupport.ru/forumdisplay.php?f=174)
-   -   [HELP] Non-Post Counting (https://vborg.vbsupport.ru/showthread.php?t=116167)

Urban51 05-20-2006 02:57 PM

[HELP] Non-Post Counting
 
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?

MrZeropage 05-23-2006 04:42 PM

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;
        }


Urban51 06-01-2006 09:35 PM

I will give this a try this weekend and see if it's successful. thanks.

MrZeropage 06-01-2006 09:42 PM

Please let me know if it works, thx :)

Urban51 06-03-2006 02:05 PM

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

MrZeropage 06-04-2006 06:46 AM

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;
        }


Urban51 06-04-2006 09:29 PM

Tried it...waiting to see if it works....

Urban51 06-06-2006 10:27 PM

Didn't cause an error but it's not allowing anyone access now....none of their threads count towards the goal...

MrZeropage 06-07-2006 04:35 AM

Ok, if you provide FTP-Access and AdminCP-Account I can have a look and fix that directly on your Site... :)


All times are GMT. The time now is 10:08 PM.

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.00976 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete