TinyPortal

Development => Support => Topic started by: sysengr on March 19, 2007, 04:13:44 PM

Title: Fatal error: Cannot redeclare tpsummary()
Post by: sysengr on March 19, 2007, 04:13:44 PM
I noticed the TP upgrade yesterday and used the package upgrade.  Everything seemed to work great, but now the system errors when you try to access a Profile or a members list.

Fatal error: Cannot redeclare tpsummary() (previously declared in /home/ashost/public_html/guild/Sources/Profile.php:2944) in /home/ashost/public_html/guild/Sources/Profile.php on line 2994


Any ideas what I did wrong?
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: sysengr on March 19, 2007, 04:21:57 PM
OMG!

The new patch is still not up to the current version of SMF and I killed my board...

Here is the link to fix it..

http://www.tinyportal.net/index.php?topic=14195.0
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: IchBin on March 19, 2007, 04:59:36 PM
The new patch? Patch for what? If you're referring to TP then you are wrong. Its more than likely something went wrong in your install. As for the first error you reported tp_summary, please use the search. That error has been covered a 100 times already. Its caused from your install TP twice or the code not removing itself if you uninstall and then install.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: BySilent on April 07, 2007, 08:31:42 PM
I did a search and I deleted the double post in the Profile.php and the Profile.php~ files.  I now get another error which I am confused since it shows up in line 670:

"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/interne7/public_html/msgboard/Sources/Profile.php on line 670"

If I uninstall tp 9.8.3 what files should I also remove so that the install doesn't do a double code post?

Just scratching my head.  The rest of TP is working except for Profile and Members List areas.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: Nokonium on April 07, 2007, 09:59:14 PM
It looks like you have got the editing a bit skew-whiff. I have attached a copy of Profile.php with the correct code. save it over your existing Profile.php. This is a backup file from a test site of mine with no mods other than TP 0.983
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: BySilent on April 08, 2007, 03:21:18 AM
Thanks worked like a charm
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: garyt on June 25, 2007, 04:24:15 AM
Just wanted to check in and confirm.

I just did a brand new install of SMF and tinyportal.

Everything worked fine except I got the Error "Cannot redeclare tpsummary()...".
Then I used your Profile.php file and it seems to work.

What I am not clear about, is this still a bug you are taking care of or how can I avoid this during a future install.

I did not do 2 installs or an uninstall. It was one original install.

Your response will be greatly appreciated.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on June 25, 2007, 07:05:47 AM
It's not really a bug.
This error can show up for several reasons.
The most common one is the doubble code when you install TP from an upgrade when you have had TP installed before.
The second one is if the files TP want to change during the install have write permission errors, that way the code dont get added at all and generate the same error.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: garyt on June 27, 2007, 04:21:45 AM
Quote from: G6â„¢ on June 25, 2007, 07:05:47 AM
It's not really a bug.
This error can show up for several reasons.
The most common one is the doubble code when you install TP from an upgrade when you have had TP installed before.
The second one is if the files TP want to change during the install have write permission errors, that way the code dont get added at all and generate the same error.

Thanks for your help.
Still encountered a problem with 2 Forum buttons but fixed that with the posted instructions.
It appears I have everything up and running.
Also installed upgrade to smf 1.1.3.

Here is another question, the Profile.php file is still listed as Version 1.1 and says current version is 1.1.3. Also says sources is 1.1 and current version is 1.1.3.

Can you help or do I have to switch to the SMF forum?
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: IchBin on June 27, 2007, 05:04:25 AM
Well, if you don't have a problem with possibly losing mods, you can just upload the update file. But if a mod has modified that file such as TinyPortal, it will make it so you have to reinstall the mod. Otherwise, you have to update by using a compare program.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: w2phoenix on November 06, 2007, 04:44:18 PM
Quote from: nokonium on April 07, 2007, 09:59:14 PM
It looks like you have got the editing a bit skew-whiff. I have attached a copy of Profile.php with the correct code. save it over your existing Profile.php. This is a backup file from a test site of mine with no mods other than TP 0.983

i installed smf 1.1.4 and tp .98 but while i was installing tp 0.9.8 the browser lost the connection to the server for several minutes.. i installed tp again. maybe this resulted in getting the
QuoteFatal error: Cannot redeclare tpsummary()

i am still new to this .. i was pretty afraid but that attachment of profile.php worked. :)
u made my day. thanks ..this works with smf 1.1.4 and 0.9.8..thanks a lot :D
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: w2phoenix on November 06, 2007, 04:49:24 PM
hey now i did a version check
Forum Maintenance - General Maintenance>>Check all files against current versions.>>Detailed Version Check

SMF File      Your Version   Current Version
Sources          1.1                  1.1.4

now how to make the source file update for the latest version.

