DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:rater

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Both sides next revision
plugin:rater [2015-02-05 21:59]
87.158.123.50 [rate Plugin]
plugin:rater [2021-04-18 14:43] (current)
wedge
Line 1: Line 1:
-====== rate Plugin ======+====== Rate Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 6: Line 6:
 email      : Taggic@t-online.de email      : Taggic@t-online.de
 type       : syntax type       : syntax
-lastupdate : 2015-02-05 +lastupdate : 2017-03-20 
-compatible : Rincewind, Angua, Adora Belle, Weatherwax, Binky, Hrun+compatible : Rincewind, Angua, Adora Belle, Weatherwax, Binky, Hrun, !Hogfather
 depends    :  depends    : 
 conflicts  conflicts 
Line 26: Line 26:
  
 ===== Installation ===== ===== Installation =====
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-Or just [[https://github.com/Taggic/rater/archives/master|download]] and extract it as folder "rater" into your “\lib\plugins” directory.+  * https://github.com/Taggic/rater/archives/master
  
-:!: **External requirements:**   
-  * none 
  
 __**Attention !**__ \\  __**Attention !**__ \\ 
Line 59: Line 57:
  
 There is also a css file but it is related to thumb output only. There is also a css file but it is related to thumb output only.
 +
 +===== Syntax =====
 +The following line contains all parameter and possible values:
 +<code>
 +{(rater>id=1|name=item1|type=rate/vote/stat/localstat|trace=user/ip|end=09/25/10 / 25.09.2011|tracedetails=0/1|img= :taggic.png|zoom=30x30|headline=off/on|rater_hdl=test)})}
 +</code>
 +
 +=== Parameters ===
 +
 +^ id            | mandatory, unique  | an id to differ between the rate/vote                                                                                                                                                                                                 |
 +^ name          | mandatory, unique  | usually the item name which will be voted/rated                                                                                                                                                                                       |
 +^ type          | mandatory          | defines of rate, vote or stat use case                                                                                                                                                                                                |
 +^ trace         | optional           | can be set to user or ip, where user is to be preferred for closed wikis                                                                                                                                                              |
 +^ end           | optional           | defines the end date of the rate/vote action, can be any valid date expression                                                                                                                                                        |
 +^ tracedetails  | optional           | can be 0 or 1 and defines if the rate or vote details will be displayed \\ (:!: vote + tracedetails will display real user name or its ip => be carefully with this combination)                                                      |
 +^ headline      | optional           | can be on or off to show or hide the headline of the rating \\ (if not set it is set to on - works only for the type "rate"                                                                                                         |
 +^ rater_hdl     | optional           | a free-text headline to substitute that defined in language.php                                                                                                                                                                       |
 +^ img           | optional           | defines the DW path to the media file to include it into the ater box, pipe extensions and curly brackets are not allowed                                                                                                             |
 +^ zoom          | optional           | on statistics to define size of Image thumbnails when img is defined, follows media link definition                                                                                                                                   |
 +^ sid           | optional           | on statistics to Show a column containing the raters id                                                                                                                                                                               |
 +^ ns            | optional           | statistic will be provided for rater objects from given namespace and ist sub-namespaces. \\ You can specify a txt file, which is the source of a page. In this case just the rater objects of the specific page will be considered.  |
 +
 +It is allowed to place more than one rate/vote function into the same page but I dont know about the performance impacts if you will place there hundreds.
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
Line 78: Line 99:
 {(rater>id=1|name=item1|type=vote)} {(rater>id=1|name=item1|type=vote)}
 </code> </code>
 +
 +=== Images inside ===
 +<code>
 +{(rater>id=1|name=Ein schräg schöner Übermorgen|img= :taggic.png?45% |type=vote)}
 +</code>
 +The image is included inside the rater box and zoomed at 45% of its original size. To handover the image the beginning of the media link is used without curly brackets and pipe extension. Special charachters are handled if the replacements are prvided within lang.php file.
  
 === Rater Statistic === === Rater Statistic ===
Line 91: Line 118:
 </code> </code>
  
-=== Syntax === +If you want to have the statistic of a dedicated namespace ten use the ns-option. All rater objects of the ns rater:tst will be considered (incl. sub-namespaces, if existing).
-The following line contains all parameter and possible values:+
 <code> <code>
-{(rater>id=1|name=item1|type=rate/vote/stat/localstat|trace=user/ip|end=09/25/10 / 25.09.2011|tracedetails=0/1|headline=on/off)})}+{(rater>id=7|type=stat|ns=rater:tst)}
 </code> </code>
  
