PhpDig.net

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

Reply
 
Thread Tools
Old 09-26-2003, 01:39 PM   #1
jirving
Green Mole
 
Join Date: Sep 2003
Posts: 10
Templates - cannot get index.php to display different one

HI I just downloaded and installed PhpDig, and the spidering worked great. However, I am trying to get index.php(from a virgin install) to show a different template other than the default one.

I've tried sending requests to the page ie.
index.php?template=corporate.html

and

index.php?template_demo=corporate.html

I've also tried changing the $template value in index.php. No go.
config.php has an entry for $template, but changing it has no effect.


I'm not even sure what $template_demo does. it doesn't get passed to a function, yet it is in the extract() array. The

What am I doing wrong. I see that the demo you have running on the site seems to work fine.

Pls advise

Last edited by jirving; 09-26-2003 at 01:42 PM.
jirving is offline   Reply With Quote
Old 09-26-2003, 02:28 PM   #2
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
Change in congig.php:

//template file and style
$template = "$relative_script_path/templates/phpdig.html";

- All templates must in Folder templates
- After submit a search you see template which is use in Browser-Adress like:

....php?template_demo=.%2Ftemplates%2Fphpdig.html&site...
Rolandks is offline   Reply With Quote
Old 09-26-2003, 08:21 PM   #3
jirving
Green Mole
 
Join Date: Sep 2003
Posts: 10
I have made that change and it doesn't seem to impact anything. Is there any configuration that says to ignore custom templates?


How is it done in the demo?

The links at the top of the page uses the query string to send what template to use.
jirving is offline   Reply With Quote
Old 09-26-2003, 09:05 PM   #4
David J Harmon
Orange Mole
 
David J Harmon's Avatar
 
Join Date: Sep 2003
Location: Corbin KY
Posts: 45
Hey hate to but in...

I just done that, I'm using Dreamweaver (I know its not the perfect php editor but it works) and change newspaper.html around getting what I want. Plus I tested it and it looks just like what I want.

well mostly I don't see the problem, if Rolandks can help you I would like to find out, maybe I'll learn something

David J Harmon
Cappuccino David
David J Harmon is offline   Reply With Quote
Old 09-27-2003, 03:14 AM   #5
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
Quote:
Originally posted by jirving
[b]I have made that change and it doesn't seem to impact anything.
@jirving Can you describe this a little better
What is in your Browser-Adress show as template ?

Perhaps can you start from beginning, delete all phpdig-tables, and delete all files, extract all new from zip and install again.....
Rolandks is offline   Reply With Quote
Old 09-27-2003, 05:03 AM   #6
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. I think jirving means that the below link doesn't work, as it still gives the phpdig.html template.

.....%2Ftemplates%2Fgreen.html
&site=0&path=&result_page=index.php&query_string=test&limite=10&option=star t

Here's how I did it in the demo, although TIMTOWTDI (there is more than one way to do it)

In config.php:
PHP Code:
//template file and style
$templates_array = array('black.html','bluegrey.html','corporate.html','green.html',
'grey.html','lightgreen.html','linear.html','newspaper.html','phpdig.html','simple.html',
'terminal.html','yellow.html');
if(isset(
$template_demo) && in_array($template_demo$templates_array)) {
$template "$relative_script_path/templates/$template_demo";
} else {
$template "$relative_script_path/templates/phpdig.html";

In function_phpdig_form.php:
PHP Code:
// before $result['form_head'] = "<form action='$result_page' method='get'> add the following
$query_string2 urlencode($query_string);
$result['templates_links'] = "
<b>Choose a template</b> : 
<a href='search.php?template_demo=phpdig.html&query_string=$query_string2'><u>phpdig.html</u></a> 
<a href='search.php?template_demo=black.html&query_string=$query_string2'><u>black.html</u></a> 
<a href='search.php?template_demo=simple.html&query_string=$query_string2'><u>simple.html</u></a> 
<a href='search.php?template_demo=green.html&query_string=$query_string2'><u>green.html</u></a> 
<a href='search.php?template_demo=grey.html&query_string=$query_string2'><u>grey.html</u></a> 
<a href='search.php?template_demo=yellow.html&query_string=$query_string2'><u>yellow.html</u></a> 
<a href='search.php?template_demo=bluegrey.html&query_string=$query_string2'><u>bluegrey.html</u></a> 
<a href='search.php?template_demo=terminal.html&query_string=$query_string2'><u>terminal.html</u></a> 
<a href='search.php?template_demo=linear.html&query_string=$query_string2'><u>linear.html</u></a> 
<a href='search.php?template_demo=lightgreen.html&query_string=$query_string2'><u>lightgreen.html</u></a> 
<a href='search.php?template_demo=newspaper.html&query_string=$query_string2'><u>newspaper.html</u></a> 
<a href='search.php?template_demo=corporate.html&query_string=$query_string2'><u>corporate.html</u></a>
"
;
// this assumes that search.php is the result_page 
In the templates use:
Code:
<phpdig:templates_links/>
Keep $template in:
PHP Code:
phpdigSearch($id_connect$query_string$option$refine,
              
$refine_url$lim_start$limite$browse,
              
$site$path$relative_script_path$template); 
__________________
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 09-27-2003, 07:13 AM   #7
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
Quote:
Originally posted by Charter
Hi. I think jirving means that the below link doesn't work, as it still gives the phpdig.html template.

.....%2Ftemplates%2Fgreen.html
&site=0&path=&result_page=index.php&query_string=test&limite=10&option=star t
SORRY, the templates are NOT installed :p
This is a DEMO for little Intelligent Php-Dig Fuzzy NOT Template-DEMO. Works only phpdig.html !

TEMPLATE DEMO are HERE :: Test PhpDig 1.6.2 here ::
Rolandks is offline   Reply With Quote
Old 09-27-2003, 07:37 AM   #8
jirving
Green Mole
 
Join Date: Sep 2003
Posts: 10
So the template line in config.php is what changes the template?

ie.
//template file and style
$template = "$relative_script_path/templates/phpdig.html";

It seems to me I changed that value, but I will try again. (i forgot the uname and password to our server )

Thank you for providing the source for the demo. Helped alot. I will post with the results .
jirving is offline   Reply With Quote
Old 09-27-2003, 08:45 AM   #9
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Quote:
Originally posted by jirving
So the template line in config.php is what changes the template?

ie.
//template file and style
$template = "$relative_script_path/templates/phpdig.html";
Yes, that's it... and also have $template in the following like so:
PHP Code:
phpdigSearch($id_connect$query_string$option$refine
              
$refine_url$lim_start$limite$browse
              
$site$path$relative_script_path$template); 
__________________
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 09-29-2003, 06:57 AM   #10
jirving
Green Mole
 
Join Date: Sep 2003
Posts: 10
Got it all working! Thanks Everyone for your help!

jirving 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
index.php brainz How-to Forum 1 07-10-2006 09:53 AM
PHP includes in templates gman How-to Forum 14 12-03-2004 11:02 PM
Problems with PHP in templates with version 1.8.3 guynemer How-to Forum 21 09-23-2004 01:02 AM
PHP eval support in templates joeboe How-to Forum 3 12-08-2003 11:37 PM
Using PHP include in templates sid How-to Forum 3 11-23-2003 07:06 AM


All times are GMT -8. The time now is 01:56 PM.


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