Thread: Adding membership?

Results 1 to 4 of 4
  1. #1 Adding membership? 
    Fake Love


    Join Date
    Jun 2008
    Age
    28
    Posts
    439
    Thanks given
    224
    Thanks received
    312
    Rep Power
    4385
    How would you add membership in a sense that it adds 30 days? and after 30 days it removes? Is this possible without integrating ?
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Quote Originally Posted by Alcazar View Post
    How would you add membership in a sense that it adds 30 days? and after 30 days it removes? Is this possible without integrating ?
    You want it to only count the days if they online of both on and off?

    I can mabye help you with just online but not with both on and off
    Reply With Quote  
     

  3. #3  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    What do you mean "Without integrating"? For it to check if you're logged in or not it would have to loop through all of your character files checking a specific token, specifically when the membership started.

    Here is a method which uses the GregorianCalender class.
    Code:
    	public void checkDateAndTime()
    	{
    		Calendar cal = new GregorianCalendar();	
    		
    		int YEAR = cal.get(Calendar.YEAR);
    		int MONTH = cal.get(Calendar.MONTH) + 1;
    		int DAY = cal.get(Calendar.DAY_OF_MONTH);
    		int HOUR = cal.get(Calendar.HOUR_OF_DAY);
    		int MIN = cal.get(Calendar.MINUTE);
    		int SECOND = cal.get(Calendar.SECOND);
    		
    		String day = "";
    		String month = "";
    		String hour = "";
    		String minute = "";
    		String second = "";
    		
    		if (DAY < 10)
    			day = "0" + DAY;
    		else 
    			day = "" + DAY;
    		if (MONTH < 10)
    			month = "0" + MONTH;	
    		else
    			month = "" + MONTH;
    		if (HOUR < 10)
    			hour = "0" + HOUR;
    		else 
    			hour = "" + HOUR;
    		if (MIN < 10)
    			minute = "0" + MIN;
    		else
    			minute = "" + MIN;
    		if (SECOND < 10)
    			second = "0" + SECOND;
    		else
    			second = "" + SECOND;
    			
    		c.date = day + "/" + month + "/" + YEAR;	
    		c.currentTime = hour + ":" + minute + ":" + second;
    	}
    	Properties p = new Properties();
    This could be used for what you're trying to achieve.
    Reply With Quote  
     

  4. #4  
    Fake Love


    Join Date
    Jun 2008
    Age
    28
    Posts
    439
    Thanks given
    224
    Thanks received
    312
    Rep Power
    4385
    I mean like, You purchase membership on the 5th of march, on the 5th aprill it will remove it.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PI] Adding real membership and features
    By Dexter Morgan in forum Snippets
    Replies: 28
    Last Post: 10-24-2010, 08:01 PM
  2. Replies: 6
    Last Post: 09-30-2010, 08:11 PM
  3. Replies: 36
    Last Post: 03-31-2009, 03:02 AM
  4. MemberShip/MemberShip Items.
    By Hyperventilate in forum Help
    Replies: 6
    Last Post: 03-29-2009, 04:19 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •