Jump to content

Need Help - Smarty


The Wolf

Recommended Posts

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>";
?>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

@ 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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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