added 10 random categories
[nyc.indymedia.org.git] / etc / producer / producers.xml
index f4ab4a6..58d5096 100755 (executable)
       <List key="mostcomments"
                  table="content c"
                  extratables="comment cm"
-                 selection="c.webdb_create > NOW()-'1 month'::interval and c.is_published=true and c.id=cm.to_media group by c.id,c.title,
+                 selection="c.webdb_create > NOW()-'2 years'::interval and c.is_published=true and c.id=cm.to_media group by c.id,c.title,
                                         c.subtitle,c.edittitle,c.date,c.creator,c.creator_main_url,c.creator_email,c.creator_address,c.creator_phone,c.description,
                                         c.comment,c.source,c.is_published,c.is_produced,c.to_publisher,c.to_language,c.to_rights,c.webdb_create,c.webdb_lastchange,
                                         c.content_data,c.is_html,c.to_article_type,c.to_content,c.keywords,c.to_locking_user"
       <Language>
         <Generate 
             generator="/startpage.template" 
-            destination="${config.storageRoot}/${pathprefix}/index.shtml"/>
+            destination="${config.storageRoot}/${pathprefix}/index.html"/>
       </Language>
     </body>
   </producer>  
    </verbs>
    <body>
 
-
+       <Set key="counter" value="1"/>
       <Enumerate key="fpimage" table="image" selection="to_media_folder=8 and is_published=true" >
         <Log message="generating include for image id: ${fpimage.id}" type="info" />
 
          <Generate
                generator="/fpinclude.template"
                destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
-
+       <Set key="counter" value="counter+1" />
       </Enumerate>
 
 
        <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 ORDER BY length(t.title)"
+       <FreeQuery key="topicCounts" query=" SELECT count(x.content_id) as count, t.title FROM topic as t LEFT OUTER JOIN content_x_topic 
+                                                                                as x ON (t.id=x.topic_id) LEFT OUTER JOIN content as c ON (c.id=x.content_id) 
+                                                                                WHERE t.archiv_url = 'Category' GROUP BY t.title ORDER BY length(t.title)"
                   type="set"/>
                   
        <Generate generator="/topiccount.template"
   </verbs>
   <body>
        <Set key="counter" value="1"/>
-    <Enumerate key="category" table="topic t" 
-        selection="archiv_url = 'Category' AND (SELECT count(*) from content_x_topic where topic_id = t.id) > 0" order="RANDOM()" limit="4">
+       
+       <Enumerate key="category" table="topic t" extratables="topic t2"
+               selection="t.id=t2.id AND t.archiv_url = 'Category' AND (SELECT count(*) from content_x_topic where topic_id = t.id) > 0" order="RANDOM()" limit="4">
+       
         <Log message="Getting Last 5 articles for category: ${category.title} - counter: ${counter}" />
         <Define key="topictitle" value="${category.title}" />