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: Modified News.php  (Read 31420 times)

0 Members and 1 Guest are viewing this topic.

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: Modified News.php
« Reply #15 on: February 02, 2006, 02:03:41 pm »
- Find a better way to pull a single result without doing the foreach loop.
I guess you are talking about code like
Code: [Select]
$result = $this -> bot -> db -> select("SELECT id, time  FROM news WHERE type = '2' OR type = '1' ORDER BY id DESC LIMIT 0, 1");
if (!empty($result))
foreach ($result as $val)
{
$newsdate = gmdate("dS M, H:i", $val[1]);
}

Just try
Code: [Select]
$result = $this -> bot -> db -> select("SELECT id, time  FROM news WHERE type = '2' OR type = '1' ORDER BY id DESC LIMIT 0, 1");
if (!empty($result))
$newsdate = gmdate("dS M, H:i", $result[0][1]);
$result is an array, $result[0] is the first entry - which has to exist, otherwise it would be empty. And you know that there won't be a second entry anyways.

Offline Aesgaard

  • BeBot Apprentice
  • ***
  • Posts: 82
  • Karma: +0/-0
  • .:.Alpha.:.
Re: Modified News.php
« Reply #16 on: February 28, 2007, 02:32:20 am »
Is it just me or is all the host servers down ?
-*tinkers*-

Offline jjones666

  • Contributor
  • *******
  • Posts: 353
  • Karma: +0/-0
Re: Modified News.php
« Reply #17 on: February 28, 2007, 08:21:09 am »
The latest version of !news should be in Bebot 0.2.11.  For a good alternative search for NewNews on the forum (by Glarawyn).

-jj-

Offline Aesgaard

  • BeBot Apprentice
  • ***
  • Posts: 82
  • Karma: +0/-0
  • .:.Alpha.:.
Re: Modified News.php
« Reply #18 on: September 02, 2007, 02:07:10 pm »
News for version 0.4 would be nice *sigh* :P
-*tinkers*-

Offline Joulette

  • BeBot Rookie
  • *
  • Posts: 3
  • Karma: +0/-0
Re: Modified News.php
« Reply #19 on: November 25, 2007, 06:01:02 pm »
In the news module, there's unfortunately no way to delete a headline item if it breaks the gui, which is what happened to our new today. I added a headline item that broke the gui. Now I don't have a way to delete it, and we can't view the news either.

Any suggestions?

thanks

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Modified News.php
« Reply #20 on: November 26, 2007, 07:52:46 am »
Best way would be to not use html-ish tags in the items. Those should ofcourse have been converted to < and > before being inserted.

For now deleting them from the database manually using either the command line or some administrator tool would be best.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

 

* 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: 108
  • 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