Log in

View Full Version : Custom page syntax problem


alfex68
03-12-2009, 11:13 PM
Hello all,
I've made a custom page that uses this piece of code:


eval(fetch_email_phrases('yourimage'));

vbmail($vbulletin->GPC['sendtoemail'], $subject, ($message = construct_phrase($vbphrase[message], $albuminfo[albumid], $pictureinfo[pictureid)), $vbulletin->GPC['name'], $vbulletin->GPC['email']);

($hook = vBulletinHook::fetch_hook('sendmessage_dosendtofri end_complete')) ? eval($hook) : false;

Here is the phrase:

Your image url $vboptions[bburl]/album.php?albumid=${1}&pictureid=${2}

I have it working...I just can't get the message body to take the variables into the phrase
I even remembered to take out the single quotes.
I'm pretty sure my syntax in regards to $message is wrong

Any suggestions and/or insight?

Marco van Herwaarden
03-13-2009, 09:22 AM
Why are you using an eval() to fetch the phrases?

ragtek
03-13-2009, 09:41 AM
Why are you using an eval() to fetch the phrases?
vB is handling it like this, or?


// ################################################## ###########################
/**
* Returns 2 lines of eval()-able code -- one sets $message, the other $subject.
*
* @param string Name of email phrase to fetch
* @param integer Language ID from which to pull the phrase (see fetch_phrase $languageid)
* @param string If not empty, select the subject phrase with the given name
* @param string Optional prefix for $message/$subject variable names (eg: $varprefix = 'test' -> $testmessage, $testsubject)
*
* @return string
*/
function fetch_email_phrases($email_phrase, $languageid = -1, $emailsub_phrase = '', $varprefix = '')


I think here's something wrong:
($message = construct_phrase($vbphrase[message], ....
Have you tried to construct the phrase befor your calling vbmail()???
It would also make debuging easier because you can check, whats the text after constructing it
for example $mytext = construct_phrase(....)
and sent then $mytext to the function?

alfex68
03-13-2009, 05:53 PM
Why are you using an eval() to fetch the phrases?

Because I don't know what I'm doing :) but i took that part directly from sendmessage.php (the basis of my new file)

Any way I fixed the problem by circumventing the phrase and declaring the values in the template.

When I learn and understand more I'm sure I'll be able to come up with a more elegant solution.

Thanks for your help on this