} echo ' <hr /> <table id ="lst_art_arch" data-toggle="table" data-striped="true" data-search="true" data-show-toggle="true" data-mobile-responsive="true" data-icons-prefix="fa" data-icons="icons"> <thead> <tr> <th data-sortable="true" data-halign="center">' . translate("Articles") . '</th> <th data-sortable="true" data-halign="center" data-align="right">' . translate("reads") . '</th> <th data-halign="center" data-align="right">' . translate("Posted on") . '</th> <th data-sortable="true" data-halign="center" data-align="right">' . translate("Author") . '</th> <th data-halign="center" data-align="right">' . translate("Functions") . '</th> </tr> </thead> <tbody>'; if (!isset($count)) { $result0 = Q_select("SELECT COUNT(sid) AS count FROM " . $NPDS_Prefix . "stories WHERE archive='{$arch}'", 3600); list(, $count) = each($result0); $count = $count['count']; } if ($arch == 0) { $xtab = news_aff("libre", "WHERE archive='{$arch}' ORDER BY sid DESC LIMIT {$start},{$maxcount}", $start, $maxcount); } else { $xtab = news_aff("archive", "WHERE archive='{$arch}' ORDER BY sid DESC LIMIT {$start},{$maxcount}", $start, $maxcount); } $ibid = 0; $story_limit = 0; while ($story_limit < $maxcount and $story_limit < sizeof($xtab)) { list($s_sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant) = $xtab[$story_limit]; $story_limit++; if ($catid != 0) { list($cattitle) = sql_fetch_row(sql_query("SELECT title FROM " . $NPDS_Prefix . "stories_cat WHERE catid='{$catid}'"));
function makeChatBox() { global $user, $admin, $member_list, $long_chain; global $NPDS_Prefix; include_once 'functions.php'; $auto = autorisation_block("makeChatBox"); $dimauto = count($auto); if (!$long_chain) { $long_chain = 12; } $thing = ''; $une_ligne = false; if ($dimauto <= 1) { $counter = sql_num_rows(sql_query("SELECT message FROM " . $NPDS_Prefix . "chatbox WHERE id='" . $auto[0] . "'")) - 6; if ($counter < 0) { $counter = 0; } $result = sql_query("SELECT username, message, dbname FROM " . $NPDS_Prefix . "chatbox WHERE id='" . $auto[0] . "' ORDER BY date ASC LIMIT {$counter},6"); if ($result) { while (list($username, $message, $dbname) = sql_fetch_row($result)) { if (isset($username)) { if ($dbname == 1) { if (!$user and $member_list == 1 and !$admin) { $thing .= '<span class="">' . substr($username, 0, 8) . '.</span>'; } else { $thing .= "<a href=\"user.php?op=userinfo&uname={$username}\">" . substr($username, 0, 8) . ".</a>"; } } else { $thing .= '<span class="">' . substr($username, 0, 8) . '.</span>'; } } $une_ligne = true; if (strlen($message) > $long_chain) { $thing .= "> <span>" . smilie(stripslashes(substr($message, 0, $long_chain))) . " </span><br />\n"; } else { $thing .= "> <span>" . smilie(stripslashes($message)) . " </span><br />\n"; } } } $PopUp = JavaPopUp("chat.php?id=" . $auto[0] . "&auto=" . encrypt(serialize($auto[0])), "chat" . $auto[0], 380, 480); if ($une_ligne) { $thing .= '<hr class="" />'; } // $thing.='<a href="javascript:void(0);" onclick="window.open('.$PopUp.');" title="'.translate("click here to open the chat window...").'" data-toggle="tooltip"><i class="fa fa-comments fa-2x "></i></a>'; $result = sql_query("SELECT DISTINCT ip FROM " . $NPDS_Prefix . "chatbox WHERE id='" . $auto[0] . "' AND date >= " . (time() - 60 * 2) . ""); $numofchatters = sql_num_rows($result); if ($numofchatters > 0) { $thing .= '<a class=" nav-link faa-pulse animated faa-slow" href="javascript:void(0);" onclick="window.open(' . $PopUp . ');" title="' . translate("click here to open the chat window...") . '" data-toggle="tooltip" data-placement="right"><i class="fa fa-comments fa-2x "></i></a><span class="tag tag-pill tag-primary pull-right" title="' . translate("person chatting right now.") . '" data-toggle="tooltip">' . $numofchatters . '</span> '; } else { $thing .= '<a href="javascript:void(0);" onclick="window.open(' . $PopUp . ');" title="' . translate("click here to open the chat window...") . '" data-toggle="tooltip" data-placement="right"><i class="fa fa-comments fa-2x "></i></a>'; } } else { if (count($auto) > 1) { $numofchatters = 0; $thing .= '<ul>'; foreach ($auto as $autovalue) { $result = Q_select("SELECT groupe_id, groupe_name FROM " . $NPDS_Prefix . "groupes WHERE groupe_id='{$autovalue}'", 3600); list(, $autovalueX) = each($result); $PopUp = JavaPopUp("chat.php?id=" . $autovalueX['groupe_id'] . "&auto=" . encrypt(serialize($autovalueX['groupe_id'])), "chat" . $autovalueX['groupe_id'], 380, 480); $thing .= "<li><a href=\"javascript:void(0);\" onclick=\"window.open({$PopUp});\">" . $autovalueX['groupe_name'] . "</a>"; $result = sql_query("SELECT DISTINCT ip FROM " . $NPDS_Prefix . "chatbox WHERE id='" . $autovalueX['groupe_id'] . "' AND date >= " . (time() - 60 * 3) . ""); $numofchatters = sql_num_rows($result); if ($numofchatters) { $thing .= ' (<span class="text-danger"><b>' . sql_num_rows($result) . '</b></span>)'; } echo '</li>'; } $thing .= '</ul>'; } } global $block_title; if ($block_title == '') { $block_title = translate("Chat box"); } themesidebox($block_title, $thing); sql_free_result($result); }
$sel = ""; } $chmod .= "<option name=\"{$champ}\" value=\"777\" {$sel}> 777 (rwxrwxrwx)</option>"; $chmod .= "</select>"; return $chmod; } // Lancement sur un Repertoire en fonction d'un fichier de conf particulier if ($FmaRep) { if (filtre_module($FmaRep)) { // Si je ne trouve pas de fichier - est-ce que l'utilisateur fait partie d'un groupe ? if (!file_exists("modules/{$ModPath}/users/" . strtolower($FmaRep) . ".conf.php")) { $tab_groupe = valid_group($user); if ($tab_groupe) { // si j'ai au moins un groupe est ce que celui-ci dispose d'un fichier de configuration ? - je m'arrête au premier groupe ! while (list(, $gp) = each($tab_groupe)) { $groupename = Q_select("select groupe_name from " . $NPDS_Prefix . "groupes where groupe_id='{$gp}' ORDER BY `groupe_id` ASC", 3600); if (file_exists("modules/{$ModPath}/users/" . $groupename[0]['groupe_name'] . ".conf.php")) { $FmaRep = $groupename[0]['groupe_name']; break; } } } } if (file_exists("modules/{$ModPath}/users/" . strtolower($FmaRep) . ".conf.php")) { // Est ce que je doit récupérer le theme si un utilisateur est connecté ? if (isset($user)) { include "themes/list.php"; $themelist = explode(' ', $themelist); $pos = array_search($cookie[9], $themelist); if ($pos !== false) { $Default_Theme = $themelist[$pos];
function auto_complete($nom_array_js, $nom_champ, $nom_tabl, $id_inpu, $temps_cache) { global $NPDS_Prefix; $list_json = ''; $list_json .= 'var ' . $nom_array_js . ' = ['; $res = Q_select("SELECT " . $nom_champ . " FROM " . $NPDS_Prefix . $nom_tabl, $temps_cache); while (list(, $ar_data) = each($res)) { foreach ($ar_data as $val_champ) { $list_json .= '"' . $val_champ . '",'; } } $list_json = rtrim($list_json, ','); $list_json .= '];'; $scri_js = ''; $scri_js .= ' <script type="text/javascript"> //<![CDATA[ ' . $list_json; if ($id_inpu != '') { $scri_js .= ' $( "#' . $id_inpu . '" ).autocomplete({ source: ' . $nom_array_js . ' });'; } $scri_js .= ' //]]> </script>'; return $scri_js; }
function auto_complete($nom_array_js, $nom_champ, $nom_tabl, $id_inpu, $temps_cache) { global $NPDS_Prefix; $list_json = ''; $list_json .= 'var ' . $nom_array_js . ' = ['; $res = Q_select("select " . $nom_champ . " from " . $NPDS_Prefix . $nom_tabl, $temps_cache); while (list(, $ar_data) = each($res)) { foreach ($ar_data as $val_champ) { $list_json .= '"' . $val_champ . '",'; } } $list_json = rtrim($list_json, ','); $list_json .= '];'; $scri_js = ''; $scri_js .= "\n <script type=\"text/javascript\">\n //<![CDATA[\n " . $list_json . "\n\n \$( '#" . $id_inpu . "' ).autocomplete({\n source: " . $nom_array_js . "\n });\n //]]>\n </script>\n"; return $scri_js; }