SMF Shop
SMFShop => Coding => Topic started by: grusomhat on February 05, 2007, 02:28:39 pm
-
I was wondering if you would be able to make the shop work with this mod http://www.smfhacks.com/hacks/Invite-registration-through-invitation.html So that when someone joins through the invite it gives the user who invited them some points? I am sure this won't be too difficult as most of the coding is probably done, it's just needing to be combined.
Thanks for any help you have.
-
I am also looking for this kind of affiliate program with SMF Shop. People can join through a 'special' url ( eg. www.yourdomain.com/forum/index.php?ref=YourUsername) and earn credits. and for every post that this new member does, you get 10% of the points that the member you refered did.
This can be seen in this forum: http://www.webdigity.com/ (http://www.webdigity.com/)
They are using SMF Shop mod, and an affiliate mod. Anyone know how to merge this two mod? ???
-
Minor typo in feeble's code: Change $getOD to $getID ;)
-
Im having a lot of trouble on my forum with this mod, is there any way to do this with the affiliate mod?
http://custom.simplemachines.org/mods/index.php?mod=287
-
Im having a lot of trouble on my forum with this mod, is there any way to do this with the affiliate mod?
http://custom.simplemachines.org/mods/index.php?mod=287
this mod was last worked on in april of last year, i really would look somewhere else. also this package format is old as well.
-
Meh, I just dont like the invite one, so Im gonna use the Affiliates mod.
-
for anyone who wants to use this , you need to do some modification ,becoz the new invite mod has extra fields so do not replace them like in feeble post.
copy n replace this instead
// Invite MOD; looks like registration went ok, let's mark the invite key as used and who it was used by.
if ($context['invite_key'] !== false)
{
db_query("
UPDATE {$db_prefix}invites
SET ID_REGISTRATION = '$memberID'
WHERE inviteKey = '{$context['invite_key']}'
LIMIT 1", __FILE__, __LINE__);
}
elseif (!empty($_REQUEST['inviter']) && (int)$_REQUEST['inviter'] !== 0)
{
db_query("
INSERT INTO {$db_prefix}invites (ID_MEMBER, ID_REGISTRATION, inviteTime)
VALUES ('" . (int)$_REQUEST['inviter'] . "', '$memberID', " . time() . ")
", __FILE__, __LINE__);
$getID = mysql_fetch_assoc(db_query("
SELECT ID_MEMBER
FROM {$db_prefix}invites
WHERE inviteKey = '$invite_key'
LIMIT 1", __FILE__, __LINE__));
if ($getID)
{
$ID = $getID['ID_MEMBER'];
$addMoney = 100;
db_query("
UPDATE {$db_prefix}members
SET money = money + '$addMoney'
WHERE ID_MEMBER = '$ID'
LIMIT 1", __FILE__, __LINE__);
}
}
Feeble , can we just replace the money fields and put into good karma ?is that easy?
-
I deleted my post above, to cut confusion.
to change karma instead of money
just replace 'money' with 'karmaGood'
-
i think made some error in the above posts :D ... feeble can u help me see if the code below is correct? i cant get it to work anymore...took the whole day to troubleshoot but cant seem to find out why this code is not updating anymore....
// Invite MOD; looks like registration went ok, let's mark the invite key as used and who it was used by.
if ($context['invite_key'] !== false)
{
db_query("
UPDATE {$db_prefix}invites
SET ID_REGISTRATION = '$memberID'
WHERE inviteKey = '{$context['invite_key']}'
LIMIT 1", __FILE__, __LINE__);
}
elseif (!empty($_REQUEST['inviter']) && (int)$_REQUEST['inviter'] !== 0)
{
db_query("
INSERT INTO {$db_prefix}invites (ID_MEMBER, ID_REGISTRATION, inviteTime)
VALUES ('" . (int)$_REQUEST['inviter'] . "', '$memberID', " . time() . ")
", __FILE__, __LINE__);
if ($getID)
{
$ID = $getID['ID_MEMBER'];
$addMoney = 100;
db_query("
UPDATE {$db_prefix}members
SET money = money + '$addMoney'
WHERE ID_MEMBER = '$ID'
LIMIT 1", __FILE__, __LINE__);
}
}
-
without looking at your forum error log
possibly you forgot to include
$getID = mysql_fetch_assoc(db_query("
SELECT ID_MEMBER
FROM {$db_prefix}invites
WHERE inviteKey = '$invite_key'
LIMIT 1", __FILE__, __LINE__));
-
This is the original modification done by the invite mod on register.php....i think my original hack was wrong coz even i used the original hack , only administrator sending out invites geta accrediated but the rest of the others do not , even after they are upgraded to admin permissions. weird! i check the forum logs there isnt any associated error logs with regards to this . And it works on administrator accounts only without the use of invite_keys , where the returning address for referals would like like
http://192.168.1.200/forums/index.php?action=register;inviter=1 ( inviter=1 would be administrator)
but if using keys it would use the key to find out whats the member_id ..
http://192.168.1.200/forums/index.php?action=register;invite_key=5ae9080878e45ce40807209601c975a343308cc8
i think thats where it gets confusing for me...the entries are all right in sql database..the invite mod works find it just that updating points n karma doesnt work properly..
Original
// Invite MOD; looks like registration went ok, let's mark the invite key as used and who it was used by.
if ($context['invite_key'] !== false)
{
db_query("
UPDATE {$db_prefix}invites
SET ID_REGISTRATION = '$memberID'
WHERE inviteKey = '{$context['invite_key']}'
LIMIT 1", __FILE__, __LINE__);
}
elseif (!empty($_REQUEST['inviter']) && (int)$_REQUEST['inviter'] !== 0)
{
db_query("
INSERT INTO {$db_prefix}invites (ID_MEMBER, ID_REGISTRATION, inviteTime)
VALUES ('" . (int)$_REQUEST['inviter'] . "', '$memberID', " . time() . ")
", __FILE__, __LINE__);
}