Ik heb de code tussen de php code van het loginsysteem proberen weven maar dan gaf ie een error op de site...
PHP-code:
<?php
// -------------------------------------------------------------------------//
// Nuked-KlaN - PHP Portal //
// http://www.nuked-klan.org //
// -------------------------------------------------------------------------//
// This program is free software. you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License. //
// -------------------------------------------------------------------------//
if (eregi("block_login.php", $_SERVER['PHP_SELF']))
{
die ("You cannot open this page directly");
}
//------------------------Traduction------------------------------
global $language;
if($language == "french")
{
define("_CONNECT","Connectés");
define("_RECORD","Record");
define("_YESDAY","Hier");
define("_TODAYC","Aujourd'hui");
define("_HIDDEN","Cacher");
define("_AFFCONNECT","Afficher les connectés dans");
}
else
{
define("_CONNECT","Connected");
define("_RECORD","Record");
define("_YESDAY","Yesterday");
define("_TODAYC","Today");
define("_HIDDEN","Hidden");
define("_AFFCONNECT","Post the connected in");
}
//-----------------------------Fin--------------------------------
function affich_block_login($blok)
{
global $user, $nuked;
list($login, $messpv, $members, $online,$connect, $aff) = explode('|', $blok['content']);
$blok['content'] = "";
$c = 0;
if($login != "off")
{
if (!$user)
{
$blok['content'] = "<form action=\"index.php?file=User&nuked_nude=index&op=login\" method=\"post\">\n"
. "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\">\n"
. "<tr><td>" . _NICK . " :</td><td><input type=\"text\" name=\"pseudo\" size=\"10\" maxlength=\"250\" /></td></tr>\n"
. "<tr><td>" . _PASSWORD . " :</td><td><input type=\"password\" name=\"pass\" size=\"10\" maxlength=\"15\" /></td></tr>\n"
. "<tr><td colspan=\"2\"><input type=\"checkbox\" class=\"checkbox\" name=\"remember_me\" value=\"ok\" checked=\"checked\" /> " . _SAVE . "</td></tr>\n"
. "<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"login\" /></td></tr>\n"
. "<tr><td colspan=\"2\"><a href=\"index.php?file=User&op=reg_screen\">" . _REGISTER . "</a><br />\n"
. "<a href=\"index.php?file=User&op=oubli_pass\">" . _FORGETPASS . "</a> ?</td></tr></table></form>\n";
}
else
{
$blok['content'] = "<div style=\"text-align: center;\">" . _WELCOME . ", <b>" . $user[2] . "</b><br /><br />\n"
. "<a href=\"index.php?file=User\">" . _ACCOUNT . "</a> / <a href=\"index.php?file=User&nuked_nude=index&op=logout\">" . _LOGOUT . "</a></div>\n";
}
$c++;
}
if($messpv != "off" && $user[0] != "")
{
if ($c > 0) $blok['content'] .= "<hr style=\"height: 1px;\" />\n";
$sql2 = mysql_query("SELECT mid FROM " . USERBOX_TABLE . " WHERE user_for = '" . $user[0] . "' AND status = 1");
$nb_mess_lu = mysql_num_rows($sql2);
$blok['content'] .= " <img src=\"images/message.gif\" alt=\"\" /> <span style=\"text-decoration: underline\"><b>" . _MESSPV . "</b></span><br />\n";
if ($user[5] > 0)
{
$blok['content'] .= " <b><big>·</big></b> " . _NOTREAD . " : <a href=\"index.php?file=Userbox\"><b>" . $user[5] . "</b></a>\n";
}
else
{
$blok['content'] .= " <b><big>·</big></b> " . _NOTREAD . " : <b>" . $user[5] . "</b>\n";
}
if ($nb_mess_lu > 0)
{
$blok['content'] .= "<br /> <b><big>·</big></b> " . _READ . " : <a href=\"index.php?file=Userbox\"><b>" . $nb_mess_lu . "</b></a>\n";
}
else
{
$blok['content'] .= "<br /> <b><big>·</big></b> " . _READ . " : <b>" . $nb_mess_lu . "</b>\n";
}
$c++;
}
if ($members != "off")
{
if ($c > 0) $blok['content'] .= "<hr style=\"height: 1px;\" />\n";
$blok['content'] .= " <img src=\"images/memberslist.gif\" alt=\"\" /> <span style=\"text-decoration: underline\"><b>" . _MEMBERS . "</b></span><br />\n";
$sql_users = mysql_query("SELECT id FROM " . USER_TABLE . " WHERE niveau < 3");
$nb_users = mysql_num_rows($sql_users);
$sql_admin = mysql_query("SELECT id FROM " . USER_TABLE . " WHERE niveau > 2");
$nb_admin = mysql_num_rows($sql_admin);
$sql_lastmember = mysql_query("SELECT pseudo FROM " . USER_TABLE . " ORDER BY date DESC LIMIT 0, 1");
list($lastmember) = mysql_fetch_array($sql_lastmember);
$lastmember = stripslashes($lastmember);
$blok['content'] .= " <b><big>·</big></b> " . _ADMINS . " : <b>" . $nb_admin . "</b><br /> <b><big>·</big></b> " . _MEMBERS . " :"
. " <b>" . $nb_users . "</b> [<a href=\"index.php?file=Members\">" . _LIST . "</a>]<br />\n"
. " <b><big>·</big></b> " . _LASTMEMBER . " : <a href=\"index.php?file=Members&op=detail&autor=" . urlencode($lastmember) . "\"><b>" . $lastmember . "</b></a>\n";
$c++;
}
if ($online != "off")
{
if ($c > 0) $blok['content'] .= "<hr style=\"height: 1px;\" />\n";
$blok['content'] .= " <img src=\"images/online.gif\" alt=\"\" /> <span style=\"text-decoration: underline\"><b>" . _WHOISONLINE . "</b></span><br />\n";
$nb = nbvisiteur();
if ($nb[1] > 0)
{
$sql4 = mysql_query("SELECT username FROM " . NBCONNECTE_TABLE . " WHERE type BETWEEN 1 AND 2 ORDER BY date");
while (list($nom) = mysql_fetch_array($sql4))
{
$user_online .= " <b><big>·</big></b> <b>" . $nom . "</b><br />";
}
$user_list = " [<a href=\"#\" onmouseover=\"AffBulle(' " . _WHOISONLINE . "', '" . htmlentities(addslashes($user_online), ENT_NOQUOTES) . "', 150)\" onmouseout=\"HideBulle()\">" . _LIST . "</a>]";
}
else
{
$user_list = "";
}
if ($nb[2] > 0)
{
$sql5 = mysql_query("SELECT username FROM " . NBCONNECTE_TABLE . " WHERE type > 2 ORDER BY date");
while (list($name) = mysql_fetch_array($sql5))
{
$admin_online .= " <b><big>·</big></b> <b>" . $name . "</b><br />";
}
$admin_list = " [<a href=\"#\" onmouseover=\"AffBulle(' " . _WHOISONLINE . "', '" . htmlentities(addslashes($admin_online), ENT_NOQUOTES) . "', 150)\" onmouseout=\"HideBulle()\">" . _LIST . "</a>]";
}
else
{
$admin_list = "";
}
$blok['content'] .= " <b><big>·</big></b> " . _VISITOR;
if ($nb[0] > 1) $blok['content'] .= "s";
$blok['content'] .= " : <b>" . $nb[0] . "</b><br /> <b><big>·</big></b> " . _MEMBER;
if ($nb[1] > 1) $blok['content'] .= "s";
$blok['content'] .= " : <b>" . $nb[1] . "</b>" . $user_list . "<br /> <b><big>·</big></b> " . _ADMIN;
if ($nb[2] > 1) $blok['content'] .= "s";
$blok['content'] .= " : <b>" . $nb[2] . "</b>" . $admin_list . "<br />\n";
$c++;
}
//ajout par makia pour afficher le nombres de connect/jour http://www.genese-graph.com/
if ($connect != "off")
{
if ($c > 0) $blok['content'] .= "<hr style=\"height: 1px;\" />\n";
$nom = $user[2];
if ($_SERVER['HTTP_CLIENT_IP'])
{
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
else if ($_SERVER['HTTP_X_FORWARDED_FOR'])
{
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
}
if ($nom == "") $nom = "visiteur";
$sql = mysql_query("SELECT temps, record FROM ". $nuked['prefix'] ."_nbconnect_jour WHERE nom = ''");
list($temps, $record) = mysql_fetch_row($sql);
if(time() >= $temps)
{
$sql3 = mysql_query("SELECT * FROM ". $nuked['prefix'] ."_nbconnect_jour WHERE nom != ''");
$con_hier = mysql_num_rows($sql3);
$temps = $temps + (3600*24);
$sql2 = mysql_query("DELETE FROM ". $nuked['prefix'] ."_nbconnect_jour");
if ($con_hier > $record)
{
$sql1 = mysql_query("INSERT INTO ". $nuked['prefix'] ."_nbconnect_jour VALUES ('','','". $temps ."','". $con_hier ."','". $con_hier ."','')");
}
else
{
$sql1 = mysql_query("INSERT INTO ". $nuked['prefix'] ."_nbconnect_jour VALUES ('','','". $temps ."','". $con_hier ."','". $record ."','')");
}
$sql = mysql_query("INSERT INTO ". $nuked['prefix'] ."_nbconnect_jour VALUES ('','". $nom ."','','','','". $ip ."')");
}
if( $nom != "visiteur")
{
$sql = mysql_query("SELECT nom,ip FROM ". $nuked['prefix'] ."_nbconnect_jour WHERE nom='". $nom ."' OR ip='". $ip ."'");
$count = mysql_num_rows($sql);
list($visiteur,$Vist_ip) = mysql_fetch_row($sql);
if($count == 1)
{
if($Vist_ip == $ip && $nom != $visiteur)
{
$sql = mysql_query("UPDATE ". $nuked['prefix'] ."_nbconnect_jour SET nom = '". $nom ."' WHERE ip = '". $ip ."'");
}
if($Vist_ip != $ip && $nom == $visiteur)
{
$sql = mysql_query("UPDATE ". $nuked['prefix'] ."_nbconnect_jour SET ip = '". $ip ."' WHERE nom = '". $nom ."'");
}
}
}
else
{
$sql = mysql_query("SELECT nom FROM ". $nuked['prefix'] ."_nbconnect_jour WHERE ip = '". $ip ."'");
list($visiteur) = mysql_fetch_row($sql);
$count = mysql_num_rows($sql);
if($visiteur == "visiteur")
{
$sql = mysql_query("UPDATE ". $nuked['prefix'] ."_nbconnect_jour SET nom = '". $nom ."' WHERE ip = '". $ip ."'");
}
}
if($count == 0)
{
$sql = mysql_query("INSERT INTO ". $nuked['prefix'] ."_nbconnect_jour VALUES ('','". $nom ."','". $temps ."','','','". $ip ."')");
}
$blok[content] .= " <img src=\"images/memberslist.gif\" alt=\"\" /> <span style=\"text-decoration: underline\"><b>" . _CONNECT . "</b></span><br />";
$sql = mysql_query("SELECT hier, record FROM ". $nuked['prefix'] ."_nbconnect_jour WHERE nom = ''");
list($con_hier, $record) = mysql_fetch_row($sql);
$blok[content].= " <b><big>·</big></b> ". _RECORD ." : <b>". $record ."</b>\n"
. "<br /> <b><big>·</big></b> ". _YESDAY ." : <b>". $con_hier ."</b><br />\n";
$sql = mysql_query("SELECT * FROM ". $nuked['prefix'] ."_nbconnect_jour WHERE nom != ''");
$today = mysql_num_rows($sql);
$blok[content] .= " <b><big>·</big></b> "._TODAYC ." : <b>". $today ."</b>";
$sql = mysql_query("SELECT nom FROM ". $nuked['prefix'] ."_nbconnect_jour WHERE nom != '' AND nom != 'visiteur'");
while(list($nom_vist) = mysql_fetch_row($sql))
{
$list_vist .= " - ". $nom_vist ."<br />";
}
$sql = mysql_query("SELECT nom FROM ". $nuked['prefix'] ."_nbconnect_jour WHERE nom = 'visiteur'");
$visite = mysql_num_rows($sql);
if($visite > 0)
{
if($visite > 1)$s = "s";
$list_vist .= " - ". $visite ." visiteur". $s;
}
if($aff == "div")
{
echo "<script type=\"text/javascript\">\n"
. "<!--\n"
. "function cacherDiv(id,div)\n"
. "{\n"
. " if(document.getElementById(id).style.visibility == 'hidden')\n"
. " {\n"
. " document.getElementById(id).style.visibility = 'visible';\n"
. " document.getElementById(id).style.position = 'relative';\n"
. " document.getElementById(id).style.width = '100%';\n"
. " document.getElementById(div).innerHTML = '". _HIDDEN ."';\n"
. " }\n"
. " else\n"
. " {\n"
. " document.getElementById(id).style.visibility = 'hidden';\n"
. " document.getElementById(id).style.position = 'absolute';\n"
. " document.getElementById(id).style.width = '';\n"
. " document.getElementById(div).innerHTML = '". _LIST ."';\n"
. " }\n"
. "}\n"
. "// -->\n"
. "</script>\n";
$blok[content] .= " [<a href=\"javascript:cacherDiv('listVist', 'cacherSpan');\"><span id=\"cacherSpan\">". _LIST ."</span></a>]\n";
}
else
{
$blok[content] .= " [<a href=\"#\" onmouseover=\"AffBulle(' " . _CONNECT . "', '" . htmlentities(addslashes($list_vist), ENT_NOQUOTES) . "', 120)\" onmouseout=\"HideBulle()\">" . _LIST . "</a>]";
}
$blok[content] .= "<br/><div id=\"listVist\" style=\"visibility:hidden;position:absolute;\">". $list_vist ."</div>\n";
$c++;
}
//fin de l'ajout http://www.genese-graph.com/
return $blok;
}
function edit_block_login($bid)
{
global $nuked, $language;
$sql = mysql_query("SELECT active, position, titre, module, content, type, nivo, page FROM " . BLOCK_TABLE . " WHERE bid = '" . $bid . "'");
list($active, $position, $titre, $modul, $content, $type, $nivo, $pages) = mysql_fetch_array($sql);
$titre = stripslashes($titre);
$titre = htmlentities($titre);
list($login, $messpv, $members, $online, $connect, $aff) = explode('|', $content);
if ($active == 1) $checked1 = "selected=\"selected\"";
else if ($active == 2) $checked2 = "selected=\"selected\"";
else $checked0 = "selected=\"selected\"";
if ($login == "off") $checked3 = "selected=\"selected\""; else $checked3 = "";
if ($messpv == "off") $checked4 = "selected=\"selected\""; else $checked4 = "";
if ($members == "off") $checked5 = "selected=\"selected\""; else $checked5 = "";
if ($online == "off") $checked6 = "selected=\"selected\""; else $checked6 = "";
if ($connect == "off") $checked7 = "selected=\"selected\""; else $checked7 = "";
if ($aff == "div") $checked8 = "checked=\"checked\""; else $checked9 = "checked=\"checked\"";
echo "<a href=\"#\" onclick=\"javascript:window.open('help/" . $language . "/block.html','Help','toolbar=0,location=0,directories=0,status=0,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=350,height=300');return(false)\">\n"
. "<img style=\"border: 0;\" src=\"help/help.gif\" alt=\"\" title=\"" . _HELP . "\" /></a><div style=\"text-align: center;\"><h3>" . _ADMINBLOCK . "</h3></div>\n"
. "<form method=\"post\" action=\"index.php?file=Admin&page=block&op=modif_block\">\n"
. "<table style=\"margin-left: auto;margin-right: auto;text-align: left;\" cellspacing=\"0\" cellpadding=\"2\" border=\"0\">\n"
. "<tr><td><b>" . _TITLE . "</b></td><td><b>" . _BLOCK . "</b></td><td><b>" . _POSITION . "</b></td><td><b>" . _LEVEL . "</b></td></tr>\n"
. "<tr><td align=\"center\"><input type=\"text\" name=\"titre\" size=\"40\" value=\"" . $titre . "\" /></td>\n"
. "<td align=\"center\"><select name=\"active\">\n"
. "<option value=\"1\" " . $checked1 . ">" . _LEFT . "</option>\n"
. "<option value=\"2\" " . $checked2 . ">" . _RIGHT . "</option>\n"
. "<option value=\"0\" " . $checked0 . ">" . _OFF . "</option></select></td>\n"
. "<td align=\"center\"><input type=\"text\" name=\"position\" size=\"2\" value=\"" . $position . "\" /></td>\n"
. "<td align=\"center\"><select name=\"nivo\"><option>" . $nivo . "</option>\n"
. "<option>0</option>\n"
. "<option>1</option>\n"
. "<option>2</option>\n"
. "<option>3</option>\n"
. "<option>4</option>\n"
. "<option>5</option>\n"
. "<option>6</option>\n"
. "<option>7</option>\n"
. "<option>8</option>\n"
. "<option>9</option></select></td></tr>\n"
. "<tr><td colspan=\"4\">" . _LOGIN . " : <select name=\"login\">\n"
. "<option value=\"on\">" . _YES . "</option>\n"
. "<option value=\"off\" " . $checked3 . ">" . _NO . "</option></select>\n"
. " " . _MESSPV . " : <select name=\"messpv\">\n"
. "<option value=\"on\">" . _YES . "</option>\n"
. "<option value=\"off\" " . $checked4 . ">" . _NO . "</option></select>\n"
. "</td></tr><tr><td colspan=\"4\">" . _MEMBERS . " : <select name=\"members\">\n"
. "<option value=\"on\">" . _YES . "</option>\n"
. "<option value=\"off\" " . $checked5 . ">" . _NO . "</option></select>\n"
. " " . _WHOISONLINE . " : <select name=\"online\">\n"
. "<option value=\"on\">" . _YES . "</option>\n"
. "<option value=\"off\" " . $checked6 . ">" . _NO . "</option></select><br />"
. "". _CONNECT ." : <select name=\"connect\">\n"
. "<option value=\"on\">" . _YES . "</option>\n"
. "<option value=\"off\" " . $checked7 . ">" . _NO . "</option></select><br />\n"
. "". _AFFCONNECT ." : <input type=\"radio\" name=\"aff\" value=\"div\" ". $checked8 ." /> Div\n"
. "<input type=\"radio\" name=\"aff\" value=\"bulle\" ". $checked9 ." /> Infobulle</td></tr><tr><td colspan=\"4\"> </td></tr>\n"
. "<tr><td colspan=\"4\" align=\"center\"><b>" . _PAGESELECT . " :</b></td></tr><tr><td colspan=\"4\"> </td></tr>\n"
. "<tr><td colspan=\"4\" align=\"center\"><select name=\"pages[]\" size=\"8\" multiple=\"multiple\">\n";
select_mod2($pages);
echo "</select></td></tr><tr><td colspan=\"4\" align=\"center\"><br />\n"
. "<input type=\"hidden\" name=\"type\" value=\"" . $type . "\" />\n"
. "<input type=\"hidden\" name=\"bid\" value=\"" . $bid . "\" />\n"
. "<input type=\"submit\" name=\"send\" value=\"" . _MODIFBLOCK . "\" />\n"
. "</td></tr></table>"
. "<div style=\"text-align: center;\"><br />[ <a href=\"index.php?file=Admin&page=block\"><b>" . _BACK . "</b></a> ]</div></form><br />\n";
}
function modif_advanced_login($data)
{
$data['content'] = $data['login'] . "|" . $data['messpv'] . "|" . $data['members'] . "|" . $data['online'] ."|". $data['connect'] ."|". $data['aff'];
return $data;
}
?>
Favorieten/bladwijzers