Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 05-22-2015, 11:44 AM
JamesAB JamesAB is offline
 
Join Date: Dec 2003
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 05-22-2015, 12:26 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 05-22-2015, 12:51 PM
JamesAB JamesAB is offline
 
Join Date: Dec 2003
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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');
This shows Database Error:
Code:
$phrasegroups = array('messaging', 'emailbody');

What am I doing wrong?
Reply With Quote
  #4  
Old 05-22-2015, 12:59 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 05-22-2015, 01:25 PM
JamesAB JamesAB is offline
 
Join Date: Dec 2003
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Then I plan to use a thread datamanager to add the thread to my reported post forum.

--------------- Added [DATE]1432308553[/DATE] at [TIME]1432308553[/TIME] ---------------

Should I change my approach and use a template instead of this phrase here?
Reply With Quote
  #6  
Old 05-22-2015, 01:40 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, then it looks like what happens with report post is something like this:

PHP Code:
eval(fetch_email_phrases('jab_reportvideo_newthread'0)); 

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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:09 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04365 seconds
  • Memory Usage 2,205KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete