Post count not updated when posting with php file

Started by themavesite, May 19, 2016, 11:13:37 AM

Previous topic - Next topic

themavesite

Hi, I'm using custom php code to reply to a topic:

<?php
require("SSI.php");
require(
"Sources/Subs-Post.php");
// Bounce to log-in page if not logged in as Admin
isAllowedTo('admin_forum');

echo 
'<html><body>';

// Set some defaults -- modify these as desired
$topicOptions['id'] = '31559'// Topic ID
$topicOptions['board'] = '54'// Board ID
$posterOptions['id'] = '1';  // Poster ID
$msgOptions['subject'] = 'Re: test'// Subject of post
$msgOptions['body'] = 'test2'// The content of the post

// Don't touch these
$posterOptions['name'] = $user_info['name'];
$posterOptions['email'] = $user_info['email'];
$posterOptions['ip'] = $user_info['ip'];

// Create the reply!
createPost($msgOptions$topicOptions$posterOptions);

echo 
'<a href="' $boardurl '/index.php?topic=' $topicOptions['id'] . '">Click here to go view the new reply!</a>';

echo 
'</body></html>';
?>


The code works without a problem!
But the user's post count isn't being updated... (stays the same value as before)
How would I fix this?
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

Arantor

Is the post in a board where posts aren't being counted?

themavesite

Quote from: Arantor on May 19, 2016, 12:27:50 PM
Is the post in a board where posts aren't being counted?

Nope, when you post a regular reply, your post count gets +1'nd
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

qc

Add the following line to your default settings:
$posterOptions['update_post_count'] = true;
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

themavesite

Quote from: qc on May 19, 2016, 01:38:03 PM
Add the following line to your default settings:
$posterOptions['update_post_count'] = true;
Thank you for your reply, this works!
One more question though: I just noticed that the statistics also aren't updated, is there another line of code I need to add to make the statistics update as well?
Would make my day if that could get fixed too  8)
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

qc

Try adding the following line after the createPost(); call:
trackStats();
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

themavesite

Quote from: qc on May 19, 2016, 02:40:17 PM
Try adding the following line after the createPost(); call:
trackStats();
Thanks, that did the trick!

Is there anything else I'm forgetting that needs to be counted?
TMS Forums
Since 2008 and still going strong! Join today! http://forums.themavesite.com/index.php

qc

No idea, really. If you miss anything, let us know :D
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Advertisement: