Support Forums


Go Back   68 Classifieds Forums > Legacy Help & Support > v3.1 Modules & Modifications

 
LinkBack Thread Tools Display Modes
Old 12-04-2007, 03:41 PM   #1
The Master
 
Maffo's Avatar
 
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44
Maffo is just really niceMaffo is just really nice
Default Fully working, operational Membership/Bulk Listing System for 3.1.10

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
Attached Files
File Type: zip working_memberships_3_1_10(2).zip (18.0 KB, 25 views)
__________________
**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.
Maffo is offline   Reply With Quote
Old 12-04-2007, 04:03 PM   #2
The Master
 
Maffo's Avatar
 
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44
Maffo is just really niceMaffo is just really nice
Default

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.
Maffo is offline   Reply With Quote
Old 12-04-2007, 04:43 PM   #3
PHP Mechanic
 
 
Join Date: Nov 2007
Posts: 118
Rep Power: 9
cheesegrits has a spectacular aura about
Default

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
cheesegrits is offline   Reply With Quote
Old 12-04-2007, 05:15 PM   #4
PHP Mechanic
 
 
Join Date: Nov 2007
Posts: 118
Rep Power: 9
cheesegrits has a spectacular aura about
Default

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
cheesegrits is offline   Reply With Quote
Old 12-04-2007, 05:24 PM   #5
The Master
 
Maffo's Avatar
 
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44
Maffo is just really niceMaffo is just really nice
Default

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.
Maffo is offline   Reply With Quote
Old 12-04-2007, 05:27 PM   #6
PHP Mechanic
 
 
Join Date: Nov 2007
Posts: 118
Rep Power: 9
cheesegrits has a spectacular aura about
Default

Read that thread. All the details you need are in it.

-- hugh
cheesegrits is offline   Reply With Quote
Old 12-04-2007, 05:36 PM   #7
The Master
 
Maffo's Avatar
 
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44
Maffo is just really niceMaffo is just really nice
Default

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.
Maffo is offline   Reply With Quote
Old 12-04-2007, 06:02 PM   #8
PHP Mechanic
 
 
Join Date: Nov 2007
Posts: 118
Rep Power: 9
cheesegrits has a spectacular aura about
Default

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');
			/*
			}
			*/
This assumes that the rest of the membership code now handles multiple memberships where there is an existing one of the same type which has timed out or reached maximum.

-- hugh
cheesegrits is offline   Reply With Quote
Old 12-04-2007, 06:08 PM   #9
The Master
 
Maffo's Avatar
 
Join Date: Mar 2006
Location: British in Argentina
Posts: 1,400
Rep Power: 44
Maffo is just really niceMaffo is just really nice
Default

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.
Maffo is offline   Reply With Quote
Old 12-04-2007, 06:21 PM   #10
PHP Mechanic
 
 
Join Date: Nov 2007
Posts: 118
Rep Power: 9
cheesegrits has a spectacular aura about
Default

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.
cheesegrits is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 04:04 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0