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

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 588
  • Total: 589
  • @rjen

HELP! Call to undefined function Tp_loadtheme()...

Started by thal, December 19, 2006, 10:54:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

thal

Hi all!

...and I know, use search function an so on... But none of se suggested solutions have made the trick!

I intend to move from smf1.1rc2/tp0.8.6 to smf 1.1.1/tp0.9.7 and this is what I've done:

- uninstalled tp
- changed back to default theme
- changed language back to english
- manually installed smf 1.1.1 upgrade (server couldn't allocate enough memory for webupgrade (!) and package-manager stated corrupt package...)
- installed language support and changed back to swedish

So far so good. Next step: install tp0.9.7!
First fixed 'package-info.xml' to enable support for smf 1.1.1, installed tp and everything seemed fine, but when i restart my site this really annoying bug appears:

Fatal error: Call to undefined function: tp_loadtheme() in /home/virtual/[my site]/public_html/forum/Sources/Load.php on line 1131

I thought that I had a grip on the procedure, I've allways managed to solve upgrade-problems before more or less on my own, but this time...

Someone, please at least point me in the right direction!

Thurnok

The TP_loadTheme() function is located in the /Sources/TPortal.php file.  Sounds like the function was never defined.  Could be a number of reasons.

1) ensure /Sources/TPortal.php actually exists
2) search your index.php file and make sure it contains the require_once($sourcedir . '/TPortal.php'); line in it
3) make sure it is near the top of the index.php file along with the other require_once() functions and not in some if/else statement or within some function declarations

G6Cad

Duplicate code added by the installer ( narroed dow to only happend if you have used the TP V.096b hack that was posted when SMF 1.1 was released)
So Check the file for duplicate code and remove it and it should be fine to go.
Or download the premade zip file from the installations board sticky post and replace the files with the ones in the package.
NOTE! If you use the premade files, if you have other mods installed, they could stop working and needs to be added in again.

thal

Hi and thanx for your tips.

@G6: No, I havent used any other upgrades than the ones stated, went straight from tp086 - > tp097. And haven't found any duplicate code...

@Turnok: This is interesting! reqire_once() is exactly where it's supposed to be, TP_loadTheme() on the other hand isn't to be found anywhere in TPortal.php!?? Can I add the code myself or...?

G6Cad


Thurnok

#5
Quote from: G6 on December 20, 2006, 06:35:03 AM
Check your Load.php file for the duplicate code ;)
It's not duplicate code Sis - the error msg would be "Cannot redefine function" if it were ---  "Call to Undefined function" means it was "never" defined which means either the file is missing, or in this case corrupt.

The TP_loadTheme() function is definately defined in TPortal.php.  If you searched that file and did not find it, then you have a corrupt TPortal.php file.  Which explains the reason the function is "Undefined" - hehe

Here's a copy of the TPortal.php file (zipped up of course) for TP 0.9.7 attached.  Try overwriting your existing one with the one I attached and see if you are then good to go.


---[EDIT]---
Additionally, if you run into further issues, your upgrade may not have worked properly.  You might need to uninstall TP, clean-up any leftover TP files, and reinstall TP 0.9.7 fresh.  But lets hope you only had this one issue and don't have to do all that ;)

thal

Wheee!  ;D :up:

Working (so far...)! Thanx Thurnok!
I suspected that the function never was defined (familiar newbie error in "all" programming languages...), but didn't know where to look for it. My server-side TPortalf-file was only 50kBytes instead of 67kBytes. Strange as it seems as if the original file I uploaded is the same you attached... Even stranger as I've done the whole procedure twice just about the same way!?!

Guess I'll never know...

Again, thanx!

Thurnok

Well, did you upload the files directly via FTP instead of using package manager to install the zip from your local machine?  If so, I've heard of some FTP clients that produce corrupt files (or incomplete files) during uploads.  This might be what happened.  I just hope the rest of the files made it ok so that you are "out-of-the-woods" on it.  :)

thal

I ran it from package manager the second time. How I did the first I'm not sure, I've tried to repair in so many ways including manual upload. But I guess you're right about ftp-clients, FileZilla tricked me a while yesterday while editing settings.php - none of my changes seemed to have effect. Required a restart of FileZilla to work...

My site still seems to work fine, but never say never...  ::)

By the way, I investigated my corrupt TPortal a bit and it seems as some parts in the middle is missing. Dropped tcp-packets shouldn't have affected the file as it never should have shown up on the server in that case...

Thurnok

Strange indeed.  And if it were originally a corrupt ZIP file, there should have been a ZIP error during decompression or something I would think.

This website is proudly hosted on Crocweb Cloud Website Hosting.