PhpDig.net

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

Reply
 
Thread Tools
Old 07-13-2004, 07:38 AM   #16
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
Well, I managed to give up on the database version of Advanced Poll and deleted it. Instead of using the database version, I'm using the textfile version of Advanced Poll, and remarkably, I had very little to reconfigure. Honestly, I'm not sure what the benefit is of using a database poll over a textfile poll, but hopefully it'll be much easier to mess with for PhpDig.

Anyway, after installing the textfile version of the script, I went ahead and deleted the .htaccess file in http://www.destroyerx.net/poll/include/.htaccess since it said the following:

deny from all

When all was said and done, I went to http://www.destroyerx.net/search/search.php thinking it would finally work since my poll isn't running on a database anymore. Lo and behold, I managed to receive another error message:

Fatal error: Cannot redeclare class poll in /home/destroyerx/public_html/poll/include/class_poll.php on line 10

I've managed to provide a text version of class_poll.php at http://www.destroyerx.net/poll/include/class_poll.txt

Unfortunately, I don't understand how to correct this fatal error so I can use Advanced Poll on the generated PhpDig search pages. Can anyone offer any suggestions?

Thanks for your time and cooperation.

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

Last edited by Destroyer X; 07-13-2004 at 08:27 AM.
Destroyer X is offline   Reply With Quote
Old 07-14-2004, 12:21 PM   #17
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
Under the suggestion of vinyl-junkie, I posted booth.php of my Advanced Poll code on my server as a .txt file. It can be viewed here for analysis:

http://www.destroyerx.net/poll/booth.txt

Thank you for your time and cooperation.

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/
Destroyer X is offline   Reply With Quote
Old 07-14-2004, 11:27 PM   #18
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
Unhappy This is Slowly but Surely Becoming Frustrating

Well, once again, I tried to fiddle around with trying to get the include to work. Here are all the current .txt files for the PHP files:

--------------------------
Advanced Poll v2.0.3
--------------------------

http://www.destroyerx.net/poll/demo_1.php (thought this might be useful too)

http://www.destroyerx.net/poll/booth.txt

http://www.destroyerx.net/poll/faq.txt (there was no PHP version of this file; it was included in the zip file)

http://www.destroyerx.net/poll/include/class_poll.txt


-----------------
PhpDig v1.8.3
-----------------

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

http://www.destroyerx.net/search/includes/config.txt

http://www.destroyerx.net/search/includes/poll.inc.txt (I decided to do this again for now)

http://www.destroyerx.net/search/lib...h_function.txt

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


Once again, after all was said and done again, I got the following error message:

Fatal error: Cannot redeclare class poll in /home/destroyerx/public_html/poll/include/class_poll.php on line 10

Now, I'm not sure what it means by cannot redeclare class poll, but as far as I know, I've done everything I could to analyze how to fix this problem I've been having. Heck, if there was a program that could just say, "hey, you need to do such and such here to fix your problem", then I would've got it already. Hopefully, all the links that've been provided will be of help, because I don't know what else I should post at this point.

Thanks for your time and cooperation.

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/
Destroyer X is offline   Reply With Quote
Old 07-15-2004, 12:41 PM   #19
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. In search_function.php you have the following:
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(); 
This causes the "Cannot redeclare class poll" error because the include_once includes the code and then afterwards there is a require which includes the code again. Remove the include_once line and see what happens.
__________________
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-15-2004, 08:54 PM   #20
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
Well actually, I forgot to upload my updated search_function.txt file into my server. Well, I managed to do that a little while ago. Anyway, I removed the following:

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(); 
and added the following below $powered_by_link .= "<a href=\"http://www.phpdig.net/\">Powered by PhpDig v.1.8.3</a><br></font>";

PHP Code:
$my_poll_file = include("/home/destroyerx/public_html/search/includes/poll.inc.php"); 
Within my poll.inc.php, I have the following:

PHP Code:
<?php

/*path*/
$poll_path "/home/destroyerx/public_html/poll";

require 
$poll_path."/include/config.inc.php";
require 
$poll_path."/include/class_poll.php";

$php_poll = new poll();

/*newest poll*/
include_once "/home/destroyerx/public_html/poll/booth.php";
echo 
$php_poll->poll_process("newest");

?>
However, it's still causing the error below:

Fatal error: Cannot redeclare class poll in /home/destroyerx/public_html/poll/include/class_poll.php on line 10

I was wondering if I would need to remodify poll.inc.php, but at the same time, I don't know how I would need to do that. Does anyone have any suggestions?

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/
Destroyer X is offline   Reply With Quote
Old 07-15-2004, 09:04 PM   #21
vinyl-junkie
Purple Mole
 
