Author Topic: Problems uninstalling Shop to upgrade  (Read 3528 times)

Offline StrangerWithin

Problems uninstalling Shop to upgrade
« on: June 03, 2006, 03:23:50 am »
Hi there :D

Have a problem with the shop mod atm. The other day we developed a database error and our board crashed. cannot remember the exact error message but to cut a long story short I had to replace the Sources/Post.php file with a fresh copy to get our board working again. All is well once again however....................

Since I carried out this fix we seem to have lost functionality of our Shop mod :(

The only thing I can think of is that there was some of the shop mods code within that page and the fresh copy doesnt have it. hence the problem.

The obvious answer is to uninstall Shop and reinstall the latest build :D

Trouble is I cant :(

If I go to package manager/ view & remove installed packages. Select uninstall for Shop mod I get an error message saying that there is no uninstall file ???

If I upload a fresh install from my PC then try and install it tells me that it is already installed.

Help me, I'm baffled!!!! :crazy2: ;D

Offline Daniel15

Re: Problems uninstalling Shop to upgrade
« Reply #1 on: June 03, 2006, 09:55:14 am »
That is simple: All you need to do is redo the edits in the Sources/Post.php file...

Are you using SMF 1.0.7 or SMF 1.1 RC2? The code is different for each of them. The code for SMF 1.0 is in the 'install_SMF1-0.xml' file, and the code for SMF 1.1 RC2 is in the 'install_SMF1-1RC2.xml' file (search for the Post.php section)

Offline StrangerWithin

Re: Problems uninstalling Shop to upgrade
« Reply #2 on: June 03, 2006, 02:49:59 pm »
Thanks for the reply :)

I didnt so much as edit the code in sources/post.php. I replaced the entire page so to speak. We're currently running SMF 1.0.7 btw ;)

Offline Daniel15

Re: Problems uninstalling Shop to upgrade
« Reply #3 on: June 04, 2006, 01:46:26 pm »
Quote
I didnt so much as edit the code in sources/post.php
I meant the edits that the SMFShop installer does to the file ;)

Now, here's what you need to do. First, Open Sources/Post.php. Then:

Find:
$newTopic true;
Add After:

	
	
//BEGIN SMFShop Shop MOD 1.3 (Build 6) code
	
	
$result_shop db_query("SELECT countMoney
	
	
	
                FROM 
{$db_prefix}boards
	
	
	
                WHERE ID_BOARD = 
$board
	
	
	
                LIMIT 1"
__FILE____LINE__);
	
	
$row_shop mysql_fetch_array($result_shopMYSQL_ASSOC);
	
	

	
	
if (isset(
$row_shop['countMoney']) && $row_shop['countMoney'] == "1") {
	
	
	
$result_shop db_query("UPDATE {$db_prefix}members
	
	
	
	
	
	
	
	
     SET money = money + 
{$modSettings['shopPointsPerTopic']}
	
	
	
	
	
	
	
     
	
 WHERE ID_MEMBER = 
{$ID_MEMBER}
	
	
	
	
	
	
	
	
     LIMIT 1"
__FILE____LINE__);
	
	
}
	
	
//END Shop MOD code


Then, find:
	
	
// They've posted, so they can make the view count go up one if they really want. (this is to keep views >= replies...)
	
	
$_SESSION['last_read_topic'] = 0;

	
	
$newTopic false;

Add after:
	
	
//BEGIN SMFShop Shop MOD 1.3 (Build 6) code
	
	
$result_shop db_query("SELECT countMoney
	
	
	
                FROM 
{$db_prefix}boards
	
	
	
                WHERE ID_BOARD = 
$board
	
	
	
                LIMIT 1"
__FILE____LINE__);
	
	
$row_shop mysql_fetch_array($result_shopMYSQL_ASSOC);
	
	

	
	
if (isset(
$row_shop['countMoney']) && $row_shop['countMoney'] == "1") {
	
	
	
$result_shop db_query("UPDATE {$db_prefix}members
	
	
	
	
	
	
	
	
     SET money = money + 
{$modSettings['shopPointsPerPost']}
	
	
	
	
	
	
	
     
	
 WHERE ID_MEMBER = 
{$ID_MEMBER}
	
	
	
	
	
	
	
	
     LIMIT 1"
__FILE____LINE__);
	
	
}
	
	
//END Shop MOD code


After you do that, SMFShop should start counting the points again   :)

Offline StrangerWithin

Re: Problems uninstalling Shop to upgrade
« Reply #4 on: June 05, 2006, 07:20:32 am »
Thanks for that :)

Out of curiosity, what should the CHMOD value be of Sources/Post.php?

Ive checked this in FTP and its currently 777. Is this right? ???

Offline Daniel15

Re: Problems uninstalling Shop to upgrade
« Reply #5 on: June 10, 2006, 01:30:56 pm »
It's usually at 0755, however, the Package Manager sets it to 0777. If you want slightly more security, set it to 0755 (however, whenever you install a package, it will be CHMODded back)