function code_aff($subject, $story, $bodytext, $notes) { global $local_user_language; $subjectX = aff_code(preview_local_langue($local_user_language, $subject)); $storyX = aff_code(preview_local_langue($local_user_language, $story)); $bodytextX = aff_code(preview_local_langue($local_user_language, $bodytext)); $notesX = aff_code(preview_local_langue($local_user_language, $notes)); themepreview($subjectX, $storyX, $bodytextX, $notesX); }
forumerror('0022'); } $row2 = sql_fetch_assoc($result); $userdata['uid'] = $row2['poster_id']; // IF we made it this far we are allowed to edit this message settype($forum, "integer"); $myrow2 = sql_fetch_assoc(sql_query("SELECT forum_type FROM " . $NPDS_Prefix . "forums WHERE (forum_id = '{$forum}')")); $forum_type = $myrow2['forum_type']; if ($allow_html == 0 || isset($html)) { $messageP = htmlspecialchars($messageP, ENT_COMPAT | ENT_HTML401, cur_charset); } if ($allow_bbcode and $forum_type != 6 and $forum_type != 5) { $messageP = smile($messageP); } if ($forum_type != 6 and $forum_type != 5) { $messageP = aff_code($messageP); $messageP = str_replace("\n", '<br />', removeHack($messageP)); $messageP .= "<br /><p>" . translate("This message was edited by") . ' : ' . $userdata['uname'] . "</p>"; if ($allow_bbcode) { $messageP = aff_video_yt($messageP); } } else { $messageP .= "\n\n" . translate("This message was edited by") . ' : ' . $userdata['uname']; } $messageP = addslashes($messageP); break; } $theposterdata = get_userdata_from_id($userdatat[0]); echo ' <h4>' . translate("Preview") . '</h4> <div class="row">
$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(' ', ' ', 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 . '&metalang=' . $metalang . '&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>"; }
forumerror('0035'); } if (user_is_moderator($userdata[0], $userdata[2], $forum_access) < 2) { forumerror('0036'); } } $userdata = get_userdata($userdata[1]); if ($allow_html == 0 || isset($html)) { $message = htmlspecialchars($message, ENT_COMPAT | ENT_HTML401, cur_charset); } if ($allow_bbcode == 1 and $forum_type != "6" and $forum_type != "5") { $message = smile($message); } if ($forum_type != 6 and $forum_type != 5) { $message = make_clickable($message); $message = aff_code($message); $message = str_replace("\n", "<br />", removeHack($message)); $message .= '<div class="text-muted text-xs-right small"><i class="fa fa-edit"></i> ' . translate("This message was edited by") . " : " . $userdata['uname'] . " / " . post_convertdate(time() + $gmt * 3600) . "</div>"; } else { $message .= "\n\n" . translate("This message was edited by") . " : " . $userdata['uname'] . " / " . post_convertdate(time() + $gmt * 3600); } $message = addslashes($message); if ($subject == "") { $subject = translate("Untitled"); } // Forum ARBRE if ($arbre) { $hrefX = "viewtopicH.php"; } else { $hrefX = "viewtopic.php"; }
function prepa_aff_news($op, $catid, $marqeur) { global $NPDS_Prefix, $storyhome, $topicname, $topicimage, $topictext, $datetime, $cookie; if (isset($cookie[3])) { $storynum = $cookie[3]; } else { $storynum = $storyhome; } if ($op == "categories") { sql_query("UPDATE " . $NPDS_Prefix . "stories_cat SET counter=counter+1 WHERE catid='{$catid}'"); settype($marqeur, "integer"); if (!isset($marqeur)) { $marqeur = 0; } $xtab = news_aff("libre", "WHERE catid='{$catid}' AND archive='0' ORDER BY sid DESC LIMIT {$marqeur},{$storynum}", "", "-1"); $storynum = sizeof($xtab); } elseif ($op == "topics") { settype($marqeur, "integer"); if (!isset($marqeur)) { $marqeur = 0; } $xtab = news_aff("libre", "WHERE topic='{$catid}' AND archive='0' ORDER BY sid DESC LIMIT {$marqeur},{$storynum}", "", "-1"); $storynum = sizeof($xtab); } elseif ($op == "news") { settype($marqeur, "integer"); if (!isset($marqeur)) { $marqeur = 0; } $xtab = news_aff("libre", "WHERE ihome!='1' AND archive='0' ORDER BY sid DESC LIMIT {$marqeur},{$storynum}", "", "-1"); $storynum = sizeof($xtab); } elseif ($op == "article") { $xtab = news_aff("index", "WHERE ihome!='1' AND sid='{$catid}'", 1, ""); } else { $xtab = news_aff("index", "WHERE ihome!='1' AND archive='0'", $storynum, ""); } $story_limit = 0; while ($story_limit < $storynum and $story_limit < sizeof($xtab)) { list($s_sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant, $notes) = $xtab[$story_limit]; $story_limit++; // trop brutal faut faire plus fin et laisser la possibilité des images !!!! // if (!$imgtmp=theme_image("box/print.gif")) { $imgtmp="images/print.gif"; } $printP = '<a href="print.php?sid=' . $s_sid . '" class="mr-1" title="' . translate("Printer Friendly Page") . '" data-toggle="tooltip" ><i class="fa fa-lg fa-print"></i></a> '; // if (!$imgtmp=theme_image("box/friend.gif")) { $imgtmp="images/friend.gif"; } $sendF = '<a href="friend.php?op=FriendSend&sid=' . $s_sid . '" class="mr-1" title="' . translate("Send this Story to a Friend") . '" data-toggle="tooltip" ><i class="fa fa-lg fa-envelope-o"></i></a>'; getTopics($s_sid); $title = aff_langue(stripslashes($title)); $hometext = aff_langue(stripslashes($hometext)); $notes = aff_langue(stripslashes($notes)); $bodycount = strlen(strip_tags(aff_langue($bodytext), "<img>")); if ($bodycount > 0) { $bodycount = strlen(strip_tags(aff_langue($bodytext))); if ($bodycount > 0) { $morelink[0] = wrh($bodycount) . ' ' . translate("bytes more"); } else { $morelink[0] = ' '; } $morelink[1] = ' <a href="article.php?sid=' . $s_sid . '" >' . translate("Read More...") . '</a>'; } else { $morelink[0] = ''; $morelink[1] = ''; } if ($comments == 0) { $morelink[2] = 0; $morelink[3] = '<a href="article.php?sid=' . $s_sid . '" class="mr-1"><i class="fa fa-comment-o fa-lg" title="' . translate("comments?") . '" data-toggle="tooltip"></i></a>'; } elseif ($comments == 1) { $morelink[2] = $comments; $morelink[3] = '<a href="article.php?sid=' . $s_sid . '" class="mr-1"><i class="fa fa-comment-o fa-lg" title="' . translate("comment") . '" data-toggle="tooltip"></i></a>'; } else { $morelink[2] = $comments; $morelink[3] = '<a href="article.php?sid=' . $s_sid . '" class="mr-1" ><i class="fa fa-comment-o fa-lg" title="' . translate("comments") . '" data-toggle="tooltip"></i></a>'; } $morelink[4] = $printP; $morelink[5] = $sendF; $sid = $s_sid; if ($catid != 0) { $resultm = sql_query("SELECT title FROM " . $NPDS_Prefix . "stories_cat WHERE catid='{$catid}'"); list($title1) = sql_fetch_row($resultm); $title = "<a href=\"index.php?op=newcategory&catid={$catid}\" class=\"\">" . aff_langue($title1) . "</a> : {$title}"; // Attention à cela aussi $morelink[6] = "<a href=\"index.php?op=newcategory&catid={$catid}\" class=\"\">" . aff_langue($title1) . "</a>"; } else { $morelink[6] = ''; } $news_tab[$story_limit]['aid'] = serialize($aid); $news_tab[$story_limit]['informant'] = serialize($informant); $news_tab[$story_limit]['datetime'] = serialize($time); $news_tab[$story_limit]['title'] = serialize($title); $news_tab[$story_limit]['counter'] = serialize($counter); $news_tab[$story_limit]['topic'] = serialize($topic); $news_tab[$story_limit]['hometext'] = serialize(meta_lang(aff_code($hometext))); $news_tab[$story_limit]['notes'] = serialize(meta_lang(aff_code($notes))); $news_tab[$story_limit]['morelink'] = serialize($morelink); $news_tab[$story_limit]['topicname'] = serialize($topicname); $news_tab[$story_limit]['topicimage'] = serialize($topicimage); $news_tab[$story_limit]['topictext'] = serialize($topictext); $news_tab[$story_limit]['id'] = serialize($s_sid); } return $news_tab; }
} sql_query("UPDATE " . $NPDS_Prefix . "stories SET counter=counter+1 WHERE sid='{$sid}'"); include "header.php"; // Include cache manager global $SuperCache; if ($SuperCache) { $cache_obj = new cacheManager(); $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);
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(" ", " ", 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}&archive=1\">{$nuke_url}/article.php?sid={$sid}&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"); } }
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) . " [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&artid=' . $artid . '">' . $nuke_url . '/sections.php?op=viewarticle&artid=' . $artid . '</a> </p> </body> </html>'; }
function PreviewStory($name, $subject, $story, $bodytext, $topic, $deb_day, $deb_month, $deb_year, $deb_hour, $deb_min, $fin_day, $fin_month, $fin_year, $fin_hour, $fin_min, $epur) { global $tipath, $NPDS_Prefix, $topictext, $topicimage; $topiclogo = '<span class="label label-default pull-right"><strong>' . aff_langue($topictext) . '</strong></span>'; include 'header.php'; $subject = stripslashes(str_replace('"', '"', strip_tags($subject))); $story = stripslashes($story); $bodytext = stripslashes($bodytext); echo ' <h2>' . translate("Submit News") . '</h2> <form class="" action="submit.php" method="post" name="adminForm"> <p class="lead"><strong>' . translate("Your Name") . '</strong> : ' . $name . '</p> <input type="hidden" name="name" value="' . $name . '" />'; echo '<div class="card card-block">'; if ($topic == '') { // $topicimage='all-topics.gif'; $warning = '<strong class="text-danger">' . translate("Select Topic") . '</strong>'; } else { $warning = ''; $result = sql_query("SELECT topictext, topicimage FROM " . $NPDS_Prefix . "topics WHERE topicid='{$topic}'"); list($topictext, $topicimage) = sql_fetch_row($result); } 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="" />'; } } $storyX = aff_code($story); $bodytextX = aff_code($bodytext); themepreview('<h3>' . $subject . $topiclogo . '</h3>', '<div class="text-muted">' . $storyX . '</div>', $bodytextX); // if ($no_img) { // echo '<strong>'.aff_langue($topictext).'</strong>'; // } echo ' </div> <div class="form-group row"> <label class="form-control-label col-sm-3" for="subject">' . translate("Title") . '</label> <div class="col-sm-9"> <input type="text" name="subject" class="form-control" value="' . $subject . '" /> </div> </div> <div class="form-group row"> <label class="form-control-label col-sm-3" for="topic">' . translate("Topic") . '</label> <div class="col-sm-9"> <select class="c-select form-control" name="topic">'; $toplist = sql_query("SELECT topicid, topictext FROM " . $NPDS_Prefix . "topics ORDER BY topictext"); echo ' <option value="">' . translate("Select Topic") . '</option>'; while (list($topicid, $topics) = sql_fetch_row($toplist)) { if ($topicid == $topic) { $sel = 'selected="selected" '; } echo ' <option ' . $sel . ' value="' . $topicid . '">' . aff_langue($topics) . '</option>'; $sel = ''; } echo ' </select> <span class="help-block text-danger">' . $warning . '</span> </div> </div> <div class="form-group row"> <label class="form-control-label col-sm-12" for="story">' . translate("Intro Text") . '</label> <div class="col-sm-12"> <span class="help-block">' . translate("HTML is fine, but double check those URLs and HTML tags!") . '</span> <textarea class="tin form-control" rows="25" name="story">' . $story . '</textarea>'; echo aff_editeur('story', ''); echo '</div> </div> <div class="form-group row"> <label class="form-control-label col-sm-12">' . translate("Full Text") . '</label> <div class="col-sm-12"> <textarea class="tin form-control" rows="25" name="bodytext">' . $bodytext . '</textarea>'; echo aff_editeur('bodytext', ''); echo ' </div> </div>'; publication($deb_day, $deb_month, $deb_year, $deb_hour, $deb_min, $fin_day, $fin_month, $fin_year, $fin_hour, $fin_min, $epur); echo '' . Q_spambot() . ''; echo ' <div class="form-group"> <div class="col-sm-12"> <input class="btn btn-secondary" type="submit" name="op" value="' . translate("Preview") . '" /> </div> </div>'; echo ' <div class="form-group"> <div class="col-sm-12"> <input class="btn btn-primary" type="submit" name="op" value="Ok" /> </div> </div> </form>'; include 'footer.php'; }
echo ' <h3>' . translate("Private Message") . '</h3> <hr /> <blockquote class="blockquote">' . translate("About Posting:") . '<br />' . translate("All registered users can post private messages.") . '</blockquote> <form action="replypmsg.php" method="post" name="coolsus">'; if ($submitP) { echo "<hr noshade=\"noshade\" class=\"ongl\" /><p align=\"center\" class=\"header\">" . translate("Preview") . "</p>\n <table border=\"0\" cellpadding=\"2\" cellspacing=\"1\" width=\"100%\">"; echo "<b>" . StripSlashes($subject) . "</b><br /><br />\n"; $Xmessage = $message = StripSlashes($message); if ($allow_html == 0 || isset($html)) { $Xmessage = htmlspecialchars($Xmessage, ENT_COMPAT | ENT_HTML401, cur_charset); } if ($sig) { $Xmessage .= '<br /><br />' . $userdata['user_sig']; } $Xmessage = aff_code($Xmessage); $Xmessage = str_replace("\n", "<br />", $Xmessage); if ($allow_bbcode) { $Xmessage = smilie($Xmessage); $Xmessage = aff_video_yt($Xmessage); } $Xmessage = make_clickable($Xmessage); echo $Xmessage; echo '<hr />'; } echo ' <div class="form-group row"> <label class="form-control-label col-sm-3" for="to_user">' . translate("Recipient") . '</label> <div class="col-sm-9">'; if (!$reply) { $carnet = JavaPopUp("carnet.php", "CARNET", 300, 350);
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> ' . adm_translate("Sauver les modifications") . '</button> <button class="btn btn-outline-secondary col-xs-12 col-sm-6" href="admin.php?op=FaqCatGo&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', '', '', ''); }
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(' ', ' ', 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 . '&archive=1">' . $nuke_url . '/article.php?sid=' . $sid . '&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"); } }
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); }
function meta_lang($Xcontent) { global $meta_glossaire, $admin, $NPDS_debug, $NPDS_debug_str, $NPDS_debug_cycle; // Reduction $Xcontent = str_replace("<!--meta", "", $Xcontent); $Xcontent = str_replace("meta-->", "", $Xcontent); $Xcontent = str_replace("!PHP!", "", $Xcontent); // Sauvegarde le contenu original / analyse et transformation $Ycontent = $Xcontent; $Xcontent = str_replace("\r", " ", $Xcontent); $Xcontent = str_replace("\n", " ", $Xcontent); $Xcontent = str_replace("\t", " ", $Xcontent); $Xcontent = str_replace("<br />", " ", $Xcontent); $Xcontent = str_replace("<BR />", " ", $Xcontent); $Xcontent = str_replace("<BR>", " ", $Xcontent); $Xcontent = str_replace(" ", " ", $Xcontent); $Xcontent = strip_tags($Xcontent); if (trim($Xcontent)) { $Xcontent .= " "; // for compatibility only with old dyna-theme ! $Xcontent .= "!theme! !bgcolor1! !bgcolor2! !bgcolor3! !bgcolor4! !bgcolor5! !bgcolor6! !textcolor1! !textcolor2! "; } else { return $Ycontent; } $text = array_unique(explode(" ", $Xcontent)); $Xcontent = $Ycontent; // Fin d'analyse / restauration du contenu original $tab = array(); while ($word = each($text)) { // longueur minimale du mot : 2 semble un bon compromis sauf pour les smilies ... (1 est donc le choix par défaut) if (strlen($word[1]) > 1) { $op = 0; $arguments = ""; $cmd = ""; $car_deb = substr($word[1], 0, 1); $car_fin = substr($word[1], -1); // entité HTML if ($car_deb != "&" and $car_fin != ";") { // Mot 'pure' if (($car_fin == "." or $car_fin == "," or $car_fin == ";" or $car_fin == "?" or $car_fin == ":") and $word[1] != "...") { $op = 1; $Rword = substr($word[1], 0, -1); } // peut être une fonction if ($car_fin == ")") { $ibid = strpos($word[1], "("); if ($ibid) { $op = 2; $Rword = substr($word[1], 0, $ibid); $arg = substr($word[1], $ibid + 1, strlen($word[1]) - ($ibid + 2)); $arguments = ana_args($arg); } else { $op = 1; $Rword = substr($word[1], 0, -1); } } // peut être un mot encadré par deux balises if ($car_deb == "[" and $car_fin == "]" and $word[1] != "[code]" or $car_deb == "{" and $car_fin == "}") { $op = 5; $Rword = substr($word[1], 1, -1); } } else { $op = 9; $Rword = $word[1]; } if ($car_deb == "(" and $op != 2) { $op = 3; $Rword = substr($word[1], 1); } if ($op == 3 and $car_fin == ")") { $op = 4; $Rword = substr($Rword, 0, -1); } if ($op == 0) { $Rword = $word[1]; } // --- REMPLACEMENTS $type_meta = ""; if (array_key_exists($Rword, $meta_glossaire)) { $Cword = $meta_glossaire[$Rword]['content']; $type_meta = $meta_glossaire[$Rword]['type']; } elseif (array_key_exists($Rword . $car_fin, $meta_glossaire)) { $Cword = $meta_glossaire[$Rword . $car_fin]['content']; $type_meta = $meta_glossaire[$Rword . $car_fin]['type']; $Rword = $Rword . $car_fin; $car_fin = ""; } else { $Cword = $Rword; } // Cword est un meta-mot ? (il en reste qui n'ont pas été interprétés par la passe du dessus ... ceux avec params !) if (substr($Cword, 0, 1) == "!") { $car_meta = strpos($Cword, "!", 1); if ($car_meta) { $Rword = substr($Cword, 1, $car_meta - 1); $arg = substr($Cword, $car_meta + 1); $arguments = ana_args($arg); if (array_key_exists("!" . $Rword . "!", $meta_glossaire)) { $Cword = $meta_glossaire["!" . $Rword . "!"]['content']; $type_meta = $meta_glossaire["!" . $Rword . "!"]['type']; } else { $Cword = ""; $type_meta = ""; } } } // Cword commence par $cmd ? if (substr($Cword, 0, 4) == "\$cmd") { @eval($Cword); if ($cmd === false) { $Cword = "<span style=\"color: red; font-weight: bold;\" title=\"Meta-lang : bad return for function\">{$Rword}</span>"; } else { $Cword = $cmd; } } // Cword commence par function ? if (substr($Cword, 0, 9) == "function ") { $Rword = "MM_" . str_replace("!", "", $Rword); if (!function_exists($Rword)) { @eval($Cword); } $Cword = charg($Rword, $arguments); $Rword = $word[1]; } // si le mot se termine par ^ : on supprime ^ | cela permet d'assurer la protection d'un mot (intouchable) if ($car_fin == "^") { $Cword = substr($Cword, 0, -1) . " "; } // si c'est un meta : remplacement identique à str_replace if ($type_meta == "meta") { $tab[$Rword] = $Cword; } else { if ($car_fin == substr($Rword, -1)) { $car_fin = " "; } $tab[$Rword . $car_fin] = $Cword . $car_fin; } if ($NPDS_debug and $admin) { $NPDS_debug_str .= "=> {$word['1']}<br />"; } } } $Xcontent = strtr($Xcontent, $tab); // Avons-nous quelque chose à supprimer (balise !delete! .... !/!) ? while (strstr($Xcontent, "!delete!")) { $deb = strpos($Xcontent, "!delete!", 0); $fin = strpos($Xcontent, "!/!", $deb + 8); if ($fin) { $Xcontent = str_replace(substr($Xcontent, $deb, $fin + 3 - $deb), "", $Xcontent); } else { $Xcontent = str_replace("!delete!", "", $Xcontent); } } $Xcontent = str_replace("!/!", "", $Xcontent); // traitement [code] ... [/code] if (strstr($Xcontent, "[code]")) { $Xcontent = aff_code($Xcontent); } $NPDS_debug_cycle++; return $Xcontent; }