added support for random categories, changed newswire to show date
authormtopper <mtopper>
Sun, 10 Jul 2005 13:08:25 +0000 (13:08 +0000)
committermtopper <mtopper>
Sun, 10 Jul 2005 13:08:25 +0000 (13:08 +0000)
etc/producer/producers.xml
etc/producer/startpage.template

index 71e8042..9ae9910 100755 (executable)
   </producer>
 
 
+
+
+
  <producer name="generatefpincludes">
    <verbs>
      <verb name="doit" />
    </verbs>
    <body>
+
+
       <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" />
-        <Define key="id" value="${fpimage.id}" />
-<Define key="server" value="${fpimage.publish_server}" />
-<Define key="path" value="${fpimage.publish_path}" />
-<Define key="author" value="${fpimage.creator}" />
-<Define key="description" value="${fpimage.description}" />
 
-<Generate
-generator="/fpinclude.template"
-destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
+         <Generate
+               generator="/fpinclude.template"
+               destination="${config.storageRoot}/fpincludes/${fpimage.id}.inc" />
 
       </Enumerate>
+
+
+          <List key="fpincludes" table="image" selection="to_media_folder=8 and is_published=true" />
+               <Generate
+                       generator="/fpmapping.template"
+                       destination="${config.storageRoot}/fpincludes/map.txt" />
+
     </body>
   </producer>
 
 
 
+ <producer name="generateRandomTopics">
+  <verbs>
+    <verb name="doit" />
+  </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">
+        <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>
+  </body>
+ </producer>
+                          
  <producer name="getlocalblogs">
    <verbs>
      <verb name="doit" />
index 3888c7b..33454cf 100755 (executable)
@@ -430,6 +430,10 @@ ed. note: most discussed stories testing
          </tr>
          <tr valign="top">
             <td class="first">
+               <!--#include virtual="/fpincludes/random1.inc" -->
+
+            <!--
+            
                <b>Global</b>
                <ul>
                   <li><a href="#">Register NOW! 2nd Annual NYC Grassroots Media Conference April 9-10, 2005</a></li> 
@@ -441,9 +445,14 @@ ed. note: most discussed stories testing
                   <a href="#">more</a>&#160;|
                   <a href="#">publish news</a>
                </small>
+               -->
             </td>
             <td>
-               <b>Analysis</b>
+               <!--#include virtual="/fpincludes/random2.inc" -->
+            
+            
+            <!--
+             <b>Analysis</b>
                <ul>
                   <li><a href="#">The Face of Protest is A Changin'</a></li> 
                   <li><a href="#">Local Organization Launches Financial Justice Blog</a></li> 
@@ -454,10 +463,15 @@ ed. note: most discussed stories testing
                   <a href="#">more</a>&#160;|
                   <a href="#">publish news</a>
                </small>
+               
+               -->
             </td>
          </tr>
          <tr valign="top">
-            <td class="first">
+            <td class="first"> 
+               <!--#include virtual="/fpincludes/random3.inc" -->
+
+            <!--
                <b>Local</b>
                <ul>
                   <li><a href="#">Photos of Marchers on 125th St and on Malclom X Blvd.</a></li> 
@@ -469,8 +483,12 @@ ed. note: most discussed stories testing
                   <a href="#">more</a>&#160;|
                   <a href="#">publish news</a>
                </small>
+               -->
             </td>
             <td>
+                               <!--#include virtual="/fpincludes/random4.inc" -->
+
+               <!--
                <b>Who Knows</b>
                <ul>
                   <li><a href="#">The Face of Protest is A Changin'</a></li> 
@@ -482,6 +500,8 @@ ed. note: most discussed stories testing
                   <a href="#">more</a>&#160;|
                   <a href="#">publish news</a>
                </small>
+               -->
+               
             </td>
          </tr>
       </table>