Skip to content
This repository has been archived by the owner on Oct 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #18 from samoth93/RewriteIndexAndCss
Browse files Browse the repository at this point in the history
Code base for 1.8
  • Loading branch information
Zdav committed Jun 12, 2013
2 parents 06b4eb7 + bf71f25 commit 80905a4
Show file tree
Hide file tree
Showing 82 changed files with 2,114 additions and 1,375 deletions.
4 changes: 3 additions & 1 deletion Includes/blocks/block_html.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ function edit_block_html($bid){
$titre = printSecuTags($titre);
$content = nkHtmlEntityDecode($content);

$checked0 = $checked1 = $checked2 = $checked3 = $checked4 = '';

if ($active == 1) $checked1 = 'selected="selected"';
else if ($active == 2) $checked2 = 'selected="selected"';
else if ($active == 3) $checked3 = 'selected="selected"';
Expand Down Expand Up @@ -75,4 +77,4 @@ function edit_block_html($bid){
, '<div style="text-align: center;"><br />[ <a href="index.php?file=Admin&amp;page=block"><b>' . _BACK , '</b></a> ]</div></form><br /></div></div>',"\n";

}
?>
?>
43 changes: 29 additions & 14 deletions Includes/blocks/block_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@
function affich_block_login($blok){
global $user, $nuked, $bgcolor3, $bgcolor1 ;

list($login, $messpv, $members, $online, $avatar) = explode('|', $blok['content']);

if(!empty($blok['content'])){
list($login, $messpv, $members, $online, $avatar) = explode('|', $blok['content']);
}
else{
$login = $messpv = $members = $online = $avatar = 'on';
}
$blok['content'] = '';

$c = 0;

if($login != 'off'){
if (!$user){
$blok['content'] = '<form action="index.php?file=User&amp;nuked_nude=index&amp;op=login" method="post">'."\n"
Expand All @@ -42,28 +48,28 @@ function affich_block_login($blok){
$c++;
}

if($messpv != 'off' && $user[0] != ''){
if($messpv != 'off' && (array_key_exists(0, $user) && $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'] .= '&nbsp;<img width="14" height="12" src="images/message.gif" alt="" />&nbsp;<span style="text-decoration: underline"><b>' . _MESSPV . '</b></span><br />'."\n";

if ($user[5] > 0){
$blok['content'] .= '&nbsp;<b><big>·</big></b>&nbsp;' . _NOTREAD . ' : <a href="index.php?file=Userbox"><b>' . $user[5] . '</b></a>'."\n";
}
else{
$blok['content'] .= '&nbsp;<b><big>·</big></b>&nbsp;' . _NOTREAD . ' : <b>' . $user[5] . '</b>'."\n";
}

if ($nb_mess_lu > 0){
$blok['content'] .= '<br />&nbsp;<b><big>·</big></b>&nbsp;' . _READ . ' : <a href="index.php?file=Userbox"><b>' . $nb_mess_lu . '</b></a>'."\n";
}
else{
$blok['content'] .= '<br />&nbsp;<b><big>·</big></b>&nbsp;' . _READ . ' : <b>' . $nb_mess_lu . '</b>'."\n";
}

$c++;
}

Expand Down Expand Up @@ -100,33 +106,34 @@ function affich_block_login($blok){
while (list($nom) = mysql_fetch_array($sql4)){
$user_online .= '&nbsp;<b><big>·</big></b>&nbsp;<b>' . $nom . '</b><br />';
}

$user_list = '&nbsp;[<a href="#" onmouseover="AffBulle(\'&nbsp;&nbsp;' . _WHOISONLINE . '\', \'' . htmlentities(mysql_real_escape_string($user_online), ENT_NOQUOTES, 'ISO-8859-1') . '\', 150)" onmouseout="HideBulle()">' . _LIST . '</a>]';
}
else{
$user_list = '';
}

if ($nb[2] > 0){
$admin_online = '';
$sql5 = mysql_query('SELECT username FROM ' . NBCONNECTE_TABLE . ' WHERE type > 2 ORDER BY date');
while (list($name) = mysql_fetch_array($sql5)){
$admin_online .= '&nbsp;<b><big>·</big></b>&nbsp;<b>' . $name . '</b><br />';
}

$admin_list = '&nbsp;[<a href="#" onmouseover="AffBulle(\'&nbsp;&nbsp;' . _WHOISONLINE . '\', \'' . htmlentities(mysql_real_escape_string($admin_online), ENT_NOQUOTES, 'ISO-8859-1') . '\', 150)" onmouseout="HideBulle()">' . _LIST . '</a>]';
}
else{
$admin_list = '';
}

$blok['content'] .= '&nbsp;<b><big>·</big></b>&nbsp;' . _VISITOR;
if ($nb[0] > 1) $blok['content'] .= 's';
$blok['content'] .= ' : <b>' . $nb[0] . '</b><br />&nbsp;<b><big>·</big></b>&nbsp;' . _MEMBER;
if ($nb[1] > 1) $blok['content'] .= 's';
$blok['content'] .= ' : <b>' . $nb[1] . '</b>' . $user_list . '<br />&nbsp;<b><big>·</big></b>&nbsp;' . _ADMIN;
if ($nb[2] > 1) $blok['content'] .= 's';
$blok['content'] .= ' : <b>' . $nb[2] . '</b>' . $admin_list . '<br />'."\n";

$c++;
}

Expand All @@ -139,7 +146,15 @@ function edit_block_login($bid){
$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 = printSecuTags($titre);
list($login, $messpv, $members, $online, $avatar) = explode('|', $content);

if(!empty($content)){
list($login, $messpv, $members, $online, $avatar) = explode('|', $content);
}
else{
$login = $messpv = $members = $online = $avatar = 'on';
}

$checked0 = $checked1 = $checked2 = '';

if ($active == 1) $checked1 = 'selected="selected"';
else if ($active == 2) $checked2 = 'selected="selected"';
Expand Down Expand Up @@ -210,4 +225,4 @@ function modif_advanced_login($data){
$data['content'] = $data['login'] . '|' . $data['messpv'] . '|' . $data['members'] . '|' . $data['online']. '|' . $data['avatar'];
return $data;
}
?>
?>
16 changes: 12 additions & 4 deletions Includes/blocks/block_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,24 @@ function block_link($content){
$link = explode('NEWLINE', $content);
$screen = '<ul style="list-style: none; padding: 0">';
$size = count($link);

for($i=0; $i<$size; $i++){
list($url, $title, $comment, $nivo, $blank) = explode('|', $link[$i]);
$url = preg_replace("/\[(.*?)\]/si", "index.php?file=\\1", $url);
$nivuser = $user[1];
if(array_key_exists(1, $user)){
$nivuser = $user[1];
}
else{
$nivuser = 0;
}

$title = preg_replace("`&amp;lt;`i", "<", $title);
$title = preg_replace("`&amp;gt;`i", ">", $title);
$comment = nkHtmlEntities($comment);
$url = nkHtmlEntities($url);

if (!$nivuser)$nivuser = 0;

if ($nivuser >= $nivo){
if ($url <> '' && $title <> '' && $blank == 0)
$screen .= '<li><a href="' . $url . '" title="' . $comment . '" style="padding-left: 10px" class="menu">' . $title . '</a></li>';
Expand All @@ -56,6 +62,8 @@ function edit_block_menu($bid){

$content = nkHtmlEntities($content);

$checked0 = $checked1 = $checked2 = '';

if ($active == 1) $checked1 = 'selected="selected"';
else if ($active == 2) $checked2 = 'selected="selected"';
else $checked0 = 'selected="selected"';
Expand Down Expand Up @@ -100,4 +108,4 @@ function edit_block_menu($bid){
, '<div style="text-align: center;"><br />[ <a href="index.php?file=Admin&amp;page=block"><b>' , _BACK , '</b></a> ]</div></form><br /></div></div>',"\n";

}
?>
?>
18 changes: 10 additions & 8 deletions Includes/blocks/block_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ function edit_block_module($bid){
list($active, $position, $titre, $modul, $content, $type, $nivo, $pages) = mysql_fetch_array($sql);
//check des modules
$handle = opendir('modules/');

while ($mod = readdir($handle)){
if($mod != 'index.html' && file_exists('modules/'.$mod.'/blok.php')) $autorized_modules[] = $mod;
if($mod != 'index.html' && file_exists('modules/'.$mod.'/blok.php')) $autorized_modules[] = $mod;
}

if (false===array_search($modul, $autorized_modules)){
die('<br /><br /><div style="text-align: center;"><big>Blok corrupted, lease delete it!</big></div><br /><br />');
}

$titre = printSecuTags($titre);

$checked0 = $checked1 = $checked2 = $checked3 = $checked4 = '';

if ($active == 1) $checked1 = 'selected="selected"';
else if ($active == 2) $checked2 = 'selected="selected"';
else if ($active == 3) $checked3 = 'selected="selected"';
Expand Down Expand Up @@ -89,11 +91,11 @@ function edit_block_module($bid){
function inc_bl($modul, $bid){
//check des modules
$handle = opendir('modules/');

while ($mod = readdir($handle)){
if($mod != 'index.html' && file_exists('modules/'.$mod.'/blok.php')) $autorized_modules[] = $mod;
if($mod != 'index.html' && file_exists('modules/'.$mod.'/blok.php')) $autorized_modules[] = $mod;
}

if (false===array_search($modul, $autorized_modules)){
$blok_content = '';
}
Expand All @@ -106,4 +108,4 @@ function inc_bl($modul, $bid){
}
return $blok_content;
}
?>
?>
6 changes: 4 additions & 2 deletions Includes/blocks/block_suggest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ function edit_block_suggest($bid){

$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 = printSecuTags($titre);

$checked0 = $checked1 = $checked2 = '';

if ($active == 1) $checked1 = 'selected="selected"';
else if ($active == 2) $checked2 = 'selected="selected"';
else $checked0 = 'selected="selected"';
Expand Down Expand Up @@ -115,4 +117,4 @@ function edit_block_suggest($bid){
, '<div style="text-align: center;"><br />[ <a href="index.php?file=Admin&amp;page=block"><b>' , _BACK , '</b></a> ]</div></form><br /></div></div>',"\n";

}
?>
?>
6 changes: 4 additions & 2 deletions Includes/blocks/block_survey.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function affich_block_survey($blok){
if ($file != 'Survey'){
$survey_id = $blok['content'];
$blok['content'] = '';

if ($survey_id != '') $where = 'WHERE sid = \'' . $survey_id . '\' ';
else $where = 'ORDER BY sid DESC LIMIT 0, 1';

Expand Down Expand Up @@ -50,6 +50,8 @@ function edit_block_survey($bid){

$titre = printSecuTags($titre);

$checked0 = $checked1 = $checked2 = '';

if ($active == 1) $checked1 = 'selected="selected"';
else if ($active == 2) $checked2 = 'selected="selected"';
else $checked0 = 'selected="selected"';
Expand Down Expand Up @@ -104,4 +106,4 @@ function edit_block_survey($bid){
, '<div style="text-align: center;"><br />[ <a href="index.php?file=Admin&amp;page=block"><b>' , _BACK , '</b></a> ]</div></form><br /></div></div>',"\n";

}
?>
?>
5 changes: 1 addition & 4 deletions Includes/fatal_errors.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
define('THEME_NOTFOUND','Erreur fatale : Impossible de trouver le thème');
define('ERROR_QUERY','Veuillez nous excuser, le site web est actuellement indisponible !<br />Information :<br />Connexion SQL impossible.');
define('ERROR_QUERYDB','Veuillez nous excuser, le site web est actuellement indisponible !<br />Information :<br />Nom de base de données sql incorrect.');
define('ERROR_SQL', '<b>Une erreur SQL a été détectée.<br /><br />Information :<br /><br />Mon ERREUR</b> [' . $errno . '] ' . $errstr . '<br />Erreur fatale sur la ligne ' . $errline . ' dans le fichier ' . $errfile . ', PHP ' . PHP_VERSION . ' (' . PHP_OS . ')<br />Arrêt...<br />');
define('WBSITE_CLOSED','Ce site est momentanément fermé, merci de réessayer plus tard');
define('WAYTODO', 'Qu\'essayez vous de faire ?');
define('REMOVEDIRINST', 'Veuillez supprimer le dossier d\'installation de Nuked-Klan (/INSTALL/)');
Expand All @@ -17,11 +16,9 @@
define('THEME_NOTFOUND','Fatal error : No theme found');
define('ERROR_QUERY','Sorry but the website is not available !<br />Information :<br />SQL connection impossible.');
define('ERROR_QUERYDB','Sorry but the website is not available !<br />Information :<br />Database SQL name incorrect.');
define('ERROR_SQL', '<b>A SQL error has been detected.<br /><br />Information:<br /><br />My ERROR</b> [' . $errno . '] ' . $errstr . '<br />Fatal error on the line ' . $errline . ', file ' . $errfile . ', PHP ' . PHP_VERSION . ' (' . PHP_OS . ')<br />Stop...<br />');
define('WBSITE_CLOSED', 'Sorry, this website is momently closed, Please try again later.');
define('WAYTODO', 'What are you trying to do ?');
define('REMOVEDIRINST', 'Please delete Nuked-Klan\'s installation folder (/INSTALL/)');
define('REMOVEINST', 'Please delete your installation files for modules or patches (install.php or update.php)');
define('DBPREFIX_ERROR', 'Can\'t connect to the database ! Check that $db_prefix variable on conf.inc.php file match with your prefix tables.');
}
?>
?>
4 changes: 2 additions & 2 deletions Includes/hash.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @return string hashed pass
**/
function nk_hash($pass, $decal = null){
$bulder = '';
$builder = '';
$decal = $decal === null?rand(0, 15):$decal;
$pass = sha1($pass);
for ($i = 0; $i < strlen($pass) * 2; $i++){
Expand Down Expand Up @@ -53,4 +53,4 @@ function FileList($dir){
}
return $return;
}
?>
?>
Loading

0 comments on commit 80905a4

Please sign in to comment.