DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • June 25, 2017, 05:15:42 PM
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 2144 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
Play LoGD on Dragonprime

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