TinyPortal

Development => Support => Installation => Topic started by: jwd98056 on November 19, 2007, 12:13:57 AM

Title: SMF 1.1.4 Profile Error After Clean Install and Solution
Post by: jwd98056 on November 19, 2007, 12:13:57 AM
I started with a clean install of SMF 1.1.4 and then installed TP with the Package Manager.  I had the double Forum button issue which has already been addressed here and I fixed that  :up:.  Everthing was going well with setting up the SMF and TP until I tried to view a profile  :(.  It came back with an error that it couldn't redeclare a function in Profile.php and it referenced lines 2945 and 3002.  I went into Profile.php and found the following TP function declarations section, located at the end of the file, was repeated twice:

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

I deleted one of the sections and the profile functions seems to worked normally.  ;D

Jim (JD) in Renton, WA
Title: Re: SMF 1.1.4 Profile Error After Clean Install and Solution
Post by: jwd98056 on November 19, 2007, 06:55:35 AM
I found similar problem in index.template.php in the default theme.  There were two sets of the sidebar shrink/expand buttons just to the right of the menu.  The following code was repeated:

-----------------------------------------------------------------------
// TinyPortal
    if($context['TPortal']['leftbar'])
             echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
         if($context['TPortal']['rightbar'])
             echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
// TinyPortal end
echo '
         </tr>
      </table>';

}
-----------------------------------------------------------------------

Deleting one set corrected the problem.
Title: Re: SMF 1.1.4 Profile Error After Clean Install and Solution
Post by: gautama on December 11, 2007, 09:38:15 AM
jwd98056
Thank you very much for your advice!
Title: Re: SMF 1.1.4 Profile Error After Clean Install and Solution
Post by: Zetan on December 11, 2007, 01:06:46 PM
Thanks jwd98056 for the feedback, pleased you fixed your problem  :)
Title: Re: SMF 1.1.4 Profile Error After Clean Install and Solution
Post by: G6Cad on December 11, 2007, 02:36:47 PM
jwd98056, please use the code tags when you post code in the posts, the posts does not generate the code correctly if you dont use codetags.