View Single Post
Old 06-23-2004, 09: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 10:07 PM.
Destroyer X is offline   Reply With Quote