pls help



Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: w2phoenix on November 06, 2007, 05:03:44 PM
i updated the profile.php from smf's installer zip file..now the version check shows all latest versions.. :) and no errors r being displayed.. is this ok.. ?? it must be since no errors r displayed.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: IchBin on November 06, 2007, 05:59:28 PM
Its ok, but the changes made to the profile will not be there unless you add the code. There's a how to in the Docs board for all the files that need modification by TP. Just look at the part for the profile and make the changes.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: w2phoenix on November 06, 2007, 06:05:53 PM
it is a new forum..is it ok..will the changes i make in future be there..can u pls confirm that..
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: IchBin on November 06, 2007, 06:09:24 PM
The changes will be there as long as you don't delete or over-write the file.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: DocPixel on July 28, 2008, 11:09:18 PM
Quote from: nokonium on April 07, 2007, 09:59:14 PM
It looks like you have got the editing a bit skew-whiff. I have attached a copy of Profile.php with the correct code. save it over your existing Profile.php. This is a backup file from a test site of mine with no mods other than TP 0.983

Hi, guys.
TP is a major solution for me, and I'm pleased to be using it. But I'm having this same exact problem with SMF 1.1.5 and TP 1.05, on a fresh new install. I need to solve it before I put it live on my SMF forum.

I get this same old error any time I click on anything involving a profile;
"Fatal error: Cannot redeclare tpsummary() (previously declared in /home/.haltingly/officialtester/testova.com/smf_testing/Sources/Profile.php:3092) in /home/.haltingly/officialtester/testova.com/smf_testing/Sources/Profile.php on line 3149"

I removed the duplicate TPsummary() block from profile.php, and chmodded it too, and profile.php~ but still getting the error.

Can a correct version of the profile.php be reattached to this thread? Or should I start a new thread? I've searched and read everything I can and don't know what else to do.
Thanks,
Doc
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: IchBin on July 29, 2008, 02:15:39 AM
How about you attach your profile?
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: DocPixel on July 29, 2008, 02:59:47 AM
Of course. I would have, except this looked to me like an existing problem with an existing solution.

I think this is what you mean;
Link to my site: http://testova.com/smf_testing/index.php (http://testova.com/smf_testing/index.php)
SMF version: SMF 1.1.5
TP version: TP 1.05
Theme name and version: Silver (http://custom.simplemachines.org/themes/index.php?lemma=151) (slightly modified, no version# available)
Mods installed:
TP of course
Global Headers/Footers (This duplicates, as in: "TESTING GLOBAL HEADERSTESTING GLOBAL HEADERS"
Tagging
gallery lite
new topic button
member notepad
member location
adsense
simple award
section targeting

Related Error messages: Fatal error: Cannot redeclare tpsummary() (previously declared in /home/.haltingly/officialtester/testova.com/smf_testing/Sources/Profile.php:3092) in /home/.haltingly/officialtester/testova.com/smf_testing/Sources/Profile.php on line 3149
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: IchBin on July 29, 2008, 03:17:17 AM
No, I'm asking you to attach your file so we can fix it. If you are still getting that error, it means that the duplicate code is still there.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: DocPixel on July 29, 2008, 07:32:45 PM
Oh, okay, I get it now.

Here, fresh off the site. Thanks.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on July 29, 2008, 07:46:37 PM
All the way at the bottom of the file.
Remove this part of the code and leave the other ( duplicate )

You will see you have that code twice added to the file

// Tinyportal
function tpsummary($memID)
{
   global $txt, $user_profile, $db_prefix, $context, $db_prefix;

   loadtemplate('TPprofile');
   $context['page_title'] = $txt['tpsummary'];
   TP_profile_summary($memID);
}
function tparticles($memID)
{
   global $txt, $user_profile, $db_prefix, $context, $db_prefix;

   loadtemplate('TPprofile');
   $context['page_title'] = $txt['articlesprofile'];
   TP_profile_articles($memID);
}
function tpdownload($memID)
{
   global $txt, $user_profile, $db_prefix, $context, $db_prefix;

   loadtemplate('TPprofile');
   $context['page_title'] = $txt['downloadprofile'];
   TP_profile_download($memID);
}
function tpshoutbox($memID)
{
   global $txt, $user_profile, $db_prefix, $context, $db_prefix;

   loadtemplate('TPprofile');
   $context['page_title'] = $txt['shoutboxprofile'];
   TP_profile_shoutbox($memID);
}
function tpgallery($memID)
{
   global $txt, $user_profile, $db_prefix, $context, $db_prefix;

   loadtemplate('TPprofile');
   $context['page_title'] = $txt['galleryprofile'];
   TP_profile_gallery($memID);
}
function tplinks($memID)
{
   global $txt, $user_profile, $db_prefix, $context, $db_prefix;

   loadtemplate('TPprofile');
   $context['page_title'] = $txt['linksprofile'];
   TP_profile_links($memID);
}
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: DocPixel on July 29, 2008, 08:53:31 PM
 :up:

You're right! Took that out and now it works!  :)

Of course, I discovered also that ya got to name the file correctly too... Profile.php, not profile.php... If there's a mistake to be made, I'm the one that will make it...

Thanks so much! Not only for solving my problem, but for the quick response. Much better than some - many - other OS support forums I've found.