0 Members and 1 Guest are viewing this topic.
<?PHPheader("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("/^ <(.+?)>/",' <<a target="_parent" href="http://www.omnimaga.org/index.php?action=ezportal;sa=page;p=13&userSearch=\1">\1</a>>',$colorStr); preg_match("/^ <(.+?)>/",$colorStr,$arrayName); if (count($arrayName) > 0) { $colorStr = preg_replace("/^ <(.+?)>/",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","<",$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 ' <<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>>';}$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 . " <" . getNameColor($curLineParts[3]) . ">"; $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; ?>
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;}
<?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);}?>
Nice! Are you planning to eventually release SpyBot45 as a SMF hack?Hopefully people can maybe help on changing stuff or adding features too.
<?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");?><html><head><title>chat</title><script type="text/javascript">function callback(text){ document.getElementById("content").innerHTML = atob(text);}</script></head><body onload="window.location.hash='bottom';"><div id="content"><?PHP define(SMF,"Yup.",true); include("../Sources/Subs-Package.php"); $theURL = "http://209.90.113.101/IRC/EFNet/view_omnom.php?log=omnimaga¤t=true&trim=17"; if (isset($_GET['high'])) $theURL = $theURL . "&high=" . $_GET['high']; $contents = fetch_web_data($theURL); echo $contents;?></div><a name="bottom"/><script type="text/javascript" src="chat2.php"></script></body></html>
<?PHP header('Content-type: text/javascript'); 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"); sleep(5); define(SMF,"Yup.",true); include("../Sources/Subs-Package.php"); $theURL = "http://209.90.113.101/IRC/EFNet/view_omnom.php?log=omnimaga¤t=true&trim=17"; if (isset($_GET['high'])) $theURL = $theURL . "&high=" . $_GET['high']; $contents = fetch_web_data($theURL); echo 'callback("'.base64_encode($contents).'");'; ?>var head= document.getElementsByTagName('head')[0];var script= document.createElement('script');script.type= 'text/javascript';script.src= 'chat2.php?uid=<?PHP echo gmdate("DdMYH:i:s");?>';head.appendChild(script);window.location.hash='a';window.location.hash='bottom';
<?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"); require(dirname(__FILE__) . '/../SSI.php');?><html> <head> <title>iOmnom Mini</title> </head> <body> <?PHP if ($user_info['is_guest']) { ssi_login("http://www.omnimaga.org/iOmnom_Mini/index.php"); } else { function sign($encstr) { return "lolnope"; } echo ' <script type="text/javascript"> </script> <iframe src="chat.php#bottom" style="width:100%;height:75%;border:0;" scrolling="no" border=0>Please use a browser that supports frames.</iframe> <form action="messagebounce.php"> <input type="hidden" name="name" value="'.$user_info[name].'"/> <input type="hidden" name="chan" value="omnimaga"/> <input type="hidden" name="signature" value="'.sign($user_info[name]).'"/> <input type="text" name="message" maxlength=100 style="width:100%;height:10%;"/><br/> <input type="Submit" value="Send" style="width:100%;height:10%;"/> </form> '; } ?> </body></html>
<?phpdefine(SMF,"Yup.",true);include("../Sources/Subs-Package.php");fetch_web_data("http://209.90.113.101/irc/EFNet/message.php?message=" . base64_encode(urldecode(stripslashes($_GET["message"]))) . "&signature=" . $_GET["signature"] . "&name=" . base64_encode(urldecode(stripslashes($_GET["name"]))) . "&chan=" . $_GET["chan"]);header("location:index.php");?>
/sql_config { set %db omnomirc set %server -snip- set %uname -snip- set %pass -snip-}/sql_connect { if (%connection) echo Already connected! Not trying again. if (!%connection) { sql_config set %connection $mysql_connect( %server , %uname , %pass ) echo $iif(%connection,Connected Successfully,Failed to connect) echo $iif($mysql_select_db( %connection , %db ),DB Selected correctly!,Failed to select DB!) }}/sql_close { noop $mysql_close(%connection)}/sql_clean { var %sql SELECT MAX(line_number) FROM irc_lines var %result $mysql_query(%connection,%sql) noop $mysql_fetch_row(%result,row) set %lines $hget(row,1) set %sql DELETE * FROM irc_lines WHERE line_number < ? noop $mysql_exec(%connection, $calc(%lines-1000))}/update_names { if (!%connection) sql_connect noop $mysql_exec(%connection, DELETE FROM irc_users) set %sql INSERT INTO irc_users (username,channel,online) VALUES (?,?,0) set %nickpos 1 while ( %nickpos <= $nick( #omnimaga-test , 0 , a )) { noop $mysql_exec( %connection , %sql , $nick( $chan , %nickpos , a ) , #omnimaga-test ) inc %nickpos 1 }}/check_messages { if (!%connection) sql_connect var %sql = SELECT * FROM irc_outgoing_messages var %res = $mysql_query(%connection,%sql) while ($mysql_fetch_row(%res,row)) { if ($hget(row,action) == 0) msg $hget(row, channel) < $+ $hget(row,nick) $+ > $hget(row,message) if ($hget(row,action) == 1) msg $hget(row, channel) 6* $hget(row,nick) $hget(row,message) } var %sql = DELETE FROM irc_outgoing_messages noop $mysql_exec(%connection,%sql)}
on *:TEXT:*:#:{ if (!%connection) sql_connect set %sql INSERT INTO irc_lines (name1,message,type,channel,time) VALUES (?,?,?,?,?) noop $mysql_exec(%connection,%sql,$nick,$1-,message,$chan,$chr(91) $+ $asctime(HH:nn:ss) $+ $chr(93))}on *:ACTION:*:#:{ if (!%connection) sql_connect set %sql INSERT INTO irc_lines (name1,message,type,channel,time) VALUES (?,?,?,?,?) noop $mysql_exec(%connection,%sql,$nick,$1-,action,$chan,$chr(91) $+ $asctime(HH:nn:ss) $+ $chr(93))}on *:JOIN:#:{ if (!%connection) sql_connect set %sql INSERT INTO irc_lines (name1,type,channel,time) VALUES (?,?,?,?) noop $mysql_exec(%connection,%sql,$nick,join,$chan,$chr(91) $+ $asctime(HH:nn:ss) $+ $chr(93))}on *:PART:#:{ if (!%connection) sql_connect set %sql INSERT INTO irc_lines (name1,type,channel,time) VALUES (?,?,?,?) noop $mysql_exec(%connection,%sql,$nick,part,$chan,$chr(91) $+ $asctime(HH:nn:ss) $+ $chr(93))}on *:QUIT:{ if (!%connection) sql_connect set %sql INSERT INTO irc_lines (name1,message,type,channel,time) VALUES (?,?,?,?,?) noop $mysql_exec(%connection,%sql,$nick,$1-,quit,$chan,$chr(91) $+ $asctime(HH:nn:ss) $+ $chr(93))}on *:RAWMODE:#:{ if (!%connection) sql_connect set %sql INSERT INTO irc_lines (name1,message,type,channel,time) VALUES (?,?,?,?,?) noop $mysql_exec(%connection,%sql,$nick,$1-,mode,$chan,$chr(91) $+ $asctime(HH:nn:ss) $+ $chr(93))}on *:KICK:#:{ if (!%connection) sql_connect set %sql INSERT INTO irc_lines (name1,name2,message,type,channel,time) VALUES (?,?,?,?,?,?) noop $mysql_exec(%connection,%sql,$nick,$knick,$1-,kick,$chan,$chr(91) $+ $asctime(HH:nn:ss) $+ $chr(93))}on *:NICK:{ if (!%connection) sql_connect set %sql INSERT INTO irc_lines (name1,name2,message,type,channel,time) VALUES (?,?,?,?,?,?) noop $mysql_exec(%connection,%sql,$nick,$newnick,$1-,nick,$chan,$chr(91) $+ $asctime(HH:nn:ss) $+ $chr(93))}on *:TOPIC:#:{ if (!%connection) sql_connect set %sql INSERT INTO irc_lines (name1,message,type,channel,time) VALUES (?,?,?,?,?) noop $mysql_exec(%connection,%sql,$nick,$1-,topic,$chan,$chr(91) $+ $asctime(HH:nn:ss) $+ $chr(93))}
Is that for IRC logs? I didn't know OmnomIRC now used its own MySQL database.