Activity Stream
48,167 MEMBERS
62709 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member
    Website's:
    Doxsters.net

    Default parse if's in my template engine?

    Does anyone have any good ways of parsing these if statements? Something like:
    [if condition=this] blah blah
    [/if]

    Once that's done and i've coded the caching, my template engine will be done

    But yeah, that's the only thing that's really annoying me atm, I can probably detect them with regex, but i don't really know how i'd parse them?
    timtamboy63 Reviewed by timtamboy63 on . parse if's in my template engine? Does anyone have any good ways of parsing these if statements? Something like: blah blah Once that's done and i've coded the caching, my template engine will be done :D But yeah, that's the only thing that's really annoying me atm, I can probably detect them with regex, but i don't really know how i'd parse them? Rating: 5

    Need a Designer/Web Developer? Click Me

    MSN: PM me for it.
    Email(Preferred):timtamboy63@gmail.com

    "Power Corrupts. Absolute Power Corrupts Absolutely"

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    you have to set up an array of comparison operators

    array(
    '=',
    '>',
    '<',
    ...
    );


    then you have to match the IF block like si

    preg_match_all('/if\((?p<expr>)\{(?P<action>)\}/s');

    then for the matched expr, you have to spit it up into () brackes so yo ucan do

    [if 1 = 2 && 2 = 7 && ({var} == 88)]

    [/endif]

    [if <expr>]
    <action>
    [/[end|else]if] //Match this.
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  4.     
    #3
    Member
    Website's:
    Doxsters.net
    yah, that bit isn't all that hard, what i can't work out how to do is get it to parse the if's
    i can't replace it with php as it prints out the php in the source rather than executing it.

    Need a Designer/Web Developer? Click Me

    MSN: PM me for it.
    Email(Preferred):timtamboy63@gmail.com

    "Power Corrupts. Absolute Power Corrupts Absolutely"

  5.     
    #4
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    What do you mean by parse, if you matched them with regex you know what values have to be checked, if you check them and its logically true then parse and execute whats within the IF block.
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  6.     
    #5
    Respected Developer
    That's why you need to cache your .tpl's to .php's.

  7.     
    #6
    Member
    Website's:
    litewarez.net litewarez.com triniwarez.com
    Yea Hyperz, i think he means how to convert like so

    Code: 
    [set MyVariable=3]
    [if %MyVariable > 3]
       [require_once 'test.tpl']
    [/if]
    into

    PHP Code: 
    $MyVariable 3;
    if(
    $MyVariable 3):
       
    $engine->require_once('test.tpl')
    endif; 
    so he has a php version.
    Join Litewarez.net today and become apart of the community.
    Unique | Clean | Advanced (All with you in mind)
    Downloads | Webmasters


    Notifications,Forum,Chat,Community all at Litewarez Webmasters


  8.     
    #7
    Member
    Website's:
    Doxsters.net
    Yeah exactly,, that cache thing that hyperz said would probably work right? Im just not too sure how i'd get it to work. Hm i'll take a look at it anyway

    Need a Designer/Web Developer? Click Me

    MSN: PM me for it.
    Email(Preferred):timtamboy63@gmail.com

    "Power Corrupts. Absolute Power Corrupts Absolutely"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Selling] DataLife Engine English Warez Template
    By peidahong in forum Completed Transactions
    Replies: 1
    Last Post: 5th Aug 2010, 04:55 AM
  2. Trying to code my own template engine.
    By timtamboy63 in forum Web Development Area
    Replies: 15
    Last Post: 26th Jul 2010, 02:42 PM
  3. [Selling] Datalife Engine 8.5 Translated Template
    By Last Word in forum Completed Transactions
    Replies: 0
    Last Post: 9th Jul 2010, 09:34 AM
  4. [Selling] Datalife Engine Core Template (English)
    By Last Word in forum Completed Transactions
    Replies: 2
    Last Post: 5th Jul 2010, 05:39 AM
  5. How to translate datalife engine template?
    By desibreaker in forum Webmaster Discussion
    Replies: 6
    Last Post: 21st Dec 2009, 03:13 AM

Tags for this Thread

BE SOCIAL