cotonti.com : ParseBlock Help https://www.cotonti.com Son konu mesajları Cotonti en Thu, 06 Nov 2025 08:34:39 -0000 kripteks Sal, 24 Şub 2009 08:24:28 -0000 Kilandor Sal, 24 Şub 2009 07:40:40 -0000 medj Sal, 24 Şub 2009 00:19:03 -0000 Trustmaster Pzt, 23 Şub 2009 22:59:33 -0000 Orkan # medj : Is it just me or does the "copy to clipboard" function not work?

Is working for me, using FF2... what is your specs?]]>
Pzt, 23 Şub 2009 22:32:37 -0000
medj
Is it just me or does the "copy to clipboard" function not work?]]>
Pzt, 23 Şub 2009 14:45:58 -0000
Kilandor
So jsut create a PHP file, and run your html file through xtemplate.]]>
Pzt, 23 Şub 2009 06:22:16 -0000
Trustmaster
$my_tpl = new XTemplate('path/to/file.tpl');
$my_tpl->assign(array(
'TEST_1' => $some_var,
'TEST_2' => $another
));

$my_tpl->parse('MAIN.MY_BLOCK');

$my_tpl->parse('MAIN'); // Parse main block
$output = $my_tpl->text('MAIN'); // return contents
$my_tpl->out(); // output contents
]]>
Pzt, 23 Şub 2009 04:31:29 -0000
medj

EDIT:
I just took a quick look at XTemplate.
All I have to do is include the xtemplate.class file. From what I understand, this should give me all the functionality that I was looking for.
Thanks for this idea, I will look more into XTemplate later on when I get back home.]]>
Pzt, 23 Şub 2009 03:29:39 -0000
Trustmaster Pzt, 23 Şub 2009 02:57:10 -0000 medj
I have a function that will parse tags in HTML. I know users of Seditio and Cotonti are all familiar with this method.

First off, here is some code:

class Parser {
  function ParseTags($Template, $ParseTags) {
    $Template = file_get_contents($Template);
    foreach($ParseTags as $UnParsed => $Parsed){      
      $Template = str_replace("{".$UnParsed."}", $Parsed, $Template);
      }
    return $Template;
    }

This will basically look at one of my HMTL files and convert any tags into the data that should be displayed for that page. This works fine.

My question is basically if anyone knows how to implement a parseblock function. A very simple one in which on my HTML file I can have the following code:

{START: SHOW_NEWS}
{row_news_title}
{row_news_body}
{END: SHOW_NEWS}

And basically it would repeat this for as many news posts as I want to show on a page.

Even if someone has a link for me to learn how to do this, that would be fine. I was searching for "ParseBlock" and didn't come up with any help.

Thanks.]]>
Pzt, 23 Şub 2009 02:48:14 -0000