Join Date: Jan 2004
Posts: 694
I believe you need to leave that chunk of code in your script that you removed.

Your problem is that you are including class_poll.php more than once in your code somewhere. Find where that is and remove one of them. If that doesn't work, put in back in and remove the other one. If that still doesn't work, or you're getting a different error message, let us know.

FWIW, I do have on my "to-do" list for the weekend of looking at your .txt versions of your scripts. I just spent this evening testing phpdig 1.8.3 with all my customized code. It's looking good!
vinyl-junkie is offline   Reply With Quote
Old 07-15-2004, 09:33 PM   #22
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Your poll.inc.php includes class_poll.php and booth.php, and then booth.php includes class_poll.php again, hence the error.

In search_function.php do:
PHP Code:
ob_start();
require(
"/home/destroyerx/public_html/search/includes/poll.inc.php");
$my_poll_file ob_get_contents();
ob_end_clean(); 
and also in search_function.php do:
PHP Code:
$t_mstrings compact('my_poll_file','js_for_clicks','rss_feed_link','powered_by_link','title_message','phpdig_version','result_message','nav_bar','ignore_message','ignore_commess','pages_bar','previous_link','next_link','templates_links'); 
But replace your poll.inc.php with:
PHP Code:
<?php

$include_path 
"/home/destroyerx/public_html/poll"

if (!isset(
$PHP_SELF)) {
    global 
$HTTP_GET_VARS$HTTP_POST_VARS$HTTP_SERVER_VARS;
    
$PHP_SELF $HTTP_SERVER_VARS["PHP_SELF"];
    if (isset(
$HTTP_GET_VARS)) {
        while (list(
$name$value)=each($HTTP_GET_VARS)) {
            $
$name=$value;
        }
    }
    if (isset(
$HTTP_POST_VARS)) {
        while (list(
$name$value)=each($HTTP_POST_VARS)) {
            $
$name=$value;
        }
    }
    if(isset(
$HTTP_COOKIE_VARS)){
        while (list(
$name$value)=each($HTTP_COOKIE_VARS)){
            $
$name=$value;
        }
    }
}

require 
$include_path."/include/config.inc.php";
require 
$include_path."/include/class_poll.php";

$php_poll = new poll();
echo 
$php_poll->set_include_path($include_path);

?>
__________________
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-15-2004, 11:17 PM   #23
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
Well, after who knows how long with messing with this, all I can say is......hallelujah!

PhpDig is parsing the poll.inc.php include almost exactly the way I wanted it to. Before I forget, here is what I did.

As suggested, I made the changes in search_function.php. Then in poll.inc.php, I did a few modifications to the coding. Instead of the code looking like this:

PHP Code:
<?php 

$include_path 
"/home/destroyerx/public_html/poll"

