-
Notifications
You must be signed in to change notification settings - Fork 0
/
_class.php
43 lines (40 loc) · 860 Bytes
/
_class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/*
* urkQuotes - An IRC quote displaying plugin for e107
*
* Copyright (C) 2015 Patrick Weaver (http://trickmod.com/)
* For additional information refer to the README.md file.
*
*/
function colorizeLine($line)
{
$starPlayers = e107::getDb()->retrieve('starPlayers', '*', '', true);
$words = explode(" ", $line);
if(!empty($starPlayers[0]))
{
foreach($starPlayers as $player)
{
$usernames = explode(',', $player['usernames']);
$colorIt = false;
foreach($usernames as $username)
if(strpos($words[0], $username) !== false)
$colorIt = true;
if($colorIt)
{
$newLine = '<span style="color:'.$player['hexcolor'].';">'.$line.'</span>';
break;
}
else
{
$newLine = $line;
}
}
$output = $newLine;
}
else
{
$output = $line;
}
return $output;
}
?>