Exemple #1
0
function fab_feed($type, $filename, $timeout)
{
    global $sitename, $slogan, $nuke_url, $backend_image, $backend_title, $backend_width, $backend_height, $backend_language, $storyhome;
    include "lib/feedcreator.class.php";
    $rss = new UniversalFeedCreator();
    $rss->useCached($type, $filename, $timeout);
    $rss->title = $sitename;
    $rss->description = $slogan;
    $rss->descriptionTruncSize = 250;
    $rss->descriptionHtmlSyndicated = true;
    $rss->link = $nuke_url;
    $rss->syndicationURL = $nuke_url . "/backend.php?op=" . $type;
    $image = new FeedImage();
    $image->title = $sitename;
    $image->url = $backend_image;
    $image->link = $nuke_url;
    $image->description = $backend_title;
    $image->width = $backend_width;
    $image->height = $backend_height;
    $rss->image = $image;
    $xtab = news_aff("index", "where ihome='0' and archive='0'", $storyhome, "");
    $story_limit = 0;
    while ($story_limit < $storyhome and $story_limit < sizeof($xtab)) {
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[$story_limit];
        $story_limit++;
        $item = new FeedItem();
        $item->title = preview_local_langue($backend_language, str_replace("&quot;", "\"", $title));
        $item->link = $nuke_url . "/article.php?sid={$sid}";
        $item->description = meta_lang(preview_local_langue($backend_language, $hometext));
        $item->descriptionHtmlSyndicated = true;
        $item->date = convertdateTOtimestamp($time) + $gmt * 3600;
        $item->source = $nuke_url;
        $item->author = $aid;
        $rss->addItem($item);
    }
    echo $rss->saveFeed($type, $filename);
}
Exemple #2
0
<?php

