+
+ <!-- generates a count for each topic -->
+ <producer name="generateTopicCounts">
+ <verbs>
+ <verb name="doit" />
+ </verbs>
+ <body>
+ <FreeQuery key="topicCounts" query=" SELECT count(c.id) AS count, t.title AS title from content c, topic t, content_x_topic x
+ WHERE c.id = x.content_id AND t.id = x.topic_id GROUP BY t.title"
+ type="set"/>
+
+ <Generate generator="/topiccount.template"
+ destination="${config.storageRoot}/${pathprefix}/topiccount.shtml" />
+ </body>
+ </producer>
+
+
+
<producer name="generateRandomTopics">
<verbs>
<verb name="doit" />
<Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
<Define key="topictitle" value="${category.title}" />
- <!--
+
<List key="randomarticles" table="content"
selection ="id in (select content_id from content_x_topic where topic_id = ${category.id})" order="date DESC"
limit="5" />
<Generate
generator="/randomcategory.template"
destination="${config.storageRoot}/fpincludes/random${counter}.inc" />
- -->
+
<Set key="counter" value="counter+1" />
</Enumerate>
--- /dev/null
+
+<table id="topicCount" cellspacing="0">
+ <list topicCounts as tc>
+ <tr>
+ <td class="count"><p>${tc.count}</p></td>
+ <td class="topic"><p><a href="#">${tc.title}</a></p></td>
+ </tr>
+ </list>
+</table>
+<script language="JavaScript 1.2" type="text/javascript">
+<!--
+
+ // apply css styles on <table> row mouseover
+ var rows = document.getElementById('topicCount').getElementsByTagName('tr');
+ var lngth = rows.length;
+ for ( i=0; i<lngth; i++ ) {
+ rows[i].onmouseover = function() {
+ this.className="mouseOn";
+ };
+ rows[i].onmouseout = function() {
+ this.className="mouseOff";
+ };
+ }
+
+// -->
+</script>