News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMFShop - Shop MOD

Started by SMFHacks.com Team, December 27, 2004, 06:46:17 AM

Previous topic - Next topic

Darius

Well... my site is down because of this "Shop" Mod... i used the install package option and it shut the whole site down... can someone help me out please  :-\

russ

any1 make the code to view other members inventories? :) waiting for that one in particular before i add other items :)

Daniel15

Darius: well, what happens? do you get any error messages?

and code for viewing someone's inventory is already in the shop admin file (Sources/shop/ShopAdmin.php), just look around about line 54 to about line 96. You should be able to copy the code and use it for your own use.

If you look at the code, it should be easy enough to understand.

--daniel15
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Brian

Here is what I did to modify the removetopic.php and post.php to prevent users from editing and deleting posts to get credits.

removetopic.php


// Decrease the post counts.
if ($decreasePostCount)
{
$requestMembers = db_query("
SELECT m.ID_MEMBER, COUNT(m.ID_MSG) AS posts
FROM {$db_prefix}messages AS m, {$db_prefix}boards AS b
WHERE m.ID_TOPIC $condition
AND b.ID_BOARD = m.ID_BOARD
AND m.icon != 'recycled'
AND b.countPosts = 0
GROUP BY m.ID_MEMBER", __FILE__, __LINE__);




if (mysql_num_rows($requestMembers) > 0)
{
while ($rowMembers = mysql_fetch_assoc($requestMembers))

{
     //BEGIN Shop MOD 0.2 code
        $result = db_query("UPDATE {$db_prefix}members
                            SET money = money - {$modSettings['shopPointsPerPost']}
                            WHERE ID_MEMBER = {$rowMembers['ID_MEMBER']}
                            LIMIT 1", __FILE__, __LINE__);
        //END SHOP MOD

updateMemberData($rowMembers['ID_MEMBER'], array('posts' => 'posts - ' . $rowMembers['posts']));
}
}
mysql_free_result($requestMembers);



}




// Only decrease post counts.
else
db_query("
UPDATE {$db_prefix}topics
SET numReplies = numReplies - 1
WHERE ID_TOPIC = $row[ID_TOPIC]
LIMIT 1", __FILE__, __LINE__);

db_query("
UPDATE {$db_prefix}boards
SET numPosts = numPosts - 1
WHERE ID_BOARD = $row[ID_BOARD]
LIMIT 1", __FILE__, __LINE__);

// If the poster was registered and the board this message was on incremented
// the member's posts when it was posted, decrease his or her post count.
if (!empty($row['ID_MEMBER']) && $decreasePostCount && empty($row['countPosts']))

{
updateMemberData($row['ID_MEMBER'], array('posts' => '-'));
               //BEGIN Shop MOD 0.2 code
        $result = db_query("UPDATE {$db_prefix}members
                            SET money = money - {$modSettings['shopPointsPerPost']}
                            WHERE ID_MEMBER = {$ID_MEMBER}
                            LIMIT 1", __FILE__, __LINE__);
        //END SHOP MOD
}

// Only remove posts if they're not recycled.





post.php


// Lock and or sticky the post.
if ((isset($_POST['sticky']) && !empty($modSettings['enableStickyTopics'])) || isset($_POST['lock']) || isset($_REQUEST['poll']))
{
if (isset($_POST['sticky']) && !empty($modSettings['enableStickyTopics']))
$setString = 'isSticky = ' . (int) $_POST['sticky'];
else
$setString = '';

if (isset($_POST['lock']) && $setString != '')
$setString .= ', locked = ' . (int) $_POST['lock'];
elseif (isset($_POST['lock']))
$setString = 'locked = ' . (int) $_POST['lock'];

if (isset($_REQUEST['poll']) && $setString != '')
$setString .= ", ID_POLL = $ID_POLL";
elseif (isset($_REQUEST['poll']))
$setString = "ID_POLL = $ID_POLL";

db_query("
UPDATE {$db_prefix}topics
SET $setString
WHERE ID_TOPIC = $topic
LIMIT 1", __FILE__, __LINE__);
}

// Might've changed the subject/poster.
updateLastMessages($board);

$newTopic = false;

        //BEGIN Shop MOD 0.2 code
        $result = db_query("UPDATE {$db_prefix}members
                            SET money = money - {$modSettings['shopPointsPerPost']}
                            WHERE ID_MEMBER = {$ID_MEMBER}
                            LIMIT 1", __FILE__, __LINE__);
        //END SHOP MOD


}



EnigmaX

When I try to install the Shop MOD via Admin Panel for SMF 1.0 it doesn't do anything.  I click on Install and it brings me to the screen where it shows various "successfull" files and at the bottom ask me to provide FTP Info for the server.

It says some files need the CHMOD changed, which will be done via FTP Access.  It doesn't say which files though.  I plug in the info and click "Save" and it doesn't do anything at all.


Any help on the Mod installation?  I'm sure it's something simple as I'm rather new to SMF.


russ

Quote from: Brian on February 27, 2005, 01:41:19 AM
Here is what I did to modify the removetopic.php and post.php to prevent users from editing and deleting posts to get credits.

removetopic.php


// Decrease the post counts.
if ($decreasePostCount)
{
$requestMembers = db_query("
SELECT m.ID_MEMBER, COUNT(m.ID_MSG) AS posts
FROM {$db_prefix}messages AS m, {$db_prefix}boards AS b
WHERE m.ID_TOPIC $condition
AND b.ID_BOARD = m.ID_BOARD
AND m.icon != 'recycled'
AND b.countPosts = 0
GROUP BY m.ID_MEMBER", __FILE__, __LINE__);




if (mysql_num_rows($requestMembers) > 0)
{
while ($rowMembers = mysql_fetch_assoc($requestMembers))

{
     //BEGIN Shop MOD 0.2 code
        $result = db_query("UPDATE {$db_prefix}members
                            SET money = money - {$modSettings['shopPointsPerPost']}
                            WHERE ID_MEMBER = {$rowMembers['ID_MEMBER']}
                            LIMIT 1", __FILE__, __LINE__);
        //END SHOP MOD

updateMemberData($rowMembers['ID_MEMBER'], array('posts' => 'posts - ' . $rowMembers['posts']));
}
}
mysql_free_result($requestMembers);



}




// Only decrease post counts.
else
db_query("
UPDATE {$db_prefix}topics
SET numReplies = numReplies - 1
WHERE ID_TOPIC = $row[ID_TOPIC]
LIMIT 1", __FILE__, __LINE__);

db_query("
UPDATE {$db_prefix}boards
SET numPosts = numPosts - 1
WHERE ID_BOARD = $row[ID_BOARD]
LIMIT 1", __FILE__, __LINE__);

// If the poster was registered and the board this message was on incremented
// the member's posts when it was posted, decrease his or her post count.
if (!empty($row['ID_MEMBER']) && $decreasePostCount && empty($row['countPosts']))

{
updateMemberData($row['ID_MEMBER'], array('posts' => '-'));
               //BEGIN Shop MOD 0.2 code
        $result = db_query("UPDATE {$db_prefix}members
                            SET money = money - {$modSettings['shopPointsPerPost']}
                            WHERE ID_MEMBER = {$ID_MEMBER}
                            LIMIT 1", __FILE__, __LINE__);
        //END SHOP MOD
}

// Only remove posts if they're not recycled.




The first code causes MYSQL errors on line 4 of subs, claiming that my database is not the correct version. once the top code was removed, these errors went...

is there soemthing wrong with the code?

Brian

It's workin for me, I dunno???  I'm not that much of a coder.

We need some more items for the shop, suggestions:

Ban User for a week
Remove Thread making abilities for a week
Maybe some sort of bank heist?

gusto5

Quote from: EnigmaX on March 01, 2005, 06:50:03 PM
When I try to install the Shop MOD via Admin Panel for SMF 1.0 it doesn't do anything.  I click on Install and it brings me to the screen where it shows various "successfull" files and at the bottom ask me to provide FTP Info for the server.

It says some files need the CHMOD changed, which will be done via FTP Access.  It doesn't say which files though.  I plug in the info and click "Save" and it doesn't do anything at all.


Any help on the Mod installation?  I'm sure it's something simple as I'm rather new to SMF.

i get an identical problem. the installation keeps looping back to the beginning of the install, like nothing happened.

running the fix_ownership.php file gets me this error

Quote530 Authentication failed, sorry

what should i do?

Mento

I'm a newbie as far as programming, but I keep getting duplicate table errors when I try to install this mod and not knowing it, it was installing 0.2 every attempt.

Now I have it 5 times on my website and no way to uninstall it besides manually, which I don't know how to do. As far as I can see, it installed 0.2, but failed to upgrade to 1.0 ...

The error was in the InstallScript.php in the /Sources/temp folder... Something about a duplicate table, MoneyBank

It's not a huge tragedy or anything because my website is in the beginning stages, but it'd be cool if someone could help a junior out, ;)

Thanks,
- MENTO


kncye

i am noobing about these ! but i want to ask how to get it to work for another theme like my forum has 2-3 themes. (i did installed it on default theme)? now i wanna get it to work for another theme ! thanks in advance

kncye,

gusto5

i am having difficulties removing the shop mod. for some reason, there is no uninstaller.

SMF 1.0.2 (Link to site: http://www.x-revolt.net)

on my other forums, package manager doesnt even acknowledge shop mods precence

SMF 1.0.2 again (link to site: http://www.revxhost.com)

so how do i remove this, manually if needed?

comitar

Fabulous Mod, you've done an amazing job.

One suggestion, maybe have the ability to make certain forums not count towards credits.  For example, I have an Off-Topic forum, and I want to encourage users to post in other topics using the credits, however they can just hang out in off-topic and accumulate credits.

Hope that made sense...

Good luck!

Daniel15

to manually remove the SMFShop mod, just delete all the MOD files from your forum, and then remove all the database stuff

(there was a previous post on this, search through the posts to find it)

sorry but i'm busy,
--daniel15
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

umiya

when ppl post in a no post increase forum they still receicve credits, anyway to stop this?

Daniel15

sorry, not yet... i'll try work on it either tonight (2:36 PM now) or tommorow... if i have time. ;)

--daniel15
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

umiya


Daniel15

remember, i said that i would work on it if i have time... if i don't get any time, sorry... but there's nothing i can do

hope you understand
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

martp

The install worked ok, I see the icon in the menu, I have the Shop Administration in the Admin-Section. But evrytime I try to access any of these I get automatically logged out and asked to log in. If I try to the same begins again.
Any Ideas?

PioneeR

I had problems installing this mod (installer failed on duplicate fieldnames). Now SMFShop seems to be installed 3 times.

Looking at the main index template (the Shop icon appears three times), credit is applied 3x..

Anyone have any instructions on how to full uninstall this mod??


Quote from: daniel15 on March 11, 2005, 09:45:13 PM
to manually remove the SMFShop mod, just delete all the MOD files from your forum, and then remove all the database stuff

(there was a previous post on this, search through the posts to find it)

sorry but i'm busy,
--daniel15

Advertisement: