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)

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


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

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