-=== Parameters ===+If you specify a dedicated page then you will have the same result as localstat but you can call it from a different page somewhere in your DokuWiki. Please take care to append the <color blue>.txt</color> that the plugin knows you refer to the page file. 
 +<code> 
 +{(rater>id=7|type=stat|ns=rater:tst:ratertest.txt)} 
 +</code>
  
-^id|mandatoryunique|an id to differ between the rate/vote| +Furthermore if you provide a zoom option like for media linksthen the lit will contain thumbnails of that size of the rater objects (if immages provided inside the box). 
-^name|mandatory, unique|usually the item name what will be voted/rated| +The zoom parameter decides if thumbnails will be displayed and what size.  
-^type|mandatory|defines of rate, vote or stat use case| +__**Take care:**__ 
-^trace|optional|can be set to user or ip, where user is to be preferred for closed wikis| +  - No zoom Option = no thumbs ! 
-^end|optional|defines the end date of the rate/vote action, can be any valid date expression| +  - No rates/votes no entry ! 
-^tracedetails|optional|can be 0 or 1 and defines if the rate or vote details will be displayed \\ (:!: vote + tracedetails will display real user name or its ip =be carefully with this combination)| +  - No Image within rater box = no thumbs ! 
-^headline|optional|can be on or off to show or hide the headline of the rating \\ (if not set it is set to on - works only for the type "rate")|+So think about the usage and style that it will not that being crauted like following table: 
 +<code
 +{(rater>id=66|type=localstat|zoom=30x30|sid=on|sort=value|)
 +</code>
  
-It is allowed to place more than one rate/vote function into the same page but I dont know about the performance impacts if you will place there hundreds. 
 ===== Development ===== ===== Development =====
 === Change Log === === Change Log ===
Line 122: Line 153:
  
  
-===== FAQ ===== 
- 
-a small FAQ is provided at: [[http://www.fristercons.de/fcon/doku.php?id=rater:descr&#faq|Rater plugin - FAQ]] 
  
 ===== Sites using this Plugin ===== ===== Sites using this Plugin =====
Line 139: Line 167:
  
 Please use only the DokuWiki Forum for discussion and [[http://www.fristercons.de/fcon/doku.php?id=rater:issues|Rater issues]] to raise your problems. You can mention it here but this page is not regularily tracked and if something is solved it will be cleaned from this page (better to use the forum due to automated notifications). Please use only the DokuWiki Forum for discussion and [[http://www.fristercons.de/fcon/doku.php?id=rater:issues|Rater issues]] to raise your problems. You can mention it here but this page is not regularily tracked and if something is solved it will be cleaned from this page (better to use the forum due to automated notifications).
 +
 +===== FAQ =====
 +
 +a small but most recent FAQ is provided at: [[http://www.fristercons.de/fcon/doku.php?id=rater:descr&#faq|Rater plugin - FAQ]]
 +
 +=== 1. Can I use multiple rater on the same page ? ===
 +Yes, of course. The rater plugin allows you as many as you want. Therefore you have to define by syntax unique id's. All 3 parameters will be used together as filename.
 +
 +=== 2. Where are the information stored to ? ===
 +All information are stored into files. So you don't need to use a database. The files are within the //\dokuwiki\data\meta// folder and have a suffix //.rating// . 
 +The filename containing the id, item and type parameter from syntax. \\ 
 +__**Example:**__ \\ 
 +The syntax %%{(rater>id=1|name=issuetracker|type=vote)}%% cause information storage to a file named //rater_1_issuetracker_vote.rating// .
 +
 +=== 3. Can I change the Style ? ===
 +Currently the style of rate details expandable box and statistic layout can be customized by style.css stored in the rater plugin folder. How to use css and what parameter are possible is explained many times by articles in the internet (e.g. [[http://www.w3schools.com/css/default.asp| W3C School/CSS]]).
 +
 +The rating-details-css defaults are \\ 
 +<code css>
 +.rating__details {
 + border:        1px #BDBEC1 solid;
 + font-size:                0.85em;
 + text-align:                right;
 + background-color:        #F2F2F2;
 + padding-right:              10px;
 + padding-left:               10px;
 + margin-left:              0.75em;
 + margin-right:             0.75em;
 + border-radius:               5px;
 + box-shadow:         3px 3px #666;
 +}
 +</code>
 +
 +=== 4. There are more rate attempts possible than configured ===
 +That is the case if you have set //trace=ip//. Web provider may give their users dynamic ip's, changing per day. For closed wiki you could use the //trace=user// option where the real user name is logged.
 +
 +=== 5. Former results disappeared after rater plugin update ===
 +The update to version 2011-09-27 needed a change in ".rating" file names. To reuse the former ".rating" files please change the filenames in ".../data/meta"-directory according following concept: \\ 
 +
 +^ old filename format ^ converted filename ^
 +| rater_[ID][NAME][TYPE].rating | rater_[ID]**<color red>_</color>**[NAME]**<color red>_</color>**[TYPE].rating |
 +| rater_1test1rate.rating | rater_1**<color red>_</color>**test1**<color red>_</color>**rate.rating |
 +
 +=== 6. How to use rater as part of namespace template ? ===
 +This is possible by using following syntax within your //%%__template.txt%%// file. It is better to use the ID replacement pattern instead of PAGE to prevent mismatch of file names caused by multiple same named pages in different namespaces.
 +<code>
 +{(rater>id=1|name=@ID@|type=rate|trace=ip)}
 +</code>
 +Further information on namespace templates can be found [[doku>namespace_templates|here ...]]
  
 ==== Use with URL rewrite ==== ==== Use with URL rewrite ====
 If the instance you are using this plugin with is set up to do [[:rewrite|URL Rewriting]] (Option 1: via Web server) you will get redirection issues when it comes to a user clicking on the vote button as the code is set to always start with ''doku.php?id=''. To workaround this change the following lines: If the instance you are using this plugin with is set up to do [[:rewrite|URL Rewriting]] (Option 1: via Web server) you will get redirection issues when it comes to a user clicking on the vote button as the code is set to always start with ''doku.php?id=''. To workaround this change the following lines:
  
-''action.php'' Line 171 to:+''action.php'' Line 171 to:
  
 <code php> <code php>
Line 150: Line 227:
 </code> </code>
  
-''syntax.php'' Line 351 to:+''syntax.php'' Line 351 to:
 <code php> <code php>
 $ret .= $addMSG.'<a class="thumbup tup" href="?do=rate_voteup&rater_id='.$rater_id.'&rater_ip='.$rater_ip.'&rater_end='.$data['rater_end'].'&anker='.$anker_id.'&rater_name='.$rater_name.'"></a>'. $ret .= $addMSG.'<a class="thumbup tup" href="?do=rate_voteup&rater_id='.$rater_id.'&rater_ip='.$rater_ip.'&rater_end='.$data['rater_end'].'&anker='.$anker_id.'&rater_name='.$rater_name.'"></a>'.
plugin/rater.1423169976.txt.gz · Last modified: 2015-02-05 21:59 by 87.158.123.50