added topic countv code in producers and created a new template for it
[nyc.indymedia.org.git] / etc / producer / producers.xml
index 9ae9910..f5b7473 100755 (executable)
 
 
 
+
+ <!-- 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>