Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Netham45

Pages: 1 ... 47 48 [49] 50 51 ... 123
721
Art / Re: Blue Lobsters have invaded my school!
« on: April 16, 2011, 02:58:07 am »
That's a soundcard driver that paid me to have my likeness in it, they thought it'd boost performance.

722
It wasn't exactly intentional having it highlighted, I just never check who sends the message.

723
That's pretty nifty, looks like a good site to do collaborative edits on.


Fails in Opera for me, though.

724
Both of these should be fixed.

725
I can verify that there's an issue for me in FF4.

726
OmnomIRC Development / Various bits of OmnomIRC Source Code
« on: April 15, 2011, 06:59:27 am »
Edit: SVN! http://ourl.ca/11696

Here's the new log parser for OmnomIRC. I'm planning to start open-sourcing components as soon as I'm not totally ashamed of the code in 'em. Regex's are awesome.

Log Parser
Spoiler For view_omnom.php:
Code: [Select]
<?PHP
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");  
?>
<link rel="stylesheet" type="text/css" href="http://209.90.113.101/omnimaganoie.css" />
<?PHP
$noShowNames = array("omnomirc","omnimaga","spybot45","spybot46");
function parseColors($colorStr)
{
$colorStr = htmlspecialchars($colorStr);
$colorStr = clickable_links($colorStr);
//$colorStr = preg_replace("/^  &lt;(.+?)&gt;/",'   &lt;<a target="_parent" href="http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=13&userSearch=\1">\1</a>&gt;',$colorStr);
preg_match("/^  &lt;(.+?)&gt;/",$colorStr,$arrayName);
if (count($arrayName) > 0)
{
$colorStr = preg_replace("/^  &lt;(.+?)&gt;/",getOmnomNameColor($arrayName[1]),$colorStr);
}
$lcount = 0;
while(strpos($colorStr,"\x03") > 0)
{
preg_match("/(^.*)\x03([0-9]{1,2}),([0-9]{1,2})(.*)/",$colorStr,$arrayResults);
preg_match("/(^.*)\x03([0-9]{1,2})(.*)/",$colorStr,$arrayResults2);
if(count($arrayResults) > 4) //FG & BG
{
$colorStr = $arrayResults[1].'<span class="fg-'.$arrayResults[2]*1 .'"><span class="bg-'.$arrayResults[3]*1 .'">'.$arrayResults[4];
}
elseif(count($arrayResults2) > 3) //FG Only
{
$colorStr = $arrayResults2[1].'<span class="fg-' . $arrayResults2[2]*1 . '">'.$arrayResults2[3];
}
else //We have a color control character w/o a color, most clients interperet this as clear colors.
{
for($lcount;$lcount;$lcount--)
$colorStr=$colorStr."</span>";
$colorStr = preg_replace("/\x03/","",$colorStr,1);
$lcount--;
}
$lcount++;
}
for(;$lcount>=0;$lcount--)
$colorStr=$colorStr."</span>";
/*Strip codes*/
$colorStr = preg_replace("(\x03|\x02|\x1F|\x09|\x0F)","",$colorStr);
$colorStr = str_replace("\x07","&lt;",$colorStr); // Removes beeps and is functional!
return($colorStr);
}
function clickable_links($text) {
$text = str_replace("http://www.omnimaga.org/","h111://www.omnimaga.org/",$text);
$text = str_replace("http://omniurl.tk/","h111://omniurl.tk/",$text);
$text = eregi_replace('((h111://(www.omnimaga.org/|omniurl.tk))[-a-zA-Z0-9@:;%_+.~#?&//=]+)', '<a target="_parent" href="\1">\1</a>', $text);
$text = eregi_replace('(((f|ht){1}(tp|tps)://)[-a-zA-Z0-9@:;%_+.~#?&//=]+)', '<a target="_blank" href="\1">\1</a>', $text);
$text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:;%_+.~#?&//=]+)', '\1<a target="_blank" href="http://\2">\2</a>', $text);
$text = str_replace("h111","http",$text);
return $text;
}
function getNameColor($name)
{
$rcolors = array(19, 20, 22, 24, 25, 26, 27, 28, 29);
$sum = $i = 0;
while (isset($name[$i]))
$sum += ord($name[$i++]);
$sum %= 9;
return '<span class="uName-'.$rcolors[$sum].'">'.$name.'</span>';
}
function getOmnomNameColor($name)
{
$rcolors = array(19, 20, 22, 24, 25, 26, 27, 28, 29);
$sum = $i = 0;
while (isset($name[$i]))
$sum += ord($name[$i++]);
$sum %= 9;
return '  &lt;<a target="_parent" href="http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=13&userSearch='.$name.'"><span class="uName-'.$rcolors[$sum].'">'.$name.'</span></a>&gt';
}
$myFile = "#" . $_GET["log"] . "." . date("Ymd") . ".log";
$arrayFile = file($myFile);
$count = count($arrayFile);
if (isset($_GET["trim"]))
$startAt = $count - $_GET["trim"];
$topic = $output = "";
$highlight = "\xFF";
if (isset($_GET["high"]))
$highlight = base64_decode($_GET["high"]);
for($i = 0;$i<$count;$i++)
{
$curLine = $arrayFile[$i];
//Try to get the topic
preg_match("/(Topic is|changes topic to) '(.*.)'/",$curLine,$topicGet);
if(count($topicGet))
$topic = $topicGet[2];
if ($i < $startAt) continue;

preg_match("/(^.*)(\[[0-9]{2}:[0-9]{2}:[0-9]{2}\]).\<(.+?)>(.*)/",$curLine,$curLineParts); //Try to match color, timestamp, message, and name
if(count($curLineParts) > 3)
{
$curLineParts[3] = str_replace("@","",$curLineParts[3]);
$curLineParts[3] = str_replace("+","",$curLineParts[3]);
$output = $output . '<span class="irc-date">'.$curLineParts[2].'</span>';
if (strpos(strtolower($curLineParts[4]),strtolower($highlight),in_array(strtolower($curLineParts[3]),$noShowNames)?strpos($curLineParts[4]," ",5):0))
$output = $output . '<span style="font-weight:bold;color:#F44">';
if (!in_array(strtolower($curLineParts[3]),$noShowNames))
{
$output = $output . " &lt;" . getNameColor($curLineParts[3]) . "&gt;";
$curLineParts[4] = str_replace("<","\x07",$curLineParts[4]);
}
$output = $output . parseColors(" ".$curLineParts[1].$curLineParts[4]);
if (strpos($curLineParts[4],$highlight))
$output = $output . '</span>';
}
else
{
preg_match("/(^.*)(\[[0-9]{2}:[0-9]{2}:[0-9]{2}\])(.*)/",$curLine,$curLineParts); //Try to match color, timestamp and message, no name
if(count($curLineParts)>3)
{
$output = $output . '<span class="irc-date">'.$curLineParts[2].'</span>';
$output = $output . parseColors(" ".$curLineParts[1] . $curLineParts[3]);
}
else //Give up and print line
{
$output = $output . parseColors($curLine);
}
}
$output = $output . '<br/>';
}
?>
<span class="irc-topic">Current Topic:<?PHP echo parseColors($topic); ?></span><br/><br/>
<?PHP echo $output; ?>

The CSS for the previous document:
Spoiler For omnimaganoie.css:
Code: [Select]
body, td, th , tr     {font-size: 10px;font-family:verdana,sans-serif;}

.irc-date       {color: #000000;}
.irc-topic     {text-decoration :none;font-size:12;color:#333333;font-family:Arial;border-style:dashed;border-width:1px;width:99%;position:absolute;text-align:center;}
.irc-green     {color: #009200;}
.irc-black     {color: #000000;}
.irc-brown     {color: #7b0000;}
.irc-navy       {color: #00007b;}
.irc-brick     {color: #9c009c;}
.irc-red       {color: #ff0000;}
.irc-teal     {color: #1A5555;}

.fg-white, .fg-0   {color: #FFFFFF;}
.fg-black, .fg-1   {color: #000000;}
.fg-dkBlue, .fg-2   {color: #3636B2;}
.fg-dkgreen, .fg-3   {color: #2A8C2A;}
.fg-red, .fg-4   {color: #C33B3B;}
.fg-dkRed , .fg-5   {color: #C73232;}
.fg-dkPurple, .fg-6   {color: #80267F;}
.fg-orange, .fg-7   {color: #E19317;}
.fg-yellow, .fg-8   {color: #D9A641;}
.fg-green, .fg-9   {color: #3DCC3D;}
.fg-teal, .fg-10 {color: #1A5555;}
.fg-ltBlue, .fg-11 {color: #2F8C74;}
.fg-blue, .fg-12 {color: #4545E6;}
.fg-pink, .fg-13 {color: #B037B0;}
.fg-dkGray, .fg-14 {color: #4C4C4C;}
.fg-ltGray, .fg-15 {color: #959595;}

.bg-white, .bg-0   {}/*Placeholder*/
.bg-black, .bg-1   {background-color: #000000;}
.bg-dkBlue, .bg-2   {background-color: #3636B2;}
.bg-dkgreen, .bg-3   {background-color: #2A8C2A;}
.bg-red, .bg-4   {background-color: #C33B3B;}
.bg-dkRed , .bg-5   {background-color: #C73232;}
.bg-dkPurple, .bg-6   {background-color: #80267F;}
.bg-orange, .bg-7   {background-color: #E19317;}
.bg-yellow, .bg-8   {background-color: #D9A641;}
.bg-green, .bg-9   {background-color: #3DCC3D;}
.bg-teal, .bg-10 {background-color: #1A5555;}
.bg-ltBlue, .bg-11 {background-color: #2F8C74;}
.bg-blue, .bg-12 {background-color: #4545E6;}
.bg-pink, .bg-13 {background-color: #B037B0;}
.bg-dkGray, .bg-14 {background-color: #4C4C4C;}
.bg-ltGray, .bg-15 {background-color: #959595;}
Spoiler For Spybot45 code:
Code: (Spybot45.php) [Select]
<?PHP
$sqlConnection = mysql_connect("Omnimaga.org","omnimaga_Netham","-Snip-");
if (!$sqlConnection)
die("Could not connect to SQL DB.");
if (!mysql_select_db("omnimaga_forums",$sqlConnection)) die('Invalid query: ' . mysql_error());

function sql_query()
{
global $sqlConnection;
$params = func_get_args();
$query = $params[0];
$args = Array();
for ($i=1;$i<count($params);$i++)
$args[$i-1] = mysql_real_escape_string($params[$i],$sqlConnection);
$result = mysql_query(vsprintf($query,$args),$sqlConnection);
if (!$result)
die(mysql_error());
return $result;
}

function postMessage($Poster,$Topic,$tID,$mID,$board)
{
$frBoards = array('101','105','169','171');
$adminBoards = array('68','3','44');
$boardsToExclude = array('2','20','69','125','172','173');
if (in_array($board,$boardsToExclude))
return false;
if (in_array($board,$frBoards))
{
$WriteLine = sprintf("12(O)10 Nouveau message par03 %s10 dans04 %s12 http://omniurl.tk/%s/%s\n",$Poster,$Topic,$tID,$mID);
$fileName = "c:\\Omnimaga IRC Spybot\\fposts";
}
else if (in_array($board,$adminBoards))
{
$WriteLine = sprintf("12(O)10 New post by03 %s10 in04 %s12 http://omniurl.tk/%s/%s\n",$Poster,$Topic,$tID,$mID);
$fileName = "c:\\Omnimaga IRC Spybot\\aposts";
}
else
{
$WriteLine = sprintf("12(O)10 New post by03 %s10 in04 %s12 http://omniurl.tk/%s/%s\n",$Poster,$Topic,$tID,$mID);
$fileName = "c:\\Omnimaga IRC Spybot\\posts";
}
$fp = fopen($fileName, 'w');
fwrite($fp,$WriteLine);
fclose($fp);
}

$curMID = 0;

while(true)
{
usleep(1000000);
$message = mysql_fetch_array(sql_query("SELECT `id_msg`,`id_topic`,`posterName` FROM `omnitempboard_messages` WHERE id_msg = (SELECT MAX(`id_msg`) FROM `omnitempboard_messages`)"));
$mID = $message['id_msg'];

if ($mID == $curMID)
continue;

$curMID = $mID;

$tID = $message['id_topic'];
$mPoster = $message['posterName'];

$topic = mysql_fetch_array(sql_query("SELECT `id_board`,`id_first_msg` FROM `omnitempboard_topics` WHERE `id_topic` = %s",$tID));
$tBoard = $topic['id_board'];
$tFirstID = $topic['id_first_msg'];

$fMessage = mysql_fetch_array(sql_query("SELECT `subject` FROM `omnitempboard_messages` WHERE `id_msg` = %s",$tFirstID));
$tTopicName = $fMessage['subject'];
postMessage($mPoster,$tTopicName,$tID,$mID,$tBoard);
echo sprintf("New Post by %s in %s http://omniurl.tk/%s/%s Board ID:%s\n", $mPoster,$tTopicName,$tID,$mID,$tBoard);
}
?>


Edit: I suppose I should attach a license to this. Do whatever you want with the code, but I'd like credit somewhere if you use it. If you wish to use it for a corporate or profitable purpose, contact me for permission.

727
Miscellaneous / Re: What is your avatar?
« on: April 15, 2011, 02:58:06 am »
It sounds welsh to me, does it to anyone else?

728
Yup. Enable/Disable will show Toggle too.

729
Code: [Select]
E n g l i s h
 F r e n c h
EFnrgelnicshh
:P

I got the rules redirecting right now too.

730
I can do that, yea.

And, sure, disable it.

731
If you look closely at OmnomIRC, you'll see two new links at the top.

One of them will say either "Français" or "English". This will toggle the chat between the English channel and the French channel (#omnimaga and #omnimaga-fr, respectively). With this, French users can now use OmnomIRC to have a conversation in their language of choice!

The other, "Disable OmnomIRC" makes OmnomIRC stop updating, so users who are on slow computers and/or slow internet connections no longer need to be placed in a group that completely disables OmnomIRC.

These settings are both cookie based, so they will not transfer between computers/browsers.

The third update is that I'm now using a different method for getting the messages to my server, so you no longer have to type 5 '\'s to get a single one.


Today's Logs, This Year's logs, and Java chat now all respect the current channel setting, and will forward to the proper page

Edit: If you are just minimizing OmnomIRC to disable it, could you please hit 'Disable' before minimizing it to help reduce load on my server.

UPDATE (23:29): OmnomIRC now supports highlighting. When someone says your nickname, text will show up in bold red color.

732
OmnomIRC Development / Re: OmnomIRC suggestions
« on: April 14, 2011, 11:01:36 pm »
Is now working in all browsers

733
OmnomIRC Development / Re: OmnomIRC suggestions
« on: April 14, 2011, 10:37:29 pm »
Stop pointing out how my code sucks! D:

734
Humour and Jokes / Re: Clubs in Omnimaga
« on: April 14, 2011, 01:47:20 pm »
He won't, us lobsters are secret forum admins. >:D

735
Humour and Jokes / Re: Clubs in Omnimaga
« on: April 13, 2011, 07:37:39 pm »
Lobsters are the best club!

Pages: 1 ... 47 48 [49] 50 51 ... 123