DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • July 22, 2018, 09:49:26 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Resource Pages

Pages: [1]   Go Down
Author Topic: Admin add news & news on village square  (Read 3775 times)
0 Members and 1 Guest are viewing this topic.
« on: February 19, 2004, 08:37:30 PM »

Ok, this is just a little one and I don't know if it makes
any sense on big servers. I liked the idea of being able
to inform players easily about small changes, errors, and
other things in an RP-style this way. Smiley

It adds an input field on top of the daily news where
admins can enter new news manually.

The second part displays the latest headline on village square.

----- PART I

----- Open:

----- Find:

----- After add:
page_header("LoGD News");
if ($session[user][superuser]==3){
output("`0<form action=\"news.php\" method='POST'>",true);
output("[Admin] Insert News? <input name='meldung' size='40'> ",true);
output("<input type='submit' class='button' value='Insert'>`n`n",true);
if ($_POST[meldung]){
$sql = "INSERT INTO news (newstext,newsdate,accountid) VALUES ('".addslashes($_POST[meldung])."',NOW(),0)";
db_query($sql) or die(db_error($link));

----- Find below:
page_header("LoGD News");

----- Replace it with:
// page_header("LoGD News");

---- PART II

----- Open:

----- Find:
output(" You see various shops and businesses along main street. There is a curious looking rock to one side. ");

----- After, add:
$sql = "SELECT * FROM news WHERE 1 ORDER BY newsid DESC LIMIT 1";
$result = db_query($sql) or die(db_error(LINK));
$news = db_fetch_assoc($result);
output("On it you can read the latest news:`n`n`0`c`i$news[newstext]`i`c`n`0");

----- Save and close all files
« Reply #1 on: February 20, 2004, 09:19:47 AM »

I guess I didn't read this through the first time I saw it on Sourceforge. Very cool, I've been adding things the hard way. GREAT MOD Anpera. . .

Pages: [1]   Go Up
Jump to:  

DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
33 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search