Esempio n. 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';
}
Esempio n. 2
0
function autoEdit($anid)
{
    global $aid, $hlpfile, $tipath, $radminsuper, $NPDS_Prefix, $adminimg;
    $f_meta_nom = 'autoStory';
    $f_titre = adm_translate("Editer un Article");
    //==> controle droit
    admindroits($aid, $f_meta_nom);
    //<== controle droit
    $result = sql_query("SELECT catid, title, time, hometext, bodytext, topic, informant, notes, ihome, date_debval,date_finval,auto_epur FROM " . $NPDS_Prefix . "autonews WHERE anid='{$anid}'");
    list($catid, $title, $time, $hometext, $bodytext, $topic, $informant, $notes, $ihome, $date_debval, $date_finval, $epur) = sql_fetch_row($result);
    sql_free_result($result);
    $titre = stripslashes($title);
    $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=autoStory");
    }
    $topiclogo = '<span class="label label-default pull-right"><strong>' . aff_langue($topictext) . '</strong></span>';
    include 'header.php';
    GraphicAdmin($hlpfile);
    adminhead($f_meta_nom, $f_titre, $adminimg);
    echo '<h3>' . adm_translate("Editer l'Article Automatique") . '</h3>';
    echo aff_local_langue(adm_translate("Langue de Prévisualisation"), '', '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="" />';
        }
    }
    //     $no_img=false;
    //     if ((file_exists("$tipath$topicimage")) and ($topicimage!="")) {
    //       echo "<img src=\"$tipath$topicimage\" border=\"0\" align=\"right\" alt=\"\" />";
    //     } else {
    //       $no_img=true;
    //     }
    code_aff('<h3>' . $subject . $topiclogo . '</h3>', '<div class="text-muted">' . $hometext . '</div>', $bodytext, $notes);
    if ($no_img) {
        echo "<b>" . aff_langue($topictext) . "</b>";
    }
    echo '<b>' . adm_translate("Utilisateur") . '</b>' . $informant . '<br /><br />';
    echo '
    </div>
   <form action="admin.php" method="post" name="adminForm">
      <div class="form-group row">
         <label class="form-control-label col-sm-4" for="title">' . adm_translate("Titre") . '</label>
         <div class="col-sm-8">
            <input class="form-control" type="text" name="title" size="50" value="' . $titre . '" />
         </div>
      </div>
      <div class="form-group row">
         <label class="form-control-label col-sm-4" 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>\n";
            $sel = '';
        }
    }
    echo ' 
            </select>
         </div>
      </div>';
    SelectCategory($catid);
    echo "<br />";
    puthome($ihome);
    echo '
      <div class="form-group row">
         <label class="form-control-label col-sm-12" for="hometext">' . adm_translate("Texte d'introduction") . '</label>
         <div class="col-sm-12">
            <textarea class="tin form-control" rows="25" name="hometext" >' . $hometext . '</textarea>
         </div>
      </div>
      ' . aff_editeur('hometext', '') . '
      <div class="form-group row">
         <label class="form-control-label col-sm-12" for="bodytext">' . adm_translate("Texte étendu") . '</label>
         <div class="col-sm-12">
            <textarea class="tin form-control" rows="25" name="bodytext" >' . $bodytext . '</textarea>
         </div>
      </div>
      ' . aff_editeur('bodytext', '');
    if ($aid != $informant) {
        echo '
      <div class="form-group row">
         <label class="form-control-label col-sm-12" for="notes">' . adm_translate("Notes") . '</label>
         <div class="col-sm-12">
            <textarea class="tin form-control" rows="7" name="notes">' . $notes . '</textarea>
         </div>
      </div>
      ' . aff_editeur('notes', '');
    }
    $deb_day = substr($date_debval, 8, 2);
    $deb_month = substr($date_debval, 5, 2);
    $deb_year = substr($date_debval, 0, 4);
    $deb_hour = substr($date_debval, 11, 2);
    $deb_min = substr($date_debval, 14, 2);
    //
    $fin_day = substr($date_finval, 8, 2);
    $fin_month = substr($date_finval, 5, 2);
    $fin_year = substr($date_finval, 0, 4);
    $fin_hour = substr($date_finval, 11, 2);
    $fin_min = substr($date_finval, 14, 2);
    //
    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">
         <div class="col-sm-12">
            <input type="hidden" name="anid" value="' . $anid . '" />
            <input type="hidden" name="op" value="autoSaveEdit" />
            <input class="btn btn-primary" type="submit" value="' . adm_translate("Sauver les modifications") . '" />
         </div>
      </div>
   </form>';
    adminfoot('fv', '', '', '');
}
Esempio n. 3
0
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('"', '&quot;', 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';
}