|
08-21-2004, 12:45 AM | #1 |
Green Mole
Join Date: Aug 2004
Posts: 4
|
A little progress report and a new question.
I created two custom.html templates (custom.html.de and custom.html.en) and use two customised search pages from within one domain (index.html.de and index.html.en). My search form looks like: <form action='http://validate/phpdig/search.php' method='get'> <input type='hidden'name='template_demo' value='custom.html.en'/> <input type='hidden' name='phpdig_language' value='en'/> <input type='hidden' name='site' value=''/> <input type='hidden' name='path' value=''/> <input type='hidden' name='result_page' value='search.php'/> With a few changes in the config.php I can now define the language and the result page for different home pages. The changes in the config however won't let me access the script via http://validate/phpdig/search.php or via http://validate/phpdig/admin/index.php because no template information is given to the script. The same happens when I try to refine the search with the restart of course. If I type ../search.php?template_demo=phpdig.html....then it returns the desired template. My question therefore: how do I define a "default template" in the config.php without defining a fixed template as in line: $template = "$relative_script_path/templates/phpdig.html"; As stated before I am a beginner and "hobby webmaster" only and not yet good in php. I think it should be possible to set up something like "if no $template then phpdig.html. Sorry if I am getting to your nerves but I think this script is flexible enough to do this but I'm just not up to the job (yet) and the solution is probably only two lines of code. Maybe this is of interest to real professionals who run multilanguage pages ? Regards Ulrich |
08-22-2004, 11:02 AM | #2 |
Purple Mole
Join Date: Jan 2004
Posts: 694
|
What you might do is something like this:
Code:
<form action='http://validate/phpdig/search.php' method='get'> <input type='hidden'name='template_demo' value='custom.html.en'/> <select name='phpdig_language'/> <option selected value = ''></option> <option value="en">English</option> <option value="de">German</option> <input type='hidden' name='site' value=''/> <input type='hidden' name='path' value=''/> <input type='hidden' name='result_page' value='search.php'/> Hope this helps. |
08-23-2004, 06:59 AM | #3 |
Green Mole
Join Date: Aug 2004
Posts: 4
|
Thanks for the suggestion but changing the language is / was not the problem. My problem was the result PAGE not the search RESULT itself to be returned in a given language.
I tried the php includes solution from this forum but this was simply too much for me and still left me with the problem of returning the right language. Well as it turned out there is a much simpler solution to this problem. It may not be "elegant" but it works for me and should work for others too that run a multi language site and use the same page DESIGN for their result page. Here is what I did: In the search form I included <input type='hidden' name='lang' value='de'> In the config.php file I replaced $phpdig_language = "en"; with $phpdig_language = "$lang"; Also in the config (around line 355) I changed the default //includes language file if (is_file("$relative_ ........ en-language.php to my prefered "de" language. Next I created a $result['template_text']="".phpDigMsg('template_text').""; just before the $result['templates_links'] = " in the function_phpdig_form.php file and added: 'template_text' =>'here is whatever htmlcode you want', into the $phpdig_mess = array of the de-language.php and the en-language.php file. Depending on the hidden line in the search box the results get displayed in either english or german whereas my admin panel remains in german no matter which search language I used before. Unfortunately I don't have any idea on how to return a completely different result page depending on the language used and / or the domain design if one phpdig script is used under different domains. The only solution is to install the script for every domain, customise for evey domain but use the same database as long as all domains are on the same server. regards Ulrich |
Thread Tools | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using Templates. | Dave A | How-to Forum | 0 | 12-22-2005 03:20 AM |
Using Smarty For Templates? | AllKnightAccess | The Mole Hole | 2 | 11-07-2005 10:14 PM |
Highlight for all templates | manfred | Bug Tracker | 0 | 06-08-2004 01:06 AM |
Using PHP include in templates | sid | How-to Forum | 3 | 11-23-2003 06:06 AM |
we need true templates | JÿGius³ | Mod Submissions | 1 | 10-11-2003 08:04 AM |