if (!isset(
$PHP_SELF)) { 
    global 
$HTTP_GET_VARS$HTTP_POST_VARS$HTTP_SERVER_VARS
    
$PHP_SELF $HTTP_SERVER_VARS["PHP_SELF"]; 
    if (isset(
$HTTP_GET_VARS)) { 
        while (list(
$name$value)=each($HTTP_GET_VARS)) { 
            $
$name=$value
        } 
    } 
    if (isset(
$HTTP_POST_VARS)) { 
        while (list(
$name$value)=each($HTTP_POST_VARS)) { 
            $
$name=$value
        } 
    } 
    if(isset(
$HTTP_COOKIE_VARS)){ 
        while (list(
$name$value)=each($HTTP_COOKIE_VARS)){ 
            $
$name=$value
        } 
    } 


require 
$include_path."/include/config.inc.php"
require 
$include_path."/include/class_poll.php"

$php_poll = new poll(); 
echo 
$php_poll->set_include_path($include_path); 

?>
I modified it slightly to make it look like this so it'll grab my poll template and display the latest poll:

PHP Code:
<?php 

/*path*/
$include_path "/home/destroyerx/public_html/poll"

if (!isset(
$PHP_SELF)) { 
    global 
$HTTP_GET_VARS$HTTP_POST_VARS$HTTP_SERVER_VARS
    
$PHP_SELF $HTTP_SERVER_VARS["PHP_SELF"]; 
    if (isset(
$HTTP_GET_VARS)) { 
        while (list(
$name$value)=each($HTTP_GET_VARS)) { 
            $
$name=$value
        } 
    } 
    if (isset(
$HTTP_POST_VARS)) { 
        while (list(
$name$value)=each($HTTP_POST_VARS)) { 
            $
$name=$value
        } 
    } 
    if(isset(
$HTTP_COOKIE_VARS)){ 
        while (list(
$name$value)=each($HTTP_COOKIE_VARS)){ 
            $
$name=$value
        } 
    } 


require 
$include_path."/include/config.inc.php"
require 
$include_path."/include/class_poll.php"

$php_poll = new poll(); 

/*template*/
$php_poll->set_template_set("Destroyer X Template"); // Destroyer X Template = template name

/*newest poll*/ 
echo $php_poll->poll_process("newest");

?>
Now, my poll is displaying at http://www.destroyerx.net/search/search.php

However, I ran into a very small problem (which I hope is very very simple to fix). While it's not in the realm of PhpDig, it's something I hope it'll be easily fixed. At http://www.destroyerx.net/sample.php, it displays the Website Poll near the bottom as the following:

----------------
Website Poll
----------------

Which OS is your Web site running on?

BSD
Linux
Solaris
FreeBSD
MacOSX
Windows NT
others

Vote Button

View Results

Advanced Poll v2.02

However, at http://www.destroyerx.net/search/search.php, it shows almost all of the poll content above, except it reduces the Vote Button to a very small textless button, the View Results link is completely gone, and where it says Advanced Poll v2.02, it now says Advanced Poll v.

I know it seems kind of stupid of me to worry about such a thing, but I don't understand why it would do that though. Does anyone have any suggestions or comments I'm thinking it may have something to do with how I ordered the contents of php.inc.php, because on sample.php where the poll code is displayed on that page, here's all that's there:

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");
?>
Now if I can get the poll on http://www.destroyerx.net/search/search.php, to display like it is at http://www.destroyerx.net/sample.php, http://www.destroyerx.net/feedback.php, or whereever, that would really make me jump for joy.

Once again Charter and vinyl-junkie, thank you two so much for all of your help This is you two's victory!

Ciao for now!
__________________
Visit the Destroyer X Network at http://www.destroyerx.net/
Destroyer X is offline   Reply With Quote
Old 07-15-2004, 11:29 PM   #24
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Go look in the poll template files and/or poll config file for the HTML that generates the following and edit it?

Button with no text: <input type="submit" value="" class="input">
Button with text: <input type="submit" value="CLICK TO VOTE" class="input">

No version number: <a href="http://www.proxy2.de" target="_blank" title="Advanced Poll">Advanced Poll v</a>
With version number: <a href="http://www.proxy2.de" target="_blank" title="Advanced Poll">Advanced Poll vERSION X.X.X</a>
__________________
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-29-2004, 10:32 PM   #25
Destroyer X
Green Mole
 
Join Date: Jun 2004
Location: Oklahoma, U.S.A.
Posts: 19
Well everyone, I have given up on trying to parse Advanced Poll with PhpDig. Although, the text version of the script was parsed successfully, there were still errors with Advanced Poll from the parsing that I couldn't even correct from the administration panel of Advanced Poll. While I'm disappointed by this, it does leave me with a few options. I could either:

1.) Take a few months to learn PHP (not sure what reference book would be the best for a PHP beginner such as myself) and create my own Web site poll from scratch

2.) Pay for a commercial PHP Web site poll such as Vote! Pro 4.0 or chumpsoft :: phpQuestionnaire and hoped it can be easily parsed with no errors at all with the commercial Web site polls

3.) Pay someone to create a PHP Web site poll that can easily be parsed with PhpDig

4.) Keep searching for a free PHP Web site poll that has decent enough features and can be easily parsed with PhpDig

However, if anyone knows of a decent free Web site poll script that is still in development (I would think that Fusion Poll would be nice if the developer for it didn't drop off the face of the Internet, taking his beta of the next version of it with him because I've already tried to mess with that poll script with no luck), please feel free to send me a Private Message.

I would like to give my thanks to Charter and vinyl-junkie for taking the time to help me with the parsing of Advanced Poll with PhpDig.

To everyone else who kept reading this thread, 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 07-29-2004, 10:53 PM   #26
vinyl-junkie
Purple Mole
 
Join Date: Jan 2004
Posts: 694
Hi DestroyerX,

I'm disappointed that you weren't able to get your poll working exactly as you wanted it, but you're still a lot further down the road than you were when you started.

I don't know how keen you are on the idea of learning PHP, but I can recommend some books that make it pretty easy to learn. The first is called Build Your Own Database Driven Website Using PHP & MySQL and is a great beginner book. If you master that and want to learn more, there is The PHP Anthology, which is a 2-volume set. These books will teach you just about anything you want to know about PHP.

Alternatively, if you would just like the easy way out and pay someone else to do the work for you, I've heard that Rent A Coder is pretty good.

Hope this helps.
vinyl-junkie 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 04:12 PM.


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