Poll_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

cmb
Posts: 12939
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Poll_XH

Post by cmb » Sun Oct 22, 2017 9:57 pm

Tata wrote:Aber, obwohl ich den Hinweis von olape verfolg habe, l'uft es bei mir nicht.
Beim aktuellen master muss nicht mehr manuell nachgebessert werden, da die nötigen Änderungen bereits eingespielt sein sollten.
Tata wrote:Ich kann die Demoseite sehen, Einloggen und das war's. Kein Adminmenu. Sollte dabei keine index.php sein? Was ruft den elFinder auf?
Der elFinder läuft niemals im Front-end, daher gibt es keine index.php. Der Aufruf erfolgt ausschließlich im Back-end durch admin.php.

Aber was meinst du mit "kein Adminmenü"? Wird gar kein Menü angezeigt, oder fehlt einfach Plugins → elFinder? Letzteres sollte nicht sein, aber es wäre an sich auch kein Problem, da die Hauptfunktionalität im Adminmenü unter Files (oder aus dem Editor heraus) zur Verfügung steht.
Christoph M. Becker –Plugins for CMSimple_XH

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Poll_XH

Post by Tata » Sun Oct 22, 2017 10:12 pm

Genau, die gesammte AdminListe erscheint nicht. Nach dem Login habe ich nur den Editor da.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

Tata
Posts: 2880
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Poll_XH

Post by Tata » Sun Oct 22, 2017 10:27 pm

Es muss wohl etwas mit anderen installierten Plugins zu tun haben, weil unter einer anderen Installation läuft es.
Diese plugins sind mit der vorigen Installation installiert:
elfinder_xh, expandcontract, fa, fhs_adminmenu, filebrowser, hi_fancybox, hi_kcfinder, hi_updatecheck, jquery, meta_tags, onepage, page_params, pagemanager, sitr, syntaxhighlighter, tinymce, tinymce4, translator, xh_emoji, xhshop
Kann es sein, dass ein der Plugins die Probleme macht?
Morgen versuche ich es finden.
EDIT:
Funtioniert +1
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

bastingse
Posts: 253
Joined: Fri Jun 06, 2008 9:38 pm
Location: Netherlands
Contact:

Re: Poll_XH

Post by bastingse » Mon Nov 20, 2017 1:54 pm

Hi Folks,

I just try this plugin and it works fine. It is not the most handy plugin because of deleting the ip list and edit the csv file if you want to restart the poll.
Right now i have a website for a radioshow and listeners can choose every friday what they want to hear.
Now i wonder, is it possible without using elfinder to reset the 2 files?
I'm running under Direct Admin so maybe a cronjob can renew the csv file and delete the ip list.ips file automaticly? Is there a way to make such script? A script where i can make a setting when the file need to be deleted and renewed by his original?

cmb
Posts: 12939
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Poll_XH

Post by cmb » Mon Nov 20, 2017 2:27 pm

bastingse wrote:I just try this plugin and it works fine. It is not the most handy plugin because of deleting the ip list and edit the csv file if you want to restart the poll.
Note that this is not sufficient to restart/reset a poll, see http://3-magi.net/demo/interaction/plug ... imitations. TL;DR: you also have to rename the poll.

And yes, all this manual editing is certainly anachronistic – I'm hoping to add a full fledged plugin administration somewhat soonish. For now, you may consider using the following cmsimple/userfuncs.php:

Code: Select all

<?php

if (XH_ADM && isset($_GET['renew_poll'])) {
    renewPoll($_GET['renew_poll']);
}

function renewPoll($name)
{
    global $pth;

    $folder = $pth['folder']['content'];
    if ($sl !== $cf['language']['default']) {
        $folder = dirname($folder) . '/';
    }
    $folder .= 'poll/';
    $week = date('W');
    copy("{$folder}$poll.csv", "{$folder}{$poll}_$week.csv");
}
The idea is that you have e.g. poll.csv, but never call {{{poll('poll')}}} on a page or the template, but rather the poll file for a certain calendar week. To create a respective copy of poll.csv, request http://example.com/?renew_poll=poll (you have to be logged in as admin). This is supposed to create the copy poll_47.csv (for this week). Then you can put {{{poll('poll_47')}}} on a page.
Christoph M. Becker –Plugins for CMSimple_XH

bastingse
Posts: 253
Joined: Fri Jun 06, 2008 9:38 pm
Location: Netherlands
Contact:

Re: Poll_XH

Post by bastingse » Mon Nov 20, 2017 6:28 pm

I've solve the problem by myself:
My client does have a poll from friday till friday. He starts every friday again the same poll (listeners from his radioshow can choose what they want to hear on friday morning) so only the csv and ips file need to be set to zero. So i send him these 2 'clean' files and i made a small upload script behind a .htaccess password (https://tutorialzine.com/2013/05/mini-a ... pload-form). Now he only have to drag and drop those 2 files every friday afternoon and the poll is "reset".

Then i removed a few lines regarding cookie control from the WidgetController.php file in the classes directory since the plugin also check the ip address there is no need to use a cookie.

Line 122 - 125

Code: Select all

            setcookie('poll_' . $this->name, CMSIMPLE_ROOT, $this->poll->getEndDate());
            foreach ($_POST['poll_' . $this->name] as $vote) {
                $this->poll->increaseVoteCount($vote);
            }
Easy as it is :-)

bastingse
Posts: 253
Joined: Fri Jun 06, 2008 9:38 pm
Location: Netherlands
Contact:

Re: Poll_XH

Post by bastingse » Tue Nov 21, 2017 6:44 am

bastingse wrote: Then i removed a few lines regarding cookie control from the WidgetController.php file in the classes directory since the plugin also check the ip address there is no need to use a cookie.
I was to fast with saying i fixed it..... removing those few lines did not work correctly... it does not count the vote anymnore.
So.... can anybody tell me what to remove so the poll does not leave a cookie behind on users computer?

cmb
Posts: 12939
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Poll_XH

Post by cmb » Tue Nov 21, 2017 11:19 am

bastingse wrote:So.... can anybody tell me what to remove so the poll does not leave a cookie behind on users computer?
Just remove the setcookie line, but leave the foreach loop.
Christoph M. Becker –Plugins for CMSimple_XH

bastingse
Posts: 253
Joined: Fri Jun 06, 2008 9:38 pm
Location: Netherlands
Contact:

Re: Poll_XH

Post by bastingse » Tue Nov 21, 2017 2:44 pm

That did the trick!! Awesome, thanks!!!
Happy with it!!!

pmschulze
Posts: 63
Joined: Thu Aug 07, 2014 5:29 pm

Re: Poll_XH

Post by pmschulze » Sun Sep 16, 2018 9:35 am

Habe heute versucht, eine Umfrage zu starten. Das neuste Pfw installiert (alles top) und Poll_XH installiert.(jeweils die Masterversionen von Github, natürlich umbenannt)
Pfw meldet, dass alles gut ist; bei Poll kommt schon einmal eine Fehlermeldung "Prüfe, dass die Pfw_XH-Version mindestens 0.2.0 ist … Fehlschlag", obgleich die Version 020 ist.
Leider kann ich aber auch keine Umfragen erstellen :?
Was kann ich tun?

Post Reply