In the "travels" document :
[[AnythingRating? &define=`1` &atrGrp=`travel` &canVote=`contest` &language=`english-utf8` &nbIP=`20` &nbStars=`5` &endDate=`unlimited`]] [!MaxiGallery? &css=`assets/snippets/anythingRating/css/maxigallery.css` &pictureTpl=`pictureTpl_travel` &galleryOuterTpl=`galleryOuterTpl_travel` &galleryPictureTpl=`galleryPictureTpl_travel` &display=`normal` &max_thumb_size=`150` &max_pic_size=`0` &thumb_use_dropshadow=`1` &disable_rightclick=`1`!]
The anythingRating snippet call define the rating group 'travel' with:
- language set as english-utf8
- only web users of the "contest" web group could vote
- a storage of a maximum of 20 IP addresses of voters per photo
- a widget with 5 images (stars as defined by the css file)
- an unlimited date as the end date for the photo contest
- the default file anythingRating.tpl.html as template file
- the default file anythingRating.css as css file
- &galleryOuterTpl=`galleryOuterTpl_travel`
- &galleryPictureTpl=`galleryPictureTpl_travel`
- &pictureTpl=`pictureTpl_travel`
The first one galleryOuterTpl_travel include at the bottom of the page the top rated results:
[+maxigallery.embedtype:isnot=`smoothgallery`:then=` [+maxigallery.pictures:isnot=``:then=` [+maxigallery.pictures+] [!AnythingRating? &getTopRated=`1` &atrGrp=`travel` &topNb=`3` &topTpl=`@FILE:assets/snippets/anythingRating/templates/anotherTopRated.tpl.html` &topTable=`maxigallery` &topDescrField=`descr` &topImageField=`filename` &topLinkField=`gal_id` &topLabel=`travel photographies`!] [!AnythingRating? &getTopRated=`1` &topDir=`worst` &atrGrp=`travel` &topNb=`3` &topTpl=`@FILE:assets/snippets/anythingRating/templates/anotherTopRated.tpl.html` &topTable=`maxigallery` &topDescrField=`descr` &topImageField=`filename` &topLinkField=`gal_id` &topLabel=`travel photographies`!] +]'
The two anythingRating snippet calls display the top & worst rated items of the 'travel' contest:
- display the 3 top/worst rated photos
- the template used is: assets/snippets/anythingRating/templates/anotherTopRated.tpl.html
- id, title and description of rated items come from the 'maxigallery' table
- id field and title field used are by default 'id' and 'title'
- description field, of the 'maxigallery' table, used is 'descr'
- image field used is 'filename'
- link field used is 'gal_id'
- the label used for the title of the best/worst rated results is 'photos'
The second one galleryPictureTpl_travel define the photo thumbnail with the rating widget:
[+maxigallery.picture.title:isnot=``:then=` [+maxigallery.picture.title:htmlent+] `+] [[AnythingRating? &atrGrp=`travel` &atrId=`[+maxigallery.picture.id+]`]]
Here we use the
[+maxigallery.picture.id+]as id to rate a photo. And we link the vote to the 'travel' rating group.
The third pictureTpl_travel define the photo with the rating widget
[[AnythingRating? &atrGrp=`travel` &atrId=`[+maxigallery.picture.id+]`]]
Again we use the
[+maxigallery.picture.id+]as id to rate each photo.