PDA

View Full Version : Cannot access custom phrases with some code


StephenKay
07-13-2008, 10:09 PM
Should the function 'fetch_email_phrases' be able to get a custom phrase?

I have defined a custom phrase named 'digestpostprefix'. In functions_digest.php, I am attempting to call it according to all the other examples in that same chunk of code.


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

eval(fetch_email_phrases('digestpostbit', $thread['languageid']));

$postbits .= $message;

}
if ($postbits != ''){
eval(fetch_email_phrases('digestpostprefix', $thread['languageid']));

if ($thread['dateline'] > $lastdate)
{ // new thread
$newthreadbits .= ($message . $postbits);
}else{
$updatedthreadbits .= ($message . $postbits);
}
}

For example, in the above code fragment, the first call of the function is a standard phrase (digestpostbit), and it works.

The second call of the function is my custom phrase (digestpostprefix). The code is the same, the name is correct, the phrase is in the database, but it returns "Could not find phrase 'digestpostprefix'" in the $message variable.

Opserty
07-13-2008, 11:30 PM
What phrasegroup is digestpostprefix in?

StephenKay
07-14-2008, 12:11 AM
Thank you - that was my problem - I wasn't aware that when you added a new phrase it went into a group and it just went into the first group by default. I recreated it in the email body group and now it works. Thanks!