vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to pass users pw through email? (https://vborg.vbsupport.ru/showthread.php?t=285376)

Simon Lloyd 08-28-2012 04:45 AM

The error isn't in misc.php it's in one of your plugin's, misc.php is called when one of yourplugins doesn't give a result.

John Lester 08-28-2012 04:02 PM

I know it's not in misc.php and the only plugin is the mod I'm working on. What I don't understand about the error is ... what exactly is it looking for?

I mean there are no ` in the mod, so is it looking for ]' or ']' or ']'' or ] ?

--------------- Added [DATE]1346177661[/DATE] at [TIME]1346177661[/TIME] ---------------

Found the elusive missing ] :D

Simon Lloyd 08-28-2012 06:32 PM

Good man :), i know what it's like, you look so hard for so long you get code blind and can't see the nose in front of you!

John Lester 08-28-2012 07:50 PM

Well it's my own fault. I had two copies of the xml, one was the master copy and the other was used to work on. I accidentally deleted the master copy instead of the borked working copy :D

So now I'm still using the borked working copy (for some reason it keeps giving me the error that I'm already unsubscribed even though I'm not), but once I get it unborked it will become the new master.

John Lester 09-16-2012 10:06 PM

I'm still stuck on the existing subscribe threads. I'm unable to get a working loop done. Just wanted to update those that are following this, it's not forgotten it's just stalled :D

John Lester 09-25-2012 10:10 PM

I need a fresh set of eyes to help me find out why this code is returning a parse error (or tell me how screwed up the code itself is as I'm just not getting this stupid loop thing :( ) Since the rest of the queries start with $unsubscribe does this one have to use it as well? I was understanding that the loop variable should be different but as I said before I'm obviously not getting it :D

Another related question, in order to get around the email error being returned with this query, would I use another JOIN statement to add the email to the insert query? If so which one?

Code:

  if ($vbulletin->options['advanced_unsubscribe_link_thread_sub_backup'])
  $thead_sub =    $db->query_read("
                                SELECT NULL,
                                      userid,
                                      threadid,
                                      emailupdate,
                                      folderid,
                                      canview
                                FROM ".TABLE_PREFIX."subscribethread
                                WHERE userid = '$id'
                                AND emailupdate IN (1, 2, 3)
                                AND usergroupid NOT IN (5, 6, 7)");
                              }
  $thread_sub = array();
    while($row = mysql_fetch_assoc($thread_sub))
          $db->query("
                INSERT INTO ".TABLE_PREFIX."unsub_subscribethread LEFT JOIN user ON (user.usergroupid = user.usergroupid)
                SELECT NULL,
                      userid,
                      threadid,
                      emailupdate,
                      folderid,
                      canview
                FROM ".TABLE_PREFIX."subscribethread
                WHERE userid = '$id'
                AND emailupdate IN (1, 2, 3)
                AND usergroupid NOT IN (5, 6, 7)");
          }


nerbert 09-25-2012 10:19 PM

Quote:

Originally Posted by John Lester (Post 2368554)
I need a fresh set of eyes to help me find out why this code is returning a parse error (or tell me how screwed up the code itself is as I'm just not getting this stupid loop thing :( ) Since the rest of the queries start with $unsubscribe does this one have to use it as well? I was understanding that the loop variable should be different but as I said before I'm obviously not getting it :D

Another related question, in order to get around the email error being returned with this query, would I use another JOIN statement to add the email to the insert query? If so which one?

Missing curlies

Code:

  if ($vbulletin->options['advanced_unsubscribe_link_thread_sub_backup'])
  {
  $thead_sub =    $db->query_read("
                                SELECT NULL,
                                      userid,
                                      threadid,
                                      emailupdate,
                                      folderid,
                                      canview
                                FROM ".TABLE_PREFIX."subscribethread
                                WHERE userid = '$id'
                                AND emailupdate IN (1, 2, 3)
                                AND usergroupid NOT IN (5, 6, 7)");
  }
  $thread_sub = array();
    while($row = mysql_fetch_assoc($thread_sub))
    {
          $db->query("
                INSERT INTO ".TABLE_PREFIX."unsub_subscribethread LEFT JOIN user ON (user.usergroupid = user.usergroupid)
                SELECT NULL,
                      userid,
                      threadid,
                      emailupdate,
                      folderid,
                      canview
                FROM ".TABLE_PREFIX."subscribethread
                WHERE userid = '$id'
                AND emailupdate IN (1, 2, 3)
                AND usergroupid NOT IN (5, 6, 7)");
          }

[/QUOTE]

John Lester 09-26-2012 04:09 PM

Oh my .... how silly of me :D Thanks nerbet :)

John Lester 10-01-2012 03:00 PM

Ok so I'm still having trouble with the stupid looping through the subscribethread table and decided that I needed to exclude the mods, supermods, and admins from having their subscriptions or usergroups (that code isn't shown here) changed.

However I'm a bit confused on how to do this. I need to LEFT JOIN the usergroupid from the user table, but the following code spits out a syntax error and I'm not seeing it.

Code:

        // If you selected to backup existing thread subscriptions this code will be executed.
        if ($vbulletin->options['advanced_unsubscribe_link_thread_sub_backup'])
          {
            // Copy users existing thread subscriptions to the unsub_subscribethread table except for mods, admins, and supermods
            $db->query("
                INSERT INTO ".TABLE_PREFIX."unsub_subscribethread LEFT JOIN user ON (user.userid = user.usergroupid)
                SELECT NULL,
                      userid,
                      threadid,
                      emailupdate,
                      folderid,
                      canview
                FROM ".TABLE_PREFIX."subscribethread
                WHERE userid = '$id'
                AND emailupdate IN (1, 2, 3)
                AND usergroupid NOT IN (5, 6, 7)");
          }


Simon Lloyd 10-01-2012 04:25 PM

Other than spacings around TABLE_PREFIX it seems fine (altough i haven't checked the tables...etc it calls)
PHP Code:

// If you selected to backup existing thread subscriptions this code will be executed.
        
if ($vbulletin->options['advanced_unsubscribe_link_thread_sub_backup'])
          {
            
// Copy users existing thread subscriptions to the unsub_subscribethread table except for mods, admins, and supermods
            
$db->query("
                INSERT INTO " 
.TABLE_PREFIX"unsub_subscribethread LEFT JOIN user ON (user.userid = user.usergroupid)
                SELECT NULL,
                       userid,
                       threadid,
                       emailupdate,
                       folderid,
                       canview
                FROM " 
.TABLE_PREFIX"subscribethread
                WHERE userid = '
$id'
                AND emailupdate IN (1, 2, 3)
                AND usergroupid NOT IN (5, 6, 7)"
);
          } 

--------------- Added [DATE]1349116350[/DATE] at [TIME]1349116350[/TIME] ---------------

This should help with your syntax (remember to only use the query part rather than the whole php :)) http://developer.mimer.com/validator...dex.tml#parser


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.03348 seconds
  • Memory Usage 1,764KB
  • 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)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete