PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 09-13-2003, 10:14 PM   #1
joeboe
Green Mole
 
Join Date: Sep 2003
Posts: 1
PHP eval support in templates

I'd like to see support for evaluating php that's built in to the template for phpDig.
joeboe is offline   Reply With Quote
Old 09-14-2003, 08:46 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
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/>
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 10-21-2003, 07:16 PM   #3
sid
Former Member
 
Join Date: Sep 2003
Posts: 34
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!
sid is offline   Reply With Quote
Old 12-08-2003, 10:37 PM   #4
WiseOne
Green Mole
 
WiseOne's Avatar
 
Join Date: Dec 2003
Location: Mumbai, India
Posts: 1
.htaccess

not working for me!
WiseOne is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP includes in templates gman How-to Forum 14 12-03-2004 10:02 PM
Problems with PHP in templates with version 1.8.3 guynemer How-to Forum 21 09-23-2004 12:02 AM
Unicode support & PHP...ironic? viclee8888 How-to Forum 1 04-15-2004 01:51 PM
Using PHP include in templates sid How-to Forum 3 11-23-2003 06:06 AM
Templates - cannot get index.php to display different one jirving How-to Forum 9 09-29-2003 05:57 AM


All times are GMT -8. The time now is 02:34 AM.


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