How to insert PHP code in file main.tpl » DataLife Engine Support

DLEVIET - DataLife Engine Support Home Page

DataLife Engine Support » DataLife Engine » Edit Code » How to insert PHP code in file main.tpl

How to insert PHP code in file main.tpl

  • Author: admin;  
  • Views: 4935;  
  • Date: 24 February 2010;  
In default, file main.tpl is a template file of DLE. But you want to insert PHP code in this file for some purpose.

Insert PHP Codes In Main.tpl


Use of any PHP inserts in templates. So often a need to paste on your website PHP script third party. However, by default, this feature is disabled in the script. Therefore we offer you a little h@ck that allows to use any PHP code in templates


1. Open file index.php

Find

echo $tpl->result['main'];


Replace to

eval (' ?' . '>' . $tpl->result['main'] . '<' . '?php ');



2. That all!
We encourage you to Register or Login to website under your name.

triposi

Posted 1 March 2010 08:39 Register: 1.03.2010
It works, thanks

Freakj

Posted 23 April 2010 17:01 Register: 15.04.2010
Thid H@ck does not for me!

Should this h@ck work also in shortstory.tpl?
Have someone an idea?

Thanks for your support

Freakj

Posted 24 April 2010 03:48 Register: 15.04.2010
Okay okay...
It works also in other .tpl files from dle.
But the only way php code can inserted is {include file="yourfile"}

Best regards

Freakj

kkrajdurai

Posted 27 April 2010 05:06 Register: 25.03.2010
error occurs :

Parse error: syntax error, unexpected T_VARIABLE in /home/zxtorren/public_html/index.php(223) : eval()'d code on line 224
Information
Members of Guest cannot leave comments.

Pagerank Update

    Updates Yandex SEO
    13.04.2012
    16.02.2012
    04.02.2012
    Updates Yandex search
    17.05.2012
    15.05.2012
    12.05.2012
    Updates Yandex Catalogue
    22.05.2012
    21.05.2012
    18.05.2012
    Updates Google
    03.05.2012
    06.02.2012
    08.11.2011

Find us on Facebook

Poll

How do you know DataLife Engine Support?

Search Engine
Other DLE Support websites
Forum
Friends
Others

Sponsor

Calendar

«    May 2012    »
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
Contact us in social network

Facebook

Twitter