mrlynn

Anonymous
I wanted to be able to provide a teaser item for topics that have no news submitted. Each topic should have a different teaser.

I've hacked up GL 1.3.7 index.php to display a customized "No News Yet" message based on the topic.
  1. Add a column to gl_topics, text type named emptymsg
  2. Apply this patch to index.php:
Text Formatted Code

--
@@ -261,12 +261,16 @@
     $display .= COM_printPageNavigation($base_url,$page, $num_pages);
 } else {
-    $display .= COM_startBlock($LANG05[1]) . $LANG05[2];
     if (!empty($topic)) {
-        $result = DB_query ("SELECT topic FROM {$_TABLES['topics']} WHERE tid='$topic'");
+        $result = DB_query ("SELECT topic,emptymsg FROM {$_TABLES['topics']} WHERE tid='$topic'");
         $A = DB_fetchArray ($result);
-        if (!empty ($A['topic'])) {
-            $topic = $A['topic'];
-        }
-        $display .= $LANG05[3];
+       if (!empty ($A['emptymsg'])) {
+               $display.=COM_startBlock($LANG05[1]) . $A['emptymsg'];
+       } else {
+               $display .= COM_startBlock($LANG05[1]) . $LANG05[2];
+               if (!empty ($A['topic'])) {
+                   $topic = $A['topic'];
+               }
+               $display .= $LANG05[3];
+       }
     }
     $display .= COM_endBlock();
---
 
Add content to your gl_topics table emptymsg row for each topic.

If there is interest, I will publish the rest of the hack including a yet to be completed topic administration modification that will prompt for the "emptymsg".

Oh yea... to the guys that created GL... Thanks for the kick@ss Free Software!

Mike

mrlynn

Anonymous
I've completed the Hack... complete with mods to the topiceditor template.

READ MORE

Please let me know if you find any bugs or problems with this hack - it's my first. Also - is there a more formalized method for announcing hacks?

Thanks, Mike