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
Extreme Talker

Posts: 173
Name: Daniel Mousdell
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

Last edited by Danaldinho : 07-04-2008 at 08:41 AM.
Danaldinho is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 07-03-2008, 08:53 PM Re: Trying to integrate a poll on to my website
wayfarer07's Avatar
$frontend->developer

Posts: 770
Name: Abel Mohler
Location: Asheville, North Carolina USA
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.
__________________
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 07-04-2008, 06:20 AM Re: Trying to integrate a poll on to my website
Extreme Talker

Posts: 173
Name: Daniel Mousdell
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
$frontend->developer

Posts: 770
Name: Abel Mohler
Location: Asheville, North Carolina USA
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.
__________________
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 07-04-2008, 11:04 AM Re: Trying to integrate a poll on to my website
Extreme Talker

Posts: 173
Name: Daniel Mousdell
I found the code, but how will I add it onto my page then?
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
Extreme Talker

Posts: 173
Name: Daniel Mousdell
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
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
$frontend->developer

Posts: 770
Name: Abel Mohler
Location: Asheville, North Carolina USA
Not 100% sure about that error, but try using "include", instead of "require_once", in the same format you have it.
__________________
wayfarer07 is offline
Reply With Quote
View Public Profile
 
Old 07-05-2008, 01:47 AM Re: Trying to integrate a poll on to my website
mgraphic's Avatar
Truth Seeker

Posts: 2,305
Name: Keith Marshall
Location: West Hartford, CT
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB 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.14633 seconds with 13 queries