vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need Help - Using newpost_complete (https://vborg.vbsupport.ru/showthread.php?t=113345)

wholemama 04-18-2006 03:41 PM

Need Help - Using newpost_complete
 
I've got this plugin I've been trying to write for newpost_complete...but I can't get it to work...anyone see where I've gone wrong?

Code:

//if post is original author
$originals = $vbulletin->db->query_read("
                        SELECT postuserid
                        FROM " . TABLE_PREFIX . "thread
                        WHERE threadid = '" . $newpost['threadid'] . "'");

while($original = $vbulletin->db->fetch_array($originals)) {
if($original['userid']==$newpost['userid']){

//Find who is subscribed to this thread
$subscribed = $vbulletin->db->query_read("
                        SELECT emailupdate,userid
                        FROM " . TABLE_PREFIX . "subscribethread
                        WHERE threadid = '" . $newpost['threadid'] . "'");

while($subscribe = $vbulletin->db->fetch_array($subscribed)) {
        if ($subscribe['emailupdate'] == 5) {
        //User is subscribed to thread & wants notification when original replies

                //Get users email address and name
                $user = $vbulletin->db->query_first("
                                SELECT email,username
                                FROM " . TABLE_PREFIX . "user
                                WHERE userid = '" . $subscribe['userid'] . "' LIMIT 1");

                // Get email phrases
                eval(fetch_email_phrases('foruminstantnotify', $forum['languageid']));
                       
                        //Send the email
                vbmail($user['email'], $subject, $message);
        }
}
}}


wholemama 05-01-2006 12:48 AM

Bumping out of desperation...

Xenium 05-01-2006 03:02 AM

Replace the where clauses in your SQL statments in the following way.

change:
PHP Code:

WHERE threadid '" . $newpost['threadid'] . "'"); 

change to:
PHP Code:

WHERE threadid $newpost['threadid']"); 

do it like that for all of them.

wholemama 05-03-2006 01:34 PM

Thanks...that seems to do something...

Except now, I always get a "this is a duplicate of a post you did in the last 5 minutes" message. It's like it double posts.


All times are GMT. The time now is 08:06 AM.

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.00980 seconds
  • Memory Usage 1,721KB
  • 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
  • (1)bbcode_code_printable
  • (2)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