The Wolf Posted May 26, 2011 Share Posted May 26, 2011 Can someone please turn this into a code that will work in a whmcs custom page for me <?php $legaldoc=$_GET['doc']; if ($legaldoc=="tos") include('/home/web/public_html/whmcs/legaldocs/tos.php'); elseif ($legaldoc=="privacy") include('/home/web/public_html/whmcs/legaldocs/privacy.php'); elseif ($legaldoc=="refunds") include('/home/web/public_html/whmcs/legaldocs/refunds.php'); else echo "<b>Error:</b> No Document Specified, Please use the correct url <b><i>legal.php?doc=_____</i></b>"; ?> 0 Quote Link to comment Share on other sites More sharing options...
tsiedsma Posted May 26, 2011 Share Posted May 26, 2011 What do you mean exactly? There is quite a bit more work to be done to create a custom WHMCS page. Your thread title says Smarty, but your code example is just including files. What exactly are you trying to accomplish and what do you need help with? If you can be more specific, people will be more eager to offer advice, help and opinions. If you are looking for someone to just code something for you, it's going to cost you money, not too many people are willing to donate their time for something custom to one person's site. 0 Quote Link to comment Share on other sites More sharing options...
The Wolf Posted May 26, 2011 Author Share Posted May 26, 2011 What do you mean exactly? There is quite a bit more work to be done to create a custom WHMCS page. Your thread title says Smarty, but your code example is just including files. What exactly are you trying to accomplish and what do you need help with? If you can be more specific, people will be more eager to offer advice, help and opinions. If you are looking for someone to just code something for you, it's going to cost you money, not too many people are willing to donate their time for something custom to one person's site. I just need like 3 minutes tops of help to make that above code work in smarty so it will work in the page i already have made.... basically if the url is... legal.php?doc=tos it will display my legaldocs/tos.php page legal.php?doc=privacy it will display my legaldocs/privacy.php page legal.php?doc=refunds it will display my legaldocs/refunds.php page 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 26, 2011 Share Posted May 26, 2011 @ David Kline Wow, so is it actually David Kline or Johnathan Snyder, you now pretend to not exist when I try to contact you privately via ticket for your mods that you had purchased with a credit card. I told you when I rang you and you answered to Johnathan, that there was a chargeback on the credit card that you used and you said that you would contact your bank. After no response and an attempt from you to alter your client details, further investegations found that the card that you used was based from a bank in the UK, you are from the US according to the details that you gave me. You had also requested to change your details a few times and I told you that I could not change your name to "The Wolf". I had tried to contact you several times asking for verification of the credit card by producing images of both front and back of the card and you refuse claiming that I am hassassing you. Maybe this will prompt you to reply to me via the ticket that is still open, without any abuse like in past replies from you, so that you can pay for what you have purchased. 0 Quote Link to comment Share on other sites More sharing options...
The Wolf Posted May 26, 2011 Author Share Posted May 26, 2011 I have told you several times simply to terminate the services and close my account as i don't have the funds... if you want to know what happened fine... my partner paid for it and we recently had a fight and ended our partnership and it seems that he chargeback'ed SEVERAL items he bought our company and at least i'm not the one who drags a personal matter out in a public place just to embarrass someone, now i am done speaking about it here. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 27, 2011 Share Posted May 27, 2011 Sorry that it has ended up here on this forum but you had left me no choice, as you would not reply to many previous requests to resolve the issue. The services cannot be simply terminated as they were products or digital downloads and not a service as such. I am glad that you have responded here and I would suggest that you contact me via the open ticket at my site so that we can sort this out there. 0 Quote Link to comment Share on other sites More sharing options...
The Wolf Posted May 27, 2011 Author Share Posted May 27, 2011 I will do so as soon as I have more time, maybe on saturday? meanwhile... can anyone help me with my code please (a) 0 Quote Link to comment Share on other sites More sharing options...
Alistair Posted May 27, 2011 Share Posted May 27, 2011 http://wiki.whmcs.com/Creating_Pages 0 Quote Link to comment Share on other sites More sharing options...
The Wolf Posted May 27, 2011 Author Share Posted May 27, 2011 http://wiki.whmcs.com/Creating_Pages I repeat...... I ALREADY MADE THE PAGE I just need my above code turned into smarty 0 Quote Link to comment Share on other sites More sharing options...
Grizzlyware Josh Posted May 27, 2011 Share Posted May 27, 2011 The code you have given is PHP, NOT Smarty sytax. Just stick it in that page and make it work. Simple. WHMCS provides more than enough documentation for it. 0 Quote Link to comment Share on other sites More sharing options...
The Wolf Posted May 27, 2011 Author Share Posted May 27, 2011 The code you have given is PHP, NOT Smarty sytax. Just stick it in that page and make it work. Simple. WHMCS provides more than enough documentation for it. Maybe you would be willing to show me the documentation then! for christ's sake it would take like 3 MINUTES to turn it into smarty for someone who actually knows it.... if THAT long 0 Quote Link to comment Share on other sites More sharing options...
sohouk Posted May 28, 2011 Share Posted May 28, 2011 To include any php in a Smarty template you just put the Smarty {php} tags around the php. Then the php is processed as is (without escaping). Its explained quite well in the Smarty documentation. Here's an example to include a php file myscript.php {php} // including a php script directly from the template. include('/path/myscript.php'); {/php} Trevor 0 Quote Link to comment Share on other sites More sharing options...
Grizzlyware Josh Posted May 30, 2011 Share Posted May 30, 2011 Maybe you would be willing to show me the documentation then! for christ's sake it would take like 3 MINUTES to turn it into smarty for someone who actually knows it.... if THAT long What I'm trying to say is, you don't need to turn it into 'Smarty' code. All Smarty does is make life easy for designers who can't read & write PHP. You will converting PHP into Smarty, and then Smarty will convert it back into PHP. There is no point, at all! Just stick it in your file. /* THIS CODE HAS NOT BEEN TESTED! */ $page = (isset($_GET["page"])) ? strtolower($_GET["page"]) : false; $allowed_pages = array(); $allowed_pages[] = "home"; $allowed_pages[] = "news"; // Dup as required $page = (in_array($page, $allowed_pages)) ? $page : false; if($page !== false) { include($page . ".php"); } else { include("default.php"); } Extremely basic, but you can use this to include different pages & limit the pages that can be included, to prevent injection. Hope this helps 0 Quote Link to comment Share on other sites More sharing options...
bernardc Posted May 30, 2011 Share Posted May 30, 2011 I do not think it would be that easy to create a custom WHMCS page. You would need to put in more work to accomplish such a task. I think there is some problem with the code you posted as it is not in line with what you are looking for. Coding must be done personally and I do not think people will just be giving code that easy. 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted May 30, 2011 Share Posted May 30, 2011 I will do so as soon as I have more time, maybe on saturday? It's now Tuesday here or Monday in the US and still nothing!! 0 Quote Link to comment Share on other sites More sharing options...
Grizzlyware Josh Posted May 31, 2011 Share Posted May 31, 2011 I do not think it would be that easy to create a custom WHMCS page. You would need to put in more work to accomplish such a task. I think there is some problem with the code you posted as it is not in line with what you are looking for. Coding must be done personally and I do not think people will just be giving code that easy. That code will do exactly what he asks, include a certain page depending on the variable in the URL. Looking at what Sparky has written, I don't think I should actually be supporting the OP! Purely for future reference / searches. 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.