PDA

View Full Version : Templates - cannot get index.php to display different one


jirving
09-26-2003, 12:39 PM
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

Rolandks
09-26-2003, 01:28 PM
Change in congig.php:

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

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

....php?template_demo=.%2Ftemplates%2Fphpdig.html&site...

jirving
09-26-2003, 07:21 PM
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.

David J Harmon
09-26-2003, 08:05 PM
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

Rolandks
09-27-2003, 02:14 AM
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 :mad:
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.....

Charter
09-27-2003, 04:03 AM
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=start

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

In config.php:

//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:

// 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:

<phpdig:templates_links/>

Keep $template in:

phpdigSearch($id_connect, $query_string, $option, $refine,
$refine_url, $lim_start, $limite, $browse,
$site, $path, $relative_script_path, $template);

Rolandks
09-27-2003, 06:13 AM
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=start

:eek: 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 :: :mad:

jirving
09-27-2003, 06:37 AM
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 .

Charter
09-27-2003, 07:45 AM
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:

phpdigSearch($id_connect, $query_string, $option, $refine,
$refine_url, $lim_start, $limite, $browse,
$site, $path, $relative_script_path, $template);

jirving
09-29-2003, 05:57 AM
Got it all working! Thanks Everyone for your help!

:)