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

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2009, 05:33 AM
vbem2 vbem2 is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Having issues with custom page titles using variables.

VB 3.7

In the custom template I have this:
Code:
<title>$Year $MakeOther $ModelOther $Trim Gas Mileage ($vehiclenickname) - $vboptions[bbtitle]</title>
Works fine as a title for just viewing the page, but links show up like this: "Check it out: Gas Mileage () - EcoModder.com"

You can see it here in google: http://www.google.com/#hl=en&q=em-fu...fp=pBEVNRsPIgM

Ideas?

Thanks!
Reply With Quote
  #2  
Old 08-11-2009, 03:56 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It doesn't work fine when viewing the actual page either. This is in your source code:
HTML Code:
<title>    Gas Mileage () - EcoModder.com</title>
The variables you are using in the title are not availabe at the time the $header template is parsed. So, you need to change the location of the plugin where you define them if you want them to show up there.
Reply With Quote
  #3  
Old 08-11-2009, 04:41 PM
vbem2 vbem2 is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you elaborate a little on that? I know php decently but find working with VB a little difficult. Is there a standard solution to this issue (I assumed it was common)?

Thanks!

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

Also, when I look at a page with firebug, I see this as the title tag:
HTML Code:
<title>1991 Honda CRX DX Gas Mileage (Vegan Powa!) - EcoModder.com</title>
*confused*

Sorry for being a newb
Reply With Quote
  #4  
Old 08-11-2009, 04:56 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perhaps your page is cached and that is why you see the whole title?

I don't know what your code is, but the variables you use in the <title> must be defined before they may be used. So, you need to define them before the header template is evaled which is in the global.php page (I am pretty sure). So, pick a plugin to use that gets evaled *before* the header template is evaled and define those variables in that plugin.
Reply With Quote
  #5  
Old 08-11-2009, 05:18 PM
vbem2 vbem2 is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, I get that I need to define it first, I'm just a little confused as to the work flow. Also, I did a hard refresh to ensure I wasn't seeing a cached page, still shows the proper title for me though.

Anyway, here's my code.

First, this fetches the data:
PHP Code:
while ($row=$db->fetch_array($vehicledetails))
       {
        
$vehiclenickname $row[VehicleNickname];
        
$vehicleuserid $row[UserID];
        
$Year $row[Year];
        
$MakeOther $row[MakeOther];
        
$ModelOther $row[ModelOther];        
        
$Trim $row[Trim];
    } 
Then, further down in the php we have this which calls the template:

PHP Code:
eval('print_output("' fetch_template('emFuelLog') . '");'); 
Then in the template I have this:
HTML Code:
<head>
<meta name="description" content="$foruminfo[description]" />
<title>$Year $MakeOther $ModelOther $Trim Gas Mileage ($vehiclenickname) - $vboptions[bbtitle]</title>
$headinclude
</head>
A little unclear on why it's not getting through . Thanks for helping me!

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

O I see! It seems to be a problem with being logged in or not. Ideas?

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

Seems to be fixed now, let me know if you can see the titles!?

For some reason my partner had made the sql query that fetches those variables only display for the owner of the pages in question, oops!

Thank you so much for helping me figure it out
Reply With Quote
  #6  
Old 08-11-2009, 05:51 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see it now! Looks like you got the issue cleared up.
Reply With Quote
  #7  
Old 08-12-2009, 01:23 AM
vbem2 vbem2 is offline
 
Join Date: Dec 2007
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sweet, thanks again for the help!
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 12:49 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04082 seconds
  • Memory Usage 2,230KB
  • Queries Executed 13 (?)
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
  • (1)bbcode_code
  • (3)bbcode_html
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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