/************************************************************** **********/
/* Modification par Jireck      BaseRoc                                          */
/* 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.       */
/************************************************************************/
global $theme;
$rep = false;
if (file_exists("themes/" . $theme . "/html/central.html")) {
    $rep = $theme;
} elseif (file_exists("themes/default/html/central.html")) {
    $rep = "default";
} else {
    echo "central.html manquant / not find !< br />";
    die;
}
if ($rep) {
    ob_start();
    include "themes/" . $rep . "/html/central.html";
    $Xcontent = ob_get_contents();
    ob_end_clean();
    echo meta_lang(aff_langue($Xcontent));
}
Exemple #3
0
function previewStory($qid, $uid, $author, $subject, $hometext, $bodytext, $topic, $notes, $catid, $ihome, $members, $Mmembers, $deb_day, $deb_month, $deb_year, $deb_hour, $deb_min, $fin_day, $fin_month, $fin_year, $fin_hour, $fin_min, $epur)
{
    global $NPDS_Prefix;
    global $tipath, $hlpfile, $language, $aid, $radminsuper;
    $hlpfile = "manuels/{$language}/newarticle.html";
    $subject = stripslashes(str_replace('"', '&quot;', $subject));
    $hometext = stripslashes($hometext);
    $bodytext = stripslashes($bodytext);
    $notes = stripslashes($notes);
    if ($topic < 1) {
        $topic = 1;
    }
    $affiche = false;
    $result2 = sql_query("SELECT topictext, topicimage, topicadmin FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'");
    list($topictext, $topicimage, $topicadmin) = sql_fetch_row($result2);
    if ($radminsuper) {
        $affiche = true;
    } else {
        $topicadminX = explode(',', $topicadmin);
        for ($i = 0; $i < count($topicadminX); $i++) {
            if (trim($topicadminX[$i]) == $aid) {
                $affiche = true;
            }
        }
    }
    if (!$affiche) {
        header("location: admin.php?op=submissions");
    }
    $topiclogo = '<span class="label label-default pull-right"><strong>' . aff_langue($topictext) . '</strong></span>';
    include 'header.php';
    GraphicAdmin($hlpfile);
    global $local_user_language;
    echo '
    <h3>' . adm_translate("Prévisualiser l'Article") . '</h3>
    <form action="admin.php" method="post" name="adminForm">
    
   <label class="form-control-label">' . adm_translate("Langue de Prévisualisation") . '</label> : ' . aff_localzone_langue("local_user_language");
    echo '<div class="card card-block">';
    if ($topicimage !== '') {
        if (!($imgtmp = theme_image('topics/' . $topicimage))) {
            $imgtmp = $tipath . $topicimage;
        }
        $timage = $imgtmp;
        if (file_exists($imgtmp)) {
            $topiclogo = '<img class="img-fluid N_sujetsize" src="' . $timage . '" align="right" alt="" />';
        }
    }
    code_aff('<h3>' . $subject . $topiclogo . '</h3>', '<div class="text-muted">' . meta_lang($hometext) . '</div>', meta_lang($bodytext), meta_lang($notes));
    echo '
    <label class="form-control-label col-sm-4">' . adm_translate("Utilisateur") . '</label>
    <input class="textbox_standard" type="text" name="author" size="50" value="' . $author . '" />
    <label class="form-control-label col-sm-4">' . adm_translate("Titre") . '</label>
    <input class="textbox" type="text" name="subject" size="50" value="' . $subject . '" />
    <label class="form-control-label col-sm-4">' . adm_translate("Sujet") . '</label>
    <select class="c-select form-control" name="topic">';
    $toplist = sql_query("SELECT topicid, topictext, topicadmin FROM " . $NPDS_Prefix . "topics ORDER BY topictext");
    if ($radminsuper) {
        echo '
    <option value="">' . adm_translate("Tous les Sujets") . '</option>';
    }
    while (list($topicid, $topics, $topicadmin) = sql_fetch_row($toplist)) {
        $affiche = false;
        if ($radminsuper) {
            $affiche = true;
        } else {
            $topicadminX = explode(',', $topicadmin);
            for ($i = 0; $i < count($topicadminX); $i++) {
                if (trim($topicadminX[$i]) == $aid) {
                    $affiche = true;
                }
            }
        }
        if ($affiche) {
            if ($topicid == $topic) {
                $sel = 'selected="selected" ';
            }
            echo '
          <option ' . $sel . ' value="' . $topicid . '">' . aff_langue($topics) . '</option>';
            $sel = '';
        }
    }
    echo '
    </select>';
    SelectCategory($catid);
    echo '<br />';
    if ($members == 1 and $Mmembers == '') {
        $ihome = "-127";
    }
    if ($members == 1 and ($Mmembers > 1 and $Mmembers <= 127)) {
        $ihome = $Mmembers;
    }
    puthome($ihome);
    closetable2();
    echo '<br /><b>' . adm_translate("Texte d'introduction") . '</b> :<br />
    <textarea class="tin form-control" cols="70" rows="25" name="hometext" >' . $hometext . '</textarea>';
    echo aff_editeur('hometext', '');
    echo '<br /><b>' . adm_translate("Texte étendu") . '</b> :<br />
    <textarea class="tin form-control" cols="70" rows="25" name="bodytext" >' . $bodytext . '</textarea>';
    echo aff_editeur('bodytext', '');
    echo '<br /><b>' . adm_translate("Notes") . '</b> :<br />
    <textarea class="tin form-control" cols="70" rows="7" name="notes" >' . $notes . '</textarea>';
    echo aff_editeur('notes', '');
    publication($deb_day, $deb_month, $deb_year, $deb_hour, $deb_min, $fin_day, $fin_month, $fin_year, $fin_hour, $fin_min, $epur);
    echo '
    <input type="hidden" name="qid" value="' . $qid . '" />
    <input type="hidden" name="uid" value="' . $uid . '" />
    <br /><select class="c-select form-control" name="op">
    <option value="DeleteStory">' . adm_translate(" Effacer l'Article ") . '</option>
    <option value="PreviewAgain" selected="selected">' . adm_translate(" Re-prévisualiser ") . '</option>
    <option value="PostStory">' . adm_translate("Poster un Article ") . '</option>
    </select>
    <input class="btn btn primary" type="submit" value="' . adm_translate("Ok") . '" /></form>';
    closetable();
    include 'footer.php';
}
Exemple #4
0
$remp = '';
include "header.php";
echo '<div id="static_cont">';
if ($op != '' and $op) {
    // Troll Control for security
    if (preg_match('#^[a-z0-9_\\.-]#i', $op) and !stristr($op, ".*://") and !stristr($op, "..") and !stristr($op, "../") and !stristr($op, "script") and !stristr($op, "cookie") and !stristr($op, "iframe") and !stristr($op, "applet") and !stristr($op, "object") and !stristr($op, "meta")) {
        if (file_exists("static/{$op}")) {
            if (!$metalang and !$nl) {
                include "static/{$op}";
            } else {
                ob_start();
                include "static/{$op}";
                $remp = ob_get_contents();
                ob_end_clean();
                if ($metalang) {
                    $remp = meta_lang(aff_code(aff_langue($remp)));
                }
                if ($nl) {
                    $remp = nl2br(str_replace(' ', '&nbsp;', htmlentities($remp, ENT_QUOTES, cur_charset)));
                }
                echo $remp;
            }
            if (!($imgtmp = theme_image("box/print.gif"))) {
                $imgtmp = "images/print.gif";
            }
            echo '<p><a href="print.php?sid=static:' . $op . '&amp;metalang=' . $metalang . '&amp;nl=' . $nl . '" title="' . translate("Printer Friendly Page") . '"><i class="fa fa-2x fa-print"></i></a></p>';
            // Si vous voulez tracer les appels au pages statiques : supprimer les // devant la ligne ci-dessous
            // Ecr_Log("security", "static/$op", "");
        } else {
            echo "<p class=\"text-danger text-xs-center\">" . translate("Please enter information according to the specifications") . "</p>";
        }
Exemple #5
0
function fab_edito()
{
    global $cookie;
    if (isset($cookie[3])) {
        if (file_exists("static/edito_membres.txt")) {
            $fp = fopen("static/edito_membres.txt", "r");
            if (filesize("static/edito_membres.txt") > 0) {
                $Xcontents = fread($fp, filesize("static/edito_membres.txt"));
            }
            fclose($fp);
        } else {
            if (file_exists("static/edito.txt")) {
                $fp = fopen("static/edito.txt", "r");
                if (filesize("static/edito.txt") > 0) {
                    $Xcontents = fread($fp, filesize("static/edito.txt"));
                }
                fclose($fp);
            }
        }
    } else {
        if (file_exists("static/edito.txt")) {
            $fp = fopen("static/edito.txt", "r");
            if (filesize("static/edito.txt") > 0) {
                $Xcontents = fread($fp, filesize("static/edito.txt"));
            }
            fclose($fp);
        }
    }
    $affich = false;
    $Xibid = strstr($Xcontents, "aff_jours");
    if ($Xibid) {
        parse_str($Xibid);
        if ($aff_date + $aff_jours * 86400 - time() > 0) {
            $affichJ = false;
            $affichN = false;
            if (NightDay() == "Jour" and $aff_jour == "checked") {
                $affichJ = true;
            }
            if (NightDay() == "Nuit" and $aff_nuit == "checked") {
                $affichN = true;
            }
        }
        $XcontentsT = substr($Xcontents, 0, strpos($Xcontents, "aff_jours"));
        $contentJ = substr($XcontentsT, strpos($XcontentsT, "[jour]") + 6, strpos($XcontentsT, "[/jour]") - 6);
        $contentN = substr($XcontentsT, strpos($XcontentsT, "[nuit]") + 6, strpos($XcontentsT, "[/nuit]") - 19 - strlen($contentJ));
        $Xcontents = '';
        if ($affichJ) {
            $Xcontents = $contentJ;
        }
        if ($affichN) {
            if ($contentN != '') {
                $Xcontents = $contentN;
            } else {
                $Xcontents = $contentJ;
            }
        }
        if ($Xcontents != '') {
            $affich = true;
        }
    } else {
        $affich = true;
    }
    $Xcontents = meta_lang(aff_langue($Xcontents));
    return array($affich, $Xcontents);
}
Exemple #6
0
function finishNewUser($uname, $name, $email, $user_avatar, $user_icq, $user_occ, $user_from, $user_intrest, $user_sig, $user_viewemail, $user_aim, $user_yim, $user_msnm, $pass, $user_lnl, $C1, $C2, $C3, $C4, $C5, $C6, $C7, $C8, $M1, $M2, $T1, $T2, $B1)
{
    global $NPDS_Prefix;
    global $makepass, $system, $adminmail, $sitename, $AutoRegUser, $memberpass, $gmt;
    $stop = userCheck($uname, $email);
    $user_regdate = time() + $gmt * 3600;
    $stop = userCheck($uname, $email);
    if (!$stop) {
        include "header.php";
        if (!$memberpass) {
            $makepass = makepass();
        } else {
            $makepass = $pass;
        }
        if (!$system) {
            $cryptpass = crypt($makepass, $makepass);
        } else {
            $cryptpass = $makepass;
        }
        $result = sql_query("INSERT INTO " . $NPDS_Prefix . "users VALUES (NULL,'{$name}','{$uname}','{$email}','','','{$user_avatar}','{$user_regdate}','{$user_icq}','{$user_occ}','{$user_from}','{$user_intrest}','{$user_sig}','{$user_viewemail}','','{$user_aim}','{$user_yim}','{$user_msnm}','','{$cryptpass}','10','','0','0','0','','0','','','10','0','0','1','0','','','{$user_lnl}')");
        list($usr_id) = sql_fetch_row(sql_query("SELECT uid FROM " . $NPDS_Prefix . "users WHERE uname='{$uname}'"));
        $result = sql_query("INSERT INTO " . $NPDS_Prefix . "users_extend VALUES ('{$usr_id}','{$C1}','{$C2}','{$C3}','{$C4}','{$C5}','{$C6}','{$C7}','{$C8}','{$M1}','{$M2}','{$T1}','{$T2}', '{$B1}')");
        if ($user_sig) {
            $attach = 1;
        } else {
            $attach = 0;
        }
        if ($AutoRegUser == 1 or !isset($AutoRegUser)) {
            $result = sql_query("INSERT INTO " . $NPDS_Prefix . "users_status VALUES ('{$usr_id}','0','{$attach}','0','1','1','')");
        } else {
            $result = sql_query("INSERT INTO " . $NPDS_Prefix . "users_status VALUES ('{$usr_id}','0','{$attach}','0','1','0','')");
        }
        if ($result) {
            if ($system == 1 or $memberpass) {
                echo '<h2>' . translate("User") . '</h2>';
                echo '<h2><i class="fa fa-user"></i>&nbsp;Inscription</h2>';
                echo "<p class=\"lead\">" . translate("Your Password is: ") . "<strong>{$makepass}</strong></p>";
                echo "<p class=\"lead\">" . translate("You can change it after you login at") . " : <a href=\"user.php?op=login&uname={$uname}&pass={$makepass}\"><strong>{$sitename}</strong></a></p>";
            } else {
                $message = "" . translate("Welcome to") . " {$sitename} !\n\n" . translate("You or someone else has used your email account") . " ({$email}) " . translate("to register an account at") . " {$sitename}.\n\n" . translate("The following is the member information:") . "\n" . translate("-Nickname: ") . " {$uname}\n" . translate("-Password: "******" {$makepass}\n\n";
                include "signat.php";
                $subject = "" . translate("User Password for") . " {$uname}";
                send_email($email, $subject, $message, "", true, "html");
                echo '<h2>' . translate("User") . '</h2>';
                echo '<h2><i class="fa fa-user"></i>&nbsp;Inscription</h2>';
                echo '<p class="lead text-info"><i class="fa fa-exclamation"></i>&nbsp;' . translate("You are now registered. You should receive your password at the email account you provided.") . '</p>';
            }
            //------------------------------------------------
            if (file_exists("modules/include/new_user.inc")) {
                include "modules/include/new_user.inc";
                global $gmt;
                $time = date(translate("dateinternal"), time() + $gmt * 3600);
                $message = meta_lang(AddSlashes(str_replace("\n", "<br />", $message)));
                $sql = "INSERT INTO " . $NPDS_Prefix . "priv_msgs (msg_image, subject, from_userid, to_userid, msg_time, msg_text) ";
                $sql .= "VALUES ('', '{$sujet}', '{$emetteur_id}', '{$usr_id}', '{$time}', '{$message}')";
                sql_query($sql);
            }
            //------------------------------------------------
            //modif debut envoyer un mel à l'admin
            send_email($adminmail, "Inscription sur {$sitename}", "Infos :\n      Nom : {$name}\n      ID : {$uname}\n      Password : {$makepass}\n      Email : {$email}", false, "text");
            //modif pour envoyer un mel à l'admin
        }
        include "footer.php";
    } else {
        message_error($stop, "finish");
    }
}
Exemple #7
0
    $cache_obj->startCachingPage();
} else {
    $cache_obj = new SuperCacheEmpty();
}
if ($cache_obj->genereting_output == 1 or $cache_obj->genereting_output == -1 or !$SuperCache) {
    $title = aff_langue(stripslashes($title));
    $hometext = aff_code(aff_langue(stripslashes($hometext)));
    $bodytext = aff_code(aff_langue(stripslashes($bodytext)));
    $notes = aff_code(aff_langue(stripslashes($notes)));
    if ($notes != '') {
        $notes = '<div class="note">' . translate("Note") . ' : "' . $notes . '"</div>';
    }
    if ($bodytext == '') {
        $bodytext = meta_lang($hometext . '<br />' . $notes);
    } else {
        $bodytext = meta_lang($hometext . '<br />' . $bodytext . '<br />' . $notes);
    }
    if ($informant == '') {
        $informant = $anonymous;
    }
    getTopics($sid);
    if ($catid != 0) {
        $resultx = sql_query("SELECT title FROM " . $NPDS_Prefix . "stories_cat WHERE catid='{$catid}'");
        list($title1) = sql_fetch_row($resultx);
        $title = '<a href="index.php?op=newindex&amp;catid=' . $catid . '"><span class="noir">' . aff_langue($title1) . '</span></a> : ' . $title;
    }
    $boxtitle = translate("Related Links");
    $boxstuff = '
      <ul>';
    $result = sql_query("SELECT name, url FROM " . $NPDS_Prefix . "related WHERE tid='{$topic}'");
    while (list($name, $url) = sql_fetch_row($result)) {
Exemple #8
0
function faq_show($id_cat)
{
    global $NPDS_Prefix;
    push_header("suite");
    $result = sql_query("select categories FROM " . $NPDS_Prefix . "faqcategories where id_cat='{$id_cat}'");
    list($categories) = sql_fetch_row($result);
    $categories = str_replace("'", "\\'", $categories);
    echo "document.write('<p align=\"center\"><a name=\"{$id}\"></a><b>" . aff_langue($categories) . "</b></p>');\n";
    $result = sql_query("select id, id_cat, question, answer from " . $NPDS_Prefix . "faqanswer where id_cat='{$id_cat}'");
    while (list($id, $id_cat, $question, $answer) = sql_fetch_row($result)) {
        $question = str_replace("'", "\\'", $question);
        echo "document.write('<b>" . aff_langue($question) . "</b>');\n";
        echo "document.write('<p align=\"justify\">" . links(convert_nl(str_replace("'", "\\'", meta_lang(aff_code(aff_langue($answer)))), "win", "html")) . "</p><br />');\n";
    }
    echo "document.write('.: <a href=\"javascript: history.go(0)\" style=\"font-size: 11px;\">" . push_translate("Home") . "</a> :.');\n";
    push_footer();
    sql_free_result($result);
}
Exemple #9
0
function PrintPage($oper, $DB, $nl, $sid)
{
    global $user, $cookie, $theme, $Default_Theme, $language, $site_logo, $sitename, $datetime, $nuke_url, $site_font, $Titlesitename;
    global $NPDS_Prefix;
    $aff = true;
    if ($oper == 'news') {
        $xtab = news_aff("libre", "where sid='{$sid}'", 1, 1);
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[0];
        if ($topic != '') {
            $result2 = sql_query("SELECT topictext FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'");
            list($topictext) = sql_fetch_row($result2);
        } else {
            $aff = false;
        }
    }
    if ($oper == 'archive') {
        $xtab = news_aff("archive", "WHERE sid='{$sid}'", 1, 1);
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[0];
        if ($topic != "") {
            $result2 = sql_query("SELECT topictext FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'");
            list($topictext) = sql_fetch_row($result2);
        } else {
            $aff = false;
        }
    }
    if ($oper == "links") {
        $DB = removeHack(stripslashes(htmlentities(urldecode($DB), ENT_NOQUOTES, cur_charset)));
        $result = sql_query("SELECT url, title, description, date FROM " . $DB . "links_links WHERE lid='{$sid}'");
        list($url, $title, $description, $time) = sql_fetch_row($result);
        $title = stripslashes($title);
        $description = stripslashes($description);
    }
    if ($oper == "static") {
        if (preg_match('#^[a-z0-9_\\.-]#i', $sid) and !stristr($sid, ".*://") and !stristr($sid, "..") and !stristr($sid, "../") and !stristr($sid, "script") and !stristr($sid, "cookie") and !stristr($sid, "iframe") and !stristr($sid, "applet") and !stristr($sid, "object") and !stristr($sid, "meta")) {
            if (file_exists("static/{$sid}")) {
                ob_start();
                include "static/{$sid}";
                $remp = ob_get_contents();
                ob_end_clean();
                if ($DB) {
                    $remp = meta_lang(aff_code(aff_langue($remp)));
                }
                if ($nl) {
                    $remp = nl2br(str_replace(" ", "&nbsp;", htmlentities($remp, ENT_QUOTES, cur_charset)));
                }
                $title = $sid;
            } else {
                $aff = false;
            }
        } else {
            $remp = "<p align=\"center\" class=\"rouge\">" . translate("Please enter information according to the specifications") . "</p><br />";
            $aff = false;
        }
    }
    if ($aff == true) {
        $Titlesitename = "NPDS - " . translate("Printer Friendly Page") . " / " . $title;
        if (isset($time)) {
            formatTimestamp($time);
        }
        include "meta/meta.php";
        if (isset($user)) {
            if ($cookie[9] == "") {
                $cookie[9] = $Default_Theme;
            }
            if (isset($theme)) {
                $cookie[9] = $theme;
            }
            $tmp_theme = $cookie[9];
            if (!($file = @opendir("themes/{$cookie['9']}"))) {
                $tmp_theme = $Default_Theme;
            }
        } else {
            $tmp_theme = $Default_Theme;
        }
        echo import_css($tmp_theme, $language, $site_font, "", "");
        echo "\n       </head>\n       <body style=\"background-color: #FFFFFF; background-image: none;\">\n       <table border=\"0\"><tr><td>\n       <table border=\"0\" width=\"640\" cellpadding=\"0\" cellspacing=\"1\" style=\"background-color: #000000;\"><tr><td>\n       <table border=\"0\" width=\"640\" cellpadding=\"20\" cellspacing=\"1\" style=\"background-color: #FFFFFF;\"><tr><td>";
        echo "<p align=\"center\">";
        $pos = strpos($site_logo, "/");
        if ($pos) {
            echo "<img src=\"{$site_logo}\" border=\"0\" alt=\"\" />";
        } else {
            echo "<img src=\"images/{$site_logo}\" border=\"0\" alt=\"\" />";
        }
        echo "<br /><br /><b>" . aff_langue($title) . "</b><br /><br />";
        if ($oper == "news" or $oper == "archive") {
            $hometext = meta_lang(aff_code(aff_langue($hometext)));
            $bodytext = meta_lang(aff_code(aff_langue($bodytext)));
            echo "<span style=\"font-size: 10px;\"><b>" . translate("Date:") . "</b> {$datetime} :: <b>" . translate("Topic:") . "</b> " . aff_langue($topictext) . "<br /><br />\n          </span></p>{$hometext}<br /><br />";
            if ($bodytext != '') {
                echo "{$bodytext}<br /><br />";
            }
            echo meta_lang(aff_code(aff_langue($notes)));
            if ($oper == "news") {
                echo "</td></tr><tr><td><br /><br /><br /><hr noshade=\"noshade\" class=\"ongl\" /><br />\n             <p align=\"center\">" . translate("This article comes from") . " {$sitename}<br /><br />\n             " . translate("The URL for this story is:") . "\n             <a href=\"{$nuke_url}/article.php?sid={$sid}\">{$nuke_url}/article.php?sid={$sid}</a></p>";
            } else {
                echo "</td></tr><tr><td><br /><br /><br /><hr noshade=\"noshade\" class=\"ongl\" /><br />\n             <p align=\"center\">" . translate("This article comes from") . " {$sitename}<br /><br />\n             " . translate("The URL for this story is:") . "\n             <a href=\"{$nuke_url}/article.php?sid={$sid}&amp;archive=1\">{$nuke_url}/article.php?sid={$sid}&amp;archive=1</a></p>";
            }
        }
        if ($oper == "links") {
            echo "<span style=\"font-size: 10px;\"><b>" . translate("Date:") . "</b> {$datetime}";
            if ($url != "") {
                echo " :: <b>" . translate("Links") . " : </b> {$url}<br /><br />";
            }
            echo "</span></p>" . aff_langue($description);
            echo "</td></tr><tr><td><br /><br /><br /><hr noshade=\"noshade\" class=\"ongl\" /><br />\n          <p align=\"center\">" . translate("This article comes from") . " {$sitename}<br /><br />\n          <a href=\"{$nuke_url}\">{$nuke_url}</a></p>";
        }
        if ($oper == "static") {
            echo "</p><span style=\"font-size: 10px;\">" . $remp . "</span>";
            echo "</td></tr><tr><td><br /><br /><br /><hr noshade=\"noshade\" class=\"ongl\" /><br />\n          <p align=\"center\">" . translate("This article comes from") . " {$sitename}<br /><br />\n          <a href=\"{$nuke_url}/static.php?op={$sid}&npds=1\">{$nuke_url}/static.php?op={$sid}&npds=1</a></p>";
        }
        echo "</td></tr></table></td></tr></table></td></tr></table></body></html>";
    } else {
        header("location: index.php");
    }
}
Exemple #10
0
        }
        $Fcontent = "";
        if (strstr($Xcontent, "!l_footer!")) {
            $l_fic = $dir . "footer.html";
            if (file_exists($l_fic)) {
                $fp = fopen($l_fic, "r");
                if (filesize($l_fic) > 0) {
                    $Fcontent = convert_ressources(fread($fp, filesize($l_fic)));
                }
                fclose($fp);
            }
        }
        if ($adminblog and strstr($Xcontent, "!l_blog_ajouter!")) {
            $blog_ajouter = "!l_blog_ajouterOK!";
        } else {
            $blog_ajouter = "";
        }
        $Xcontent = convert_ressources($Xcontent);
        // Meta-lang et removehack local
        $MNS_METALANG_words = array("'!l_header!'i" => "{$Hcontent}", "'!l_footer!'i" => "{$Fcontent}", "'!blog_page!{$perpage}'i" => "", "'!l_compteur!'i" => "{$cpt}", "'!l_new_pages!'i" => "{$new_pages}", "'!l_blog_ajouter!'i" => "{$blog_ajouter}", "'!blog!'i" => "{$content}", "'!copyright!'i" => "{$copyright}");
        $Xcontent = preg_replace(array_keys($MNS_METALANG_words), array_values($MNS_METALANG_words), $Xcontent);
        $Xcontent = meta_lang(MNSremoveHack($Xcontent));
        //applique aff_video que sur la partie affichage
        $rupt = strpos($Xcontent, "!v_yt!");
        echo substr($Xcontent, 0, $rupt);
        echo aff_video_yt(substr($Xcontent, $rupt + 6));
        echo '
            </body>
         </html>';
    }
}
Exemple #11
0
function Test($Yheader, $Ybody, $Yfooter)
{
    global $hlpfile;
    global $NPDS_Prefix;
    include "header.php";
    GraphicAdmin($hlpfile);
    opentable();
    // $type = HED or FOT
    $result = sql_query("SELECT text, html FROM " . $NPDS_Prefix . "lnl_head_foot WHERE type='HED' and ref='{$Yheader}'");
    $Xheader = sql_fetch_row($result);
    $result = sql_query("SELECT text, html FROM " . $NPDS_Prefix . "lnl_body WHERE html='{$Xheader['1']}' and ref='{$Ybody}'");
    $Xbody = sql_fetch_row($result);
    $result = sql_query("SELECT text, html FROM " . $NPDS_Prefix . "lnl_head_foot WHERE type='FOT' and html='{$Xheader['1']}' and ref='{$Yfooter}'");
    $Xfooter = sql_fetch_row($result);
    // For Meta-Lang
    global $cookie;
    $uid = $cookie[0];
    if ($Xheader[1] == 1) {
        echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"header\">\n";
        echo adm_translate("Prévisualiser") . " HTML";
        echo "</td></tr></table>\n";
        echo "<br />\n";
        $Xmime = "html-nobr";
        $message = meta_lang($Xheader[0] . $Xbody[0] . $Xfooter[0]);
    } else {
        echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"header\">\n";
        echo adm_translate("Prévisualiser") . " " . adm_translate("TEXTE") . "";
        echo "</td></tr></table>\n";
        echo "<br />\n";
        $Xmime = "text";
        $message = meta_lang(nl2br($Xheader[0]) . nl2br($Xbody[0]) . nl2br($Xfooter[0]));
    }
    echo $message;
    echo "<br /><br />\n";
    echo "[ <a href=\"javascript:history.go(-1)\" class=\"noir\">" . adm_translate("Retour en arriére") . "</a> ]";
    closetable();
    global $adminmail;
    send_email($adminmail, "LNL TEST", $message, "", true, $Xmime);
    include "footer.php";
}
Exemple #12
0
function PrintSecPage($artid)
{
    global $NPDS_Prefix, $user, $cookie, $theme, $Default_Theme, $site_logo, $sitename, $nuke_url, $language, $site_font, $Titlesitename;
    include "meta/meta.php";
    if (isset($user)) {
        if ($cookie[9] == '') {
            $cookie[9] = $Default_Theme;
        }
        if (isset($theme)) {
            $cookie[9] = $theme;
        }
        $tmp_theme = $cookie[9];
        if (!($file = @opendir("themes/{$cookie['9']}"))) {
            $tmp_theme = $Default_Theme;
        }
    } else {
        $tmp_theme = $Default_Theme;
    }
    echo import_css($tmp_theme, $language, $site_font, "", "");
    echo '
      </head>
      <body style="background-color: #FFFFFF; background-image: none;">
      <p class="text-xs-center">';
    $pos = strpos($site_logo, "/");
    if ($pos) {
        echo '<img src="' . $site_logo . '" border="0" alt="" />';
    } else {
        echo '<img src="images/' . $site_logo . '" border="0" alt="" />';
    }
    $result = sql_query("SELECT title, content FROM " . $NPDS_Prefix . "seccont WHERE artid='{$artid}'");
    list($title, $content) = sql_fetch_row($result);
    echo '<br /><br /><strong>' . aff_langue($title) . '</strong><br /><br /></p>';
    $content = aff_code(aff_langue($content));
    $pos_page = strpos($content, "[page");
    if ($pos_page) {
        $content = str_replace("[page", str_repeat("-", 50) . "&nbsp;[page", $content);
    }
    echo meta_lang($content);
    echo '
         <hr />
         <p class="text-xs-center">
         ' . translate("This article comes from") . ' ' . $sitename . '<br /><br />
         ' . translate("The URL for this story is:") . '
         <a href="' . $nuke_url . '/sections.php?op=viewarticle&amp;artid=' . $artid . '">' . $nuke_url . '/sections.php?op=viewarticle&amp;artid=' . $artid . '</a>
         </p>
      </body>
   </html>';
}
Exemple #13
0
function FaqCatGoEdit($id)
{
    global $hlpfile, $NPDS_Prefix, $local_user_language, $admf_ext, $f_meta_nom, $f_titre, $adminimg;
    include "header.php";
    GraphicAdmin($hlpfile);
    $result = sql_query("SELECT fa.question, fa.answer, fa.id_cat, fc.categories FROM " . $NPDS_Prefix . "faqanswer fa LEFT JOIN " . $NPDS_Prefix . "faqcategories fc ON fa.id_cat = fc.id_cat WHERE fa.id='{$id}'");
    list($question, $answer, $id_cat, $faq_cat) = sql_fetch_row($result);
    adminhead($f_meta_nom, $f_titre, $adminimg);
    echo '
   <hr />
   <h3>' . $faq_cat . '</h3>
   <h4>' . $question . '</h4>
   <h4>' . adm_translate("Prévisualiser") . '</h4>';
    echo '
   <label class="form-control-label" for="">' . aff_local_langue(adm_translate("Langue de Prévisualisation"), '', 'local_user_language') . '
   </label>
   <div class="card card-block">
   <p>' . preview_local_langue($local_user_language, $question) . '</p>';
    $answer = aff_code($answer);
    echo '<p>' . meta_lang(preview_local_langue($local_user_language, $answer)) . '</p>
   </div>';
    echo '
   <h4>' . adm_translate("Editer Question & Réponse") . '</h4>
   <form action="admin.php" method="post" name="adminForm">
      <fieldset>
         <div class="form-group row">
            <label class="form-control-label col-xs-12" for="question">' . adm_translate("Question") . '</label>
            <div class="col-sm-12">
               <textarea class="form-control" type="text" name="question" id="question" maxlength="255">' . $question . '</textarea>
               <span class="help-block text-xs-right"><span id="countcar_question"></span></span>
            </div>
         </div>
         <div class="form-group row">
            <label class="form-control-label col-xs-12" for="answer">' . adm_translate("Réponse") . '</label>
            <div class="col-sm-12">
               <textarea class="tin form-control" name="answer" rows="15">' . $answer . '</textarea>
            </div>
         </div>
         ' . aff_editeur('answer', '') . '
         <div class="form-group row">
            <div class="col-sm-12">
               <input type="hidden" name="id" value="' . $id . '" />
               <input type="hidden" name="op" value="FaqCatGoSave" />
               <button class="btn btn-outline-primary col-xs-12 col-sm-6" type="submit"><i class="fa fa-check-square fa-lg"></i>&nbsp;' . adm_translate("Sauver les modifications") . '</button>
               <button class="btn btn-outline-secondary col-xs-12 col-sm-6" href="admin.php?op=FaqCatGo&amp;id_cat=' . $id_cat . '" >' . adm_translate("Retour en arrière") . '</a>
            </div>
         </div>
      </fieldset>
   </form>
   <script type="text/javascript">
   //<![CDATA[
      $(document).ready(function() {
         inpandfieldlen("question",255);
      });
   //]]>
   </script>';
    adminfoot('fv', '', '', '');
}
Exemple #14
0
function PrintPage($oper, $DB, $nl, $sid)
{
    global $user, $cookie, $theme, $Default_Theme, $language, $site_logo, $sitename, $datetime, $nuke_url, $site_font, $Titlesitename;
    global $NPDS_Prefix;
    $aff = true;
    if ($oper == 'news') {
        $xtab = news_aff('libre', "where sid='{$sid}'", 1, 1);
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[0];
        if ($topic != '') {
            $result2 = sql_query("SELECT topictext FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'");
            list($topictext) = sql_fetch_row($result2);
        } else {
            $aff = false;
        }
    }
    if ($oper == 'archive') {
        $xtab = news_aff('archive', "WHERE sid='{$sid}'", 1, 1);
        list($sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[0];
        if ($topic != '') {
            $result2 = sql_query("SELECT topictext FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'");
            list($topictext) = sql_fetch_row($result2);
        } else {
            $aff = false;
        }
    }
    if ($oper == 'links') {
        $DB = removeHack(stripslashes(htmlentities(urldecode($DB), ENT_NOQUOTES, cur_charset)));
        $result = sql_query("SELECT url, title, description, date FROM " . $DB . "links_links WHERE lid='{$sid}'");
        list($url, $title, $description, $time) = sql_fetch_row($result);
        $title = stripslashes($title);
        $description = stripslashes($description);
    }
    if ($oper == 'static') {
        if (preg_match('#^[a-z0-9_\\.-]#i', $sid) and !stristr($sid, ".*://") and !stristr($sid, "..") and !stristr($sid, "../") and !stristr($sid, 'script') and !stristr($sid, "cookie") and !stristr($sid, 'iframe') and !stristr($sid, 'applet') and !stristr($sid, 'object') and !stristr($sid, 'meta')) {
            if (file_exists("static/{$sid}")) {
                ob_start();
                include "static/{$sid}";
                $remp = ob_get_contents();
                ob_end_clean();
                if ($DB) {
                    $remp = meta_lang(aff_code(aff_langue($remp)));
                }
                if ($nl) {
                    $remp = nl2br(str_replace(' ', '&nbsp;', htmlentities($remp, ENT_QUOTES, cur_charset)));
                }
                $title = $sid;
            } else {
                $aff = false;
            }
        } else {
            $remp = '<div class="alert alert-danger">' . translate("Please enter information according to the specifications") . '</div>';
            $aff = false;
        }
    }
    if ($aff == true) {
        $Titlesitename = 'NPDS - ' . translate("Printer Friendly Page") . ' / ' . $title;
        if (isset($time)) {
            formatTimestamp($time);
        }
        include "meta/meta.php";
        if (isset($user)) {
            if ($cookie[9] == '') {
                $cookie[9] = $Default_Theme;
            }
            if (isset($theme)) {
                $cookie[9] = $theme;
            }
            $tmp_theme = $cookie[9];
            if (!($file = @opendir("themes/{$cookie['9']}"))) {
                $tmp_theme = $Default_Theme;
            }
        } else {
            $tmp_theme = $Default_Theme;
        }
        echo '
         <link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap.min.css" />';
        echo import_css($tmp_theme, $language, $site_font, '', '');
        echo '
       </head>
       <body>
          <div max-width="640" class="container p-1 n-hyphenate">
             <div>';
        $pos = strpos($site_logo, '/');
        if ($pos) {
            echo '<img class="img-fluid d-block mx-auto" src="' . $site_logo . '" alt="website logo" />';
        } else {
            echo '<img class="img-fluid d-block mx-auto" src="images/' . $site_logo . '" alt="website logo" />';
        }
        echo '
               <h1 class="d-block text-xs-center my-2">' . aff_langue($title) . '</h1>';
        if ($oper == 'news' or $oper == 'archive') {
            $hometext = meta_lang(aff_code(aff_langue($hometext)));
            $bodytext = meta_lang(aff_code(aff_langue($bodytext)));
            echo '
             <span class="float-xs-right text-capitalize" style="font-size: .8rem;"> ' . $datetime . '</span><br />
             <hr />
             <h2 class="mb-1">' . translate("Topic:") . ' ' . aff_langue($topictext) . '</h2>
         </div>
         <div>' . $hometext . '<br /><br />';
            if ($bodytext != '') {
                echo $bodytext . '<br /><br />';
            }
            echo meta_lang(aff_code(aff_langue($notes)));
            echo '
          </div>';
            if ($oper == 'news') {
                echo '
             <hr />
             <p class="text-xs-center">' . translate("This article comes from") . ' ' . $sitename . '<br />
             ' . translate("The URL for this story is:") . '
             <a href="' . $nuke_url . '/article.php?sid=' . $sid . '">' . $nuke_url . '/article.php?sid=' . $sid . '</a>
             </p>';
            } else {
                echo '
             <hr />
             <p class="text-xs-center">' . translate("This article comes from") . ' ' . $sitename . '<br />
             ' . translate("The URL for this story is:") . '
             <a href="' . $nuke_url . '/article.php?sid=' . $sid . '&amp;archive=1">' . $nuke_url . '/article.php?sid=' . $sid . '&amp;archive=1</a>
             </p>';
            }
        }
        if ($oper == 'links') {
            echo '<span class="float-xs-right text-capitalize" style="font-size: .8rem;">' . $datetime . '</span><br /><hr />';
            if ($url != '') {
                echo '<h2 class="mb-1">' . translate("Links") . ' : ' . $url . '</h2>';
            }
            echo '
          <div>' . aff_langue($description) . '</div>
          <hr />
          <p class="text-xs-center">' . translate("This article comes from") . ' ' . $sitename . '<br />
          <a href="' . $nuke_url . '">' . $nuke_url . '</a></p>';
        }
        if ($oper == 'static') {
            echo '
          <div>
             ' . $remp . '
          </div>
          <hr />
          <p class="text-xs-center">' . translate("This article comes from") . ' ' . $sitename . '<br />
          <a href="' . $nuke_url . '/static.php?op=' . $sid . '&npds=1">' . $nuke_url . '/static.php?op=' . $sid . '&npds=1</a></p>';
        }
        echo '
      </div>
   </body>
</html>';
    } else {
        header("location: index.php");
    }
}
Exemple #15
0
function forum($rowQ1)
{
    global $user, $subscribe, $theme, $NPDS_Prefix, $admin, $adminforum;
    //==> droits des admin sur les forums (superadmin et admin avec droit gestion forum)
    $adminforum = false;
    if ($admin) {
        $adminX = base64_decode($admin);
        $adminR = explode(':', $adminX);
        $Q = sql_fetch_assoc(sql_query("SELECT * FROM " . $NPDS_Prefix . "authors WHERE aid='{$adminR['0']}' LIMIT 1"));
        if ($Q['radminsuper'] == 1) {
            $adminforum = 1;
        } else {
            $R = sql_query("SELECT fnom, fid, radminsuper FROM " . $NPDS_Prefix . "authors a LEFT JOIN " . $NPDS_Prefix . "droits d ON a.aid = d.d_aut_aid LEFT JOIN " . $NPDS_Prefix . "fonctions f ON d.d_fon_fid = f.fid WHERE a.aid='{$adminR['0']}' AND f.fid BETWEEN 13 AND 15");
            if (sql_num_rows($R) >= 1) {
                $adminforum = 1;
            }
        }
    }
    //<== droits des admin sur les forums (superadmin et admin avec droit gestion forum)
    if ($user) {
        $userX = base64_decode($user);
        $userR = explode(':', $userX);
        $tab_groupe = valid_group($user);
    }
    if ($ibid = theme_image("forum/icons/red_folder.gif")) {
        $imgtmpR = $ibid;
    } else {
        $imgtmpR = "images/forum/icons/red_folder.gif";
    }
    if ($ibid = theme_image("forum/icons/folder.gif")) {
        $imgtmp = $ibid;
    } else {
        $imgtmp = "images/forum/icons/folder.gif";
    }
    $linked = "onmouseover=\"this.className='lignb'; this.style.cursor='default';\" " . " onmouseout=\"this.className='ligna';\"";
    // preparation de la gestion des folders
    $result = sql_query("SELECT forum_id, COUNT(topic_id) AS total FROM " . $NPDS_Prefix . "forumtopics GROUP BY (forum_id)");
    while (list($forumid, $total) = sql_fetch_row($result)) {
        $tab_folder[$forumid][0] = $total;
        // Topic
    }
    $result = sql_query("SELECT forum_id, COUNT(DISTINCT topicid) AS total FROM " . $NPDS_Prefix . "forum_read WHERE uid='{$userR['0']}' AND topicid>'0' AND status!='0' GROUP BY (forum_id)");
    while (list($forumid, $total) = sql_fetch_row($result)) {
        $tab_folder[$forumid][1] = $total;
        // Folder
    }
    // préparation de la gestion des abonnements
    $result = sql_query("SELECT forumid FROM " . $NPDS_Prefix . "subscribe WHERE uid='{$userR['0']}'");
    while (list($forumid) = sql_fetch_row($result)) {
        $tab_subscribe[$forumid] = true;
    }
    // preparation du compteur total_post
    $rowQ0 = Q_Select("SELECT forum_id, COUNT(post_aff) AS total FROM " . $NPDS_Prefix . "posts GROUP BY forum_id", 600);
    while (list(, $row0) = each($rowQ0)) {
        $tab_total_post[$row0['forum_id']] = $row0['total'];
    }
    if ($subscribe and $user) {
        $colspanX = 7;
    } else {
        $colspanX = 6;
    }
    $ibid = '';
    if ($rowQ1) {
        while (list(, $row) = each($rowQ1)) {
            $title_aff = true;
            $rowQ2 = Q_Select("SELECT * FROM " . $NPDS_Prefix . "forums WHERE cat_id = '" . $row['cat_id'] . "' AND SUBSTRING(forum_name,1,3)!='<!>' ORDER BY forum_index,forum_id", 21600);
            if ($rowQ2) {
                while (list(, $myrow) = each($rowQ2)) {
                    // Gestion des Forums Cachés aux non-membres
                    if ($myrow['forum_type'] != "9" or $userR) {
                        // Gestion des Forums réservés à un groupe de membre
                        if ($myrow['forum_type'] == "7" or $myrow['forum_type'] == "5") {
                            $ok_affich = groupe_forum($myrow['forum_pass'], $tab_groupe);
                            if (isset($admin) and $adminforum == 1) {
                                $ok_affich = true;
                            }
                            // to see when admin mais pas assez precis
                        } else {
                            $ok_affich = true;
                        }
                        if ($ok_affich) {
                            if ($title_aff) {
                                $title = stripslashes($row['cat_title']);
                                if (file_exists("themes/{$theme}/html/forum-cat" . $row['cat_id'] . ".html") or file_exists("themes/default/html/forum-cat" . $row['cat_id'] . ".html")) {
                                    $ibid .= '
         <tr valign="top">
            <td colspan="' . $colspanX . '" class="lignb"><a href="forum.php?catid=' . $row['cat_id'] . '">' . $title . '</a></td>
         </tr>';
                                } else {
                                    $ibid .= '
         <tr valign="top">
            <td colspan="' . $colspanX . '" class="lignb">' . $title . '</td>
         </tr>';
                                }
                                $title_aff = false;
                            }
                            $forum_moderator = explode(" ", get_moderator($myrow['forum_moderator']));
                            $Mmod = false;
                            for ($i = 0; $i < count($forum_moderator); $i++) {
                                if ($userR[1] == $forum_moderator[$i]) {
                                    $Mmod = true;
                                }
                            }
                            $last_post = get_last_post($myrow['forum_id'], "forum", "infos", $Mmod);
                            $ibid .= '
         <tr align="left" valign="top">';
                            if ($tab_folder[$myrow['forum_id']][0] - $tab_folder[$myrow['forum_id']][1] > 0) {
                                $ibid .= '
            <td class="lignb" align="center" valign="middle" width="5%"><img src="' . $imgtmpR . '" border="" alt="" /></td>';
                            } else {
                                $ibid .= '
            <td class="lignb" align="center" valign="middle" width="5%"><img src="' . $imgtmp . '" border="" alt="" /></td>';
                            }
                            $name = stripslashes($myrow['forum_name']);
                            $redirect = false;
                            if (strstr(strtoupper($name), "<a HREF")) {
                                if ($colspanX == 7) {
                                    $ibid .= '
            <td width="40%" class="ligna" ' . $linked . '>' . $name;
                                } else {
                                    $ibid .= '
            <td width="45%" class="ligna" ' . $linked . '>' . $name;
                                }
                                $redirect = true;
                            } else {
                                if ($colspanX == 7) {
                                    $ibid .= '
            <td width="40%" class="ligna" ' . $linked . ' onclick=\'window.location.href="viewforum.php?forum=' . $myrow['forum_id'] . '"\'><a href="viewforum.php?forum=' . $myrow['forum_id'] . '" >' . $name . '</a>';
                                } else {
                                    $ibid .= '
            <td width="45%" class="ligna" ' . $linked . ' onclick=\'window.location.href="viewforum.php?forum=' . $myrow['forum_id'] . '"\'><a href="viewforum.php?forum=' . $myrow['forum_id'] . '" >' . $name . '</a>';
                                }
                            }
                            $desc = stripslashes(meta_lang($myrow['forum_desc']));
                            $ibid .= '<br />' . $desc . '</td>';
                            // Subscribe
                            if ($subscribe and $user) {
                                if (!$redirect) {
                                    if ($tab_subscribe[$myrow['forum_id']]) {
                                        $ibid .= '
            <td class="lignb" width="5%" align="center" valign="middle"><input type="checkbox" name="Subforumid[' . $myrow['forum_id'] . ']" checked="checked" /></td>';
                                    } else {
                                        $ibid .= '
            <td class="lignb" width="5%" align="center" valign="middle"><input type="checkbox" name="Subforumid[' . $myrow['forum_id'] . ']" /></td>';
                                    }
                                } else {
                                    $ibid .= '
            <td class="lignb" width="5%" align="center" valign="middle">&nbsp;</td>';
                                }
                            }
                            if (!$redirect) {
                                $ibid .= '
            <td width="15%" align="center" valign="middle" class="ligna">';
                                if ($myrow['forum_access'] == "0" && $myrow['forum_type'] == "0") {
                                    $ibid .= translate("Free for All");
                                }
                                if ($myrow['forum_type'] == "1") {
                                    $ibid .= translate("Private");
                                }
                                if ($myrow['forum_type'] == "5") {
                                    $ibid .= "PHP Script + " . translate("Group");
                                }
                                if ($myrow['forum_type'] == "6") {
                                    $ibid .= "PHP Script";
                                }
                                if ($myrow['forum_type'] == "7") {
                                    $ibid .= translate("Group");
                                }
                                if ($myrow['forum_type'] == "8") {
                                    $ibid .= translate("Extended Text");
                                }
                                if ($myrow['forum_type'] == "9") {
                                    $ibid .= translate("Hidden");
                                }
                                if ($myrow['forum_access'] == "1" && $myrow['forum_type'] == "0") {
                                    $ibid .= translate("Registered User");
                                }
                                if ($myrow['forum_access'] == "2" && $myrow['forum_type'] == "0") {
                                    $ibid .= translate("Moderator");
                                }
                                if ($myrow['forum_access'] == "9") {
                                    $ibid .= ' <strong>' . translate("Closed") . '</strong>';
                                }
                                $ibid .= '</td>
            <td width="10%" align="center" valign="middle" class="lignb">' . $tab_folder[$myrow['forum_id']][0] . '</td>
            <td width="10%" align="center" valign="middle" class="ligna">' . $tab_total_post[$myrow['forum_id']] . '</td>
            <td width="15%" align="center" valign="middle" class="lignb">' . $last_post . '</td>
         </tr>';
                            } else {
                                $ibid .= '
            <td width="15%" align="center" valign="middle" class="ligna">&nbsp;</td>
            <td width="10%" align="center" valign="middle" class="lignb">&nbsp;</td>
            <td width="10%" align="center" valign="middle" class="ligna">&nbsp;</td>
            <td width="15%" align="center" valign="middle" class="ligna">&nbsp;</td>
         </tr>';
                            }
                        }
                    }
                }
            }
        }
    }
    return $ibid;
}
Exemple #16
0
function themedito($content)
{
    global $theme;
    $inclusion = false;
    if (file_exists("themes/" . $theme . "/html/editorial.html")) {
        $inclusion = "themes/" . $theme . "/html/editorial.html";
    }
    if ($inclusion) {
        ob_start();
        include $inclusion;
        $Xcontent = ob_get_contents();
        ob_end_clean();
        $npds_METALANG_words = array("'!editorial_content!'i" => "{$content}");
        echo meta_lang(aff_langue(preg_replace(array_keys($npds_METALANG_words), array_values($npds_METALANG_words), $Xcontent)));
    }
    return $inclusion;
}
Exemple #17
0
function forum($rowQ1)
{
    global $user, $subscribe, $theme, $NPDS_Prefix, $admin, $adminforum;
    //==> droits des admin sur les forums (superadmin et admin avec droit gestion forum)
    $adminforum = false;
    if ($admin) {
        $adminX = base64_decode($admin);
        $adminR = explode(':', $adminX);
        $Q = sql_fetch_assoc(sql_query("SELECT * FROM " . $NPDS_Prefix . "authors WHERE aid='{$adminR['0']}' LIMIT 1"));
        if ($Q['radminsuper'] == 1) {
            $adminforum = 1;
        } else {
            $R = sql_query("SELECT fnom, fid, radminsuper FROM " . $NPDS_Prefix . "authors a LEFT JOIN " . $NPDS_Prefix . "droits d ON a.aid = d.d_aut_aid LEFT JOIN " . $NPDS_Prefix . "fonctions f ON d.d_fon_fid = f.fid WHERE a.aid='{$adminR['0']}' AND f.fid BETWEEN 13 AND 15");
            if (sql_num_rows($R) >= 1) {
                $adminforum = 1;
            }
        }
    }
    //<== droits des admin sur les forums (superadmin et admin avec droit gestion forum)
    if ($user) {
        $userX = base64_decode($user);
        $userR = explode(':', $userX);
        $tab_groupe = valid_group($user);
    }
    if ($ibid = theme_image("forum/icons/red_folder.gif")) {
        $imgtmpR = $ibid;
    } else {
        $imgtmpR = "images/forum/icons/red_folder.gif";
    }
    if ($ibid = theme_image("forum/icons/folder.gif")) {
        $imgtmp = $ibid;
    } else {
        $imgtmp = "images/forum/icons/folder.gif";
    }
    // preparation de la gestion des folders
    $result = sql_query("SELECT forum_id, COUNT(topic_id) AS total FROM " . $NPDS_Prefix . "forumtopics GROUP BY (forum_id)");
    while (list($forumid, $total) = sql_fetch_row($result)) {
        $tab_folder[$forumid][0] = $total;
        // Topic
    }
    $result = sql_query("SELECT forum_id, COUNT(DISTINCT topicid) AS total FROM " . $NPDS_Prefix . "forum_read WHERE uid='{$userR['0']}' AND topicid>'0' AND status!='0' GROUP BY (forum_id)");
    while (list($forumid, $total) = sql_fetch_row($result)) {
        $tab_folder[$forumid][1] = $total;
        // Folder
    }
    // préparation de la gestion des abonnements
    $result = sql_query("SELECT forumid FROM " . $NPDS_Prefix . "subscribe WHERE uid='{$userR['0']}'");
    while (list($forumid) = sql_fetch_row($result)) {
        $tab_subscribe[$forumid] = true;
    }
    // preparation du compteur total_post
    $rowQ0 = Q_Select("SELECT forum_id, COUNT(post_aff) AS total FROM " . $NPDS_Prefix . "posts GROUP BY forum_id", 600);
    while (list(, $row0) = each($rowQ0)) {
        $tab_total_post[$row0['forum_id']] = $row0['total'];
    }
    $ibid = '';
    if ($rowQ1) {
        while (list(, $row) = each($rowQ1)) {
            $title_aff = true;
            $rowQ2 = Q_Select("SELECT * FROM " . $NPDS_Prefix . "forums WHERE cat_id = '" . $row['cat_id'] . "' AND SUBSTRING(forum_name,1,3)!='<!>' ORDER BY forum_index,forum_id", 21600);
            if ($rowQ2) {
                while (list(, $myrow) = each($rowQ2)) {
                    // Gestion des Forums Cachés aux non-membres
                    if ($myrow['forum_type'] != "9" or $userR) {
                        // Gestion des Forums réservés à un groupe de membre
                        if ($myrow['forum_type'] == "7" or $myrow['forum_type'] == "5") {
                            $ok_affich = groupe_forum($myrow['forum_pass'], $tab_groupe);
                            if (isset($admin) and $adminforum == 1) {
                                $ok_affich = true;
                            }
                            // to see when admin mais pas assez precis
                        } else {
                            $ok_affich = true;
                        }
                        if ($ok_affich) {
                            if ($title_aff) {
                                $title = stripslashes($row['cat_title']);
                                if (file_exists("themes/{$theme}/html/forum-cat" . $row['cat_id'] . ".html") or file_exists("themes/default/html/forum-cat" . $row['cat_id'] . ".html")) {
                                    $ibid .= '
                           <div class="list-group mt-1" id="catfo_' . $row['cat_id'] . '" >
                              <a class="list-group-item list-group-item-action active" href="forum.php?catid=' . $row['cat_id'] . '"><h5 class="list-group-item-heading" >' . $title . '</h5></a>';
                                } else {
                                    $ibid .= '
                           <div class="list-group mt-1" id="catfo_' . $row['cat_id'] . '">
                              <div class="list-group-item list-group-item-action active"><h5 class="list-group-item-heading" >' . $title . '</h5></div>';
                                }
                                $title_aff = false;
                            }
                            $forum_moderator = explode(' ', get_moderator($myrow['forum_moderator']));
                            $Mmod = false;
                            for ($i = 0; $i < count($forum_moderator); $i++) {
                                if ($userR[1] == $forum_moderator[$i]) {
                                    $Mmod = true;
                                }
                            }
                            $last_post = get_last_post($myrow['forum_id'], "forum", "infos", $Mmod);
                            $ibid .= '<p class="list-group-item list-group-item-action">';
                            if ($tab_folder[$myrow['forum_id']][0] - $tab_folder[$myrow['forum_id']][1] > 0) {
                                $ibid .= '<i class="fa fa-folder text-primary fa-lg" title="' . translate("New Posts since your last visit.") . '" data-toggle="tooltip" data-placement="right"></i>';
                            } else {
                                $ibid .= '<i class="fa fa-folder-o text-primary fa-lg" title="' . translate("No New Posts since your last visit.") . '" data-toggle="tooltip" data-placement="right"></i>';
                            }
                            $name = stripslashes($myrow['forum_name']);
                            $redirect = false;
                            if (strstr(strtoupper($name), "<a HREF")) {
                                $redirect = true;
                            } else {
                                $ibid .= '
                        <a href="viewforum.php?forum=' . $myrow['forum_id'] . '" >' . $name . '</a>';
                            }
                            if (!$redirect) {
                                $ibid .= ' 
            <span class="tag tag-default ml-1" style=" position: relative; float: right;" title="' . translate("Posts") . '" data-toggle="tooltip">' . $tab_total_post[$myrow['forum_id']] . '</span>
            <span class="tag tag-default " style=" position: relative; float: right;" title="' . translate("Topics") . '" data-toggle="tooltip">' . $tab_folder[$myrow['forum_id']][0] . '</span>';
                            }
                            $desc = stripslashes(meta_lang($myrow['forum_desc']));
                            if ($desc != '') {
                                $ibid .= '<br />' . $desc;
                            }
                            if (!$redirect) {
                                $ibid .= '<br />[ ';
                                if ($myrow['forum_access'] == "0" && $myrow['forum_type'] == "0") {
                                    $ibid .= translate("Free for All");
                                }
                                if ($myrow['forum_type'] == "1") {
                                    $ibid .= translate("Private");
                                }
                                if ($myrow['forum_type'] == "5") {
                                    $ibid .= "PHP Script + " . translate("Group");
                                }
                                if ($myrow['forum_type'] == "6") {
                                    $ibid .= "PHP Script";
                                }
                                if ($myrow['forum_type'] == "7") {
                                    $ibid .= translate("Group");
                                }
                                if ($myrow['forum_type'] == "8") {
                                    $ibid .= translate("Extended Text");
                                }
                                if ($myrow['forum_type'] == "9") {
                                    $ibid .= translate("Hidden");
                                }
                                if ($myrow['forum_access'] == "1" && $myrow['forum_type'] == "0") {
                                    $ibid .= translate("Registered User");
                                }
                                if ($myrow['forum_access'] == "2" && $myrow['forum_type'] == "0") {
                                    $ibid .= translate("Moderator");
                                }
                                if ($myrow['forum_access'] == "9") {
                                    $ibid .= ' <strong class="text-danger">' . translate("Closed") . '</strong>';
                                }
                                $ibid .= ' ]';
                                $ibid .= '<br />';
                                // Subscribe
                                if ($subscribe and $user) {
                                    if (!$redirect) {
                                        if ($tab_subscribe[$myrow['forum_id']]) {
                                            $ibid .= '<input class="n-ckbf" type="checkbox" name="Subforumid[' . $myrow['forum_id'] . ']" checked="checked" title="" data-toggle="tooltip" />';
                                        } else {
                                            $ibid .= '<input class="n-ckbf" type="checkbox" name="Subforumid[' . $myrow['forum_id'] . ']" title="' . translate("Check me and click on OK button to receive an Email when is a new submission in this forum.") . '" data-toggle="tooltip" data-placement="right" />';
                                        }
                                    }
                                }
                                $ibid .= '<span class="float-xs-right">' . $last_post . '</span><br />';
                            } else {
                                $ibid .= '';
                            }
                        }
                    }
                }
                if ($ok_affich) {
                    $ibid .= '
            </p>
         </div>';
                }
            }
        }
    }
    if ($subscribe and $user and $ok_affich) {
        $ibid .= '<input type="checkbox" id="ckball_f" />&nbsp;<span class=" text-muted" id="ckb_status_f">Tout cocher</span>';
    }
    return $ibid;
}