vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Using adminincludes in misc.php (https://vborg.vbsupport.ru/showthread.php?t=188003)

ThorstenA 08-13-2008 09:07 AM

Using adminincludes in misc.php
 
This is misc_start plugin is not working. How can I include adminfunctions_ within misc.php?
Quote:

Fatal error: Call to undefined function log_admin_action() in misc.php(97) : eval()'d code on line 590
Code:

if ( $_REQUEST['do'] == 'test')
{
require_once(DIR . '/includes/adminfunctions_stats.php');

print_cp_header($vbphrase['statistics']);
}

Thanks.

Marco van Herwaarden 08-13-2008 09:16 AM

You don't need to include global.php in a plugin.

The print_cp_XXXX functions are designed to be used inside the AdminCP, not on front-end scripts.

If you need to include any admin functions, then you will need to include (at least) adminfunctions.php

Opserty 08-13-2008 09:23 AM

adminfunctions_xxxx.php files are for usage in the AdminCP/ModCP files.

functions_xxxxx.php files are for usage in the normal root files.

(You should be using templates when creating a "normal" page).

ThorstenA 08-13-2008 09:47 AM

Thank you both!
It works now with
Code:

require_once(DIR . '/includes/adminfunctions.php');
Quote:

Originally Posted by Opserty (Post 1597617)
adminfunctions_xxxx.php files are for usage in the AdminCP/ModCP files.

functions_xxxxx.php files are for usage in the normal root files.

I am writing a statistic product and just want to use all existing built-in functions there are.

Opserty 08-13-2008 10:18 AM

In misc.php you should be using templates though. Using other admin functions is fine but you shouldn't use the print_* functions that are defined in adminfunctions(_xxx).php files. Notice that other pages like "showthread.php", "forumdisplay.php" use print_* functions, they use templates (even for forms).

ThorstenA 08-13-2008 10:43 AM

I understand that but I need these built-in functions. And I do not want to copy and paste existing functions just to get rid of print_* functions. Could I not integrate these echo functions (I asked about that in my other thread)?

Opserty 08-13-2008 10:48 AM

Why exactly do you need them? (Why can't you make them using templates? Which functions do you want to use?)

May be worth reading: [How-To] vBulletin API Basics: Creating Custom Pages & Misc. if you haven't already done so.

ThorstenA 08-14-2008 09:49 AM

Thanks to you, my new forum statistics product is online :)


All times are GMT. The time now is 01:06 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.00971 seconds
  • Memory Usage 1,726KB
  • 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
  • (2)bbcode_code_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