The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to find name of phrase group?
I must be dense this morning.
How does one find the value to put in the $phrasegroups = array(); based on the name we see in the AdminCP? Is there a list somewhere? For example, the AdminCP just shows "friendly" names like "Email Body Text". That's the one I'm looking for first. Thanks, James |
#2
|
|||
|
|||
You're not dense, it's kind of hard to find. If you go to the phrase manager and select the phrase type from the dropdown, after the "friendly" version in the table header, it says (fieldname = global) (or whatever the type is). The 'global' is what you'd use in $phrasegroups.
|
#3
|
|||
|
|||
Thanks for your help.
I found this: Email Body Text Phrases (fieldname = emailbody) However, when I put emailbody into the $phrasegroups array I get a database error. This works: Code:
$phrasegroups = array('messaging'); Code:
$phrasegroups = array('messaging', 'emailbody'); What am I doing wrong? |
#4
|
|||
|
|||
Hmm...I don't know. I hope what I told you is correct. But searching the vbulletin code, it doesn't look like anything ever puts emailbody in $phrasegroup. What does the database error say?
|
#5
|
|||
|
|||
It's just the generic "Database error". It doesn't say what the query problem is.
I'm trying to emulate the "report post" function, so I found the phrase reportpost_newthread. Then I created my own similar phrase in the "Email Body Text" phrase group. My phrase = jab_reportvideo_newthread HTML Code:
[url=$vboptions[bburl]/member.php?u=$reportinfo[ruserid]]$reportinfo[rusername][/url] has reported a post. Reason:[quote]$reportinfo[reason][/quote] Video: [url=$vboptions[bburl]/streaming-video.php?id=$attachemntid [/url] Posted by: [url=$vboptions[bburl]/member.php?u=$reportinfo[puserid]]$reportinfo[pusername][/url] Original Content: PUT A THUMBNAIL LINK TO THE VIDEO HERE --------------- Added [DATE]1432308553[/DATE] at [TIME]1432308553[/TIME] --------------- Should I change my approach and use a template instead of this phrase here? |
#6
|
|||
|
|||
OK, then it looks like what happens with report post is something like this:
PHP Code:
Then you can use $subject and $message as the title and text of your post. Well, jab_reportvideo_newthread in group Email Body will be in $message, and if you create a jab_reportvideo_newthread in group Email Subject then it will be in $subject (I think it's Email Subject - it might be Email TItle or something like that). If you look in includes/class_reportitem.php in function do_report() you can see where it creates a thread for the report. You can use a template or a phrase, but I think the intention is that templates would have html (and anything that might vary by style), and you'd use a phrase for anything that might change in a different language. But that's in general, I think there are phrases with html in them and some that are used for different purposes. Anyway, I think the bottom line is that phrases are probably the way to go. The email phrases are kind of special in that it automatically does some variable replacement on them, but you could use a phrase of another type (like General) and use the phrase parameter replacement if you want. This might make more sense if you look at class_reportitem.php as I mentioned above, then look at function fetch_email_phrases() in includes/functions.php. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|