vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   resetable posts counter (https://vborg.vbsupport.ru/showthread.php?t=33176)

mega77 12-13-2001 08:05 PM

PHP Code:

newthread.php

          $DB_site
->query("UPDATE user SET
          "
.iif ($foruminfo[countposts],"posts=posts+1,","")."
          
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'"); 

I've created the field call reset_posts (same field as posts) in user table and whenever someone post the new thread I like to +1 in that field ... work just same as "posts" field but i want to reset "reset_posts" field weekly or monthly manually for my event purpose.

Can anyone modify the above script? Am I looking at the right parts of the script? I just started to learn PHP ...

Thanks in advance

mega77 12-13-2001 09:05 PM

PHP Code:

$DB_site->query("UPDATE user SET
          "
.iif ($foruminfo[countposts],"posts=posts+1,","")."
          
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");

$DB_site->query("UPDATE user SET reset_post = reset_post + 1 WHERE userid='$bbuserinfo[userid]'"); 

plz help ... i added last line ... is it going to work?

Freddie Bingham 12-13-2001 09:29 PM

PHP Code:

$DB_site->query("UPDATE user SET
          "
.iif ($foruminfo[countposts],"posts=posts+1,reset_post=reset_post+1,","")."
          
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'"); 


mega77 12-13-2001 09:38 PM

[QUOTE]Originally posted by freddie
PHP Code:

$DB_site->query("UPDATE user SET
          "
.iif ($foruminfo[countposts],"posts=posts+1,reset_post=reset_post+1,","")."
          
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'"); 



All times are GMT. The time now is 06:02 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.01353 seconds
  • Memory Usage 1,735KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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