vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Help with vbmail function (https://vborg.vbsupport.ru/showthread.php?t=210176)

reotto 04-02-2009 11:24 PM

Help with vbmail function
 
I am trying to edit the 'email' field to change it to a second alternate e-mail address made up of field5@field6. Anyone have any ideas? This line of code is what I am interested in modifying: vbmail($subscription['email'], $subject, $message);

PHP Code:

$subscriptions $db->query("
        SELECT subscriptions.userid, username, email
        FROM " 
ADV_DYNA_TABLE_PREFIX "subscribeentry AS subscriptions
        INNER JOIN " 
TABLE_PREFIX "user AS user ON (subscriptions.userid = user.userid)
        WHERE entryid = '
$entryid' AND user.lastactivity > '$entry[dateline]' AND subscriptions.userid != '$userid'
    "
);
    while (
$subscription $db->fetch_array($subscriptions))
    {
        eval(
fetch_email_phrases(ADV_DYNA_PREFIX '_subscribe_entry2'0));
        
vbmail($subscription['email'], $subject$message);
    }
}

?> 


Dismounted 04-03-2009 05:06 AM

Just change it? I don't see what the real problem is here. Unless you are talking about using plugins - but that's not possible as there are no hook locations there.

reotto 04-03-2009 08:06 AM

Should it be vbmail($subscription[$field5@$field6], $subject, $message);

OR

vbmail($subscription['field5@field6'], $subject, $message);

Do I need the dollar signs? Do I need the 's? Is it going to be a problem that I am calling data in vB from vB Dynamics?

Dismounted 04-03-2009 09:11 AM

Custom profile fields are not fetched in that query. You can just add a join to do that (see the existing join).

reotto 04-03-2009 10:24 AM

1 Attachment(s)
OK I took another route for some other features, but I am still stuck because I suck at JOIN. Here is the file or plugin I found and added, but now I need to find out how to add the "cellemail" field to the $subscriptions table so I can change the $subscription['email'] to $subscription['cellemail']. Here is spot where I think I need to pull the code for SMS 1.2 I loaded from.

PHP Code:

$vbulletin->db->query_write("
    CREATE TABLE IF NOT EXISTS `" 
TABLE_PREFIX "cellsettings` (
    `userid` INT NOT NULL ,
    `cellnum` VARCHAR( 20 ) NOT NULL ,
    `cellprovider` VARCHAR( 5 ) NOT NULL ,
    `cellprovidername` VARCHAR( 50 ) NOT NULL ,
    `country` VARCHAR( 50 ) NOT NULL ,
    `cellemail` VARCHAR( 100 ) NOT NULL ,
    `confirm` INT( 4 ) NOT NULL ,
    `smsonpm` INT( 4 ) NOT NULL ,
    `smscontact` INT( 4 ) NOT NULL ,
    `maxtexts` INT( 4 ) NOT NULL ,
    `dailytexts` INT( 4 ) NOT NULL DEFAULT '0' ,
    PRIMARY KEY ( `userid` ) 
    ) ENGINE = MYISAM 
"
); 

But this part is throwing me for a loop as well.

PHP Code:

    if ($vbulletin->GPC['cellemail'])
    {
        
$cellinfo $db->query_first("
            SELECT cellnum FROM " 
TABLE_PREFIX "cellsettings
            WHERE userid = '" 
$vbulletin->userinfo['userid'] . "'
            LIMIT 1
            "
);
    
        
// build their cell email address
        
$shiznizzle $db->query_first("
            SELECT email FROM " 
TABLE_PREFIX "cellproviders 
            WHERE id = '" 
$vbulletin->GPC['cellemail'] . "'
            LIMIT 1
            "
);
            
        
$cellemail "$cellinfo[cellnum]$shiznizzle['email'] . ""

The whole file for SMS 1.2 is attached. I tried a couple of different ways to do the join, but I could never get them into the subscription tables.


All times are GMT. The time now is 09:24 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.01027 seconds
  • Memory Usage 1,733KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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