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,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 606
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 468
  • Total: 468

Undefined variable: item

Started by ThunderBolt, February 06, 2006, 06:21:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thurnok

I found this same issue.  I corrected the problem on my installation.  Then I saw a message about the rev2 update.  I downloaded it and looked in the files but they had the same issue.

Here's what I found.  There are array definitions in the TPdlmanager.php file for which two are never used again.  Instead, throughout the two files where all the information for those arrays are compiled, the index names are changed.  However, information is only inserted into the changed versions if you have files already in your download manager.

There are two files you need to update.  The /Sources/TPdlmanager.php file and the /Themes/default/TPdladmin.template.php file.

Here's the array defintions in question:
$context['TPortal']['dl_admcats']=array();
$context['TPortal']['dl_admitems']=array();
$context['TPortal']['dl_admcount']=array();
$context['TPortal']['dl_admsubmitted']=array();

The two arrays that give the problems are ...['dl_admitems'] and ...['dl_admcats'].  You will find that all references later on in TPdlmanager.php and TPdladmin.template.php refer to these as ...['admitems'] and ...['admcats'].  This causes the undefined index error for these items since the original arrays as depicted in the code section above are defined outright whereas all the others where the index name has changed are only created/defined if there are files in your download manager already.

I like to keep things consistent, so I simply changed all the other occurrances to ['dl_admitems'] and ['dl_admcats'] in the two files mentioned above.  There are I believe 11 and 8 occurrances respectively.

So, to sum it up, in both TPdlmanager.php and TPdladmin.template.php:
- All occurrances -
Search for ['admitems']
Replace with ['dl_admitems']
Search for ['admcats']
Replace with ['dl_admcats']

Problem resolved, files or no files in your download manager.
Thurnok
The one, the only!

bloc

Thanks, Thurnok. I think you have indeed uncovered a major error there. I have made the correction for the upcoming 0.9.5 version.

Thurnok

np Bloc.

It is only because of TinyPortal that I have such a renewed interest in SMF.  I had tried SMF for the first time back in 2004 where I felt it to be a very capable competitor to phpBB.  I've been running numerous websites since the web was... well, the web.  I'm currently running over 30 of them, most of them using a combination of Mambo and phpBB.  I had set up some SMF sites back then; however, I had some problems with the SMF -- Mambo integration.  Unfortunately, back then I simply didn't have the time to really dig into it to see where the problems lied.  So I did not expand on my SMF use any further.

Enter TinyPortal.  I was casually browsing the Simple Machines site a few months back, as I had done occasionally over the years, where I for the first time noticed TinyPortal.  I don't know why I hadn't noticed it beforehand, other than I simply hadn't been looking for it.  After deciding to put up another test SMF site, and trying out the TinyPortal mod to see what it was made of, I was hooked!  You have an excellent product Bloc.  I'm sure you have heard that plenty of times during the history of TinyPortal, but why should that stop me from reiterating it?

All good developments fall prey to bugs here and there.  It is because of the popularity of a product that they tend to be found by those who love it most.  These are the people that want to see it succeed even further than it already has.  I'm happy to say, I've become one of those individuals.  Thanks again for a great product!
Thurnok
The one, the only!

bloc

:) Thank you. And do keep posting any errors you find, its a big help in getting the script bug-free.

This website is proudly hosted on Crocweb Cloud Website Hosting.