TinyPortal

Development => Support => Topic started by: waronyou on April 24, 2008, 10:41:32 AM

Title: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: waronyou on April 24, 2008, 10:41:32 AM
I get this error when I click on members profiles. Amber 1.1.4 -
http://www.ronpaulforum.info

Fatal error: Cannot redeclare tpsummary() (previously declared in /home/dirtyp/public_html/ronpaulforum/Sources/Profile.php:2970) in /home/dirtyp/public_html/ronpaulforum/Sources/Profile.php on line 3027
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: waronyou on April 24, 2008, 12:53:01 PM
I fixed it// Had the file installed twice
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 11:04:21 AM
Had what file installed twice?  Tiny Portal? I uninstalled TP9.8 before I installed TP 1.0  Do I need to delete something from the server and if so, what exactly?  Thanks for any help in clearing this up.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: Zetan on August 18, 2008, 11:14:39 AM
Quote from: Marian on August 18, 2008, 11:04:21 AM
Had what file installed twice?  Tiny Portal? I uninstalled TP9.8 before I installed TP 1.0  Do I need to delete something from the server and if so, what exactly?  Thanks for any help in clearing this up.

I'm guessing that there were 2 instances of the file: Profile.php, but its a guess.


Did you search for the error as suggested by Smokey in your support topic?
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 11:20:31 AM
It's duplicate code in the file.
Open it with some text editor, find the line where the error say you have the error, remove the chunk of code thats duplicated.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 11:25:07 AM
Yes, and I am now Reading  g a possible solution.  I will certainly write this solution down in my notes for future reference!  :)

I have looked at the file in the code editor on the server, and there is a block of code between [  and  ] which is about 3 lines but for the life of me, I do see another that is exactly like it.  Is it possible that the duplicate files is not actually there because it cannot be redeclared?  :-\


Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 11:35:21 AM
In looking at the file where the Profile.php is shown, I finally see two files which aren't what I was looking for and are half a page separated, that was my problem.  I was thinking that the two would be side by side but they aren't.  Am I correct in thinking this is the file to be removed and do I removed the first instance or the second?

function tpdownload($memID)
{
   global $txt, $user_profile, $db_prefix, $context, $db_prefix;

   loadtemplate('TPprofile');
   $context['page_title'] = $txt['downloadprofile'];
   TP_profile_download($memID);
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 11:36:46 AM
It's not the files that are duplicated, it's the code inside the file.

Look at the line in the Profile.php that you get the error on.

It's more then 2 lines of code, it's the code TP adds to the file that needs to be removed , you probably had that code left before you installed so it got added twice

If you need to know what code in that file, you have a reference in the modinstruction.
Look at the code for Profile.php, thats the code you have doubble of.

Modification Instructions (http://docs.tinyportal.co.uk/index.php?topic=140)

This

// Tinyportal
'tpsummary' => array(array('profile_view_any', 'profile_view_own'), array('profile_view_any')),
'tparticles' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_articles')),
'tpdownload' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_dlmanager')),
'tpshoutbox' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_blocks')),
'tpgallery' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_gallery')),
'tplinks' => array(array('profile_extra_any', 'profile_extra_own'), array('tp_links')),
// end Tinyportal


and this

// TinyPortal
if (!$user_info['is_guest'] && (($context['user']['is_owner'] && allowedTo('profile_view_own')) || allowedTo(array('profile_view_any', 'moderate_forum', 'manage_permissions','tp_dlmanager','tp_blocks','tp_articles','tp_gallery','tp_linkmanager'))))
{
$context['profile_areas']['tinyportal'] = array(
'title' => $txt['tp-profilesection'],
'areas' => array()
);

$context['profile_areas']['tinyportal']['areas']['tpsummary'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tpsummary">' . $txt['tpsummary'] . '</a>';
if ($context['user']['is_owner'] || allowedTo('tp_articles'))
$context['profile_areas']['tinyportal']['areas']['tparticles'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tparticles">' . $txt['articlesprofile'] . '</a>';
if(($context['user']['is_owner'] || allowedTo('tp_dlmanager')) && $context['TPortal']['show_download'])
$context['profile_areas']['tinyportal']['areas']['tpdownload'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tpdownload">' . $txt['downloadprofile'] . '</a>';
if($context['user']['is_owner'] || allowedTo('tp_blocks'))
$context['profile_areas']['tinyportal']['areas']['tpshoutbox'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tpshoutbox">' . $txt['shoutboxprofile'] . '</a>';
if(($context['user']['is_owner'] || allowedTo('tp_gallery')) && $context['TPortal']['show_gallery'])
$context['profile_areas']['tinyportal']['areas']['tpgallery'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tpgallery">' . $txt['galleryprofile'] . '</a>';
if(($context['user']['is_owner'] || allowedTo('tp_linkmanager')) && $context['TPortal']['show_linkmanager'])
$context['profile_areas']['tinyportal']['areas']['tplinks'] = '<a href="' . $scripturl . '?action=profile;u=' . $memID . ';sa=tplinks">' . $txt['linksprofile'] . '</a>';
}
    // end TinyPortal
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 12:34:59 PM
I guess I have really messed things up, I removed the second code but now I am getting a parse error.  I must have removed too much.  :(

Going back and compare the mod file again.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 12:51:38 PM
I am getting one error after another.  Now getting unexpected $end and I can't see that tag any where near the line it says it is on.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 12:55:59 PM
I give up, I am unable to fix this.  I will consider other options!
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 12:59:26 PM
Add the file here and i will fix it for you
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 01:29:28 PM
Do you want the complete file? Because I keep getting different errors on different  lines.  File too large, I will see if I can saved the template itself and upload it.  Maybe that will do better.
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 01:39:29 PM
here is the template Profile.php
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: Ianedres on August 18, 2008, 01:53:31 PM
Not trying to steal G6's thunder...  ;)  but here is your file edited to remove the duplicate code. Rename it to the proper name when you save it back to your server.

(Trying to help lighten the load for ya G6!)
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 02:00:54 PM
Thank you, thank you, thank you!  Where should I make a donation?  Because I know the work that goes in this .
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 02:08:25 PM
Donation to TP and Bloc can be found on your left hand side in the block there.
Im sure Bloc will be happy to recieve a donation :)

Great and thank you Ianedres  :up:
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 02:11:45 PM
Fix worked! Problem solved.  :up: I am saving that file.  ;)  Making donation now.  :)
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: Ianedres on August 18, 2008, 02:12:03 PM
Just trying to take *one* thing off your list!   8)

Will mark as [SOLVED] too. That makes two things...  :buck2:
Title: Re: Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 02:12:15 PM
Thank you Marian and Ianedres  :)
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 02:18:09 PM
You are more than welcome Carina.  You all have taken a burden from me and that is a very good feeling.  :)
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 02:21:24 PM
How is the rest of the progress going on your forum now ?
I felt bad when you host crached your forum beyond repair, so im a bit qurious about hw things are going now ?
You had quite a lot going there in your old forum  :-\
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 02:56:07 PM
This new forum was created for members of my church and I have just announced it in Sunday School this week and so I am expecting people to begin registering soon.  I wanted everything to be working properly when they register and the profile is one of the first things they need to configure.

Yes, I was very disappointed over losing the role playing forum, we had some great stories written that I was going to take and convert into a manuscript for my next writing project, sadly that will not happen now.  But I looked at it this way, maybe the good Lord was disappointed in it and saw fit for it to be taken away because I would not have started this new one had I not lost the old.  The Fantastico backup is still on the server and perhaps one day the posts can be retrieved.

I have re-created the role-playing forum but I think the joy has been lost because we have not started any new stories.  :(  If it is meant to be, it will be.  :)
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 03:31:29 PM
Can you download the backup to your local PC Marian ?
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 03:41:28 PM
I have the forum already downloaded to my PC, (Took overnight on a cable connection!)  not the Fantastico one but the damage file.  And I have the Fantastico backup also, but when I went to open it, my program told me it was damage.  It is still on the server as well.
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 04:00:34 PM
Do you have PHP Myadmin ?
If so, export the DB to your local PC and a ZIP or RAR file.

If you dont have PHPMyadmin, try and download the DB again from fantastico
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 04:08:56 PM
That database no longer exists.  I do have MyAdmin and I was following the directions for restoring and the first thing I was told to do was empty that database, which I took to mean delete it because I saw no way to 'empty' it.  I recreated the database with the SMF_1 name but I was unable to unzipped the backup, I kept getting damage file.  It was store as a tgz file and I chose to download it as a zip file because I was unable to find a program that would unzipped it.

Since I have lost that forum, I created Christian Treasures Forum and it is now using that database name, SMF_1.  Wouldn't the backup need to go into the same database name as it was saved?
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 04:36:41 PM
The db should be named  the same during the install of it from the backup.

Can i get the DB backup you have some how?, i would like to test it and see if i can restore it.
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: mnichols7 on August 18, 2008, 06:00:36 PM
I will PM you all the information!
Title: Re: [SOLVED] Fatal error: Cannot redeclare tpsummary()
Post by: G6Cad on August 18, 2008, 06:11:24 PM
Great  :up:  :)