TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 488
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 442
  • Total: 442

Error with TPortal.lang.php

Started by Nolt, February 19, 2011, 11:11:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nolt

Recently on my forum I have lot of errors in my log, It tells me something is not right in TPortal.lang.php (both charset) on line ex. 372 or 373. This file isn't so large and doesn't have so many lines.

I've attached screen from SMF log section.
Thanks for any anserws and help.

IchBin

In order to see the real error you need to disable template eval. In SMF2 you can do this in the server settings. In SMF 1 you have to run a database query like this:

REPLACE INTO smf_settings VALUES ('disableTemplateEval', 1);

After that, the error should point the correct place. The errors don't look like TP errors to me. If they are, they are likely caused from a bad piece of code in a block or something.

Nolt

You were right :) It's something with template (SMF2.0) it tells:

Undefined variable: link_num
372: <li class="link_home">', ($link_num == count($context['linktree']) < 1) ? '

Undefined variable: scripturl
373: <a href="'.$scripturl.'" title="Home"><img class="link_home" src="'.$settings['images_url'].'/theme/home.png" alt="*" /></a>' : '', '</li>';

Im not a codder, maybe someone know what is wrong here?

IchBin

Can you post the file(s) where this code appears? The $scripturl probably just needs to be put in the global line. Don't know about the first one though without seeing the code in the file.

Nolt

Error appears only in one file, index.template.php. File attached.

IchBin

Not sure what the exact point of your code is ATM. But here is the problem.

global $context, $settings, $options, $shown_linktree;

// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;

echo '
<div class="navigate_section">
<div class="navigate_sectionLeft"><div class="navigate_sectionRight">
<ul>
<li class="link_home">', ($link_num == count($context['linktree']) < 1) ? '
<a href="'.$scripturl.'" title="Home"><img class="link_home" src="'.$settings['images_url'].'/theme/home.png" alt="*" /></a>' : '', '</li>';


Neither $link_num or $scripturl are defined. You can fix the $scripturl  by adding that variable to the global line like this:
global $context, $settings, $options, $shown_linktree, $scripturl;

For the $link_num, it looks to me like your code needs to be reworked a little. Try this file out and see if it still works the same way you need it to.

Nolt

Thanks IchBin :) now error log is empty.   O0

This website is proudly hosted on Crocweb Cloud Website Hosting.