Welcome to Geeklog, Anonymous Monday, November 25 2024 @ 09:43 pm EST
Geeklog Forums
Custom
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.
I've hacked up GL 1.3.7 index.php to display a customized "No News Yet" message based on the topic.
- Add a column to gl_topics, text type named emptymsg
- 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
6
8
Quote
All times are EST. The time is now 09:43 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content