vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Is it possible to eval a template from within AdminCP? (https://vborg.vbsupport.ru/showthread.php?t=155064)

Antivirus 08-13-2007 12:59 AM

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?

Opserty 08-13-2007 08:47 AM

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/

Paul M 08-13-2007 10:47 AM

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 ;)).

Marco van Herwaarden 08-13-2007 01:11 PM

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.

bobster65 08-13-2007 01:18 PM

Quote:

Originally Posted by Marco van Herwaarden (Post 1316522)
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?

Antivirus 08-13-2007 01:33 PM

1 Attachment(s)
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.

Marco van Herwaarden 08-13-2007 02:09 PM

Bobster: I doubt there will be major changes in the AdminCP for the 3.x versions.

Opserty 08-13-2007 03:23 PM

Quote:

Originally Posted by Antivirus (Post 1316533)
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>



All times are GMT. The time now is 01:25 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.02046 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete