Example #1
0
function previewAdminStory($subject, $hometext, $bodytext, $topic, $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, $tipath, $hlpfile, $language, $aid, $radminsuper, $adminimg, $topicimage;
    $hlpfile = "manuels/{$language}/newarticle.html";
    $subject = stripslashes(str_replace('"', '"', $subject));
    $hometext = stripslashes($hometext);
    $bodytext = stripslashes($bodytext);
    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");
    }
    $f_meta_nom = 'adminStory';
    $f_titre = adm_translate("Nouvel Article");
    //==> controle droit
    //   admindroits($aid,$f_meta_nom); // à voir l'intégrationavec les droits sur les topics ...
    //<== controle droit
    $topiclogo = '<span class="label label-default pull-right"><strong>' . aff_langue($topictext) . '</strong></span>';
    include 'header.php';
    GraphicAdmin($hlpfile);
    global $local_user_language;
    adminhead($f_meta_nom, $f_titre, $adminimg);
    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 " src="' . $timage . '" align="right" alt="" />';
        }
    }
    code_aff('<h3>' . $subject . $topiclogo . '</h3>', '<div class="text-muted">' . $hometext . '</div>', $bodytext, '');
    echo '
   </div>
      <div class="form-group row">
         <label class="col-sm-4 form-control-label" for="subject">' . adm_translate("Titre") . '</label>
         <div class="col-sm-8">
            <input class="form-control" type="text" name="subject" value="' . $subject . '" />
         </div>
      </div>
      <div class="form-group row">
         <label class="col-sm-4 form-control-label" for="topic">' . adm_translate("Sujet") . '</label>
         <div class="col-sm-8">
            <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>
         </div>
      </div>';
    $cat = $catid;
    SelectCategory($catid);
    echo "<br />";
    if ($members == 1 and $Mmembers == "") {
        $ihome = "-127";
    }
    if ($members == 1 and ($Mmembers > 1 and $Mmembers <= 127)) {
        $ihome = $Mmembers;
    }
    puthome($ihome);
    echo '
      <div class="form-group row">
         <label class="form-control-label col-xs-12" for="hometext">' . adm_translate("Texte d'introduction") . '</label>
         <div class="col-xs-12">
            <textarea class="tin form-control" rows="25" name="hometext">' . $hometext . '</textarea>
         </div>
      </div>';
    echo aff_editeur("hometext", "true");
    echo '
      <div class="form-group row">
         <label class="form-control-label col-xs-12" for="bodytext">' . adm_translate("Texte étendu") . '</label>
         <div class="col-xs-12">
            <textarea class="tin form-control" rows="25" name="bodytext" >' . $bodytext . '</textarea>
         </div>
      </div>';
    echo aff_editeur('bodytext', '');
    publication($deb_day, $deb_month, $deb_year, $deb_hour, $deb_min, $fin_day, $fin_month, $fin_year, $fin_hour, $fin_min, $epur);
    echo '
      <div class="form-group row">
         <input type="hidden" name="author" value="' . $aid . '" />
         <div class="col-xs-7">
            <select class="c-select form-control" name="op">
               <option value="PreviewAdminStory" selected>' . adm_translate("Prévisualiser") . '</option>
               <option value="PostStory">' . adm_translate("Poster un Article Admin") . '</option>
            </select>
         </div>
         <div class="col-xs-5">
             <input class="btn btn-primary" type="submit" value="' . adm_translate("Ok") . '" />
         </div>
      </div>
   </form>';
    include 'footer.php';
}
Example #2
0
function aff_local_langue($mess = '', $ibid_index, $ibid)
{
    if ($ibid_index == '') {
        global $REQUEST_URI;
        $ibid_index = $REQUEST_URI;
    }
    $M_langue = '<form action="' . $ibid_index . '" name="local_user_language" method="post">';
    $M_langue .= $mess . aff_localzone_langue($ibid);
    $M_langue .= '</form>';
    return $M_langue;
}