DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • March 19, 2018, 05:32:54 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Resource Pages

Pages: [1]   Go Down
Author Topic: Filter for news?!  (Read 2223 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Mod God
Offline Offline

Posts: 4647

Be aware of the squirrel!

View Profile WWW
« on: December 16, 2004, 12:00:10 AM »

Is it possible to change the addnews functions to allow giving an additional parameter for the type of message?!

For example one flag for suicide/"entered the world" news, one for forest-specials output, one for pvp and so on?

for example:

function addnews(){
   global $session;
   $args = func_get_args();
   $news = $args[0];
   $type = $args[1];

   $sql = "INSERT INTO " . db_prefix("news") .
      " (newstext,newsdate,accountid,arguments, newstype) VALUES ('" .
      addslashes($news) . "','" . date("Y-m-d H:i:s") . "'," .
      $user .",'".addslashes($arguments)."',".$type.")";
   return db_query($sql);
and I would call
addnews("%s found the great sword of glory", "forest", $session[user][name]);
addnews("`4%s`3 defeated `4%s`3 by sneaking into their room in the inn!","pvp", $session['user']['name'],$badguy['creaturename']);

So it would be possible to filter the messages (e.g. only show forest related messages in one town. or show the latest pvp news on a newspaper-boy module).
« Last Edit: December 16, 2004, 12:02:02 AM by XChrisX » Logged

Running for more than three years now:
« Reply #1 on: December 16, 2004, 08:05:46 AM »

Of course it's *possible* but it's a substantial amount of work which I have no interest in doing right now.

Of course, if someone else did it and did it well and submitted correct diffs to me..... Smiley
Pages: [1]   Go Up
Jump to:  

DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

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