Archive > AO official modules

Modified News.php

(1/5) > >>

Zarkingu:
Modified Blondengy's News.php with a !headline command.

Modified News.php

Probably not very good programming, still just a beginner with PHP  ;D
It works whough  :)

Naturalistic:
Going to be doing a big change to the !news function, I'll post it once I finish :)

Lack of control of news items sucks :P

Khalem:

--- Quote from: Naturalistic on December 13, 2005, 11:00:42 pm ---Going to be doing a big change to the !news function, I'll post it once I finish :)

Lack of control of news items sucks :P

--- End quote ---

Amen. Hence why its a big item on my Todo list :P
I'll hold of on my plans until youve posted yours Naturalistic.
I can however mention the very basic changes i had in mind from current 0.2.x:
- ID field should be just that, a unique ID. Its possible, but not probable that two news items be added at the same time. For interoperability and standards sake, id's should be autoincrement integer values starting at 1. (A convert function should take the old timestamp based ID's and enter new id's starting from 1, and timestamps should be their own field)
- Admins/Superadmins should be able to delete any news item, and posters should be allowed to delete their own posts.
- The ability to sticky news items (integer 0/1 field in database)
- The ability to configure the number of sticky newsitems to display aswell as the number of newsitems to be displayed.
- Admins should have the ability to list any number of news items for.. err.. administrative purposes. Ie a !news show x   where x is an integer value.
- Potentially merge the Raids module into the News module as they are basically the same, only with a different name. Again, probably integer 0/1 field in database.

Xenixa:
Well I got board and did pretty much what you were looking at doing with the News module Khalem.

This version combines the Original News and Raids Modules by Foxferal, also includes updates/ideas by Naturalistic and Zarkingu.
Additional Database Fields added/changed:
 ID renamed to TIME, ID added to Auto Inc starting at 1
 TYPE field to Denote News Type I.E.: 1 = News, 2 = Headline, 3 = Raid News

Notes on Headline: I've written this one to were you can only have one Headline in the News Table at any given time. If a new headline is given it delete's the old one before it inserts the new one. The first time you do !news and no Headline is present it'll just show "No Headline's" at the top of the Info window.

xen.afraid.org/bebot_files/news.php

Giver a once over and lemme know what ya think.

EDIT: There is a commented ALTER TABLE statement included in the file above that will update the current News Table. Oh and either rename or remove Raids.php before using this. I still have yet to write a script to move entries from the Raids news table to the News table. Actually I did it by hand by performing the same ALTER TABLE script using the appropriet table name then exported the table to a .sql file and changing the INSERT INTO to news rather than raids before loading the sql file.

Khalem:
Ohh nice.

I'll have a look at this one as soon as im done with the server move hell im in.

Navigation

[0] Message Index

[#] Next page

Go to full version