If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
Messages posted by: Auron
Forum Index » Profile for Auron » Messages posted by Auron
Author Message
Test_Poll.php :: Notice the .PHP extentsion!!!

:: Another notice when creating a *.PHP file the first line must NOT have ANY white space before it!

<!-- This first bit of PHP includes and executes the file poll_cookie.php so that people can only vote once -->
<?php
include_once "C:/Program Files/Apache Group/Apache2/html_public/textfile/poll_cookie.php";
?>

<HTML>
<HEAD>
Random Stuff that goes in the head tags...
</HEAD>

<BODY>

<!-- This PHP code includes the poll in your page (So you can SEE it). Place this where you want the poll to be displayed -->
<?php
include_once "C:/Program Files/Apache Group/Apache2/html_public/textfile/booth.php";
echo $php_poll->poll_process("newest");
?>

</BODY>
</HTML>

Just change the path names to what yours are. Keep the end file the same though. The path names must be the full/real ones like these ones. I could of put "/textfile/booth.php" BUT from what I understand that doesn't work. So you'll have to input the whole path name like I have above.

*********

For the benefit of people with problems installing Advanced Poll and using it here is an example that proves it can be done. This server won't be available all the time and may be a bit slow as I use it for just testing. This setup uses the textfile version (said to be quicker than the MySQL version).

Good Luck!
Auron
Changing the option in the Genral Settings should modify the width of tables for the poll and results pages. If you look at the Templates in the Admin Panel for Poll View and Poll Results they have the same code for the width of the table. The only one that doesn't have it is the Comments template. So maybe if you have comments enabled it will use the original default table width instead of the one you specify.

Good Luck!
Auron
Hi people!

Just to answer a few questions it does work! I got it to in about 15 minutes due to a few technical hitches (Not quite as easy as their readme file suggests!). I'm using the text file version on Apache 2.0.45 and PHP 4.3.1 on my PC - NOT a real live web server! Here's some hints on how to get it to work -

0) Whatever you do don't edit any of the files through NotePad or any other equivlent!!! Edit the files ONLY through the Admin Panel. Also keep a backup of anything you think you might need to restore to later. For example make a backup of the original templates before you start customizing them.

1.1) Add this code to a *.PHP file in the <BODY>..</BODY> tags. Put it where you want the script to appear. This will display the most recent poll you created ::

<?php
include_once "C:/Program Files/Apache Group/Apache2/html_public/textfile/booth.php";
echo $php_poll->poll_process("newest");
?>

1.2) If you want to display an old post for some reason add this the <BODY> tags. Replace the 'x' after poll_process to display the poll you want. To find the ID No. of a poll go to the Admin Panel and look under Poll List and you can find the ID No. of the poll you want to be displayed ::

<?php
include_once "C:/Program Files/Apache Group/Apache2/html_public/textfile/booth.php";
echo $php_poll->poll_process(x);
?>

1.3) Add this to the <BODY> tags to display a random poll. Nothing more can be said really. ::

<?php
include_once "C:/Program Files/Apache Group/Apache2/html_public/textfile/booth.php";
echo $php_poll->poll_process("random");
?>

*NOTE* For 1.1, 1.2 and 1.3 :: Replace the C:/Program Files... up to /textfile to the actual location of you booth.php file. I have Apache and PHP 4 installed on my PC to test this kind of stuff.

2) To get the cookie feature to work add this code Before the opening <HTML> tag. On the page your using to view the poll on must have the extentsion *.PHP !!! The solution to this problem comes with it. In FAQ.txt with the follders DB and textfile. So I'll quote from there ::

FAQ:

- After voting I get the following error:
Warning: Cannot add header information - headers already sent by (output started at ...) in ..poll_cookie.php on line ...

Make sure that the page your poll is embedded in has the ::
<?php
require "poll_cookie.php";
?>
tag before anything else. You may have to put in some path information before so... DO IT!

Another way of doing it is this ::
<?php
include_once "poll_cookie.php";
?>

*NOTE*If anyone has tried both these methods can you e-mail me saying which one works or if both of them work, so I can update it here.

3) For those of you with problems with the table width after some fiddling around the solution is SO VERY SIMPLE!!! Go to the Admin Panel and then Genral Settings. The scroll down to - "Table, Font And Color Options" from there you can change the width of the table and loads of other stuff!

If that doesn't work here's a link to a thread where I came up with some other idea for why the problem occured ::

http://proxy2.de/forum/viewtopic.php?t=2022

4.1) I've noticed quite a lot of people having trouble logging in. Well to start with if you got any major problems delete all the files associated with Adv. Poll v2.02 and download a fresh version of it. The first time you log in you have to use the default, preset username and password ::

Username: admin
Password: poll

Once in change the username and password!

4.2) One last thing I'm gonna add here is - if you put any code into a page that is between these tags :: <?php ?/> :: is PHP code. If that page has the extentsion *.htm or *.html or anything else it MUST be changed to *.php other wise the script won't work and your browser will just output the code as plain text in a htm or html page!

5) Now I'm gonna how to explain how to stop people voting more than once. First get into admin panel and change the dropdown box to "logging on" then click "Save changes" (***NOTICE*** I've manged to get the IP logging working by just doing the next step here - General Settings... ect. and without the code at the top of the file). Next go to "General Settings" and down to "Miscellaneous" and then change the dropdown box next to check to IP table. This will check anyones IP, if its in the table they can't vote. Another point I would like to make it worked just by linking to booth.php as in 1.1 and I didn't need to put any code before everything else like it says in 2, so if this doesn't or does work then you might need to add or remove the code from 3 from your *.PHP page where you included the poll.

And 6) I can't think of any other problems. If you have any leave me a message in this thread or send me an e-mail. I'll say this ONCE - I'll only help you if I can!

Good Luck!
Auron
 
Forum Index » Profile for Auron » Messages posted by Auron
Go to:   
Based on the open source JForum