Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-21-2006, 02:45 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default construct_phrase() not working.

Can someone tell me what I'm doing wrong?

PHP Code:
construct_phrase($vbphrase['tooshort'], $vbulletin->options['minimumcharsforsearch']); 
$vbulletin->options['minimumcharsforsearch'] is for my hack.
Reply With Quote
  #2  
Old 11-21-2006, 03:01 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's the result? Where are you using it?

Check your two input values as well (var_dump or something similar).
Reply With Quote
  #3  
Old 11-21-2006, 04:55 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I echo both but $vbphrase['tooshort'] won't parse.
Reply With Quote
  #4  
Old 11-21-2006, 04:58 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Inside a function? Phrase cached?
Reply With Quote
  #5  
Old 11-21-2006, 05:16 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just used echo $vbphrase['tooshort'];. I don't know how to cache a phrase.
Reply With Quote
  #6  
Old 11-21-2006, 05:21 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you enter the phrase group in the $phrasegroups array (beginning of a file), it will tell vBulletin which phrase groups should be cached. Using a phrase that isn't won't work. The exception is global phrases, which are always cached.
Reply With Quote
  #7  
Old 11-21-2006, 05:34 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is odd. It's throwing this error

PHP Code:
SELECT 
            userfield
.*, usertextfield.*, user.*, UNIX_TIMESTAMP(passworddate) AS passworddate,
            IF(
displaygroupid=0user.usergroupiddisplaygroupid) AS displaygroupid,
            
language.phrasegroup_search AS phrasegroup_search,
            
language.phrasegroup_error AS phrasegroup_error,
            
language.phrasegroup_global AS phrasegroup_global,
            
language.options AS lang_options,
            
language.languagecode AS lang_code,
            
language.charset AS lang_charset,
            
language.locale AS lang_locale,
            
language.imagesoverride AS lang_imagesoverride,
            
language.dateoverride AS lang_dateoverride,
            
language.timeoverride AS lang_timeoverride,
            
language.registereddateoverride AS lang_registereddateoverride,
            
language.calformat1override AS lang_calformat1override,
            
language.calformat2override AS lang_calformat2override,
            
language.logdateoverride AS lang_logdateoverride,
            
language.decimalsep AS lang_decimalsep,
            
language.thousandsep AS lang_thousandsep
            
        FROM user 
AS user
        LEFT JOIN userfield 
AS userfield ON (user.userid userfield.userid)
        
LEFT JOIN usertextfield AS usertextfield ON (usertextfield.userid user.useridLEFT JOIN language AS language ON (language.languageid = IF(user.languageid 01user.languageid)) 
        
        
WHERE user.userid 1;

MySQL Error  Unknown column 'language.phrasegroup_error' in 'field list' 
I can see that it's selecting the column but why is it throwing the error?


I'm using
PHP Code:
$phrasegroups = array('error'); 
Reply With Quote
  #8  
Old 11-21-2006, 05:40 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is that a new phrase group? If so - you have to add them using a function and not just create a new record in the database.
Reply With Quote
  #9  
Old 11-21-2006, 05:45 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Search for the varname "tooshort" in your phrases and you'll see it's under "Error Messages" and the fieldname for "Error Messages" is "error".
Reply With Quote
  #10  
Old 11-21-2006, 06:34 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Error phrases are handled differently in the fact that they aren't cached with the rest of the phrases. Instead, it grabs em as it needs them and caches them inside the function (static). Try this:
PHP Code:
eval(standard_error(fetch_error('tooshort'$vbulletin->options['postminchars']))); 
That's how vBulletin does it - and if you follow the fetch_error function, it will execute fetch_phrase which actually fetches it from the database.
Reply With Quote
Reply


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 03:50 PM.


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.04842 seconds
  • Memory Usage 2,277KB
  • 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
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete