ionCube Logo
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


 
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder

Encoded File - Doesnt include smarty template (tpl) file

Author Message
ptomter



Joined: 24 Mar 2020
Posts: 5

PostPosted: Tue Mar 24, 2020 10:24 pm    Post subject: Encoded File - Doesnt include smarty template (tpl) file Reply with quote

I have encoded all my files execept one file that when I encode it it would not load the .tpl pages on my webserver.

In the file I wish to enconde my smarty templates are included as follow

Code:

        $TemplatFile = __DIR__ . "/template/Control.tpl";
        if (file_exists($TemplatFile) and is_readable($TemplatFile)) {
            $HTML = $smarty->fetch($TemplatFile); //Returns HTML instead of shows it
            return $HTML;
        }


Its not required for the .tpl files to be encoded as users may do their own styling of the templates. But why doesnt it load. please advice without encoding the tpl files and generating a plugin for smarty (if possible)
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 372

PostPosted: Wed Mar 25, 2020 9:20 am    Post subject: Reply with quote

Hi,

Do you mean that you have encrypted your Smarty template file(s) rather than encoded them, using the Encoder's ability to encrypt non-PHP files?

If you have encoded them then that will not work as encoding only works with PHP files, turning them into byte code. Of course, Smarty needs to interpret the template files before displaying them.

If you have encrypted the template files then you will need to modify Smarty itself at the point it reads template files in. You will need to use the ioncube_read_file function instead of the function Smarty is using (file_get_contents). In addition you will need to *encode* that Smarty PHP file otherwise ioncube_read_file will not decrypt the encrypted template.

We have more information about that in our blog article at https://blog.ioncube.com/2014/11/27/encrytping-smarty-templates/

If that does not help it is best to create a ticket in our Support Help Desk about this at https://support.ioncube.com
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
ptomter



Joined: 24 Mar 2020
Posts: 5

PostPosted: Fri Mar 27, 2020 11:04 am    Post subject: Hi Reply with quote

Think we are using the terms enconding/encrypting deifferent. Anyhow

The .php files is protexted by Ioncube. The smarty files (.tpl) is not protected by Ioncube, but the php files should have them included, but this is not working as long as the php is protected by ioncube.
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 372

PostPosted: Fri Mar 27, 2020 1:14 pm    Post subject: Reply with quote

Hi,

Okay, I thought from your original post that you had processed the template files in some way using the Encoder.

When you say it is not loading, what precisely do you mean? Are you getting an error message of some sort, either displayed or in the error log?

In any case it is probably best to create a Support ticket about this at https://support.ioncube.com

In your ticket please include the following:

1. The full phpinfo() output from the server on which you are running the encoded files. Please attach that to the ticket as a single HTML file.

2. Your encoding options if using the command-line or your encoding project file (.iep file) if using the GUI.

3. Any error messages that may be logged or displayed.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
ptomter



Joined: 24 Mar 2020
Posts: 5

PostPosted: Fri Mar 27, 2020 3:31 pm    Post subject: Hi again Reply with quote

What I mean its not loading. I mean that the file is not included. When the php file is protected by
ioncube it exclude including of .tpl files, but it does include other files like php.

The error log doesnt gives any error the protected file just doesnt want to include .tpl files. simple as that.

The reason I ask here as I thought this was a simple issue
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 372

PostPosted: Fri Mar 27, 2020 3:57 pm    Post subject: Reply with quote

Hi,

There must be some reason for the template file not being included and this is what I am unclear about.

You had this piece of code:

Code:
$TemplatFile = __DIR__ . "/template/Control.tpl";
        if (file_exists($TemplatFile) and is_readable($TemplatFile)) {
            $HTML = $smarty->fetch($TemplatFile); //Returns HTML instead of shows it
            return $HTML;
        }


Now what precisely do you mean by "not included"? The comment "Returns HTML instead of shows it" suggests that the file $TemplatFile is being found and is readable. Is that correct?

What exactly does "Returns HTML instead of shows it" mean?

If it is not actually getting that far then either file_exists or is_readable must be false. If one of those is false then what is the value of $TemplatFile?

I really think it would be best to create a Support ticket about this as then we can get more information from you such as your encoding options.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
ptomter



Joined: 24 Mar 2020
Posts: 5

PostPosted: Sat Apr 04, 2020 12:14 am    Post subject: Reply with quote

alastair wrote:
Hi,

There must be some reason for the template file not being included and this is what I am unclear about.

You had this piece of code:

Code:
$TemplatFile = __DIR__ . "/template/Control.tpl";
        if (file_exists($TemplatFile) and is_readable($TemplatFile)) {
            $HTML = $smarty->fetch($TemplatFile); //Returns HTML instead of shows it
            return $HTML;
        }


Now what precisely do you mean by "not included"? The comment "Returns HTML instead of shows it" suggests that the file $TemplatFile is being found and is readable. Is that correct?

What exactly does "Returns HTML instead of shows it" mean?

If it is not actually getting that far then either file_exists or is_readable must be false. If one of those is false then what is the value of $TemplatFile?

I really think it would be best to create a Support ticket about this as then we can get more information from you such as your encoding options.


Yes this is what I am also unclear about. And by not included is that when the files is protected by ioncube the template doesnt load, but when its not protected the template control.tpl is loading. Please dont focus on the comment rather than the code. So what you say is that I should ay 95 usd dollar for support plan for something that should work in the first place?! Hopefully this is not what you actually mean.

What settings might be the issue
?
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 372

PostPosted: Mon Apr 06, 2020 8:20 am    Post subject: Reply with quote

Hi,

Smarty templates certainly do work with encoded files.

As you are requesting support with your encoded application I think it is reasonable that you have a current support plan. It would also resolve this issue much more quickly as we would be able to get more information from you.
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
ptomter



Joined: 24 Mar 2020
Posts: 5

PostPosted: Mon Apr 13, 2020 10:07 pm    Post subject: Hi Reply with quote

Hi, so what more information you like to have?
Back to top
View user's profile Send private message
alastair



Joined: 23 Feb 2010
Posts: 372

PostPosted: Tue Apr 14, 2020 7:48 am    Post subject: Reply with quote

We would need to have your encoding project file (.iep file).

Most of all we need a more precise description of what exactly is going wrong.

You have just said that the "template doesn't load". Now, in the code snippet you gave what does that mean exactly? There are the following possibilities:

1. file_exists($TemplatFile) is false.

2. is_readable($TemplatFile) is false.

3. $smarty->fetch($TemplatFile) is failing.

If 1 or 2 are the case then what is the value of $TemplatFile?

If it is 3 then what exactly is being returned by the fetch method?
_________________
Alastair

ionCube
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ionCube Forum Index -> ionCube PHP Encoder All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum