Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 11833
Latest: playwyourlifenotme
New This Month: 0
New This Week: 1
New Today: 0
Stats
Total Posts: 42303
Total Topics: 7379
Most Online Today: 31
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 31
Total: 31

Author Topic: Cannot redeclare  (Read 6760 times)

0 Members and 1 Guest are viewing this topic.

Offline کŋ

  • Member
  • *
  • Posts: 13
    • View Profile
Cannot redeclare
« on: March 09, 2008, 07:28:46 am »
I'm having a small prob and can't seem to find a way to fix it myself.

I've just clean installed SMF Gallery Pro 1.3.15 on the same forum that only yesterday had a clean install of SMF Store 1.2

Finished importing pics to the gallery sucessfully, then returned to the store to be met by this message on a blank page:

Code: [Select]
Fatal error: Cannot redeclare viewrating() (previously declared in /home/inanet/public_html/detcomau/Sources/Gallery.php:3586) in /home/inanet/public_html/detcomau/Sources/Store.php on line 1267
so I rem out the function ViewRating() in the Store.php
and it moves onto the next error:

Code: [Select]
Fatal error: Cannot redeclare deleterating() (previously declared in /home/inanet/public_html/detcomau/Sources/Gallery.php:3597) in /home/inanet/public_html/detcomau/Sources/Store.php on line 1278
so I rem out the function DeleteRating() in the Store.php
and then at least I can return to a nicely formatted and informative error message within the forum:

An Error Has Occurred!  :D

I've also installed the 2 SSI packages:

SMF Store SSI 1.1
SMF Gallery Pro SSI 1.1

The 2 php boxes that I use to call  ssi_storerandom() & ssi_galleryrandom() still work fine as does the recent blocks in the forum index & info center.


The only thought I have towards a fix is to use a conditional when declaring those functions...

something like...

global $boarddir;
if(!function_exists("name of function"))
require($boarddir . '/name_of_file.php');

but I might be completely on the wrong track? please help!
کŋ

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16037
    • View Profile
Re: Cannot redeclare
« Reply #1 on: March 09, 2008, 09:11:58 am »
Hmm, I could rename those functions with their own prefix. Just wondering how both of those functions would be called at the same time..

Since they should only load when under action=store and action=gallery
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline کŋ

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Cannot redeclare
« Reply #2 on: March 09, 2008, 09:20:05 am »
I'm running with the XD-MrsXV1 theme which has native support in it's code for both the gallery and store but that's ruled out with a quick switch to the default theme and of course the redeclare error is still comes up.

Would you like me to PM you with an admin account?
کŋ

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16037
    • View Profile
Re: Cannot redeclare
« Reply #3 on: March 09, 2008, 09:32:47 am »
Renamed the two functions in the store mod try
http://www.smfhacks.com/index.php/topic,825.msg5016.html#msg5016
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline کŋ

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Cannot redeclare
« Reply #4 on: March 09, 2008, 09:51:51 am »
Getting Closer:

Did an uninstall & delete of yesterday's 1.2 package, then installed this one

the result...

Code: [Select]
Fatal error: Cannot redeclare addcategory() (previously declared in /home/inanet/public_html/detcomau/Sources/Gallery.php:328) in /home/inanet/public_html/detcomau/Sources/Store.php on line 1305
did the rem outs, the next one will be function AddCategory2() then it will return a formatted error.
« Last Edit: March 09, 2008, 10:41:37 am by کŋ »
کŋ

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16037
    • View Profile
Re: Cannot redeclare
« Reply #5 on: March 09, 2008, 12:57:35 pm »
Hmm still trying to figure why it would call both files.  I could add a prefix to all the store's function to help prevent this.

It seems like a script or function is included both the store and gallery code.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline کŋ

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Cannot redeclare
« Reply #6 on: March 09, 2008, 05:43:33 pm »
I can't think of any but you're welcome to come & poke around.
کŋ

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16037
    • View Profile
Re: Cannot redeclare
« Reply #7 on: March 09, 2008, 07:03:15 pm »
PM the information I can check it out.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline کŋ

  • Member
  • *
  • Posts: 13
    • View Profile
Re: Cannot redeclare
« Reply #8 on: March 09, 2008, 11:45:33 pm »
Thanks  :)
کŋ

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
2964 Views
Last post October 05, 2015, 07:53:32 am
by Vincent Volmer

+- Recent Topics

Trying to access array offset on value of type null by SMFHacks
June 30, 2022, 03:58:54 pm

SMF forum by davejo
June 27, 2022, 01:16:25 am

Quick-moderation checkboxes by davejo
June 22, 2022, 09:27:24 am

Add option to Main Menu bar by Shades
June 21, 2022, 12:23:00 am

Logo and Category? by SMFHacks
June 12, 2022, 03:43:31 pm

prettyurls - TroubleShooting.wiki by GhostHunting
June 12, 2022, 02:52:57 pm

[Mod]Modification Update Version Checker by SMFHacks
June 06, 2022, 09:25:39 pm

Profile Gallery Link by SMFHacks
June 02, 2022, 05:17:45 pm

SMF Store 5.0 Beta Errors - Trying to access array offset on value of type null by Michael Vail
June 01, 2022, 12:48:48 pm

Upgrade Issues? by SMFHacks
May 30, 2022, 06:24:03 pm

Powered by EzPortal