68 Classifieds Forums

68 Classifieds Forums (http://www.68classifieds.com/forums/index.php)
-   v3.1 Suggestions and Feedback (http://www.68classifieds.com/forums/forumdisplay.php?f=23)
-   -   Voting Poll (http://www.68classifieds.com/forums/showthread.php?t=1336)

Scooter 08-14-2006 01:45 PM

Voting Poll
 
Is there any way to implement a vote poll without having to use a 3rd party? I am currently using Bravenet's poll, but it keeps throwing pop-ups on the page and I don't like that. The company that I use to host my domain has some scripts that I can create and modify for the site, but they don't work with 68 classifieds (or at least I haven't figured it out yet). Does anyone have any thoughts or ideas?

Thanks.

Lhotch 08-14-2006 03:14 PM

There isnt anything built in so you will have to implement a 3rd party peice of software. What is the name of the polls your host has available to you? Chances are they require you to insert php or javascrip code into your site to get it to work. This generally isnt a problem but you have to escape the code so that smarty doesnt process it.

Scooter 08-14-2006 05:52 PM

The name of the poll is "vzPoll" by ipowerweb.com. It says it must be inserted onto a page with a php extension. I'm not quite sure how to make it work.

Lhotch 08-14-2006 06:39 PM

Do the scripts give you a chunck of code and tell you to insert it in the php file? If so you can out it in a template you just need to put the {php} tags around it so smarty doesnt parse it. SOmething like this.....

{php}
code goes here
{/php}

Scooter 08-14-2006 09:07 PM

I placed {php} and {/php} before and after the code and it still did not work. It actually gave me a "parse" error.

Parse error: parse error, unexpected '<' in /home/cypressr/public_html/templates_c/^default^user^%%29^291^29105299%%layout.tpl.php.ph p on line 176


The code that I'm trying to insert is

<?php @include("http://cypressresale.com/v-web/vzpoll/poll.php");?>

detrate 08-15-2006 02:22 AM

Quote:

Originally Posted by Scooter (Post 7048)
I placed {php} and {/php} before and after the code and it still did not work. It actually gave me a "parse" error.

Parse error: parse error, unexpected '<' in /home/cypressr/public_html/templates_c/^default^user^%%29^291^29105299%%layout.tpl.php.ph p on line 176


The code that I'm trying to insert is

<?php @include("http://cypressresale.com/v-web/vzpoll/poll.php");?>

no <?php and ?> are needed.

just do


Code:

{php}
include("http://cypressresale.com/v-web/vzpoll/poll.php");
{php}


Scooter 08-15-2006 09:27 AM

That didn't work. All it did was place this text on the screen:

include("http://cypressresale.com/v-web/vzpoll/poll.php");

Lhotch 08-15-2006 10:00 AM

detrate forgot the slash in the closing php tage, do you have it like this...

{php}
include("http://cypressresale.com/v-web/vzpoll/poll.php");
{/php}

Scooter 08-15-2006 11:36 AM

Thanks for all of your help (both of you). It worked!

GSP 08-30-2006 07:53 AM

Hello,

Hoping that since Kevin was helped a while back someone might offer up a suggestion for me on this similar issue.

On the admin side of this same polling script and after creating a poll you can click on a Code button to see 3 variations of code to input into the layout. The first is Javascript and works fine however when you try to use the poll and click on the Vote or Results link it directs you to a Page Cannot Be Found screen so I�d like to try the other 2 to see if it will resolve this issue.

The other 2 are similar to the one Kevin was enquiring about but probably due to different version numbers of the polling script they have since changed to be slightly different. I�ve tried all suggestions posted above only using these 2 codes and also tried the exact same code suggested above but to no avail. I simply can�t get these php codes to produce a poll on my site, nothing appears. Any suggestions on this would be greatly appreciated. The codes I was given are as follows:

include("./vzpoll/config.inc.php");
include("./vzpoll/show.inc");

Lhotch 08-30-2006 09:14 AM

Tom, if your putting the code given in a template it will need to be escaped just like above, ie....

{php}
include("./vzpoll/config.inc.php");
include("./vzpoll/show.inc");
{/php}

However, in your example code its using a path realative to your current location and my guess is that is where the problem lies.

A "realative" path is one that continues or is executed from your current location. Paths can get a bit awkward in a web hosting environment because as a user of the web host you are assigned a user root directory, then the web server has a "document root", php can have various other paths etc etc so sometimes it takes a little trial and error to get the proper path figured out.

For example if you are the root (ie administrative user) on the web server and you login and look at the path to your web site it may look like this.....

/home/~yourusername/public_html/

However when you log in as a user you are placed in

/~yourusername

Ok, back to your issue you first need to identify where your classifieds are at when you log in as a user. As an example lets assume you installed your classifieds in the root of your domain/webspace.

/home/~yourusername/public_html/index.php <-your main classified file

Now depending on your template in use the following may be different but assuming your using the default template that file will be...

home/~yourusername/public_html/templates/default/layout.tpl.php

Your voting poll software is probably installed in a subdirectory of the root, something like this...

home/~yourusername/public_html/vzpoll/

the ./ in the path above means to continue from where you at so if you put the above include line in the template file its looking for the config.inc.php file in the following path...

home/~yourusername/public_html/templates/default/vzpoll/

Of course that path doesnt exist so it cant find the file. So what you need to do is specify a URL as Detrate did above or specify a complete path to vzpoll and depending on how your server is setup could vary slightly.

If you go into the vzpoll directory create a file called siteinfo.php and inside the file place the following.

PHP Code:

<?
phpinfo
();
?>

Then point your browser to it, ie http://mydomain.com/vzpoll/siteinfo.php

and you will get a a buch of config info for php, look for the section called "environment" and in that section make note of the value for "SCRIPT_FILENAME" and use that path for your include links. The script filename value will have the actual name of the script thats displaying in the browser and you can replace it with the 2 files you are including. The end result will be something like this......

PHP Code:

{php}
include(
"/home/username/public_html/vzpoll/config.inc.php");
include(
"/home/username/public_html/vzpoll/show.inc");
{/
php}

if the above doesnt work you can try using a URL to include the files.

PHP Code:

{php}
include(
"http://mydomain.com/vzpoll/config.inc.php");
include(
"http://mydomain.com/vzpoll/show.inc");
{/
php}


GSP 08-30-2006 12:00 PM

WOW!!!

Thanks a lot Larry for taking the time on this. I am putting the given code in a template and so far none of the above suggestions have worked. I dug a little deeper and found in a config.inc.php file a section that could be the problem. Like I said before the Javascript code worked great except for it not producing any �Results�. Below is the section of this file that I think I need to configure but I don�t know exactly what I need to change and to what to change it to. I know messing around with other scripts isn�t what this forum is all about but it could help other 68 users in need of a Polling Script. If you could take a second to look over the below code and advise I would appreciate it. The code is as follows:

//////// RESULTS SHOWING ////////
/// how the results are shown
/// 1-normal html pop-up
/// 2-javascript windows to configure
/// 3-same page of poll with refresh
$mode_results_show="3";

// these 3 parameters are for returning to the poll page after voting when $mode_results_show is set to 3
// these are for getting the exact address of the page where the poll is
// this should work, anyway change to whatever you need
$prot_vzpoll="http://"; // the protocol used to show the poll
$refer_var_root=$_SERVER['HTTP_HOST']; // the base web address
$refer_var=$_SERVER['PHP_SELF']; // the relative address of the poll page

$percentage_show="y"; // set to y if you want to show percentager numbers on result tab when $mode_results_show is set to 3
$votes_string_sp=""; // this is if you want to show this string near number of votes on result tab when $mode_results_show is set to 3
$target_old_polls_page=""; // this is for the link to show polls results with the show_polls.php script, _blank to open a new page

Thanks again for your very informative reply Larry.

Tom
V3.1.4
Developer

Lhotch 08-30-2006 12:53 PM

Tom, could you post the javascript code it gave you to incorporate into the page where you want the poll?

I have run into a few java tidbits that dont play nicely with smarty templates and what I have had to do is instead of putting the code itself in the template I put the js code in its own file and then call the file from the template.

GSP 08-30-2006 01:41 PM

The Javascript given is as follows Larry:

<script language='javascript' src='http://www.mysite.com/vzpolls/show_java.php'></script>

Lhotch 08-30-2006 01:52 PM

I dont see anything in the config file that would prevent it from working although you could possibly try and alter the results showing section, say change it from its current value of 3 to 1-normal html pop-up or 2-javascript windows to configure.

As for the javascript code it looks as though they are already pointing to an external file so that shouldnt be a problem.

The only other thing I see thats questionable is the file names they gave you to include.......

include("./vzpoll/config.inc.php");
include("./vzpoll/show.inc");

the "show.inc" file may not be parsed by the webserver because it has a file extension of .inc. I wonder if perhaps changing its name as follows would work.

include("./vzpoll/config.inc.php");
include("./vzpoll/show.inc.php");

Keep in mind you will also need to actually change the name of the file itself as well.

GSP 08-30-2006 02:23 PM

Thanks for trying Larry. I've tried all your suggestions but still no go.

Tom

Lhotch 08-30-2006 02:32 PM

Quote:

Originally Posted by GSP (Post 7446)
Thanks for trying Larry. I've tried all your suggestions but still no go.

Tom

Out of curiosity, try creating a simple static html page, name it something like test.php and place it in your template folder.

Point a bwoser to it and see if it works fine.

Next try adding the include lines vzpoll says to use into the test file and see if they work.

Maybe that will give us some idea as to weather the problem is smarty related or path related.

GSP 08-30-2006 03:01 PM

Ok Larry,

Created the test page as you said, inputted the given code. The Javascript works the same as before except of course now the poll is being displayed on a white backdrop. When I click Vote or Results I get the same �Not Found� screen. The address that it points to is as follows:

http://www.mysite.com/vzpoll/vote.php?cod=1

This is exactly as it was when I put it in my layout.

Adding the other 2 lines simply shows the 2 lines that I inputted as text.

Adding all 3 shows the poll with the same 2 lines of text below it.

Tom

Lhotch 08-30-2006 03:10 PM

Quote:

Originally Posted by GSP (Post 7449)
Ok Larry,

Created the test page as you said, inputted the given code. The Javascript works the same as before except of course now the poll is being displayed on a white backdrop. When I click Vote or Results I get the same �Not Found� screen. The address that it points to is as follows:

http://www.mysite.com/vzpoll/vote.php?cod=1

This is exactly as it was when I put it in my layout.

Ok, this leads me to beleive its a path issue. Without knowing more about vzpoll I cant be certain how to fix it, perhaps posting to their forums will help?

Quote:

Originally Posted by GSP (Post 7449)
Adding the other 2 lines simply shows the 2 lines that I inputted as text.

Adding all 3 shows the poll with the same 2 lines of text below it.

Tom

In order to get the 2 include files to parse as php you would need to have php tags around them, try this.

PHP Code:

<?
include("./vzpoll/config.inc.php");
include(
"./vzpoll/show.inc");
?>


GSP 08-30-2006 03:17 PM

They don't have a forum. I tried emailing the creator a few days ago but havn't heard anything back so I tried here.

I had put the code in with {php} by mistake. I changed it as you suggested and I just get a blank screen.

Tom

Lhotch 08-30-2006 03:20 PM

Quote:

Originally Posted by GSP (Post 7453)
I had put the code in with {php} by mistake. I changed it as you suggested and I just get a blank screen.

Tom

Strange, is the test file your using end with .php?

GSP 08-30-2006 03:23 PM

Yes it does

Lhotch 08-30-2006 03:26 PM

Do you have a link to where I could download it? IF I get some time I will DL it and see if I can come up with something.

GSP 08-30-2006 03:40 PM

That would be great Larry, thanks again for all your help so far. The link to download the script is as follows:

http://www.linux.it/~fedro/index.php...cripts&lang=en

The most current version and the one I downloaded is - Vz Poll System 0 .32

Tom

Lhotch 08-30-2006 05:41 PM

Ok, here is what I have done so far, installed the script and then tried the javascript code method.

I tried it with each of the below settings to see the results.

//////// RESULTS SHOWING ////////
/// how the results are shown
/// 1-normal html pop-up
/// 2-javascript windows to configure
/// 3-same page of poll with refresh
$mode_results_show="3";

if I set $mode_results_show="1"; everything seems to work fine, vote is counted and a new window is opened.

If I set $mode_results_show="2"; everything seems to work fine, vote is counted and a new window is opened.

If I set $mode_results_show="3"; it redirects the current window to a page that doesnt exist.

Have you tried the "1" or "2" settings yourself? That may be the best option and it causes a new window to open displaying the results, if you have a popup blocker running that may be why your not seeing any results.

GSP 08-30-2006 06:00 PM

Larry,

I've tried changing between 1, 2 and 3 in the past. I just tried again but I still get the same "Not Found" screen for all 3. All pop-up blockers are off. Did you change anything else in config.inc.php? I'm thinking I've missed a step in there but can't for the life of me figure out what.

Tom

Lhotch 08-31-2006 08:58 AM

The only other things I changed in config file was the folder path.

$folder_path="http://mydomain/vzpoll"

GSP 08-31-2006 10:32 AM

Damn Larry,

The script folder was automatically saved as vzpolls, the database name came set to vzpolls but that folder path is ending with vzpoll. I changed it to vzpolls and all is well. Set to 1 I get the pop-up window with results, set to 2 I get the pop-up window with results and set to 3, well 3 doesn�t work yet but that�s the same on your end. Thanks so much for putting in the time to help me with this Larry, you�re a good man and I really appreciate it.

Hey, atleast 68 members now have a polling script that�s tried and tested to implement into their script.

Tom

free2take 03-06-2007 09:16 AM

Hey guys,

I want to implement the Vz Poll on my template. I followed the advice in this thread and all is well. My only gripe is that it appears to put a rectangular box around each of the radio buttons, any ideas how I can clear this ?

Thanks in advance,
Mully

Lhotch 03-06-2007 09:20 AM

Do you have a link to an example so I could see what your referring to?

Scooter 03-06-2007 09:57 AM

I have an example of the Vz polls on my site:

www.cypressresale.com.

The boxes on the radio buttons appear when viewing with IE, but if you view the site with Firefox the boxes around the radio buttons disappear.

free2take 03-06-2007 11:06 AM

Ok looked into this more and found that if I set the border = 0px on the .formsmall style.css entry this gets rid of the border. The catch is that this also gets rid of the border around you submit buttons etc so is not a real solution. I guess there must be some way of extending / overiding this class and then using that version in the vz script. Will let you know if I hit a solution.

One thing I notice is that if I just put it on a html page it displays fine. I am starting to think it may be something to do with being inside a smarty template as check boxes also have this rectangle, although it looks fine on them as the shapes match..

Yes thats exactly what happened on mine. I took it down as on my white background it just didn't look right.

Scooter 03-13-2007 01:00 PM

Good find. My question now though is why does everything look the way it should in Firefox?

I went in and looked at a few things. The problem is if you try to change the vzpoll style sheet .formsmall, nothing happens. Only when you change the style sheet .formsmall in your primary template directory. When the 0px is applied it also eliminates some of the formfields, i.e. registration, etc. A quick solution may be to change the background color of the formfields, but if you do that you have to make sure that they're the same background color as your vzpoll background.

If you find another solution, please let me know. If I find something I will do the same.

Thanks.

Lhotch 03-13-2007 01:36 PM

Quote:

Originally Posted by Scooter (Post 13515)
Good find. My question now though is why does everything look the way it should in Firefox?

Because firefox is more standard compliant. Microsoft, as usual, tried to get everyone to do things their way instead of following the way everyone else agrees upon.

free2take 03-13-2007 06:06 PM

Big thanks to Maffo he helped me get a way around this.

Please refer to he following thread

http://68classifieds.com/forums/show...3525#post13525

All the best,
Mully


All times are GMT -4. The time now is 05:02 PM.

Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.