Page 1 of 1

A glitch with the poll plugin.

Posted: Wed Mar 22, 2006 8:01 am
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.

Posted: Thu Mar 23, 2006 3:34 am
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.

Posted: Thu Mar 23, 2006 11:27 pm
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^^

Posted: Thu Mar 23, 2006 11:33 pm
by Ripper^^
also, which of the files in the plugin pollbox folder am i supposed to modify?