function onData($data) { if ($this->autoOpConfig['mode']) { if (strpos($data, 'JOIN :') !== false) { $bits = explode(" ", $data); $nick = getNick(@$bits[0]); $channel = trim(str_replace(":", '', @$bits[2])); if ($this->autoOpConfig['mode'] == 1) { if (in_array($nick, $this->autoOpConfig['channel'][$channel])) { sendData($this->socket, "MODE {$channel} +o {$nick}"); } } elseif ($this->autoOpConfig['mode'] == 2) { sendData($this->socket, "MODE {$channel} +o {$nick}"); } } } }
function getChat($lines) { $chat = ""; for ($i = 0; $i < count($lines); $i++) { $line = '<span class="lineNum">' . ($i + 1) . "</span> " . date("h:i:s", $lines[$i]->time) . " " . '<span class="nick"><' . $lines[$i]->nick . "></span> " . $lines[$i]->text . "\n"; $chat .= '<div class="line">' . $line . '</div>'; } $out = ""; $out .= ' <div id="window"> <div id="chat">' . $chat . '</div>'; $out .= '<div id="typein"> <form method="post" action="http://213.243.142.47' . $_SERVER['PHP_SELF'] . '">'; if (!getNick()) { $out .= 'Choose nickname <input type="text" name="nick" />'; } else { $out .= '<span class="nick"><' . getNick() . '></span>' . ' <input class="typeform" type="text" autocomplete="off" name="line" /> '; } $out .= ' </form> </div> </div>'; return $out; }
function main() { while (true) { //Sleep a bit, no need to hog all CPU resources usleep(100000); //Join channels if not already joined if (!$this->inChannel && time() - $this->config['waitTime'] > $this->startTime) { $this->joinChannel($this->config['channel']); sleep(2); $this->inChannel = true; } //Run scheduled memory check if (time() - 600 > $this->lastMemCheckTime) { $this->lastMemCheckTime = time(); $this->doMemCheck(); } //Tick plugins foreach ($this->plugins as $plugin) { $plugin->tick(); } //Load data from IRC server $data = fgets($this->socket, 256); if (strlen($data) > 0) { $this->lastServerMessage = time(); logMsg("<Server to bot> " . $data); $bits = explode(' ', $data); if ($bits[0] == 'PING') { sendData($this->socket, "PONG {$bits[1]}"); //Ping? Pong! } else { if ($bits[0] == 'ERROR') { logMsg("Error from server, trying to reconnect in 2 minutes"); $this->prepareShutdown(""); sleep(120); doRestart(); } } $from = getNick($bits[0]); if ($this->antiFlood($from)) { if (isset($bits[2])) { $chan = trim($bits[2]); } if (isset($chan[0]) && $chan[0] != '#') { $chan = $from; } if (isset($bits[3])) { $cmd = trim($bits[3]); switch ($cmd) { case ":{$this->config['trigger']}exit": $this->shutdown($bits[4], $from, $chan); break; case ":{$this->config['trigger']}restart": $this->restart($bits[4], $from, $chan); break; case ":{$this->config['trigger']}help": if (isset($bits[4])) { $this->help($from, $chan, $bits[4]); } else { $this->help($from, $chan); } break; } $cmd = null; } if ($bits[1] == 'PRIVMSG') { $msg = @substr($bits[3], 1); for ($i = 4; $i < count($bits); $i++) { $msg .= ' ' . $bits[$i]; } $msg = trim($msg); foreach ($this->plugins as $plugin) { $plugin->onMessage($from, $chan, $msg); } $msg = null; } else { foreach ($this->plugins as $plugin) { if (method_exists($plugin, 'onData')) { $plugin->onData($data); } } } } else { logMsg("Ignoring {$from} due to flooding"); } $bits = null; $from = null; $chan = null; $bits = null; } $data = null; if ($this->lastServerMessage < time() - 60 * 5) { sendData($this->socket, "PING {$this->config['server']}"); } if ($this->lastServerMessage < time() - 60 * 10) { logMsg("Last server message/ping was >10min ago, going to restart the bot."); $this->prepareShutdown(""); doRestart(); } } }
function restaurarFondo($id) { $t = mysql_query("SELECT * FROM `DisenoFD` WHERE `idEmpresa`='" . $_SESSION['idEmpresa'] . "'") or die(mysql_error()); $r = mysql_fetch_array($t); $yu = mysql_query("UPDATE `DisenoFD` SET `fondo`='NULL' WHERE `idEmpresa`='" . $_SESSION['idEmpresa'] . "'") or die(mysql_error()); echo "<script language='javascript'>window.location='../" . getNick($_SESSION['idEmpresa']) . "'</script>"; }
while ($i = mysql_fetch_array($gi)) { $empresa = mysql_query("SELECT * FROM `AnuncioEmpresa` WHERE `idAnuncio`='" . $i['idAnuncio'] . "'") or die(mysql_error()); $e = mysql_fetch_array($empresa); $login = mysql_query("SELECT * FROM `Empresa` WHERE `idEmpresa`='" . $e['idEmpresa'] . "'") or die(mysql_error()); $l = mysql_fetch_array($login); echo ' <div id="bbottom"></div> <div id="publicacion"> <div id="divisor"> <table> <td valign="top"><a href="' . getNick($e['idEmpresa']) . '"> <div id="bordep"> </div></td></a> <td valign="top"> <a href=' . $l['nick'] . '><div id="mtext"><b>' . $l['nombre'] . '</b></a> - El ' . $i['fechaAnuncio'] . '</div>'; echo mensionar($i['descripcionAnuncio']); echo '</td></table> </div></div>'; } } echo "</div>"; require_once '../Plugins/publicidadREG.php';
<?php if (isset($_SESSION['id'])) { echo "<script language='javascript'>window.location='" . getNick($_SESSION['id']) . "'</script>"; } else { if (@$_GET['pagina'] == "superanuncio") { echo "<div id='tboxizqsanuncio'>\n\t\t\t\t\t<div id='content-header'><div id='header1'><div id='h1'>\n\t\t\t\t\t<table>\n\t\t\t\t\t<td><img src='../misc/iconos/bullhorn.png'></td>\n\t\t\t\t\t\t<td valign='top'>Super Anuncio<div id='date'><a href='@info-comprarpublicidad'>Comprar Ioseet Ads</a></td>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div></div></div>"; $limit = 1; $gt = mysql_query("SELECT * FROM `AnuncioPremium` WHERE `TipoPremium`='4' ORDER BY RAND()") or die(mysql_error()); while ($n = mysql_fetch_array($gt) and $limit <= 1) { $limit++; echo "\n\t\t\t\t\t\t<a href='" . $n['URL'] . "'><div style='width:100%; height:100%'>\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t<td><div id='bordep'><img src='misc/publicidad/" . $n['imagenAnuncio'] . "' width='100%' height='310'><br><br><h1>" . $n['tituloAnuncio'] . "</h1>\n\t\t\t\t\t\t<div id='textoads'><h8>" . $n['descripcionAnuncio'] . "</h8></div></div></td>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</div></a>\n\t\t\t\t\t\t<div id='bbottom'></div><br>\n\t\t\t\t\t\t<div id='bbottom'></div>"; } echo "</div>"; } else { echo ' <div id="tboxizqindex"> <div id="divisor"><div id="imgindex"> <table> <td valign="top"><a href="Ioseet"><img src="misc/images/Ioseetlogo.png" id="imgindexparameter"></a><a href="Ioseet"></a></div> </table> </div> </div> </div>'; } } ?>