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-13-2007, 12:59 AM
Antivirus's Avatar
Antivirus Antivirus is offline
 
Join Date: Sep 2004
Location: Black Lagoon
Posts: 1,090
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Is it possible to eval a template from within AdminCP?

I have been trying to do this and not having any luck. I've never seen this doen within any of jelsoft's scripts, so my guess is not, however if it is possible can someone tell me how?
Reply With Quote
  #2  
Old 08-13-2007, 08:47 AM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not too sure what you mean by eval template from within the AdminCP but if you mean like fetching a template for the standard pages then I don't think it is possible, at least I haven't seen it done anywhere either. Although I don't think there would be much of a need anyway. the adminfunctions.php file has lots of print functions which will display everything correctly. Normally labeled print_.... check out the "Functions" section of the code documentation.

http://members.vbulletin.com/api/
Reply With Quote
  #3  
Old 08-13-2007, 10:47 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The template system is not initialised when in the admincp.

I believe you could change this via a plugin and I'm sure I posted something about it many months ago, but I don't have time to search for it atm (i'm at work ).
Reply With Quote
  #4  
Old 08-13-2007, 01:11 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The reason that the AdminCP does not use regular templates is that it would make it more likely that you get locked outof the AdminCP in case of an error in a template.
Reply With Quote
  #5  
Old 08-13-2007, 01:18 PM
bobster65's Avatar
bobster65 bobster65 is offline
 
Join Date: Mar 2006
Location: Montana
Posts: 1,169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
The reason that the AdminCP does not use regular templates is that it would make it more likely that you get locked outof the AdminCP in case of an error in a template.
Do you know if the .com team has any plans to revamp the ACP in the future?
Reply With Quote
  #6  
Old 08-13-2007, 01:33 PM
Antivirus's Avatar
Antivirus Antivirus is offline
 
Join Date: Sep 2004
Location: Black Lagoon
Posts: 1,090
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks people, yes i'm currently utilizing many of the the print_ functions within adminfunctions.php but for several of the mods I'm currently writing, I have found that the existing functions are insufficient.

For instance, one of my mods shows thumbnails of file attachments from within the admincp, and I was looking to call template postbit_attachmentthumbnail to display them. as many of us know, there's no such type of vbulletin function in existence.

I've got around the limitation by assigning the html to a var, and using the var within print_description_row() which is fine, but coding it would have been so much easier if I were able to just eval the template. You can see what I did in attachment.

Marco, that's a good reason i suppose why jelsoft doesn't currently eval anyt templates in admincp, I never thought of that possibility, but it certainly makes sense.
Attached Images
File Type: gif imginadmincp.gif (57.3 KB, 0 views)
Reply With Quote
  #7  
Old 08-13-2007, 02:09 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bobster: I doubt there will be major changes in the AdminCP for the 3.x versions.
Reply With Quote
  #8  
Old 08-13-2007, 03:23 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Antivirus View Post
For instance, one of my mods shows thumbnails of file attachments from within the admincp, and I was looking to call template postbit_attachmentthumbnail to display them. as many of us know, there's no such type of vbulletin function in existence.

I've got around the limitation by assigning the html to a var, and using the var within print_description_row() which is fine, but coding it would have been so much easier if I were able to just eval the template. You can see what I did in attachment.
Don't forget you can still use the standard PHP echo() function, you won't get any headers already sent errors since the ACP doesn't use templates.

P.s. did you see my post in your other topic about using construct_phrase?

e.g. for your thumbnail thing just store all the html for the images in a variable whilst inside the while() then you can just echo it between a

HTML Code:
<tr><td class="thead">thumbnail things</td></tr>
<tr><td class="alt2">$thumbs</td></tr>
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 10:56 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.04258 seconds
  • Memory Usage 2,248KB
  • Queries Executed 14 (?)
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_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete