PhpDig.net

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

Reply
 
Thread Tools
Old 06-18-2004, 03:20 PM   #1
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
Creating a .php Template Instead of .html

Hey everyone! I have a question regarding template creation. You see, my Web site is composed of PHP pages, and as part of my Web site layout, I have a Website Poll on every page. Because I use a PH code to place my poll on every page of my layout, if I were to use a .html template for the search engine, I'm afraid that the page would be broken when I try to insert a PHP code into a .html page.

My question is, is there a possibility that instead of using a .html page for a template, would it be possible to use a .php page for a template? Thank you very much for your time.

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/
Destroyer X is offline   Reply With Quote
Old 06-18-2004, 05:47 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Check through this thread.
__________________
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 06-20-2004, 10:34 PM   #3
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19

To prevent an inconvenience, I purposely made the text smaller.

Well, I managed to follow the directions that I found on that thread. However, I somehow managed to mess up in using my Web site template for the search pages. I'll try to be as descriptive as possible, so people can see exactly where I went wrong and hopefully offer a possible solution. First, http://www.destroyerx.net/staff.php is one of the pages of my new Web site layout that I'm working on. Here's the coding I used for search_function.php that was suggested to put in:

function get_my_includes($filename) {
if (file_exists($filename)) {
$buffer = "";
$handle = fopen($filename, "r");
while (!feof($handle)) {
$buffer .= fgets($handle, 4096);
}
fclose($handle);
return $buffer;
}
}

// check that the paths are correct or use full paths
$my_page_header = includes("/home/destroyerx/search/templates/destroyerx/header.php");
$my_page_sidebar = includes("/home/destroyerx/search/templates/destroyerx/sidebar.php");
$my_page_main = includes("/home/destroyerx/search/templates/destroyerx/main.php");
$my_page_footer = includes("/home/destroyerx/search/templates/destroyerx/footer.php");

if ($template == 'array' || is_file($template)) {
$phpdig_version = PHPDIG_VERSION;
$t_mstrings = compact('my_page_header','my_page_footer','powered_by_link','title_message'
,'phpdig_version','result_message','nav_bar','ignore_message','ignore_comme
ss','pages_bar','previous_link','next_link','templates_links');
$t_fstrings = phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'templ
ate',$template);
if ($template == 'array') {
return array_merge($t_mstrings,$t_fstrings,array('results'=>$table_results));
}
else {
$t_strings = array_merge($t_mstrings,$t_fstrings);
phpdigParseTemplate($template,$t_strings,$table_results);
}
}

In my "search/templates/destroyerx" folder, I made four includes: header.php, sidebar.php, main.php, and forum.php. Since the coding for each of them can be quite lenghty, I've saved them all as text files at

http://www.destroyerx.net/search/tem...erx/header.txt

http://www.destroyerx.net/search/tem...rx/sidebar.txt

http://www.destroyerx.net/search/tem...oyerx/main.txt

http://www.destroyerx.net/search/tem...erx/footer.txt

After I made the modifications to search_function.php, I then created destroyerx.html in "/search/templates/destroyerx." Below is the HTML I used for that HTML document:

<html>
<head>
<title><phpdig:title_message/></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<phpdig:my_page_header/>
<phpdig:my_page_sidebar/>
<phpdig:my_page_main/>
<phpdig:my_page_footer/>
</body>
</html>

Once I completed that, I tried going to http://www.destroyerx.net/search/search.php, but it gave me the following error message:

Fatal error: Call to undefined function: includes() in /home/destroyerx/public_html/search/libs/search_function.php on line 594

Anyway, I was hoping if someone on the forum can offer a solution to my problem. I managed to install the search engine to my Web site just fine. The only snag I'm facing right now is customizing the template. Anyway, thank you very much everyone for your time.

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/

Last edited by Destroyer X; 06-20-2004 at 10:43 PM.
Destroyer X is offline   Reply With Quote
Old 06-21-2004, 05:44 AM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. If you are only including PHP files, you can remove the get_my_includes function, as this function reads but does not parse PHP files. The function is meant for text files like HTML files.

Next, change the following:

PHP Code:
$my_page_header includes("/home/destroyerx/search/templates/destroyerx/header.php");
$my_page_sidebar includes("/home/destroyerx/search/templates/destroyerx/sidebar.php");
$my_page_main includes("/home/destroyerx/search/templates/destroyerx/main.php"); 
$my_page_footer includes("/home/destroyerx/search/templates/destroyerx/footer.php"); 

to the following:

PHP Code:
$my_page_header = include("/home/destroyerx/search/templates/destroyerx/header.php");
$my_page_sidebar = include("/home/destroyerx/search/templates/destroyerx/sidebar.php");
$my_page_main = include("/home/destroyerx/search/templates/destroyerx/main.php"); 
$my_page_footer = include("/home/destroyerx/search/templates/destroyerx/footer.php"); 

Last, change the following:

PHP Code:
$t_mstrings compact('my_page_header','my_page_footer','powered_by_link','title_message','phpdig_version','result_message','nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','next_link','templates_links'); 

to the following:

PHP Code:
$t_mstrings compact('my_page_header','my_page_sidebar','my_page_main','my_page_footer','powered_by_link','title_message','phpdig_version','result_message','nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','next_link','templates_links'); 

Keep everything else the same, and remember to remove any 'word' wrapping in the above code.
__________________
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 06-21-2004, 10:47 AM   #5
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
Well, I managed to do everything I was suggested to. However, now I have a new problem. Instead of the search page using the template files, it reverted back to the default search page. I think it might have something to do with the syntax of destroyerx.html in the "search/templates/destroyerx", but I'm not sure. Can someone offer any suggestions? Thanks for your time.

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/
Destroyer X is offline   Reply With Quote
Old 06-21-2004, 11:32 AM   #6
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. In the config.php file, do you have the following set?
PHP Code:
//template file and style
$template "$relative_script_path/templates/destroyerx/destroyerx.html"
__________________
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 06-21-2004, 01:20 PM   #7
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
It's pretty embarassing that I'm having so much trouble configuring a template for PhpDig, but since this site is the origin of PhpDig, I feel as if my questions would be best answered here. I apologize if I inconveniene anyone.

Anyway, I did do the last thing that Charter said, but unfortunately when I went to http://www.destroyerx.net/search/search.php, it gave me a completely white screen. I wish I knew how the completely white screen was caused, but I don't. Does anyone have any theories why it's not displaying my template? Thanks for your time.

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/
Destroyer X is offline   Reply With Quote
Old 06-21-2004, 08:30 PM   #8
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Check the path of the include statements and see if it is correct, i.e. is it:

/home/destroyerx/public_html/search/templates/destroyerx/filename.php

or is it:

/home/destroyerx/search/templates/destroyerx/filename.php
__________________
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 06-21-2004, 08:57 PM   #9
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19

Well, I can honestly say I feel myself getting closer to having this search engine configured for my Web site. Thank you everyone for putting up with me so far. Well, now http://www.destroyerx.net/search/search.php is showing bits of my template, but it's still not working yet. Here's what I have for error messages on http://www.destroyerx.net/search/search.php:

Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/destroyerx/public_html/poll/include/class_mysql.php on line 32

Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/destroyerx/public_html/poll/include/class_mysql.php on line 32
Connection Error
--------------------------------------------------------------------------------

MySQL Error : Connection Error
Error Number: 0
Date : Mon, June 21, 2004 22:34:36
IP : 68.13.236.125
Browser : Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Referer :
PHP Version : 4.2.2
OS : Linux
Server : Apache/2.0.40 (Red Hat Linux)
Server Name : www.destroyerx.net
Script Name : /search/search.php

Honestly, I have no idea why it's displaying that error message since the most exposure I've had to PHP was my FormMail script and phpBB (which I still need to configure a layout for *sigh*). Now, does anyone know why it would be giving me those error messages?

In the meantime, I guess I should be asking myself a brand new question. Well, before I installed PhpDig on my Web site, I had a Perl search engine called Perlfect Search, and in addition, I have a Perl image gallery called emAlbum. Now, while I'll be getting rid of these two Perl scripts to make way for PHP scripts such as PhpDig, Perlfect only had two HTML files to customize: search.html and no_match.html. Also, emAlbum only had one HTML file to customize which I named destroyerx.html. Is there any way that I could just use one PHP file for a template instead of creating several PHP files like header.php, sidebar.php, main.php, and footer.php? Since I use Macromedia Dreamweaver to apply a change in a .dwt template to all .html and .php files that've been created with a partictular .dwt file, it would be extremely convenient for me if only one .php file could be used as a template.

Once again, I would like to thank everyone for their time and patience in working with me on this. While I could do stuff to make a decent Web site layout with just HTML knowledge and Notepad, when it comes to PHP, I'm a lost puppy. In addition, I would like to thank the people who've developed this search engine script. When I'm finally able to configure it for my Web site, you guys will definately be a lifesaver. Thank you everyone for your time.

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/
Destroyer X is offline   Reply With Quote
Old 06-22-2004, 10:33 PM   #10
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19

Well everyone, first, I like to thank Charter for helping me out every step of the way. Because of his help, I nearly have http://www.destroyerx.net/search/search.php completely configured. While I wasn't intending on doing this, I'm going to add a link to the Search page on my sidebar of my layout.

Anyway, I restored config.php and search_function.php to their default settings (thank goodness, I backed those up). After that, I replaced:

if ($template == 'array' || is_file($template)) {
$phpdig_version = PHPDIG_VERSION;
$t_mstrings = compact('powered_by_link','title_message','phpdig_version','result_message'
,'nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','n
ext_link','templates_links');
$t_fstrings = phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'templ
ate',$template);
if ($template == 'array') {
return array_merge($t_mstrings,$t_fstrings,array('results'=>$table_results));
}
else {
$t_strings = array_merge($t_mstrings,$t_fstrings);
phpdigParseTemplate($template,$t_strings,$table_results);
}
}

with

// check that the paths are correct or use full paths
$my_page_header = get_my_includes("../../dir/header.html");
$my_page_footer = get_my_includes("../../dir/footer.html");

if ($template == 'array' || is_file($template)) {
$phpdig_version = PHPDIG_VERSION;
$t_mstrings = compact('my_page_header','my_page_footer','powered_by_link','title_message'
,'phpdig_version','result_message','nav_bar','ignore_message','ignore_comme
ss','pages_bar','previous_link','next_link','templates_links');
$t_fstrings = phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'templ
ate',$template);
if ($template == 'array') {
return array_merge($t_mstrings,$t_fstrings,array('results'=>$table_results));
}
else {
$t_strings = array_merge($t_mstrings,$t_fstrings);
phpdigParseTemplate($template,$t_strings,$table_results);
}
}

After fixing the "word wrapping", I removed

$my_page_header = get_my_includes("../../dir/header.html");

and

$my_page_footer = get_my_includes("../../dir/footer.html");

as well as removed them from

$t_mstrings = compact('my_page_header','my_page_footer',

etc.

Once that was done, I created destroyerx.php and placed it in the template folder. After that, I changed the template file and style to

//template file and style
$template = "/home/destroyerx/public_html/search/templates/destroyerx.php";

Well, I'm nearly done with completely configuring the template to suit my needs. There're a few questions remaining which should completely wrap up using PhpDig on my Web site. Here they are:

1.) On the top of http://www.destroyerx.net/search/search.php I have a search bar and a Go graphic button that I want to use for the search engine like how I used it for Perlfect Search. Is there anyway I can configure that search field to work with PhpDig instead and still keep the search bar and the Go graphic intact?

2.) I am also running a Website Poll on my Web site called Advanced Poll v2.03. When I go to http://www.destroyerx.net/search/search.php and scroll down to where the poll's at, I get the following:

set_template_set("Destroyer X Template"); // Destroyer X Template = template name echo $php_poll->poll_process("newest"); ?>

While it does that on the search page, on the other pages like http://www.destroyerx.net/staff.php the Website Poll will display fine. I'm suspecting I need to do an include, but I'm not completely sure. Can someone offer me assistance as to whether or not this is right, and if so, how would I word the include on search_function.php and the template destroyerx.php?

3.) On the bottom of http://www.destroyerx.net/search/search.php there's text saying "Powered by PhpDig." I was wanting to not only make the text for this slightly larger (after all, this is a good search engine, and I really want to promote it), but I was also wanting to include the version number of PhpDig I have on my Web site. Where can I go to do this?

Anyway, I would like to thank everyone for putting up with me and my questions. This is a great script, and the tech support here is very friendly and prompt to respond. Thank you so much everyone for your time and cooperation.

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/

Last edited by Destroyer X; 06-22-2004 at 10:35 PM.
Destroyer X is offline   Reply With Quote
Old 06-23-2004, 09:39 AM   #11
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. For one, try the following. Replace:

<form method="get" action="http://www.destroyerx.net/cgi-bin/perlfect/search/search.pl">
<td valign="top" width="177">
<div align="left" class="searchbar">

<!-- Begin Search Field -->

<input type="hidden" name="p" value="1">
<input type="hidden" name="lang" value="en">
<table width="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
&nbsp;<input type="text" name="q" size="15" maxlength="255" value="Search" style="font-family: Arial, Helevetica, sans-serif; font-size: 12px; color: #FFFFFF; background-color: #000000; border: 1px" onfocus="javascript:if(this.value=='Search') {this.value='';}">
</td>
<td valign="top">
&nbsp;<input type="image" src="../../images/nav_go.gif" alt="">
</td>
</tr>
</table>

<!-- End Search Field -->

</div>
</td>
</form>

with the following:

<form action='http://www.destroyerx.net/search/search.php' method='get'>
<td valign="top" width="177">
<div align="left" class="searchbar">

<!-- Begin Search Field -->

<input type='hidden' name='site' value='0'/>
<input type='hidden' name='path' value=''/>
<input type='hidden' name='result_page' value='search.php'/>
<table width="140" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
&nbsp;<input type="text" name="query_string" size="15" maxlength="255" value="Search" style="font-family: Arial, Helevetica, sans-serif; font-size: 12px; color: #FFFFFF; background-color: #000000; border: 1px" onfocus="javascript:if(this.value=='Search') {this.value='';}">
</td>
<td valign="top">
&nbsp;<input type="image" name="search" src="../../images/nav_go.gif" alt="">
</td>
</tr>
</table>

<!-- End Search Field -->

</div>
</td>
</form>

For two, the following:
PHP Code:
        <?php
        
include_once "/home/destroyerx/public_html/poll/booth.php";
        
$php_poll->set_template_set("Destroyer X Template"); // Destroyer X Template = template name 
        
echo $php_poll->poll_process("newest");
        
?>
appears in the HTML source at http://www.destroyerx.net/search/search.php because it is not being parsed. There was also a "Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/destroyerx/public_html/poll/include/class_mysql.php on line 32" error meaning that the poll script wasn't able to access the database. To include PHP code in the search page, you'd need to do the stuff mentioned ealier in this thread.

For three, find and edit the $powered_by_link variable in the search_function.php file. Look for PHPDIG_VERSION in the config.php file to get the version number.
__________________
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 06-23-2004, 10:50 PM   #12
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19

Well, the search engine did work fine until I tried to mess with the PHP poll include. I'm still not understanding what I'm doing wrong, but here goes nothing. Here is what all i did.

First, I opened up Notepad, copied the following out of destroyerx.php in http://www.destroyerx.net/search/templates/

<?php
include_once "/home/destroyerx/public_html/poll/booth.php";
$php_poll->set_template_set("Destroyer X Template"); // Destroyer X Template = template name
echo $php_poll->poll_process("newest");
?>

and I saved this as a separate file in http://www.destroyerx.net/search/includes/ as poll.inc.php.

Next, what I did was opened up search_function.php and included the following:

// check that the paths are correct or use full paths
$my_poll_file = include("./includes/poll.inc.php");

if ($template == 'array' || is_file($template)) {
&nbsp;&nbsp;&nbsp;&nbsp;$phpdig_version = PHPDIG_VERSION;
&nbsp;&nbsp;&nbsp;&nbsp;$t_mstrings = compact('my_poll_file','powered_by_link','title_message','phpdig_version',' result_message','nav_bar','ignore_message','ignore_commess','pages_bar','pr evious_link','next_link','templates_links');
&nbsp;&nbsp;&nbsp;&nbsp;$t_fstrings = phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'templ ate',$template);
if ($template == 'array') {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return array_merge($t_mstrings,$t_fstrings,array('results'=>$table_results));
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$t_strings = array_merge($t_mstrings,$t_fstrings);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;phpdigParseTemplate($templa te,$t_strings,$table_results);
&nbsp;&nbsp;&nbsp;&nbsp;}
}

After that, I went into destroyerx.php in http://www.destroyerx.net/search/templates/ and replaced

<div align="center" class="sidebar" id="sidebarheaderfont"><b>Website Poll</b></div>
<?php
include_once "/home/destroyerx/public_html/poll/booth.php";
$php_poll->set_template_set("Destroyer X Template"); // Destroyer X Template = template name
echo $php_poll->poll_process("newest");
?>
<br>
</div>

with

<div align="center" class="sidebar" id="sidebarheaderfont"><b>Website Poll</b></div>
<phpdig:my_poll_file/>
<br>
</div>

While I thought I had everything working absolutely right this time, it gave the following message again, except this time it didn't show any of my template:

Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/destroyerx/public_html/poll/include/class_mysql.php on line 32

Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/destroyerx/public_html/poll/include/class_mysql.php on line 32
Connection Error
--------------------------------------------------------------------------------

MySQL Error : Connection Error
Error Number: 0
Date : Thu, June 24, 2004 00:19:56
IP : 68.13.236.125
Browser : Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Referer :
PHP Version : 4.2.2
OS : Linux
Server : Apache/2.0.40 (Red Hat Linux)
Server Name : www.destroyerx.net
Script Name : /search/search.php

Now, believe me, I've been reading up on the past threads, and I've been reading on this thread and trying to follow the advice of Charter, and while I've been able to get the search page working without the Website Poll, when I try to use the include, I keep messing up somewhere. Honestly, I don't know why it's giving me that error message, because I thought I configured search_functions.php, destroyerx.php, and config.php (when I set destroyerx.php as my template file) accordingly, but I messed up again, and it's starting to get frustrating. What I'm wanting to know is there anything else that needs to be done for the include to work?

Also, while I tried looking in my PHP and MySQL for Dummies book (bought that when I started getting into PHP for my phpBB), I couldn't find an answer to another one of my questions that's been deep inside my head, so I might as well ask it here:

What does parsing mean?

Well, once again, thanks to everyone for their time. I swear after this thing is configured, I won't be this lost again. Thanks everyone!

By the way, if the PHP code for /home/destroyerx/public_html/poll/include/class_mysql.php is needed, I posted a text file for it at http://www.destroyerx.net/class_mysql.txt

I've also posted config.php, search_function.php, and destroyerx.php as the following:

http://www.destroyerx.net/config.txt (with the values of username and password replaced with something else)
http://www.destroyerx.net/search_function.txt
http://www.destroyerx.net/destroyerx.txt

As one can see, I'm deserate to be able to run this include with PhpDig.

Once again, thanks everyone for your time and cooperation.

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/

Last edited by Destroyer X; 06-23-2004 at 11:07 PM.
Destroyer X is offline   Reply With Quote
Old 07-11-2004, 08:54 PM   #13
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Oops, thread got buried. Still having problems? If so, what's the code from the class_mysql.php file?
__________________
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 07-12-2004, 07:54 AM   #14
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
Hey, it's ok Charter. I knew that you were busy for a time, and since I don't know of anyone else who's proficient with PhpDig besides you and vinyl-junkie, I tried seeking advice from vinyl-junkie in the meantime. Unfortunately, my problem still remains even when following yours and vinyl-junkie's advice for parsing.

