Quote:
Originally Posted by John Lester
Ok so I sorta started working on this again, and I can't figure out what's wrong here. I'm trying to copy the rows from subscribethread to unsub_subscribethread *yes it does exist*. Yes the option is selected in the ACP. The mod runs but doesn't spit out ANY errors, it also doesn't copy the rows
This is the select query I'm using
Code:
$unsubscribe = $db->query_read("SELECT NULL, userid, threadid, emailupdate, folderid, canview FROM " .TABLE_PREFIX. "subscribethread WHERE userid = '$id' AND emailupdate IN (1, 2,3)");
This is the code inside of the function
for example where is
Code:
// If you selected to backup existing thread subscriptions this code will be exectued.
if ($vbulletin->options['advanced_unsubscribe_link_thread_sub_backup'])
{
// Copies existing thread subscriptions to the unsub_subscribethread table.
$db->query("
INSERT INTO " .TABLE_PREFIX. "unsub_subscribethread
SELECT NULL,
userid,
threadid,
emailupdate,
folderid,
canview
FROM " .TABLE_PREFIX. "subscribethread
WHERE userid = '$id'
AND emailupdate IN (1, 2, 3)");
}
If I run this query in phpmyadmin it works ...
Code:
INSERT INTO unsub_subscribethread
SELECT NULL,
userid,
threadid,
emailupdate,
folderid,
canview
FROM subscribethread
WHERE userid = 1
AND emailupdate IN (1, 2, 3)
|
you havent registered the variable
$unsubscribe
here is an example of how to do so
$templater = vB_Template::create('
unsubscribe');
$templater->register('$unsubscribe',
$unsubscribe);
$template_hook[
forumhome_wgo_pos2] .= $templater->render();
you will then need to call
$unsubscribe in a template which will display the content from the query remembering to change the
$template_hook
you will then need to place
{vb:raw unsubscribe}
in template
unsubscribe
as long as you place the correct hook location with the correct template hook the query will show in the hook location you selected