collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: !news fix to show last headline out of blob  (Read 4479 times)

0 Members and 1 Guest are viewing this topic.

Offline kuznechik

  • Contributor
  • *******
  • Posts: 60
  • Karma: +0/-0
!news fix to show last headline out of blob
« on: August 17, 2007, 06:45:00 pm »
Well, I've got used to getting last headline out of blob so people can immediately see what's happening... So - lil addition...
Code: [Select]
--- News.php.orig       Tue Jul 31 16:36:26 2007
+++ News.php    Fri Aug 17 20:37:48 2007
@@ -105,6 +105,7 @@
                $this -> bot -> settings -> create ("News", "Raid_Add", "LEADER", "Who should be able to add raids", "ADMIN;LEADER;MEMBER;GUEST;ANONYMOUS");
                $this -> bot -> settings -> create ("News", "Raid_Del", "LEADER", "Who should be able to delete raids", "ADMIN;LEADER;MEMBER;GUEST;ANONYMOUS"
                $this -> bot -> settings -> create("News", "LogonSpam", FALSE, "Should the news be spammed to all buddies on their logon?");
+               $this -> bot -> settings -> create("News", "PrintLastHeadline", FALSE, "Should the last headline be shown out of blob?");

                $this -> help['description'] = 'Sets and shows headlines, news and raid events.';
                $this -> help['command']['news']="Shows current headlines and news";
@@ -216,6 +217,12 @@
                {
                        $newsdate = gmdate($this -> bot -> settings -> get("Time", "FormatString"), $val[1]);
                }
+               $result = $this -> bot -> db -> select("SELECT id, time, news  FROM #___news WHERE type = '2' ORDER BY id DESC LIMIT 0, 1");
+               if (!empty($result))
+               foreach ($result as $val)
+               {
+                       $lasthead = "<font color=CCInfoHeadline>" . $val[2] . "</font>";
+               }

                $result_headline = $this -> bot -> db -> select("SELECT id, time, name, news FROM #___news WHERE type = '2' ORDER BY time DESC LIMIT 0, 3");
                if (!empty($result_headline))
@@ -246,7 +253,11 @@
                        }
                        $inside .= "\n\n";
                }
+               if ($this -> bot -> settings -> get("News", "PrintLastHeadline")) {
+                    return $lasthead . ":: " . $this -> bot -> make_blob("click to view other news", $inside); }
+               else {
                return "News last updated " . $newsdate . ":: " . $this -> bot -> make_blob("click to view", $inside);
+               }
        }
Kuznechik, proud bot admin of Disciples of Omni-Tek, Rimor.

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 330
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal