Adamski Posted February 11, 2007 Share Posted February 11, 2007 Hi, Just a quickie - I will be selling two different types of product from two different sites. I know I cant share one installation between two domains so I want to have two order forms on one domain - branded seperately.Is this possible? Many thanks, Adam 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted February 11, 2007 WHMCS CEO Share Posted February 11, 2007 With the use of the appropriate code in the template files this would be possible. You'd need to pass in a variable telling the system which style it should use and then use an if statement in the templates to check this variable and display the header/footer accordingly. 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted February 11, 2007 Author Share Posted February 11, 2007 excellent - thanks Matt I will continue to play around but it rocks so I'll be signing up soon Ad 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted February 28, 2007 Author Share Posted February 28, 2007 Can anyone help me with this I was thinking that the best way was to pass something like "template=blue_template" at the end of the logon url (I have a login form on my domain) and then check if $_REQUEST[template] exists and if it does save it in a SESSION variable... But I have no idea how to actually do it. Can someone point me in the right direction or where there may be some good examples? Matt you may want to move this to Customisation and Intergration. Thanks all Ad 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted February 28, 2007 WHMCS CEO Share Posted February 28, 2007 Ok, I haven't tested this but I think it would need to be done something like this. In header.tpl, add a PHP code block at the top: {php} if ($_GET["template"]) { $_SESSION["template"] = $_GET["template"]; } {/php} Then you would use code such as the following: {if $smarty.session.template eq "blue_template"} Display this HTML code here {else} Display this HTML code here {/if} You would probably need to use the above code in both your header and footer template files to modify these sections to fit the selected template. Hope that helps! Matt 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted February 28, 2007 Author Share Posted February 28, 2007 ok I have done that but all that displays is the default theme. Now this is likely to be down to me so this is what I have so far {php} if ($_GET["template"]) { $_SESSION["template"] = $_GET["template"]; } {/php} {if $smarty.session.template eq "onestopdigital"} <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>{$companyname} - {$pagetitle}</title> <link rel="stylesheet" type="text/css" href="templates/onestopdigital/style.css" /> </head> <body> <table id="wrapper" align="center"> <tr> etc etc etc ... {else} <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>{$companyname} - {$pagetitle}</title> <link rel="stylesheet" type="text/css" href="templates/default/style.css" /> </head> <body> etc etc etc {/if} Do I need to sepecify the template path as I have done in the css line? Have I put everything in the right place? Thanks Ad 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted February 28, 2007 Author Share Posted February 28, 2007 ok that's because I was editing my custom header.tpl and the config was set to use the default theme. I've changed that but it just displays what ever is between the {else} tag. Ad 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted February 28, 2007 WHMCS CEO Share Posted February 28, 2007 Set it to output the template variable using the code {$smarty.session.template} and see if this ever has a value at all. Matt 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted February 28, 2007 Author Share Posted February 28, 2007 it just displays the default theme as per the {else} tag .. that bit is working as I have my onestopdigital theme set to be used in control panel. I just can't work out why it doesn't do the first bit! My login passes "&template=onestopdigital" at the end of the string so all the names are correct. I will have to sit and stare and work it out lol 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted March 1, 2007 Author Share Posted March 1, 2007 Ok if I add ?template=onestopdigital to the end of the url in the address bar it all works. My login form is one form for several control panels, which then goes through a script to redirect to the appropriate panel depending on which has been selected. switch ( $_REQUEST['controlpanel'] ) { case 'billing': $url = "http://www.domain.co.uk/client/dologin.php?template=onestopdigital&username={$_REQUEST['username']}&password={$_REQUEST['password']}"; break; When I type it into the address bar with ..co.uk/client/clientarea.php?template=onestopdigital - all ok but .co.uk/client/dologin.php?template=onestopdigital - doesn't like Ad 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted March 1, 2007 Author Share Posted March 1, 2007 Ok so I've worked out that the dologin.php must not reference the templates which is why it doesn't get picked up. Is there anyway around this like being able to carry the string to the next page? Thanks Ad 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted March 1, 2007 WHMCS CEO Share Posted March 1, 2007 No, you'll have to link to the clientarea.php file and have the client login from there. Matt 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted March 1, 2007 Author Share Posted March 1, 2007 [rant]which defeats the object of having my own logon. I have 5 different control panels and they can't all be seperate pages it looks very unprofressional. why can't it be done this way?[/rant] ok i have had a thought - if i pass the variables to login page I should be able to play with the login.tpl .. ok that probably makes no sense. I'll play and report back 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted March 1, 2007 Author Share Posted March 1, 2007 UPDATE - all sorted and working I changed my redirect code from this: switch ( $_REQUEST['controlpanel'] ) { case 'billing': $url = "http://www.domain.co.uk/client/dologin.php?template=onestopdigital&username={$_REQUEST['username']}&password={$_REQUEST['password']}"; break; to this: switch ( $_REQUEST['controlpanel'] ) { case 'billing': $url = "http://www.domain.co.uk/client/dologin.php?goto=clienteare&template=onestopdigital&username={$_REQUEST['username']}&password={$_REQUEST['password']}"; break; it's always something simple that gets me stuck! Hopefully this might help someone else! Thanks for you help Matt - and aplogies for my rant.. I've spent hours doing something that took seconds in the end. Ad 0 Quote Link to comment Share on other sites More sharing options...
wildorchid Posted March 1, 2007 Share Posted March 1, 2007 Interesting, maybe this will help me too. I tried to have a little login form in Joomla which should call the WHMCS dologin page in the wrapper iframe and automatically login. I did not figure out how pass on the login data. Maybe your solution works for me too. I'll give it a try. Thanks 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted March 3, 2007 Author Share Posted March 3, 2007 ok I've run into a stumble.. so overwhelmed in joy was I that I could log in I didnt realise that my browser was caching the template so that bit isn't working. I'm using the above code still but it is loading the default template everytime. Again if I mainly add ?template=onestopdigital to the end of the url it's ok. Any suggestions? Cheers Adam 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted March 4, 2007 Share Posted March 4, 2007 Did you delete the template cache? 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted March 4, 2007 Author Share Posted March 4, 2007 yeah but to no avail 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted March 5, 2007 Share Posted March 5, 2007 "?template=onestopdigital" mite work, but it leaves the visitor knowing more than you'd like them to. I suggest some good old PHP "IF/Else" to accomplish this. 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted March 5, 2007 Author Share Posted March 5, 2007 yeh that is what I am using (code in post at beginning of thread!) but it relys on me passing a variable through the url. is there another way? Thanks 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted March 5, 2007 Share Posted March 5, 2007 This should do it: <?php $this_domain = $_SERVER['HTTP_HOST']; if ( $this_domain == yourdomain1.com ) { echo "HTML 4 your first domain's theme"; } else { echo "HTML 4 your second domain's theme"; } ?> It took me a whole smoke to remember that one. Thanks for the refresher. Let me know if you have problems. Oh, and you don't have to code it that way, "$_SERVER['HTTP_HOST']" is all you needed. 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted March 5, 2007 Author Share Posted March 5, 2007 cool I'll give it a try thanks man - have another smoke lol 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted March 5, 2007 Share Posted March 5, 2007 Just did. Let me know how it works out. 0 Quote Link to comment Share on other sites More sharing options...
Adamski Posted March 5, 2007 Author Share Posted March 5, 2007 Just loading the default template which is what I have specified for else. As it's in the header.tpl file I've smartied it - I think it is right: {php} $this_domain = $_SERVER['HTTP_HOST']; {/php} {if $this_domain == "http://www.domain.co.uk"} <html> <head> I've tried the domain with/without http and https and with/withouth www etcetc Any more ideas? Thanks Adam 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted March 5, 2007 Share Posted March 5, 2007 That's really strange. This will print the domain name: {php} $this_domain = $_SERVER['HTTP_HOST']; {echo "$this_domain";} {/php} I'll see what I can do. 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.