vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Template warning, variable conflict? (https://vborg.vbsupport.ru/showthread.php?t=38021)

everwicked 04-29-2002 02:19 PM

Template warning, variable conflict?
 
Hello,

I recently started a postnuke+vbulletin project for my website.

Till now I just hacked register.php to update pn's edited tables as well. To do so I had to call pnInit().

Although the registration proceeds fine, I get a warning.

Warning: Use of undefined constant template - assumed 'template' in /home/everwick/public_html/project/forums/admin/functions.php on line 974

I thought that some variable of my hack is conflicting with vB but looking at my code over and over, can't find anything.

Any suggestions?

PS: I could post the code I added but I don't think it will be of any use. Just let me know if it does though.

PS2: I modified templates register_adult and register_stylecell

Cheers

Admin 04-29-2002 02:48 PM

What's line 974 of functions.php?

The warning isn't about templates, it's about using an undefined constant ('template'). It should probably be a string / variable, I'll need to see the line in order to tell.

everwicked 04-29-2002 02:51 PM

Pasting from the file, the line is the one in bold

Code:

// ###################### Start gettemplate #######################
function gettemplate($templatename,$escape=1,$gethtmlcomments=1) {
  // gets a template from the db or from the local cache
  global $templatecache,$DB_site,$templatesetid,$addtemplatename;

  if (isset($templatecache[$templatename])) {
    $template=$templatecache[$templatename];
  } else {
    $gettemp=$DB_site->query_first("SELECT template FROM template WHERE title='".addslashes($templatename)."' AND (templatesetid=-1 OR templatesetid='$templatesetid') ORDER BY templatesetid DESC LIMIT 1");
   $template=$gettemp[template];
    $templatecache[$templatename]=$template;
 }

  if ($escape==1) {
    $template=addslashes($template);
    $template=str_replace("\\'","'",$template);
  }
  if ($gethtmlcomments and $addtemplatename) {
    return "<!-- BEGIN TEMPLATE: $templatename -->\n$template\n<!-- END TEMPLATE: $templatename -->";
  }

  return $template;
}


Admin 04-29-2002 02:57 PM

I see, looks like PostNuke or whatever is using functions.php has a high level of error reporting. Fixing that instance won't solve the problem because you will just get another error in a different place.

Find a line in your files that contains "error_reporting()" (not a vBulletin file, a custom file), and change whatever there is in there to 7, so it would look like this:
Code:

error_reporting(7);

everwicked 04-29-2002 03:35 PM

I hope that works :)

There was only one error_reporting(E_ALL) in pnInit()

I'll get back to u if it doesn't work.

Thanks :)

Admin 04-29-2002 03:53 PM

Yeah that's the problem. E_ALL means report all errros, including warnings.


All times are GMT. The time now is 07:00 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.01192 seconds
  • Memory Usage 1,721KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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