Current time: 02-07-2012, 11:07 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Paid plugin
12-13-2008, 09:53 AM
Post: #1
Paid plugin
I'm also working on a paid plugin, but I need some help.

Now I have this:
PHP Code:
<?
if(THT != 1){die();}

//Create the class
class paid {

    public 
$acpForm = array(), $orderForm = array(), $acpNav = array(), $acpSubNav = array(); # The HTML Forms arrays
    
public $signup true# Does this type have a signup function?
    
public $cron true# Do we have a cron?
    
public $acpBox true# Want to show a box thing?
    
public $clientBox true# Show a box in client cp

public function __construct() { # Assign stuff to variables on creation
        
global $main$db;

        
$this->orderForm[] = array("Cycle"'<select name="cycle" id="cycle"> <option value="annual">Annualy</option> <option value="monthly">Monthly</option></select>'"cycle");
        
$this->orderForm[] = array("Paypal email"'<input name="test" type="text" id="test"  />''ppemail');
        
$this->acpForm[] = array("Monthly cost:"'<input name="monthly" type="text" id="monthly" size="5" onkeypress="return onlyNumbers();" />'"cycle");
        
$this->acpForm[] = array("Annualy cost:"'<input name="annualy" type="text" id="monthly" size="5" onkeypress="return onlyNumbers();" />''annualy');
        
$this->acpNav[] = array("Paid""paid""lightning.png""paid");
        
$this->acpSubNav[] = array("test""paid""lightning.png""test");
    }
    

public function 
acpPage() {

     
}

...


   }
//End Paid
?>
But I have some questions
-How do you get the variables from the forms?
with:
PHP Code:
$fuser $main->getvar['type_fuser']; 
-what's the acpBox, acpPage,...
-how do you display things on the client/admin pages?
Find all posts by this user
Quote this message in a reply
12-13-2008, 10:33 AM
Post: #2
RE: Paid plugin
ALL your orderform element ID's need to have type_ infront of them or they won't make it through the system, they won't get noted in the DB.
$main->getvar is just basically $_GET but they are already DB cleaned. So to get cycle it would be... $main->getvar['type_cycle'];

acpBox is the part you see in the ACP Clients section. For example, in P2H if you have a client and you view them in ACP, you'll get a box underneath the boxes about email, signup etc quoting their forum posts.

acpPage is the code called when a link is clicked in ACP for your page.

To display stuff in client area, it's clientPage.

Jonny H - THT Main Developer & Founder
Find all posts by this user
Quote this message in a reply
12-13-2008, 12:23 PM
Post: #3
RE: Paid plugin
Ok, thanks! THT works with so many arrays that it's difficult to understand for a non skilled programmer. But this should work! Thanks
Find all posts by this user
Quote this message in a reply
12-13-2008, 03:17 PM
Post: #4
RE: Paid plugin
Yeah, there's a few things. It's hard to understand when it isn't documented. Any problems, give me a shout.

Jonny H - THT Main Developer & Founder
Find all posts by this user
Quote this message in a reply
12-23-2008, 08:46 AM
Post: #5
RE: Paid plugin
This is still assigned to alfaleader?
I want to see that feature. Tongue

Jimmie Lin - Community Manager & THT.Next Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
12-24-2008, 07:35 AM
Post: #6
RE: Paid plugin
I don't know if I can finish this, because this is lots harder then a easy language plugin. But I'll try.
Find all posts by this user
Quote this message in a reply
12-24-2008, 07:57 AM
Post: #7
RE: Paid plugin
Well it's up to you. I will be creating a Paid system in a futute version. Probably 1.2.

Jonny H - THT Main Developer & Founder
Find all posts by this user
Quote this message in a reply
12-26-2008, 06:23 AM
Post: #8
RE: Paid plugin
Thanks! Saves me lots of work!

maybe this can help:
PHP Code:
<?php
//////////////////////////////
// The Hosting Tool
// Free - THT Type
// By Jonny H
// Released under the GNU-GPL
//////////////////////////////

//Check if called by script
if(THT != 1){die();}

//Create the class paid
class paid {
    
    public 
$acpForm = array(), $orderForm = array(), $acpNav = array(), $acpSubNav = array(); # The HTML Forms arrays
    
public $signup true# Does this type have a signup function?
    
public $cron true# Do we have a cron?
    
public $acpBox true# Want to show a box thing?
    
public $clientBox true# Show a box in client cp?
    
    # Start the functions #
    
    
public function __construct() { # Assign stuff to variables on creation
        
global $main$db;
        
//forms for the package creation
        
$this->acpForm[] = array("Price Monthly"'<input name="m_price" type="text" id="m_price" size="5" onkeypress="return onlyNumbers();" />''m_price');
        
$this->acpForm[] = array("Price Annualy"'<input name="a_price" type="text" id="a_price" size="5" onkeypress="return onlyNumbers();" />''a_price');
        
//forms for the order
        
$this->orderForm[] = array("Paypal"'<input name="paypal" type="text" id="paypal" />''paypal');
        
//navigation for the admin control panel
        
$this->acpNav[] = array("Paid""paid""lightning.png""Paid");
        
//navigation for the client control panel
        
$this->clientNav[] = array("Forum Posting""forums""lightning.png""Forum Posting");
    }
    
public function 
acpPage() {
        global 
$main$style$db;
        switch(
$main->getvar['do']) { //what do we have to do in the admin control panel?
        
            
default:
                
$array['CONTENT'] = $style->replaceVar("tpl/paid_main.tpl"); //if no button is pressed, show this default info about the paid plugin
                
break;
                
            case 
"paid"//this has to list all the paid users
                
                
                
break;
                
        } 
//end switch
        
echo $style->replaceVar("tpl/manage_paid.tpl"$array); //show the navigation-box in the admin control panel
    
}
    } 
Find all posts by this user
Quote this message in a reply
04-27-2010, 03:52 PM
Post: #9
RE: Paid plugin
so...is it finish? does it works for annual payments?
Find all posts by this user
Quote this message in a reply
04-27-2010, 06:36 PM
Post: #10
RE: Paid plugin
Paid support is in THT now.

Kevin Mark - TheHostingTool Lead Developer
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)