Anyway, out of frustration, I've deleted PhpDig and Advanced Poll, tables and all, and re-uploaded them from scratch. After configuring Advanced Poll, I tried to go for PhpDig. What I did since the re-upload is that I changed the template path from the default one to the following:

PHP Code:
//template file and style
$template "$relative_script_path/templates/destroyerx.php"
After that, I went into search_function.php and tried the advice that I got from vinyl-junkie. Below this code right here:

PHP Code:
//===============================================
// do the search and display the results
// can be called in any page
function phpdigSearch($id_connect$query_string$option='start'$refine=0,
                       
$refine_url=''$lim_start=0$limite=10$browse=0,
                       
$site=0$path=''$relative_script_path '.'$template='')

I added the following PHP code:

PHP Code:
include_once "/home/destroyerx/public_html/poll/booth.php"
ob_start(); 
require(
"/home/destroyerx/public_html/poll/booth.php"); 
$my_poll ob_get_contents(); 
ob_end_clean(); 
After that, I added my_poll to the following:

PHP Code:
if ($template == 'array' || is_file($template)) {
    
$phpdig_version PHPDIG_VERSION;
    
$t_mstrings compact('my_poll','powered_by_link','title_message','phpdig_version','result_message','nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','next_link','templates_links');
    
$t_fstrings phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'template',$template);
    if (
$template == 'array') {
        return 
array_merge($t_mstrings,$t_fstrings,array('results'=>$table_results));
    }
    else {
        
$t_strings array_merge($t_mstrings,$t_fstrings);
        
phpdigParseTemplate($template,$t_strings,$table_results);
    }

Once that was done, I went to my template file, destroyerx.php, and added <phpdig:my_poll/> as shown below:

<div align="center" class="sidebar" id="sidebarheaderfont"><b>Website Poll</b></div>
<br>
<phpdig:my_poll/>
<br>
</div>

When all was said and done and I finally went to http://www.destroyerx.net/search/search.php to try it out, thinking it would finally work, I received the same error message yet again:

Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/destroyerx/public_html/poll/include/class_mysql.php on line 32

Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/destroyerx/public_html/poll/include/class_mysql.php on line 32
Connection Error

MySQL Error : Connection Error
Error Number: 0
Date : Mon, July 12, 2004 09:40:05
IP : 68.13.236.125
Browser : Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Referer :
PHP Version : 4.2.2
OS : Linux
Server : Apache/2.0.40 (Red Hat Linux)
Server Name : www.destroyerx.net
Script Name : /search/search.php

While there's probably someone out there saying give up and just drop the Website Poll, I prefer to have it to get the input of people that visit my Web site when it comes to games, cartoons, or whatever I poll about. Anyway, I posted the following links that may be of interest:

For Advanced Poll:

http://www.destroyerx.net/poll/index.php
http://www.destroyerx.net/poll/include/class_mysql.txt

For PhpDig:

http://www.destroyerx.net/search/search.txt
http://www.destroyerx.net/search/includes/config.txt
http://www.destroyerx.net/search/lib...h_function.txt
http://www.destroyerx.net/search/tem...destroyerx.txt

I also noticed in my Advanced Poll folder in http://www.destroyerx.net/poll/include/.htaccess the .htaccess file said the following:

deny from all

I'm not sure if that's of any relevance or not, but I thought I'd post that anyway. Well, I'd like to thank Charter and vinyl-junkie for sticking with me on this thing. If anymore information is needed to help solve this problem, I'm willing to post anything from my Advanced Poll and PhpDig coding, with the exception of usernames and passwords. Thank you all very much for your time.

Ciao for now!


Edit:

Well, I just now tested out the link to class_mysql.txt at http://www.destroyerx.net/poll/include/class_mysql.txt to make sure everyone can view it, and it pulled up my Error 403: Access Forbidden! page. Anyway, I added the .txt file in a new spot:

http://www.destroyerx.net/class_mysql.txt

Thanks everyone for your time and cooperation!

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/

Last edited by Destroyer X; 07-12-2004 at 08:06 AM.
Destroyer X is offline   Reply With Quote
Old 07-12-2004, 08:51 PM   #15
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Your poll script isn't connecting to the database:

Warning: Access denied for user: 'apache@localhost' (Using password: NO) in /home/destroyerx/public_html/poll/include/class_mysql.php on line 32

Warning: MySQL Connection Failed: Access denied for user: 'apache@localhost' (Using password: NO) in /home/destroyerx/public_html/poll/include/class_mysql.php on line 32
Connection Error

Perhaps check that your poll script and PhpDig aren't overwriting the same name variables of each other.
__________________
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
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
install.php not creating tables twalker Script Installation 5 08-26-2005 09:33 PM
Index on html pages build by template Magnetic Core How-to Forum 1 09-07-2004 11:06 AM
A simple include in my php template doesn't appear claudiomet How-to Forum 4 08-23-2004 07:35 AM
PHP and Javascript in phpdig.html template file jayhawk How-to Forum 1 06-17-2004 06:03 PM
PHP includes in Template? jirving How-to Forum 1 09-29-2003 03:37 PM


All times are GMT -8. The time now is 10:38 PM.


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