Elxis CMS Forum
Extensions => Bots and plugins => Topic started by: datahell on January 21, 2014, 09:54:17
-
I create a poll plugin in which poll options are images. I call this new Elxis 4.x extension Photo Vote.
It supports 3 types of polls:
1. Poll for articles (vote options: bad to excellent)
2. Poll for IOSR Hotels (vote options: bad to excellent)
3. Poll with custom options and images (vote options: up to 8 custom options).
I took the idea from site palo.gr (http://palo.gr) (look at the main top area "Όλες οι αναφορές για τους υπουργούς στο διαδίκτυο"). Although the original is not a poll, what I will develop will be a poll that will look like what you see at palo.gr. You will click on an image to vote that option.
I believe this poll will be idea for create custom polls for personalities, trends, or political parties (elections are coming in EU... )
More information very soon!
-
I think it will be a useful plugin. Bravo go go!!
-
It sounds great, Datahell!!
-
See attached an early preview of the Photo Vote plugin.
-
I don't like as i can see Panathinaikos should be the first one. You do something wrong. ;D Please check this out! ::) :P
-
:P
The plugin is ready. I will do an extensive check of it in the afternoon and then release it on EDC.
-
The Photo Vote plugin for Elxis 4.x was released and you can download it from EDC (https://www.elxis.net/edc/public-opinion/60.html).
The plugin supports voting Articles, IOS Reservations Hotels and also allows you to create Custom polls.
Short description
Displays a poll where people can vote by clicking on an icon option. The plugin uses AJAX to count the voting and the bars are animated.
Features
- 5 options (Bad to Excellent) for Article / Hotel polls
- Set the icons set to use on Article / Hotel polls.
- Up to 8 options for custom polls. Each option can have a custom image and also custom bar colour.
- Animated bars
- Responsive design and mobile compatible
- Option to display percentage or absolute values for votes.
Usage instructions - Articles
Integrate in WYSIWYG editor of Article's intro or main text:
{photovote}{/photovote}
Integrate in any WYSIWYG editor able to accept plugins (Article, Hotel, Content module, etc):
{photovote}article:X{/photovote}
where X the article ID to vote
Usage instructions - Hotels
Integrate in WYSIWYG editor of hotel's description text:
{photovote}{/photovote}
Integrate in any WYSIWYG editor able to accept plugins (Article, Hotel, Content module, etc):
{photovote}hotel:X{/photovote}
where X the hotel ID to vote
Usage instructions - Custom polls
Integrate in any WYSIWYG editor able to accept plugins (Article, Hotel, Content module, etc):
{photovote}Z{/photovote}
or
{photovote}custom:Z{/photovote}
where Z the poll ID to display
For custom polls please use the "Guided input" method.
WYSIWYG editor > Click the Elxis icon > Click "Guided input"
Download Photo Vote plugin (https://www.elxis.net/edc/public-opinion/60.html)
-
Bravo!
-
datahell
This is a very nice and useful plugin.
How can I implement/show the photovote at the bottom of all articles without manually going into the WYSISYG editor?
-
Photo Vote (https://www.elxis.net/edc/public-opinion/60.html) is a plugin which means that you integrate it within articles. In Elxis plugins can also be used inside instances of module Content. Not all plugins will work good with this method as some (like the mini shop plugin (https://www.elxis.net/edc/ecommerce/64.html)) require an article. If I remember correctly photo vote will not have any problem with this integration method. Test it. Create a new custom content module, add inside it the photo vote plugin and assign it in the template position you want.
-
Hi datahell.
I was able to successfully implement the plugin based on your suggestion.
For the benefit of other users, here's how I did it.
1. Using the "custom content_module", I added the photovote parameter < {photovote}{/photovote} >, then at the mod_content parameter settings, I activated the plugin by choosing, "Yes"
2. I went into the template file (I used Tiara), and I called the module using the code < $eDoc->module('mod_content'); >
and Viola! It worked like a charm.
P.S.
For those who are using English as their primary language, a little grammatical correction can be done for the poll question. Do this by going into, < ...components/com_content/plugins/photovote/language/en.plugin_photovote.php>, on line 31 you will see the question,
Did you liked this article? , proper way of constructing the question is;
Did you like, without 'd' since "did" already denotes the past tense form.
I am not a good php programmer nor an experienced one, so these are just some of the things that I can do to help the community....
testing the plugins and modules...
Thanks datahell for the wonderful work!!
One last question though, how will I disable the photovote from showing at the homepage? Any conditional statement I can use to make it work? I simply want to display the poll on the actual articles (excluding home, categories, and autonomous pages).
I tried injecting < $eDoc->module('mod_content'); > into the article.php file but it failed and it caused to display a blank page.
Why would I want it to be this way? Because if a visitor would hit like from the homepage, it automatically follows that he/she liked all pages including all articles and categories, which I don't want to happen. :(
-
Using $eDoc->module method for the content module is a bad choice as this module has, almost always, multiple instances. The module method will load the first instance of module content which might be an other one and not the one with the plugin. The proper method to add the module is by creating a module position (eg "myposition") and then load the position instead of loading the single module:
$eDoc->modules('myposition');
To include the photo vote plugin inside an article use the plugin integration code, not the module.
{photovote}X{/photovote}
Where X the poll id.
-
datahell,
I was able to implement your suggestion, but why is it that inserting $eDoc->modules('customposition'); into the article.html.php is not being accepted?
--------------------------------------*************************************-----------------------------------------
/*******************/
/* DISPLAY ARTICLE */
/*******************/
public function showArticle($row, $params, $chained=null, $comments=null, $print=0) {
if ((int)$params->get('popup_window') == 1) {
eFactory::getDocument()->loadLightbox();
}
<... more codes here...>
echo $this->makeImageBox($row, $params);
if (trim($row->subtitle) != '') { echo '<p class="elx_content_subtitle">'.$row->subtitle."</p>\n"; }
echo $row->text."\n";
echo '<div class="clear"></div>'."\n";
$eDoc->modules('customposition'); <-------- I want it right there.
Am I not doing it right?
-
As it seems document instance $eDoc has not been set! So you have to change your code to:
eFactory::getDocument()->modules('customposition');
-
Perfect!
Thank you so much webgift.
-
You are very welcome, @striker!
-
Γεια σας!
Με την αναβάθμιση του πρόσθετου και την ενεργοποίησή του σε σελίδα με πρόσβαση μόνο σε διαχειριστές όποια επιλογή κι αν κάνω μου επιστρεύει Άκυρη επιλογή ψηφοφορίας.
Μπορούμε να επιβεβαιώσουμε ότι δεν υπάρχει κάποιο γενικό πρόβλημα;
-
Δημήτρη το δοκίμασα με πρόσβαση στο άρθρο μόνο για διαχειριστές και δεν βλέπω κάποιο πρόβλημα. Ψήφισα κανονικά. Βεβαιώσου πως έχεις την τελευταία έκδοση του Elxis, δεν λειτουργεί με παλαιότερες. Αν από το Elxis είσαι ΟΚ, τότε άλλαξε τα δικαιώματα του άρθρου σε Επισκέπτες και ξαναδοκίμασε να ψηφίσεις. Δουλεύει έτσι; Σημείωση: Στο Plugin το επίπεδο πρόσβασης βάλτο σε Επισκέπτες σε κάθε περίπτωση (επεξεργασία plugin 1η καρτέλα "Βασικές ρυθμίσεις").
-
Γιάννη, το δοκίμασα! Σε μικρή μορφή στην αξιολόγηση δουλεύει κανονικά. Θα το ψάξω περισσότερα για τις άλλες μορφές.
-
Για ψάξτο ρε θηρίο :)
-
Για ψάξτο ρε θηρίο :)
Τι να κάνω αφού μου εμφανίζει ακόμα αυτό το μήνυμα στις άλλες μορφές!
Θα το ψάξω (μάλλον όταν θα το χρειαστώ :-) ).
Τώρα το μίνι, με καλύπτει :-)
-
Μίνι φούστα και καράτε (https://www.youtube.com/watch?v=hd1RLCINjE0) ;D