added support for "most discussed articles"
authormtopper <mtopper>
Wed, 15 Jun 2005 22:27:19 +0000 (22:27 +0000)
committermtopper <mtopper>
Wed, 15 Jun 2005 22:27:19 +0000 (22:27 +0000)
etc/producer/producers.xml
etc/producer/startpage.template

index 0b27d27..c967468 100755 (executable)
@@ -1,4 +1,3 @@
-
 <!--
   This XML file defines a set of producers intended for a typical indymedia 
   site:
     </definition>
   </nodedefinition>
 
-               
-
-
-
-
 <nodedefinition name="Pull">
     <parameters>
       <string name="url"/>
@@ -69,6 +63,8 @@
             <Set key="origin" value="item.identifier"/>
           </else>
         </If>
+        
+        
 
         <If condition="item['dcterms:hasPart']">
           <then>
@@ -93,7 +89,7 @@
                key="article"
                table="content"
 
-               date="config.now.formatted.yyyymmdd"
+               date="utility.datetime.formatDate(item['dc:date'], 'yyyyMMdd')"
                publish_path="' '"
                to_publisher="'0'"
                is_produced="'0'"
                description="haspartimg++item['rss:description']++' '"
                to_language="languageCodeToId(languagecode)"
                title="item['rss:title']++''"
-               webdb_create="config.now"
+               webdb_create="item['dc:date']"
                creator="blogname"
                comment="'Taken from ' ++ blogname"
              />
         selection="is_published=true and to_article_type=${articletype.newswire}"
         order="webdb_create desc"/>
         
+      <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,
+                                        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"
+                         order="count(cm.id) desc"
+                         limit="5"
+                   />    
+               
+        
       <List key="breakingnews" table="breakingNews" limit="10"
          order="webdb_create desc"/>
         
     </body>
   </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" />
-               
-      </Enumerate>
-    </body>
-  </producer>
-
  <producer name="getlocalblogs">
    <verbs>
      <verb name="doit" />
    <body>
       <Enumerate key="article" table="content" selection="to_article_type in(${articletype.communityrssfeed}) and is_published=true"  order="webdb_create desc">
         <Log message="Pulling 1.0 feed from ${article.title} at ${article.source}" type="info" />
-        
-        
-        
         <Pull
           url="${article.source}"
           articletype="${articletype.communityrssarticle}"
       </Enumerate>
     </body>
   </producer>
-  
-
-       
 
 
   
index 4459220..3888c7b 100755 (executable)
@@ -272,10 +272,28 @@ this is a draft<br />
                   <a href="#">Publish News</a>
                </small>
                <div class="topics">
-ed. note: most discussed stories
+ed. note: most discussed stories testing
+
+
+<list mostcomments as mc>
                   <table class="topicTeaser" cellspacing="0" cellpadding="0" border="0">
                      <tr>
                         <td class="icon">
+                           <a href="#"><img src="http://sarai.indymedia.org/~patrick/mir.nyc/img/palestine.01.gif" border="0" /></a>
+                        </td>
+                        <td class="link">
+                           <a href="#" class="teaserLink">palestine</a>
+                           <a href="${config["Producer.DocRoot"]}/${language.code}/${mc.date.formatted["yyyy'/'MM"]}/${mc.id}.shtml">${mc.title}</a> <small>
+                           <a style="text-deocration: none; font-size: 110%;">${mc.commentcount} Comments</a><br /></small>
+                        </td>
+                     </tr>
+                  </table>
+</list>
+
+                               <!--
+
+                     <tr>
+                        <td class="icon">
                            <a href="#"><img src="http://sarai.indymedia.org/~patrick/mir.nyc/img/zapatista.02.gif" border="0" /></a>
                         </td>
                         <td class="link">
@@ -309,6 +327,7 @@ ed. note: most discussed stories
                         </td>
                      </tr>
                   </table>
+        -->
                   <small class="publish">
                      <a href="#">more</a>&#160;|
                      <a href="#">publish news</a>
@@ -322,7 +341,7 @@ ed. note: most discussed stories
             begin center right column
             --><div class="centerRightColumn">
                
-               <!--#include virtual="/fpincludes/762.inc" -->
+               <!--#include virtual="/fpincludes/874.inc" -->
                
 <!--
                <a href="#"><img src="BLAHhttp://sarai.indymedia.org/~patrick/mir.nyc/img/penny_drive.jpg" width="200" height="300" class="headlineImage" alt="" border="0" /></a>