Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Need Help - Why can't I put VBCode in templates Details »»
Need Help - Why can't I put VBCode in templates
Version: , by Mutt Mutt is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 03-07-2003 Last Update: Never Installs: 0
 
No support by the author.

I posted this in the wrong forum and can't delte it there, sorry

sometimes when I'm making a hack, I want to have the hack make a post and I'd like to use a template to format that post so it's easy to change later. I always seem to have to make the template / post an html post. When I try to set up the template using vbcode, I get errors.

example template
Code:
Offending User: $postusername
Offending Post: Go directly to post #$postid
Original Post Date : $postdate $posttime
Thread: $posttitle[hr]$message[hr]The offending post has been copied below
now this seems like a perfectly fine template but if I try and use it I get this error

Quote:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /path/to/forum/report.php(61) : eval()'d code on line 2
it's caused by the brackets in the template. If I remove the brackets and leave everything else, it works. If I add a backslash before the brackets it works, but the backslashes get printed. I'm sure this is something real simple but I don't know what. I'd like to use

I'm calling the template like this
PHP Code:
    eval("\$message = \"".gettemplate("reportbadpost_post",1,0)."\";"); 
thanks in advance and sorry again for the double post

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-07-2003, 09:47 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

of course, the site is parsing the vbcode in my example template above so you can't really see what my template looked like.

here's an example
[ url=$bburl/showthread.php?postid=$postid#post$postid ]$threadtitle[ /url ]
without the spaces

anyway, I found out what was wrong

it would come on someing like this

$message[hr]

and instead of seeing a var with a vbtag after it, it saw just a var from an array. by adding a space between them, the problem was solved

$message [hr]

I don't really like this solution since it would be too easy for someone to edit the template and get an error. Is there anyway to fix this? How can I let it know that the [hr] in this example is just text and not part of the var?
Reply With Quote
  #3  
Old 03-08-2003, 10:34 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, you can use the bbcodeparse2 function where the template is caleld to convert the vbcode into html, then it should work
Reply With Quote
  #4  
Old 03-08-2003, 11:20 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Shouldn't that be <hr> instead of [hr]?
Reply With Quote
  #5  
Old 03-08-2003, 05:04 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

no, i have an [hr] vb tag that inserts a <hr>
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 01:48 PM.


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.04105 seconds
  • Memory Usage 2,241KB
  • Queries Executed 18 (?)
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)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (5)postbit_onlinestatus
  • (5)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