Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
update the forum/postcounter Details »»
update the forum/postcounter
Version: , by Wildthinks Wildthinks is offline
Developer Last Online: Sep 2013 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-07-2003 Last Update: Never Installs: 0
 
No support by the author.

Hi,

it's wrong board plz move to the right THX.

I use the follow function to post in my forum, but the problem is, that the counter not be updated. I cant understand whyy...please helpt (posting is ok, but reply is wrong) based on a post on this board :-)

PHP Code:
function replytoallsearchtext($subject,$message,$searchstring,$searchfield="pagetext"$tbl="post",$iconid="1",$signature="1",$postusername="::uploadbot::",$userid="4108")
{
global 
$conn;
global 
$dbpass;
global 
$dbserver;
global 
$dbase;

    
// dearch post to be answer
$sql "SELECT DISTINCT $searchfield, threadid FROM $tbl where $searchfield like '%$searchstring%' group by threadid";
echo 
$sql." <br>";
$vb_searchresult mysql_query($sql,$conn);
echo 
"<br>Found Count: ".mysql_num_rows($vb_searchresult);
while (    
$listlinked=mysql_fetch_array($vb_searchresult))
    {
            
/* Insert values into the POST table */
        
$sql "INSERT INTO post (postid,threadid,title,username,userid,dateline,attachmentid,pagetext,allowsmilie,showsignature,ipaddress,iconid,visible) VALUES (NULL,'$listlinked[threadid]','".addslashes($subject)."','".addslashes($postusername)."','$userid','".time()."','$attachmentid','".addslashes($message)."','$allowsmilie','$signature','$ipaddress','$iconid','1')";
        echo 
"<br> Posten der Nachricht ";
        
$vb_result mysql_query($sql,$conn);
        
$postid mysql_insert_id();
        echo 
"<br>PostID:".$postid;
        
//get forumid 

        
$sql="select thread.threadid, thread.forumid from thread where thread.threadid=$listlinked[threadid];";
        echo 
"<br> Forumid holen...";
        
$forumsearchresult mysql_query($sql,$conn);

        while (    
$forumsearch_ID=mysql_fetch_array($forumsearchresult))
        {
        
//Update threadcount
        
$sql "SELECT * FROM forum WHERE forumid='$forumsearch_ID[forumid]'";
        
$forum_query mysql_query($sql,$conn) or die(mysql_error());
        echo 
"<br> get forum for update counter ";
        
$forum_row mysql_fetch_Array($forum_query);
        
$sql "UPDATE forum SET replycount=replycount+1,threadcount=threadcount+1,lastpost='".time()."',lastposter='".addslashes($postusername)."' WHERE forumid IN ($forum_row[parentlist])";
        echo 
"<br> Update Counter: ";
        
$vb_result mysql_query($sql,$conn);
        }
    }

THX....

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:36 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12178 seconds
  • Memory Usage 2,209KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete