I tend to take the long way of doing things . . .
So here is my code (working) (script placed in div fD)
Looking for any suggestions or areas of improvement
Using MatchTagsPlugin + Inline JavascriptPlugin (www.tiddlytools.com)
{{center{<script>
var tids=store.getMatchingTiddlers("Cigar && ! excludeLists && !
Trash","modified").reverse();
var rr=tids.length
//check Raw Array
//document.write('<br>' + rr + ' raw array items' + '<br>')
var fmt='[[%0|%0]]';
var filter=[];
for (var i=0; i<tids.length; i++) {
var val1=tids[i].title;
if (store.getTiddlerSlice(val1,"PersonalRank") < 9) continue;
if (store.getTiddlerSlice(val1,"PersonalRank") == "Not Rated")
continue;
if (store.getTiddlerSlice(val1,"Purchased") != "Yes") continue;
filter.push(fmt.format([val1]));
}
filter.join('\n');
var ra=filter.length
//check filtered array
//document.write('<br>' + ra + ' filtered array items' + '<br>')
var out=[];
if (!filter.length) out=["No Cigars found"];
var ry=Math.floor(Math.random()*filter.length)
return(filter[ry] + ' {{small{(random cigar rated 9 or above) ' +ry
+'/'+ra+'}}}')
</script><script>
setTimeout("config.refreshers.content(document.getElementById('fD'))",
60000);
</script>}}}
Thanks,
Mike
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.