Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Trying to integrate a poll on to my website
Old 07-03-2008, 07:38 PM Trying to integrate a poll on to my website
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
I recently added an AJAX Poll to my blog which you can see on the sidebar here: http://lilwaynehq.com/blog

Anyway I want to add this poll onto my main website: http://www.lilwaynehq.com under the main menu.

I have tried this code as its what I'm using on my blogs main page:

Code:
<?php if (function_exists('vote_poll') && !in_pollarchive()): ?>
            <ul class="navlist" style="font-size:12px;">
                                <li><?php get_poll();?></li>
                        </ul>
<?php endif; ?>
But nothing shows on my website, so I'm wondering what I need to edit. Is it not linking to the right file?

I hope you understand me, thanks
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by Danaldinho; 07-04-2008 at 08:41 AM..
Danaldinho is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-03-2008, 08:53 PM Re: Trying to integrate a poll on to my website
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
It probably isn't displaying anything, because the functions "vote_poll()" and "in_pollarchive()" don't exist on your main site, while they are defined somewhere on your wordpress generated site. Find where these functions exist in your blog, then find a place to define them on your main site, preferrably in a file that is shared site wide, since you will probably want to place the poll in many places.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-04-2008, 06:20 AM Re: Trying to integrate a poll on to my website
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Do you mean like change "vote_poll()" to "/blog/plugin/vote_poll()" etc?
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-04-2008, 10:21 AM Re: Trying to integrate a poll on to my website
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
No, the problem is not with the code you described above, and the path you suggested doesn't work for calling a function. Functions can only be called if the code is either on the page, or is included somehow, which means that somewhere on your page, or in one of the include files, there needs to be something like this:
PHP Code:
function vote_poll() {
/*a bunch of code goes here*/
}

function 
in_pollarchive() {
/*a bunch more code goes here*/

What you need to do is find the code that runs the poll, so that you can include it on the page somehow, and thus use the functions. Since you are using Wordpress, they are probably in your plugins folder. Hopefully they are designed to work independant of the Wordpress platform.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-04-2008, 11:04 AM Re: Trying to integrate a poll on to my website
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
I found the code, but how will I add it onto my page then?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-04-2008, 11:34 AM Re: Trying to integrate a poll on to my website
Ultra Talker

Posts: 254
Name: Daniel Mousdell
Trades: 0
Also I added this to the top of my file:

Code:
<?PHP

require_once('blog/wp-content/plugins/wp-polls/wp-polls.php');

?>
And now I get this error:


Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(../../../wp-config.php) is not within the allowed path(s): (/home/dannym:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/dannym/public_html/lilwaynehq.com/blog/wp-content/plugins/wp-polls/wp-polls.php on line 33

Warning: require_once(../../../wp-config.php) [function.require-once]: failed to open stream: Operation not permitted in /home/dannym/public_html/lilwaynehq.com/blog/wp-content/plugins/wp-polls/wp-polls.php on line 33

Fatal error: require_once() [function.require]: Failed opening required '../../../wp-config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dannym/public_html/lilwaynehq.com/blog/wp-content/plugins/wp-polls/wp-polls.php on line 33
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Danaldinho is offline
Reply With Quote
View Public Profile
 
Old 07-04-2008, 01:43 PM Re: Trying to integrate a poll on to my website
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Not 100% sure about that error, but try using "include", instead of "require_once", in the same format you have it.
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 07-05-2008, 01:47 AM Re: Trying to integrate a poll on to my website
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
It means the file your are including is in an area where you don't have permission. Use a direct absolute file path instead of a relative path.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Trying to integrate a poll on to my website
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.63373 seconds with 12 queries