PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   How-to Forum (http://www.phpdig.net/forum/forumdisplay.php?f=33)
-   -   PHP eval support in templates (http://www.phpdig.net/forum/showthread.php?t=74)

joeboe 09-13-2003 10:14 PM

PHP eval support in templates
 
I'd like to see support for evaluating php that's built in to the template for phpDig.

Charter 09-14-2003 08:46 AM

Here are two methods to include PHP in templates using XML-like tags.
  1. Method One:

    In function_phpdig_form.php, look for the following:
    PHP Code:

    $result['form_head'] = "<form action='$result_page' method='get'> 

    and right before it, insert the following:
    PHP Code:

    $result['put_unique_name_here'] = $do_php_here

    and then in the template, use the following:
    Code:

    <phpdig:put_unique_name_here/>
  2. Method Two:

    In search_function.php, look for the following:
    PHP Code:

    $timer->start('Template parsing'); 

    and right after it, insert the following:
    PHP Code:

    $put_unique_name_here $do_php_here

    and then in search_function.php, look for the following:
    PHP Code:

    $t_mstrings compact('title_message'// and so forth 

    and 'put_unique_name_here' into the line like so:
    PHP Code:

    $t_mstrings compact('put_unique_name_here','title_message'// and so forth 

    and then in the template, use the following:
    Code:

    <phpdig:put_unique_name_here/>

sid 10-21-2003 07:16 PM

I know a very good method, in which: You don't need to alter all the other search_functions.php files etc. but only need to make a .HTACCESS file and it will parse PHP into HTML documents! Sneaky....

Anyway here it is:
Make a file name called .htaccess and add this code in it:

<Files phpdig.html>
ForceType application/x-httpd-php
</Files>

If you're using a different template than phpdig.html ,change the 'phpdig.html' into the file name (Only include for example template.html , not http://www.your_site.com/template.html)

And upload the .htaccess file into the 'templates' directory, I've tried it and it worked!

Cool!

WiseOne 12-08-2003 10:37 PM

.htaccess

not working for me!


All times are GMT -8. The time now is 12:07 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.