DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • October 19, 2017, 02:08:33 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Filter for news?!  (Read 2180 times)
0 Members and 1 Guest are viewing this topic.
XChrisX
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:

Code:
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
Code:
addnews("%s found the great sword of glory", "forest", $session[user][name]);
or
Code:
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:
Kendaer
Guest
« 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
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Please take the time to read the FAQ and browse the DragonPedia

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