Username:    Password:        Click Here To Signup     Forgotten Password
Main Menu
Online
Members: 0

Guests: 12

112.111.x.x forum
117.26.x.x signup
123.125.x.x lgsl
175.42.x.x forum
175.44.x.x forum
36.248.x.x forum
54.234.x.x forum
66.249.x.x forum
66.249.x.x forum
78.98.x.x news
85.108.x.x news
91.236.x.x forum

Last Seen

xMin Sat 21:27
TacTicToe Sat 21:07
Dodgeitorelse Sat 20:50
game_stats.eu Sat 20:32
Wussie Sat 17:07

Newest Members

Forums
Multiple-Page index.php
Rich
Sat Mar 29 2008, 06:33PM
Posts: 1700
Joined: Wed Nov 26 2003, 04:30PM

Remember that symbols in names will be entitied, so you need to entity your list of names to search for.

So first you get your names out of the db, or hard code them, so they are in an array.


$admin = array("alpha", "bravo", "charlie");


Then entity the admin names.


foreach ($admin as $key => $name)
{
  $admin[$key] = lgsl_string_html($name);
}


Then you can search and add the html for an icon directly to someones name ( because the names have already been entitied )


foreach ($server['p'] as $player_key => $player)
{
  if (in_array($player['name'], $admins)
  {
   $player['name'] = "<img src='admin_icon.gif' />".$player['name'];
  }
}
Website
Elite_Marines
Sat Mar 29 2008, 11:28PM
Posts: 59
Joined: Tue Mar 25 2008, 11:18PM
Registered Member #3872
That works but in the game battlefield 2, players have clan tags. i have no way to keep up to date with the admins' clan tags. sooo. i need it to search the array, but not need to be an exact match. is there anyway to do that?

Website
Rich
Sun Mar 30 2008, 09:02AM
Posts: 1700
Joined: Wed Nov 26 2003, 04:30PM

You can do partial case-insensitive matching:


foreach ($server['p'] as $player_key => $player)
{
  foreach ($admin as $admin_name)
  {
    if (stristr($player['name'], $admin_name) !== FALSE)
    {
      $player['name'] = "<img src='admin_icon.gif' />".$player['name'];
      break;
    }
  }
}

Website
Elite_Marines
Sun Mar 30 2008, 11:56PM
Posts: 59
Joined: Tue Mar 25 2008, 11:18PM
Registered Member #3872
Rich wrote ...

You can do partial case-insensitive matching:


foreach ($server['p'] as $player_key => $player)
{
  foreach ($admin as $admin_name)
  {
    if (stristr($player['name'], $admin_name) !== FALSE)
    {
      $player['name'] = "<img src='admin_icon.gif' />".$player['name'];
      break;
    }
  }
}



I think im just going to look up player ID's and do it that way. our admins change tags like its going out of style.

i also added un-commented the "pid" => "Player ID" and added a code that when you clicked on the player id it would take you to the players full stats.


Website
Anonymous
Wed Apr 02 2008, 05:29AM
Guest fghjkllllllllllllllll
Anonymous
Wed Apr 02 2008, 05:29AM
Guest xcvbn,;
Elite_Marines
Wed Apr 02 2008, 02:29PM
Posts: 59
Joined: Tue Mar 25 2008, 11:18PM
Registered Member #3872
Please refrain from spamming.

Website
Turrete
Mon May 26 2008, 09:39PM
Posts: 4
Joined: Mon May 26 2008, 09:32PM
Registered Member #4079
[/quote1206935720]
i also added un-commented the "pid" => "Player ID" and added a code that when you clicked on the player id it would take you to the players full stats.
[/quote1211852308]

How u do that ?
What file need to edit?

Thanks in advance!
Website
Elite_Marines
Mon May 26 2008, 10:48PM
Posts: 59
Joined: Tue Mar 25 2008, 11:18PM
Registered Member #3872

if($title == "Player ID")
    {
    $player[$field] = <a href='httphttp://bf2s.com/player/{$player['pid']}/'>{$player['pid']}</a>";
    }


add this code after it says this below


foreach ($used_field_list as $field => $title)
        {

in the file "lgsl_details.php"

im not sure if it will work for your needs because my version of lgsl is HIGHLY modified

Website
Turrete
Tue May 27 2008, 08:42AM
Posts: 4
Joined: Mon May 26 2008, 09:32PM
Registered Member #4079
Thanks, im gonna try it, then i'll let u know.
Website
Elite_Marines
Tue May 27 2008, 10:32AM
Posts: 59
Joined: Tue Mar 25 2008, 11:18PM
Registered Member #3872
i found a problem in the code.

use this instead


if($title == "Player ID") 
    { 
    $player[$field] = "<a href='httphttp://bf2s.com/player/{$player['pid']}/'>{$player['pid']}</a>"; 
    } 

i forgot a quotation mark lol

Website
Anonymous
Tue Jun 03 2008, 07:24PM
Guest Thanks, thats why my DW, check error, lol!
Turrete
Tue Jun 03 2008, 07:28PM
Posts: 4
Joined: Mon May 26 2008, 09:32PM
Registered Member #4079
"<a href='httphttp://bf2s.com is this ok ?
"<a href='http://bf2s.com or this ?
Website
Elite_Marines
Wed Jun 04 2008, 06:56PM
Posts: 59
Joined: Tue Mar 25 2008, 11:18PM
Registered Member #3872
dang lol. why do i keep messing this up. yep your right

Website
Turrete
Mon Jun 09 2008, 07:56PM
Posts: 4
Joined: Mon May 26 2008, 09:32PM
Registered Member #4079
Thanks man!
Website
Violative
Thu Apr 23 2009, 06:10AM
Posts: 2
Joined: Thu Apr 23 2009, 04:49AM
Registered Member #5023
Elite_Marines wrote ...

i found a problem in the code.

use this instead


if($title == "Player ID") 
    { 
    $player[$field] = "<a href='httphttp://bf2s.com/player/{$player['pid']}/'>{$player['pid']}</a>"; 
    } 

i forgot a quotation mark lol



I like to do this but with the SteamID
any workarounds or solutions?
http://proteamclan.com/liveview/?s=2
Website
Violative
Fri Apr 24 2009, 05:14AM
Posts: 2
Joined: Thu Apr 23 2009, 04:49AM
Registered Member #5023
Anyone?
Website
Go to page   <<       

Jump:     Back to top


You are not logged in - Click Here To Signup

Username:    Password:   

Mini Buttons

.... © GreyCube.com - Richard Perry - Powered by e107.org