Jump to content

rmatakajr

Retired Forum Member
  • Posts

    11
  • Joined

  • Last visited

Everything posted by rmatakajr

  1. If you dont mind me asking how do they pick thier subdomain name during the checkout process? Rick
  2. If your like me, you want the affiliate program to do more then it already does... so i hacked it and here is a solution to give your customer specific affiliate links for promos you run through WHMCS affiliate system, plus i made the links search engine friendly APACHE MUST HAVE AcceptPathInfo = on STEP 1 Edit The affiliates.tpl Change <input type="text" size="80" value="{$referrallink}"> to <input type="text" size="80" readonly="readonly" value="http://www.yourdomain.com/whmcs/*/aff/{$affiliateid}/NAME-OF-PROGRAM"> Where NAME-OF-PROGRAM == to unique program, like mypackage so it would look like <input type="text" size="80" readonly="readonly" value="http://www.yourdomain.com/whmcs/*/aff/{$affiliateid}/mypackage"> Step 2 Now Replace the Code in * with this code <?php define("CLIENTAREA",true); include("dbconnect.php"); include("includes/functions.php"); $pathArray=array(); $strip_array=array(); $pathArray=processURI(); //print_r($pathArray); exit(); // ORG WHMCS CODE // if (isset($aff)) { // update_query("tblaffiliates",array("visitors"=>"+1"),array("id"=>$aff)); // setcookie("WHMCSAffiliateID", $aff, time()+90*24*60*60); // } // NEW CODE if (($pathArray['arg1']=='aff') && (is_numeric($pathArray['arg2'])) ) { update_query("tblaffiliates",array("visitors"=>"+1"),array("id"=>$pathArray['arg2'])); setcookie("WHMCSAffiliateID", $pathArray['arg2'], time()+90*24*60*60); } header("HTTP/1.1 301 Moved Permanently"); if ( (isset($pathArray['arg3'])) && ($pathArray['arg3']=='mypackage') ) { header("Location: http://www.mydomain.com/mypackage.php"); }else{ // Send To Home Page header("Location: ".$CONFIG["Domain"]); } // Lets Setup Search Engine Friendly URIS // http://localhost/listing/index.php/1093114973.html // this phrases the /var/1/2/ function processURI() { global $PATH_INFO; // Define our global variables $array = explode("/",$PATH_INFO); // Explode the URI using '/'. $num = count($array); // How many items in the array? $url_array = array(); // Init our new array for ($i = 1 ; $i < $num ; $i++) { $url_array["arg".$i] = $array[$i]; } return $url_array; // return our new shiny array } NOW YOUR LINKS SHOULD LOOK LIKE THIS in the Client Area for the affiliate program http://www.yourdomain.com/whmcs/*/aff/004/mypackage'>http://www.yourdomain.com/whmcs/*/aff/004/mypackage When you go to this link, it will track the aff=004 and send them off to your mypackage page If you leave off /mypackage Then it will send off to your home page I have 2 links in my affiliate area like look like this Special Offer Page Affiliate Link http://www.yourdomain.com/whmcs/*/aff/004/mypackage'>http://www.yourdomain.com/whmcs/*/aff/004/mypackage Home page affiliate link http://www.yourdomain.com/whmcs/*/aff/004 Enjoy! Rick Jr http://www.mataka.com
  3. Ok this is how to solve my first part, getting the correct item ordered before the amember script gets called, Matt Said SO Thanks to this user in post http://forum.whmcs.com/showthread.php?t=8536 I got a quick start from here function actionhook_InvoicePaid($vars) { # This function runs when an invoice is fully paid and therefore the services renewed # $vars["InvoiceID"] // we need invoiceid in order to do a lookup $invoiceID = $vars['InvoiceID']; // lookup relid from the invoiceid $result = mysql_query("SELECT relid FROM tblinvoiceitems WHERE type='Hosting' AND invoiceid='".$invoiceID."'"); $grab_relid = mysql_fetch_row($result); $relid = $grab_relid[0]; // lookup the packageid from the relid $result = mysql_query("SELECT packageid, userid FROM tblhosting WHERE id='".$relid."'"); $grab_packageid = mysql_fetch_row($result); $packageid = $grab_packageid[0]; // verify package id is of the correct product type - one that should have additional action taken if(($packageid == "0000000011") || ($packageid == "0000000010") ) { //success spark amember code! } Take Care Rick
  4. Im in contact with Matt right now for this question, and I am makeing a thread so i can keep the community updated Basicly I have aMemeber membership system. Now they sigup process for a member is only one way.. where you have your userers signup in aMemeber and then aMemeber will create accounts in 3rd Party apps You cant have 3rd Party Apps Create signups in aMemeber and i will tell you that it is extremmly hard and if your not a seasoned PHP developer... dont waste your time. But ofcource.. i have to have things the hard way! So here I am ripping up the system to alleviate this one way cluster-fuk because i need WHM to send off signup information to aMember. So here is what i got, and why im working with Matt to get this done when an invoice is paid it shoots off the action hook actionhook_InvoicePaid($vars) Now here is my problem, using the $invoiceID = $vars['InvoiceID']; I need to 1) Make sure at least one of the items ordered in that invoice the product id 10 or 11 (these are the membership products) 2) Once i verify this, i need to get the userid, so i can get the account information. email, password, etc... 3) I then send this off to aMember {more on this in a moment} NOW!! My hack at this was $result = mysql_query("SELECT packageid, userid FROM tblhosting WHERE orderid='".$invoiceID."'"); $packageid_array = mysql_fetch_array($result,MYSQL_ASSOC); $packageid=$packageid_array['packageid']; // verify package id is of the correct product type - one that should have additional action taken if(($packageid == "0000000011") || ($packageid == "0000000010") ) { // success } From what i tested, when an invoice becomes paid, the invoice id and the order id match in the tblhosting table, then when i delete the invoice the row in the tblhosting is deleted but not the tblinvoiceitems, The tblinvoiceitems contains a relid .. but i have no idea how the relid is used Now when i asked Matt He said So oviously this is not the SURE FIRE WAY.. and this is what im lokoing for help on.. in other words I need the SUREFIRE way, with the invoice id to make sure that the items ordered was indeed 10 or 11 and get the userid. =================== NOW FOR AMEMBER ===================== I figured i would show you the way to hack an aMember signup process ** PLEASE NOTE, THIS IS ONLY FOR FREE PRODUCTS IN aMEMBER This is because im having WHM handle the billing, i just needed to create accounts in aMemeber, so that the protected directories that aMemeber protects would create an entry in the htgroup and htpasswd files SO ITS IMPORTANT TO SETUP YOUR PROTECTED DIR WITH htpassword as the METHOD OF PROTECTION So... aMemebr is stuborn you cant send off usual posts to the signup.php page because it wont maintain session varibales, and then you will have an added memeber into the system, that is not active and no entrys are created in the htpassword or htgroup files PAIN IN THE ASSSS!! So i had to basicly hack the **** out of the signup.php page in order to imitate the signup and thankyou automation process so that the proper entries are created! PLUS YOU MAY NOTE, in PHP5 Curl does not followredirect no more so i had to incorperate a CURL redirect hack.. because amember does redirects, during the signup process This is the code that makes the request to aMemeber make a file named send_to_amember.php Place this code // cURL CURLOPT_FOLLOWLOCATION WorkAround // When OpenBase Dir or SafeMode is set function curl_redir_exec($ch,$debug="") { static $curl_loops = 0; static $curl_max_loops = 20; if ($curl_loops++ >= $curl_max_loops) { $curl_loops = 0; return FALSE; } curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); $debbbb = $data; list($header, $data) = explode("\n\n", $data, 2); $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($http_code == 301 || $http_code == 302) { $matches = array(); //check in header if(preg_match('/Location:(.*?)\n/', $header, $matches)) { $url = @parse_url(trim(array_pop($matches))); } if (!$url) { //couldn't process the url to redirect to $curl_loops = 0; return $data; } $last_url = parse_url(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); //if (!$url['scheme']) // $url['scheme'] = $last_url['scheme']; //if (!$url['host']) // $url['host'] = $last_url['host']; //if (!$url['path']) // $url['path'] = $last_url['path']; $new_url = $url['scheme'] . '://' . $url['host'] . $url['path'] . ($url['query']?'?'.$url['query']:''); curl_setopt($ch, CURLOPT_URL, $new_url); // debug('Redirecting to', $new_url); return curl_exec($ch); } else { // Check in Data if(preg_match('/<meta(.*)url=(.*?)"/i',$debbbb,$matches)) { $url=@parse_url(trim($matches[2])); } if (!$url) { //couldn't process the url to redirect to $curl_loops=0; return $debbbb; } $last_url = parse_url(curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)); //if (!$url['scheme']) // $url['scheme'] = $last_url['scheme']; //if (!$url['host']) // $url['host'] = $last_url['host']; //if (!$url['path']) // $url['path'] = $last_url['path']; $new_url = $url['scheme'] . '://' . $url['host'] . $url['path'] . ($url['query']?'?'.$url['query']:''); curl_setopt($ch, CURLOPT_URL, $new_url); // debug('Redirecting to', $new_url); return curl_redir_exec($ch); } } // SETUP POST FIELDS $f_name='Rick'; $l_name='M'; $email='email@yourdomain.com'; $username='username'; $pass='pass'; $url_post = 'product_id'."=". '1'. "&"; $url_post .= 'paysys_id'."="."free". "&"; $url_post .= 'paysys_id_not_required'."="."for javascript". "&"; $url_post .= 'name_f'."=".$f_name. "&"; $url_post .= 'name_l'."=".$l_name. "&"; $url_post .= 'email'."=".$email. "&"; $url_post .= 'login'."=".$username . "&"; $url_post .= 'pass0'."=".$pass. "&"; $url_post .= 'pass1'."=".$pass. "&"; $url_post .= 'do_payment'."="."1". "&"; $url_post .= 'price_group'."=".''. "&"; $url_post .= 'i_agree'."="."1". "&"; // NOTE: Make Sure to make a /cookies/ folder in your // amember directory // curl needs this to maintain PHP session //if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')) if(function_exists('curl_init')) { $ch = curl_init(); // SET URL FOR THE POST FORM LOGIN curl_setopt($ch, CURLOPT_URL,'http://www.yourdomain.com/members/signup_hacked.php'); // ENABLE HTTP POST curl_setopt ($ch, CURLOPT_POST, 1); // SET POST PARAMETERS : FORM VALUES FOR EACH FIELD curl_setopt ($ch, CURLOPT_POSTFIELDS,$url_post); // $DOC_ROOT/amember/cookies/cookie.txt MAKE SURE READABLE and WRITEABLE !! curl_setopt ($ch, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'].'/amembers/cookies/cookies.txt'); // CURLOPT_FOLLOWLOCATION Does Not Work With OpenBase Dir or SafeMode // Work Around Function Included in general.php // curl_setopt($ch,CURLOPT_FOLLOWLOCATION, 1); $contents=curl_redir_exec($ch); // THIS ECHOS THE RESPONSE echo '<pre>'.htmlentities($contents).'</pre>'; exit(); // CLOSE HANDLE curl_close ($ch); } Now we are ready to send off a request to aMemeber make another file named signup_hacked.php and put it in the same folder as signup.php Add this code include('./config.inc.php'); $signup_scope_allowed = array('', 'signup'); $vars = & get_input_vars(); $additional_values=''; // IF YOU WANT TO CHECK FOR EXISTING USER // OFF NOW //if($db->users_find_by_string($vars['email'], 'email', 1)){ //die('USER EXISTS'); //} // Setup Vars $vars['login'] = strtolower($vars['login']); $vars['paysys_id'] = 'free'; $vars['pass'] = $vars['pass1']; $vars['paysys_id'] = $vars['paysys_id']; $begin_date = date('Y-m-d'); $expire_date = '2037-12-31'; // LIFETIME // BECAUSE WE HANDLE SUBSCRIPTIONS WITH WHM // SO SETUP LIFETIME! // But that makes a termination question for Matt!! // ADD USER $member_id = $db->add_pending_user($vars); $payment_id = $db->add_waiting_payment($member_id, $vars['product_id'], $vars['paysys_id'], '0.00', $begin_date, $expire_date, $vars, $additional_values); $payment = $db->get_payment($payment_id); $db->update_payment($payment_id, $payment); // IF YOU WANT TO IMPLIMENT ERRORS // if ($error) { // $db->delete_payment($payment_id); // $db->delete_user($member_id); // } $db->finish_waiting_payment( intval($payment['payment_id']), 'free', $REMOTE_ADDR, '', $vars); Thats Basicly it, You now can automate the signup of a FREE product in amember, i hope this helps as i hope someone can clear up my issue as well I will keep things posted as i develop more Thanks Rick PS: by the way make sure you copy and paste your messages into a note pad if your writing a long post like this because i just lost everything when i tried to POST!!!!! But im a trooper!!
  5. Hi I am using Plesk 8.3, and i did not haver to put $pleskpacketversion = "1.4.2.0"; in the configuration file to setup the accounts it worked flawlessly with the plesk module I got this error when trying to use the plesk reseller module <client_id> should be specified in <gen_setup> [RESULT] => Array ( [sTATUS] => error [ERRCODE] => 1014 [ERRTEXT] => <client_id> should be specified in <gen_setup> Does any one know why this may be happining, i tried to search on pleak and these forumns no luck! Thanks Rick
  6. http://swdn.swsoft.com/en/library/sitebuilder/ Rick! http://www.mataka.com
  7. Hi my name is Rick, I would like to manage my own DNS Server. Where i am confused is id like to be able to intergrade the server within WHMCS.. so when a client makes a domain registration (im using resellONE) it tells resellONE where our nameserver is... but how could i have WHMCS contact our DNS Server to make the record? Does anybody know of a solution that works well and is automated? Would I fill out the nameserver fields under domain registration options? Thanks in advance Rick
  8. Hi, Im hoping someone is some one is subscribed to this thread. Im using planet domains and i would like to host my own dns server. Im just confused how this all intergrades with WHMCS... does any one have experince with DNS managment software that intergrades well? Thanks Rick
  9. I sent support tickets in as suggested and once i figure this out i will be glad to post the solutions, so users with the same problems could be informed but... I just got off the phone with Planet Domains, which is really the backend of resellOne.WHM supports both API's which confuses me a bit, as ResellOne askes for a Private Key which they are unsure about, and PlanetDomains asks for a User ID, which they are also unsure about... So besides the Server Command Error Message Problem.. I guess my other question boils down to Which API should I be using and what information must I obtain. Once I have this information i can approch Planet Domains and gather the correct Criteria. Thank you for your help in advance Rick
  10. Hi My Name is Richard Mataka, I am new to the board, but i am not new to plesk and its problems as i have been using plesk since 2.0 and helped sugest developments to what they have become today. Any way I love the simplicity of WHM.. so much better then MB that was a nightmare intergrading and just full of bugs.. i spent more time helping them solve bugs then get my platform setup! I am contacting anyone with experince for WHM as i need a billing support up like yesterday... but i setup PayPal Standard for Gateway even though I have PayPal Pro and developed scripts for their API i figured this would be good for testing I setup the Plesk 8.1.1 server config in WHM, I tested the domain templates and the clients templates and they all work. So i went and placed a test order and everything went absolulty well but when i try to create the account on the server using the Products/Services Tab i get Server Command Error - Blank with no message at all?? So now im stumped and i searched the forum and tried to add the $pleskpacketversion = "1.4.2.0"; To the configuration.php, but no luck! Does anybody have a clue what might be going on? ========================= Also Im a bit confused as I contacted ResellOne about thier API and got a response from Planet Domains!? In WHM there is the options for PlanetDomains and ResellOne. When I signed up i was given a username and password no private key and no user id, im trying to contact them again to obtain this information But where Im confused is what API should i be using within WHM? ResellOne or Planet Domains? Thank you, I appreciate the help greatly Richard Mataka http://www.mataka.com
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated