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

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

Author Topic: Modified News.php  (Read 13081 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
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


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


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 545
  • 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