Hi,
I was thinking a lot about implementing safe views & votes on midcom content
and thanks to Bergie's idea of Anonymous comments I've written a component
that tracks views and collects votes on content that was created by
taviewer. I've taken discussion component as a guide so few thing nac be
similiar
Usage:
1. Get pl.olga.vv from CVS and repligard it:-)
2. Create new subtopic using p.o.vv and set parameters:
* allow_create_by_uri - like in n.n.discussion - aitomatically create
reference if non existing
* use antispam - well...it is to prevent unfair voting by reloading a page.
Simply IP of last voter is saved.
3. Customize styles create a page element <(views-votes)> under midcom root
page:
if(isset($view["id"])) {
$article=mgd_get_article($view["id"]);
if($article) {
$article_guid=$article->guid();
if($article_guid) {
$midcom->dynamic_load("/vv/".$article_guid); <- where 'vv'
is the name of a topic created in 2.
}
}
}
4. Modify your show-article (or whatever you use to show content) to engage
VV by including <(views-votes)>
5. Modify schemas to include id of an article (refer to Bergie's info at
http://www.midgard-project.org/community/communications/midgard-site/howbuilt/comments
Component returns an array $view that contains:
views => number of views
vote => sum of votes
votes => number of votes
resuls => vote/votes rouned by 2 decimals
It uses fileds:
view = views
extra1 = sum of votes
extra2 = number of votes
extra3 = last voter IP if antispam used
Perhaps those figures should be moved to parameter to allow use VV with
other objects like events etc. Of course this would incline modification of
an invocation at point 3.
This is my first component so please have mercy :-) BTW: It was my first CVS
commit as well so I hope I did it right.
Solt
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]