A glitch with the poll plugin.

Found a bug? Tell us!!
Post Reply
Ripper^^
Regular
Posts: 50
Joined: Mon Aug 15, 2005 7:49 am
Location: Gainesville, Florida, USA
Contact:

A glitch with the poll plugin.

Post by Ripper^^ »

Hello again guys :)

I use a static page as the frontpage for my site. When you cast a vote using the poll plugin the page refreshes to the actual s9y frontpage rather than my custom frontpage.
Thanks.
Ripper^^
Administrator, TheRipper.com
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

The plugin is using serendipity_currentURL() to return you to the page the poll is on. Unfortunately, this includes the ?, which is messing you up; it makes Serendipity think you're not actually on the front page.

The actual solution for this is more complicated, and is probably beyond my meager time allotment right now. However, there is a simple fix you could perform that would make things work for you.

Go to the plugins/serendipity_plugin_pollbox directory. Around line 36 (your lines may differ, due to version differences), you should see something like:

Code: Select all

    function showPoll($pollid = null) {
        global $serendipity;

        echo '<strong>' . $this->poll['title'] . '</strong>';
        echo '<form action="' . serendipity_currentURL() . '" method="post" id="serendipity_poll_showform">';
Make sure the "global $serendipity;" line is there. Then change the form action from "serendipity_currentURL()" to "$serendipity['baseURL']". The poll will always redirect to your front page, but it'll be your front page.

I hope. Let me know how it goes.
Judebert
---
Website | Wishlist | PayPal
Ripper^^
Regular
Posts: 50
Joined: Mon Aug 15, 2005 7:49 am
Location: Gainesville, Florida, USA
Contact:

Post by Ripper^^ »

thanks judebert.

since most folks voting on the site will be voting from the frontpage this should work for now.

forgive my presumption as i know nothing about coding php but wouldnt an if then type of statement be able to make it work for both situations, my custom frontpage and any other page on the site with an index? in the url?

again, thanks.

Ripper^^
Ripper^^
Administrator, TheRipper.com
Ripper^^
Regular
Posts: 50
Joined: Mon Aug 15, 2005 7:49 am
Location: Gainesville, Florida, USA
Contact:

Post by Ripper^^ »

also, which of the files in the plugin pollbox folder am i supposed to modify?
Ripper^^
Administrator, TheRipper.com
Post Reply