peeta Posted September 21, 2010 Share Posted September 21, 2010 I want to place the affiliate codes on its own page because the banner images are displayed on the page and it has now become a clutter and lengthened the page significantly. I created a template file called affiliatelinks.tpl and added {if $loggedin} {if $affiliatelinkscode} {$affiliatelinkscode} {/if}{/if} but the links do not display. What can I do to show the banner codes separately from the aff report page? Ideally I'd like to have several pages categorized as 728x90, 300x250, 160x600 etc. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted September 21, 2010 Share Posted September 21, 2010 http://wiki.whmcs.com/Creating_Pages 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted September 21, 2010 Author Share Posted September 21, 2010 Does anyone know what codes are required to call the affiliate link codes so it display on a stand alone page? I figure the code that calls [AffiliateLinkCode] is within affiliates.php which is encrypted so I can't extract it. 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted September 22, 2010 Author Share Posted September 22, 2010 I didn't realise this would be such a task to resolve. Please see the attached images to get an understanding of what I want to acheive. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted September 22, 2010 Share Posted September 22, 2010 Did you look in the associated template for that page? (affiliates.tpl) {if $affiliatelinkscode} <p><strong>{$LANG.affiliateslinktous}</strong></p> <p align="center">{$affiliatelinkscode}</p> {/if} 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted September 22, 2010 Author Share Posted September 22, 2010 I don't get what you are suggesting here and with all due respect, did you not note in my initial post that I have already extracted and used that code? It just is not calling the data so there must be a query in the encoded affiliates.php which is making the call then output to the $affiliatelinkscode definition. I just don't know how that query is written and this is where I seek assistance. I don't know how else to clarify my quest. So in repetition here is what I have already done with no success Created files affiliatelinks.php and affiliatelinks.tpl Inserted in affiliatelinks.tpl the code copied from affiliates.tpl and wrapped within the logged in condition as below; {if $loggedin} {if $affiliatelinkscode} {$affiliatelinkscode} {/if} {/if} The page opens without error but the affiliate codes do not display. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted September 22, 2010 Share Posted September 22, 2010 It just is not calling the data so there must be a query in the encoded affiliates.php which is making the call then output to the $affiliatelinkscode definition. Yes, you will need to "paste" the details you've put in the text-area in whmcs into your new page, and change the text area display in the affilaite tpl to be a link to your new page 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted September 23, 2010 Share Posted September 23, 2010 What exactly do you have in affiliatelinks.php? Did you follow the instructions located on the wiki article I pasted to you a while ago? the code you're looking for is in the template vars. You can output them with this: print_r($smarty->get_template_vars()); Then reference them within your template code, or manipulate them as an array reference and assign them to a new smarty tag. 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted September 23, 2010 Author Share Posted September 23, 2010 Yes, you will need to "paste" the details you've put in the text-area in whmcs into your new page, and change the text area display in the affilaite tpl to be a link to your new page The manual method will show the code but the affliate's ID is not displayed with this code <(a href="[AffiliateLinkCode]")><(img src="banner.png" width="728" height="90" border="0")><(/a)> What can I do so the code interprets the logged in affiliate's ID? 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted September 24, 2010 Author Share Posted September 24, 2010 This is what I have in the php file <?php define("CLIENTAREA",true); require("dbconnect.php"); require("includes/functions.php"); require("includes/clientareafunctions.php"); $pagetitle = "Affiliate Banners"; $pageicon = "images/support/clientarea.gif"; $breadcrumbnav = '<a href="index.php">'.$_LANG['globalsystemname'].'</a>'; $breadcrumbnav .= ' » <a href="affiliatelinks.php">Affiliate Banners</a>'; initialiseClientArea($pagetitle,$pageicon,$breadcrumbnav); if ($_SESSION['uid']) { # User is Logged In - put any code you like here } # To assign variables in Smarty use the following syntax. # This can then be used as {$variablename} in the template $smartyvalues["variablename"] = $value; $templatefile = "affiliatelinks"; outputClientArea($templatefile); ?> I tried many smarty variables relative to affiliate codes and still no result. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted September 24, 2010 Share Posted September 24, 2010 Did you try printing all the template vars like I listed before? 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted September 24, 2010 Author Share Posted September 24, 2010 Yes I printed all the vars and tried all that related to affiliate id or link and nothing returned. I suspect there is a query in affiliates.php which is making this call. I may eventually have to contact WHMCS on this. 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted September 30, 2010 Author Share Posted September 30, 2010 I got this working now with help from WHMCS but now I have another issue. I have 8 categories which require 8 pages and I want to load each template file with the single afflinks.php file using a url query similar to clientarea.php?action=invoices so mine would be as afflinks.php?action=728x90, afflinks.php?action=300x250 and so on. I have created each of the .tpl files for the categories but just cannot figure how to load them. Can anyone offer instructions? 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted October 1, 2010 Author Share Posted October 1, 2010 Maybe no one understands this. I want to have a single .php file and have it load different template files. 0 Quote Link to comment Share on other sites More sharing options...
laszlof Posted October 1, 2010 Share Posted October 1, 2010 switch ($_REQUEST['action']) { case "728x90": $templatefile = "afflinks_728x90"; break; case "300x250": $templatefile = "afflinks_300x250"; break; } outputClientArea($templatefile); 0 Quote Link to comment Share on other sites More sharing options...
peeta Posted October 2, 2010 Author Share Posted October 2, 2010 Thank you laszlof. 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.