|
|||||||
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44 ![]() ![]() |
Due to continuous moans & groans about the membership system for 3.1.10, people blaming mefor my banner system not working properly, demands for refunds etc etc I have once again made the fix so all 68 classifieds users can enjoy the wonderful fruits of this fully armed and operational battle station, sorry I meant membership system.
As we all know there are issues with the current version 3.1.10 which limits members to one membership and there are also bugs if a user purchases a new membership and their old membership hasnt been deleted. Basically it simply doesnt work. So for the second time I have addressed these issues and have updated the 3.1.10 to run with memberships. Ive just spent 4 hours doin this where I should have been working for a client so I dont have the time to write the code changes down individually. Simply download the zip file with the 4 files and providing you havent made changes to usercheckout.php membercheckout.php usermemberships.php and checkout/step2.tpl You can simply swap these files over. If you have made changes try a program like beyondcompare to help you merge the code to your current system. If you are doing this I would suggest you set my versions as defaults and work YOUR code into them, rather than the other way round. Be warned, I have only just finished this work, it runs on my system fine after a couple of quick tests. Please reply to this post if there are any issues. I also hope 68 can incorporate this into the software so that other members dont have any future or further membership problems. Your King.... Maffo Enjoy
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. Last edited by Maffo; 12-04-2007 at 05:34 PM. |
|
|
|
|
|
#2 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44 ![]() ![]() |
It would be nice if somebody fancied doing something similar to CIVs Ad Notification but for membership packages.
At present, if a membership is not complete, when you login and are directed to your userindex page, you will see these memberships but can not 'pay & activate' like you can with normal ads. I currently have a client blaming me for the lack of this ability but Im run off my feet at the moment. If any one fancies doing it, let me know.
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. |
|
|
|
|
|
#3 |
|
PHP Mechanic
Join Date: Nov 2007
Posts: 118
Rep Power: 9 ![]() |
I'm testing this stuff now.
I'll let you know how it goes ... Thanks for the effort you've put in on this!! -- hugh |
|
|
|
|
|
#4 |
|
PHP Mechanic
Join Date: Nov 2007
Posts: 118
Rep Power: 9 ![]() |
OK, we still have the issue from this thread:
http://www.68classifieds.com/forums/...ed=1#post19092 As soon as I try and add a second membership, that funky query dumps me into the "LANG_MULT_MEM_SORRY - LANG_MULT_MEM_NOT_ALLOWED" page. So I can't really test your changes, as I can't create any multiple memberships. I bailed out of my efforts when I saw this post, but I'll pick back up where I left off. I had a two stage query working for displaying only 'valid' memberships. First it grabs all memberships not already purchased, then finds any already purchased which have either expired or haven't reached their max yet. I tried a single query to do it, but the joining got a little complex! -- hugh |
|
|
|
|
|
#5 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44 ![]() ![]() |
More info please, where were you getting the error? I have no trouble on my system with this.
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. |
|
|
|
|
|
#6 |
|
PHP Mechanic
Join Date: Nov 2007
Posts: 118
Rep Power: 9 ![]() |
Read that thread. All the details you need are in it.
-- hugh |
|
|
|
|
|
#7 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44 ![]() ![]() |
Ok, its fixed. Simply re-download from the top post.
MODERATORS PLEASE CAN YOU REMOVE THESE BOTTOM FEW POSTS TO REMOVE CLUTTER
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. |
|
|
|
|
|
#8 |
|
PHP Mechanic
Join Date: Nov 2007
Posts: 118
Rep Power: 9 ![]() |
Well lets test this stuff before we have the mods remove these posts.
Just for grins, here's the solution I came up with: Code:
// $$$ hugh - this stuff is bogus, prevents getting a second membership of any kind
/*
// check to see if member has existing membership
$sSQL="SELECT mID,packageID,mUserGroup,mExpirationDays,oDate,numUsed,mNumber FROM ".PREFIX."memberships_orders LEFT JOIN `".PREFIX."memberships` ON mID=packageID WHERE completed='Y' AND userID=".$_SESSION['uid']." AND DATE_SUB(CURDATE(),INTERVAL mExpirationDays DAY) <= oDate";
$result=$db->query($sSQL);
$compare = $result->fetch();
if($compare['numUsed']<$compare['mNumber']){
// member owns current membership
$class_tpl->assign('title', LANG_MULT_MEM_SORRY);
$class_tpl->assign('pPageContent', LANG_MULT_MEM_NOT_ALLOWED);
$class_tpl->assign('body','content.tpl.php');
} else {
*/
//show all packages
// $$$ hugh - modified queries so we only show memberships which aren't already purchased,
// or have time out, or reached maximum
$sSQL="
SELECT m.mID, m.mTitle, m.mDescription, m.mPrice
FROM ".PREFIX."memberships AS m
INNER JOIN ".PREFIX."memberships_orders AS o ON m.mID != o.packageID
ORDER BY m.mTitle
";
$result=$db->query($sSQL);
$data=array();
while($rs=$result->fetch())
{
$rs['title']=safeStripSlashes($rs['mTitle']);
$rs['description']=safeStripSlashes($rs['mDescription']);
$rs['price']=FormatCurrency($rs['mPrice']);
$data[] = $rs;
}
$sSQL="
SELECT m.mID, m.mTitle, m.mDescription, m.mPrice
FROM ".PREFIX."memberships AS m
LEFT JOIN ".PREFIX."memberships_orders AS o ON m.mID = o.packageID
WHERE (
o.completed='Y'
AND o.userID=".$_SESSION['uid']."
)
AND (
(
DATE_SUB(CURDATE(),INTERVAL m.mExpirationDays DAY) <= o.oDate
AND o.numUsed < m.mNumber
)
OR
DATE_SUB(CURDATE(),INTERVAL m.mExpirationDays DAY) > o.oDate
)
ORDER BY m.mTitle
";
$result=$db->query($sSQL);
while($rs=$result->fetch())
{
$rs['title']=safeStripSlashes($rs['mTitle']);
$rs['description']=safeStripSlashes($rs['mDescription']);
$rs['price']=FormatCurrency($rs['mPrice']);
$data[] = $rs;
}
$class_tpl->assign('results', $data);
$class_tpl->assign('body','memberships/step1.tpl.php');
/*
}
*/
-- hugh |
|
|
|
|
|
#9 |
|
The Master
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44 ![]() ![]() |
I simply cut the code out of the bottom of the page as there is no need to run this check as we are allowing multiple memberships
__________________
**Bulk Upload System** has been upgraded. Works on all v4 versions with new functionality. Free upgrade for existing customers. |
|
|
|
|
|
#10 |
|
PHP Mechanic
Join Date: Nov 2007
Posts: 118
Rep Power: 9 ![]() |
OK, as far as I can tell, the usermembership mod you just posted doesn't take in to account if the existing memberships have expired or reached maximum.
My code above will only show memberships which you don't already have, OR you have, but they have expired or reached maximum. [edit] The reason I did it this way was I wasn't sure if the rest of the multiple membership code would gracefully handle having two active memberships of the same type. -- hugh Last edited by cheesegrits; 12-04-2007 at 06:28 PM. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New Listing Notify Not working for memberships | abkeller | v3.1 Questions & Support | 0 | 08-03-2007 02:51 AM |