disgruntled Posted September 18, 2010 Share Posted September 18, 2010 whmcs/* <?php define("CLIENTAREA",true); include("dbconnect.php"); include("includes/functions.php"); // update table + set 90 day cookie if (isset($aff)) { update_query("tblaffiliates",array("visitors"=>"+1"),array("id"=>$aff)); setcookie("WHMCSAffiliateID", $aff, time()+90*24*60*60); } // Custom page code header("HTTP/1.1 301 Moved Permanently"); (isset($_GET["list"]) ? header('location: /billing/packages/' . $_GET['list'] . '.html') : header('Location: ' . $CONFIG["Domain"])) ?> whmcs/.htaccess #Needed wont work without it. RewriteEngine On ################################################################### # affiliate -> group rewrite linking like this # http://domain.com/whmcs/packages/001/reseller.html (where 001 is affiliate id) # this rule directs the * file to process a referral RewriteRule ^packages/([0-9]+)/([a-z0-9_-]+)\.html$ ./*?aff=$1&list=$2 [L,NC] ################################################################### #package group (triggers if affiliate rule does not) #this rule will be used a lot if you convert your template to a SEO templating EG making pretty links. RewriteRule ^packages/([a-z0-9_-]+)\.html$ ./packages.php?list=$1 [L,NC] ################################################################### #catch all package -> package.php (only if no other rule triggers) RewriteRule ^packages$ ./packages.php [L,NC] whmcs/.packages.php <?php define("CLIENTAREA",true); require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = $_LANG[$list]; $pageicon = "images/support/clientarea.gif"; $breadcrumbnav = '<a href="packages/'.$list.'.html">'.$_LANG[$list].'</a>'; initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav); if ($_SESSION['uid']) { # User is Logged In - put any code you like here } #variable name called with {$list} in the .tpl file $smartyvalues["list"] = $value; # template file name, just the name not .tpl $templatefile = "packages"; outputClientArea($templatefile); ?> whmcs/templates/templatename/packages.tpl {if $list} {* possibly including eternal .tpl here for ease of reading? *} {include file='{$list}.tpl'} {else} Default Page (suggest package listing page) {include file='packagelist.tpl'} {/if} The above codes are not meant to replace whmcs functionality rather allow you to integrate better with your own site. Using the above you get several bonuses. SEO affiliate links. SEO package Pages. Build your site around WHMCS. Best way to utilise this. (literally build your site around whmcs. by doing that your whmcs installation will be at yourdomain.com and not yourdomain.com/somedirectory/ Your sytem urls will be a directory shorter and therefore will in turn be even more SEO Friendly. You can set up lots of mod_rewrite rules to give the illusion of seperate directories for each area. packages support knowlegdebase the list goes on but you will see for yourself that if you enter this route it is a large task to do it. With what i have provided you dont need to do any more to get it working right. One more rule that you might want to use rather than just using whmcs/*?aff=001 could be this welcome/001.html this is the rule for that and you can just use it on its own. RewriteEngine On RewriteRule ^welcome/([0-9]+)\.html$ ./*?aff=$1 [L,NC] 0 Quote Link to comment Share on other sites More sharing options...
disgruntled Posted September 18, 2010 Author Share Posted September 18, 2010 whmcs/.packages.php Should be whmcs/packages.php One more rule that you might want to use rather than just using whmcs/*?aff=001 could be this welcome/001.html Makes more sense to show it like this whmcs/welcome/001.html -> whmcs/*?aff=001 Hope the type fix and the revision of the last part make this easier to understand 0 Quote Link to comment Share on other sites More sharing options...
disgruntled Posted September 18, 2010 Author Share Posted September 18, 2010 (edited) <?php define("CLIENTAREA",true); include("dbconnect.php"); include("includes/functions.php"); // update table + set 90 day cookie if (isset($aff)) { update_query("tblaffiliates",array("visitors"=>"+1"),array("id"=>$aff)); setcookie("WHMCSAffiliateID", $aff, time()+90*24*60*60); } // Custom page code header("HTTP/1.1 301 Moved Permanently"); (isset($_GET["list"]) ? header('location: /billing/packages/' . $_GET['list'] . '.html') : header('Location: ' . $CONFIG["Domain"])) ?> whmcs/.htaccess #Needed wont work without it. RewriteEngine On ################################################################### # affiliate -> group rewrite linking like this # http://domain.com/whmcs/packages/001/reseller.html (where 001 is affiliate id) # this rule directs the * file to process a referral RewriteRule ^packages/([0-9]+)/([a-z0-9_-]+)\.html$ ./*?aff=$1&list=$2 [L,NC] ################################################################### #package group (triggers if affiliate rule does not) #this rule will be used a lot if you convert your template to a SEO templating EG making pretty links. RewriteRule ^packages/([a-z0-9_-]+)\.html$ ./packages.php?list=$1 [L,NC] ################################################################### #catch all package -> package.php (only if no other rule triggers) RewriteRule ^packages$ ./packages.php [L,NC] whmcs/.packages.php <?php define("CLIENTAREA",true); require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = $_LANG[$list]; $pageicon = "images/support/clientarea.gif"; $breadcrumbnav = '<a href="packages/'.$list.'.html">'.$_LANG[$list].'</a>'; initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav); if ($_SESSION['uid']) { # User is Logged In - put any code you like here } #variable name called with {$list} in the .tpl file $smartyvalues["list"] = $value; # template file name, just the name not .tpl $templatefile = "packages"; outputClientArea($templatefile); ?> whmcs/templates/templatename/packages.tpl {if $list} {assign var="specialmsg" value="templates/$template/$list.tpl"} {if file_exists($specialmsg)} {include file="$template/$list.tpl"} {else} {$specialmsg} {include file="$template/mainpage.tpl"} {/if} {/if} The above codes are not meant to replace whmcs functionality rather allow you to integrate better with your own site. Using the above you get several bonuses. SEO affiliate links. SEO package Pages. Build your site around WHMCS. Best way to utilise this. (literally build your site around whmcs. by doing that your whmcs installation will be at yourdomain.com and not yourdomain.com/somedirectory/ Your sytem urls will be a directory shorter and therefore will in turn be even more SEO Friendly. You can set up lots of mod_rewrite rules to give the illusion of seperate directories for each area. packages support knowlegdebase the list goes on but you will see for yourself that if you enter this route it is a large task to do it. With what i have provided you dont need to do any more to get it working right. One more rule that you might want to use rather than just using whmcs/welcome/001.html -> whmcs/*?aff=001 this is the rule for that and you can just use it on its own. RewriteEngine On RewriteRule ^welcome/([0-9]+)\.html$ ./*?aff=$1 [L,NC] Note To Admin. I would like you to edit my first post with to the contents of this one and remove the extra posts please Edited September 18, 2010 by disgruntled Admin Message 0 Quote Link to comment Share on other sites More sharing options...
disgruntled Posted September 18, 2010 Author Share Posted September 18, 2010 whmcs/templates/templatename/packages.tpl {if $list} {assign var="specialmsg" value="templates/$template/$list.tpl"} {if file_exists($specialmsg)} {include file="$template/$list.tpl"} {else} {$specialmsg} {include file="$template/mainpage.tpl"} {/if} {/if} Added in some tpl file_exist checking, replace the tpl code in above post to this 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted September 20, 2010 WHMCS Support Manager Share Posted September 20, 2010 Original post updated. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.