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: 195,856
  • Total Topics: 21,292
  • Online today: 1,096
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 695
  • Total: 695

[SOLVED] Fatal error: Cannot redeclare tpsummary()

Started by waronyou, April 24, 2008, 10:41:32 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

waronyou

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

waronyou

I fixed it// Had the file installed twice

mnichols7

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.

Zetan

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?

G6Cad

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.

mnichols7

#5
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?  :-\



mnichols7

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);

G6Cad

#7
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

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

mnichols7

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.

mnichols7

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.

This website is proudly hosted on Crocweb Cloud Website Hosting.