Beispiel #1
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', '', '', '');
}
Beispiel #2
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('"', '&quot;', $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';
}
Beispiel #3
0
}
echo " />" . _AM_NO . "&nbsp;&nbsp;&nbsp;";
echo "<b>" . _AM_TOPICALIGN . "</b>&nbsp;<select name='topicalign'>\n";
if ("L" == $topicalign) {
    $sel = " selected='selected'";
} else {
    $sel = "";
}
echo "<option value='R'>" . _AM_RIGHT . "</option>\n";
echo "<option value='L'" . $sel . ">" . _AM_LEFT . "</option>\n";
echo "</select>\n";
echo "<br />";
if (isset($ihome)) {
    puthome($ihome);
} else {
    puthome();
}
echo "</p><p><b>" . _AM_INTROTEXT . "</b><br /><br />\n";
xoopsCodeTarea("hometext", 60, 15);
xoopsSmilies("hometext");
echo "<br /></p><p><b>" . _AM_EXTEXT . "</b><br /><br />\n";
xoopsCodeTarea("bodytext", 60, 15, 2);
xoopsSmilies("bodytext");
echo "</p>" . _MULTIPAGE;
if (!empty($xoopsConfig['allow_html'])) {
    echo "<p>" . _AM_ALLOWEDHTML . "<br />";
    //echo get_allowed_html();
    echo "</p>";
}
echo "<p><input type='checkbox' name='nosmiley' value='1'";
if (isset($nosmiley) && $nosmiley == 1) {
Beispiel #4
0
 function previewAdminStory($automated, $year, $day, $month, $hour, $min, $subject, $hometext, $bodytext, $topic, $catid, $ihome, $alanguage, $acomm, $pollTitle, $optionText, $assotop)
 {
     global $user, $bgcolor1, $bgcolor2, $prefix, $db, $alanguage, $multilingual;
     include 'header.php';
     if ($topic < 1) {
         $topic = 1;
     }
     GraphicAdmin();
     OpenTable();
     echo "<center><font class=\"title\"><b>" . _ARTICLEADMIN . "</b></font></center>";
     CloseTable();
     echo "<br>";
     $today = getdate();
     $tday = $today[mday];
     if ($tday < 10) {
         $tday = "0{$tday}";
     }
     $tmonth = $today[month];
     $tyear = $today[year];
     $thour = $today[hours];
     if ($thour < 10) {
         $thour = "0{$thour}";
     }
     $tmin = $today[minutes];
     if ($tmin < 10) {
         $tmin = "0{$tmin}";
     }
     $tsec = $today[seconds];
     if ($tsec < 10) {
         $tsec = "0{$tsec}";
     }
     $date = "{$tmonth} {$tday}, {$tyear} @ {$thour}:{$tmin}:{$tsec}";
     OpenTable();
     echo "<center><font class=\"option\"><b>" . _PREVIEWSTORY . "</b></font></center><br><br>" . "<form action=\"admin.php\" method=\"post\">" . "<input type=\"hidden\" name=\"catid\" value=\"{$catid}\">";
     $subject = stripslashes($subject);
     $subject = ereg_replace("\"", "''", $subject);
     $hometext = stripslashes($hometext);
     $bodytext = stripslashes($bodytext);
     $result = $db->sql_query("select topicimage from " . $prefix . "_topics where topicid='{$topic}'");
     list($topicimage) = $db->sql_fetchrow($result);
     echo "<table border=\"0\" width=\"75%\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"{$bgcolor2}\" align=\"center\"><tr><td>" . "<table border=\"0\" width=\"100%\" cellpadding=\"8\" cellspacing=\"1\" bgcolor=\"{$bgcolor1}\"><tr><td>" . "<img src=\"images/topics/{$topicimage}\" border=\"0\" align=\"right\" alt=\"\">";
     themepreview($subject, $hometext, $bodytext);
     echo "</td></tr></table></td></tr></table>" . "<br><br><b>" . _TITLE . "</b><br>" . "<input type=\"text\" name=\"subject\" size=\"50\" value=\"{$subject}\"><br><br>" . "<b>" . _TOPIC . "</b><select name=\"topic\">";
     $toplist = $db->sql_query("select topicid, topictext from " . $prefix . "_topics order by topictext");
     echo "<option value=\"\">" . _ALLTOPICS . "</option>\n";
     while (list($topicid, $topics) = $db->sql_fetchrow($toplist)) {
         $topicid = intval($topicid);
         if ($topicid == $topic) {
             $sel = "selected ";
         }
         echo "<option {$sel} value=\"{$topicid}\">{$topics}</option>\n";
         $sel = "";
     }
     echo "</select><br><br>";
     for ($i = 0; $i < sizeof($assotop); $i++) {
         $associated .= "{$assotop[$i]}-";
     }
     $asso_t = explode("-", $associated);
     echo "<table border='0' width='100%' cellspacing='0'><tr><td width='20%'><b>" . _ASSOTOPIC . "</b></td><td width='100%'>" . "<table border='1' cellspacing='3' cellpadding='8'><tr>";
     $sql = "SELECT topicid, topictext FROM " . $prefix . "_topics ORDER BY topictext";
     $result = $db->sql_query($sql);
     while ($row = $db->sql_fetchrow($result)) {
         if ($a == 3) {
             echo "</tr><tr>";
             $a = 0;
         }
         for ($i = 0; $i < sizeof($asso_t); $i++) {
             if ($asso_t[$i] == $row[topicid]) {
                 $checked = "CHECKED";
                 break;
             }
         }
         echo "<td><input type='checkbox' name='assotop[]' value='{$row['topicid']}' {$checked}>{$row['topictext']}</td>";
         $checked = "";
         $a++;
     }
     echo "</tr></table></td></tr></table><br><br>";
     $cat = $catid;
     SelectCategory($cat);
     echo "<br>";
     puthome($ihome, $acomm);
     if ($multilingual == 1) {
         echo "<br><b>" . _LANGUAGE . ": </b>" . "<select name=\"alanguage\">";
         $handle = opendir('language');
         while ($file = readdir($handle)) {
             if (preg_match("/^lang\\-(.+)\\.php/", $file, $matches)) {
                 $langFound = $matches[1];
                 $languageslist .= "{$langFound} ";
             }
         }
         closedir($handle);
         $languageslist = explode(" ", $languageslist);
         sort($languageslist);
         for ($i = 0; $i < sizeof($languageslist); $i++) {
             if ($languageslist[$i] != "") {
                 echo "<option value=\"{$languageslist[$i]}\" ";
                 if ($languageslist[$i] == $alanguage) {
                     echo "selected";
                 }
                 echo ">" . ucfirst($languageslist[$i]) . "</option>\n";
             }
         }
         if ($alanguage == "") {
             $sellang = "selected";
         } else {
             $sellang = "";
         }
         echo "<option value=\"\" {$sellang}>" . _ALL . "</option></select>";
     } else {
         echo "<input type=\"hidden\" name=\"alanguage\" value=\"{$language}\">";
     }
     echo "<br><br><b>" . _STORYTEXT . "</b><br>" . "<textarea wrap=\"virtual\" cols=\"50\" rows=\"12\" name=\"hometext\">{$hometext}</textarea><br><br>" . "<b>" . _EXTENDEDTEXT . "</b><br>" . "<textarea wrap=\"virtual\" cols=\"50\" rows=\"12\" name=\"bodytext\">{$bodytext}</textarea><br><br>";
     if ($automated == 1) {
         $sel1 = "checked";
         $sel2 = "";
     } else {
         $sel1 = "";
         $sel2 = "checked";
     }
     echo "<br><b>" . _PROGRAMSTORY . "</b>&nbsp;&nbsp;" . "<input type=\"radio\" name=\"automated\" value=\"1\" {$sel1}>" . _YES . " &nbsp;&nbsp;" . "<input type=\"radio\" name=\"automated\" value=\"0\" {$sel2}>" . _NO . "<br><br>" . "" . _NOWIS . ": {$date}<br><br>";
     $xday = 1;
     echo "" . _DAY . ": <select name=\"day\">";
     while ($xday <= 31) {
         if ($xday == $day) {
             $sel = "selected";
         } else {
             $sel = "";
         }
         echo "<option name=\"day\" {$sel}>{$xday}</option>";
         $xday++;
     }
     echo "</select>";
     $xmonth = 1;
     echo "" . _UMONTH . ": <select name=\"month\">";
     while ($xmonth <= 12) {
         if ($xmonth == $month) {
             $sel = "selected";
         } else {
             $sel = "";
         }
         echo "<option name=\"month\" {$sel}>{$xmonth}</option>";
         $xmonth++;
     }
     echo "</select>";
     echo "" . _YEAR . ": <input type=\"text\" name=\"year\" value=\"{$year}\" size=\"5\" maxlength=\"4\">";
     echo "<br>" . _HOUR . ": <select name=\"hour\">";
     $xhour = 0;
     $cero = "0";
     while ($xhour <= 23) {
         $dummy = $xhour;
         if ($xhour < 10) {
             $xhour = "{$cero}{$xhour}";
         }
         if ($xhour == $hour) {
             $sel = "selected";
         } else {
             $sel = "";
         }
         echo "<option name=\"hour\" {$sel}>{$xhour}</option>";
         $xhour = $dummy;
         $xhour++;
     }
     echo "</select>";
     echo ": <select name=\"min\">";
     $xmin = 0;
     while ($xmin <= 59) {
         if ($xmin == 0 or $xmin == 5) {
             $xmin = "0{$xmin}";
         }
         if ($xmin == $min) {
             $sel = "selected";
         } else {
             $sel = "";
         }
         echo "<option name=\"min\" {$sel}>{$xmin}</option>";
         $xmin = $xmin + 5;
     }
     echo "</select>";
     echo ": 00<br><br>" . "<select name=\"op\">" . "<option value=\"PreviewAdminStory\" selected>" . _PREVIEWSTORY . "</option>" . "<option value=\"PostAdminStory\">" . _POSTSTORY . "</option>" . "</select>" . "<input type=\"submit\" value=\"" . _OK . "\">";
     CloseTable();
     echo "<br>";
     putpoll($pollTitle, $optionText);
     echo "</form>";
     include 'footer.php';
 }
Beispiel #5
0
 function poll_createPoll()
 {
     global $language, $admin, $multilingual, $prefix, $db;
     include 'header.php';
     GraphicAdmin();
     OpenTable();
     echo "<center><font class=\"title\"><b>" . _POLLSADMIN . "</b></font></center>";
     CloseTable();
     echo "<br>";
     OpenTable();
     echo "<center><font class=\"option\"><b>" . _CREATEPOLL . "</b></font><br><br>" . "[ <a href=\"admin.php?op=remove\">" . _DELETEPOLLS . "</a> | <a href=\"admin.php?op=polledit_select\">" . _EDITPOLL . "</a> ]</center><br><br>" . "<form action=\"admin.php\" method=\"post\">" . "" . _POLLTITLE . ": <input type=\"text\" name=\"pollTitle\" size=\"50\" maxlength=\"100\"><br><br>";
     if ($multilingual == 1) {
         echo "<br>" . _LANGUAGE . ": " . "<select name=\"planguage\">";
         $handle = opendir('language');
         while ($file = readdir($handle)) {
             if (preg_match("/^lang\\-(.+)\\.php/", $file, $matches)) {
                 $langFound = $matches[1];
                 $languageslist .= "{$langFound} ";
             }
         }
         closedir($handle);
         $languageslist = explode(" ", $languageslist);
         sort($languageslist);
         for ($h = 0; $h < sizeof($languageslist); $h++) {
             if ($languageslist[$h] != "") {
                 echo "<option value=\"{$languageslist[$h]}\" ";
                 if ($languageslist[$h] == $language) {
                     echo "selected";
                 }
                 echo ">" . ucfirst($languageslist[$h]) . "</option>\n";
             }
         }
         echo "</select><br><br>";
     } else {
         echo "<input type=\"hidden\" name=\"planguage\" value=\"{$language}\"><br><br>";
     }
     echo "<font class=\"content\">" . _POLLEACHFIELD . "</font><br>" . "<table border=\"0\">";
     for ($i = 1; $i <= 12; $i++) {
         echo "<tr>" . "<td>" . _OPTION . " {$i}:</td><td><input type=\"text\" name=\"optionText[{$i}]\" size=\"50\" maxlength=\"50\"></td>" . "</tr>";
     }
     echo "</table>" . "<br><br><center><hr size=\"1\" noshade><font class=\"option\"><b>" . _ANNOUNCEPOLL . "</b></font><br>" . "<font class=\"tiny\">" . _LEAVEBLANK . "</font></center>" . "<br><br><b>" . _TITLE . ":</b><br>" . "<input type=\"text\" name=\"title\" size=\"40\"><br><br>";
     $cat = 0;
     $ihome = 0;
     $acomm = 0;
     SelectCategory($cat);
     echo "<br>";
     puthome($ihome, $acomm);
     echo "<b>" . _TOPIC . "</b> <select name=\"topic\">";
     $toplist = $db->sql_query("SELECT topicid, topictext from " . $prefix . "_topics order by topictext");
     echo "<option value=\"\">" . _SELECTTOPIC . "</option>\n";
     while ($row = $db->sql_fetchrow($toplist)) {
         $topicid = intval($row['topicid']);
         $topics = $row['topictext'];
         echo "<option value=\"{$topicid}\">{$topics}</option>\n";
     }
     echo "</select>";
     echo "<br><br><b>" . _STORYTEXT . "</b><br>" . "<textarea wrap=\"virtual\" cols=\"50\" rows=\"7\" name=\"hometext\">{$story}</textarea><br><br>" . "<b>" . _EXTENDEDTEXT . "</b><br>" . "<textarea wrap=\"virtual\" cols=\"50\" rows=\"8\" name=\"bodytext\"></textarea><BR>" . "<br><br>" . "<input type=\"hidden\" name=\"op\" value=\"createPosted\">" . "<input type=\"submit\" value=\"" . _CREATEPOLLBUT . "\">" . "</form>";
     CloseTable();
     include 'footer.php';
 }
Beispiel #6
0
 function editStory($sid)
 {
     global $user, $bgcolor1, $bgcolor2, $aid, $prefix, $db, $multilingual, $admin_file;
     $aid = substr("{$aid}", 0, 25);
     $result = $db->sql_query("select radminsuper from " . $prefix . "_authors where aid='{$aid}'");
     list($radminsuper) = $result->fetch_row();
     $radminsuper = intval($radminsuper);
     $result = $db->sql_query("SELECT admins FROM " . $prefix . "_modules WHERE title='News'");
     $row2 = $db->sql_fetchrow($db->sql_query("SELECT name FROM " . $prefix . "_authors WHERE aid='{$aid}'"));
     while ($row = $db->sql_fetchrow($result)) {
         $admins = explode(",", $row['admins']);
         $auth_user = 0;
         for ($i = 0; $i < sizeof($admins); $i++) {
             if ($row2['name'] == $admins[$i]) {
                 $auth_user = 1;
             }
         }
         if ($auth_user == 1) {
             $radminarticle = 1;
         }
     }
     $result2 = $db->sql_query("select aid from " . $prefix . "_stories where sid='{$sid}'");
     list($aaid) = $result2->fetch_row();
     $aaid = substr("{$aaid}", 0, 25);
     if ($radminarticle == 1 and $aaid == $aid or $radminsuper == 1) {
         include 'header.php';
         GraphicAdmin();
         OpenTable();
         echo "<center><font class=\"title\"><b>" . _ARTICLEADMIN . "</b></font></center>";
         CloseTable();
         echo "<br>";
         $result = $db->sql_query("SELECT catid, title, hometext, bodytext, topic, notes, ihome, alanguage, acomm FROM " . $prefix . "_stories where sid='{$sid}'");
         list($catid, $subject, $hometext, $bodytext, $topic, $notes, $ihome, $alanguage, $acomm) = $result->fetch_row();
         $catid = intval($catid);
         $topic = intval($topic);
         $subject = filter($subject, "nohtml");
         $hometext = filter($hometext);
         $bodytext = filter($bodytext);
         $notes = filter($notes);
         $ihome = intval($ihome);
         $acomm = intval($acomm);
         $result2 = $db->sql_query("select topicimage from " . $prefix . "_topics where topicid='{$topic}'");
         list($topicimage) = $result2->fetch_row();
         OpenTable();
         echo "<center><font class=\"option\"><b>" . _EDITARTICLE . "</b></font></center><br>" . "<table width=\"80%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"{$bgcolor2}\" align=\"center\"><tr><td>" . "<table width=\"100%\" border=\"0\" cellpadding=\"8\" cellspacing=\"1\" bgcolor=\"{$bgcolor1}\"><tr><td>" . "<img src=\"images/topics/{$topicimage}\" border=\"0\" align=\"right\">";
         themepreview($subject, $hometext, $bodytext, $notes);
         echo "</td></tr></table></td></tr></table><br><br>" . "<form action=\"" . $admin_file . ".php\" method=\"post\">" . "<b>" . _TITLE . "</b><br>" . "<input type=\"text\" name=\"subject\" size=\"50\" value=\"{$subject}\"><br><br>" . "<b>" . _TOPIC . "</b> <select name=\"topic\">";
         $toplist = $db->sql_query("select topicid, topictext from " . $prefix . "_topics order by topictext");
         echo "<option value=\"\">" . _ALLTOPICS . "</option>\n";
         while (list($topicid, $topics) = $toplist->fetch_row()) {
             $topicid = intval($topicid);
             $topics = filter($topics, "nohtml");
             if ($topicid == $topic) {
                 $sel = "selected ";
             }
             echo "<option {$sel} value=\"{$topicid}\">{$topics}</option>\n";
             $sel = "";
         }
         echo "</select>";
         echo "<br><br>";
         $asql = "SELECT associated FROM " . $prefix . "_stories WHERE sid='{$sid}'";
         $aresult = $db->sql_query($asql);
         $arow = $db->sql_fetchrow($aresult);
         $asso_t = explode("-", $arow[associated]);
         echo "<table border='0' width='100%' cellspacing='0'><tr><td width='20%'><b>" . _ASSOTOPIC . "</b></td><td width='100%'>" . "<table border='0' cellspacing='0' cellpadding='0'><tr>";
         $sql = "SELECT topicid, topictext FROM " . $prefix . "_topics ORDER BY topictext";
         $result = $db->sql_query($sql);
         echo "<td><select multiple name=\"assotop[]\" size=\"5\">";
         while ($row = $db->sql_fetchrow($result)) {
             for ($i = 0; $i < sizeof($asso_t); $i++) {
                 if ($asso_t[$i] == $row['topicid']) {
                     $checked = "selected";
                     break;
                 }
             }
             $row['topicid'] = intval($row['topicid']);
             $row['topictext'] = filter($row['topictext'], "nohtml");
             echo "<option value='" . $row['topicid'] . "' {$checked}>" . $row['topictext'] . "</option>";
             $checked = "";
         }
         echo "</select></td>";
         echo "</tr></table></td></tr></table><br><br>";
         $cat = $catid;
         SelectCategory($cat);
         echo "<br>";
         puthome($ihome, $acomm);
         if ($multilingual == 1) {
             echo "<br><b>" . _LANGUAGE . ":</b>" . "<select name=\"alanguage\">";
             $handle = opendir('language');
             while ($file = readdir($handle)) {
                 if (preg_match("/^lang\\-(.+)\\.php/", $file, $matches)) {
                     $langFound = $matches[1];
                     $languageslist .= "{$langFound} ";
                 }
             }
             closedir($handle);
             $languageslist = explode(" ", $languageslist);
             sort($languageslist);
             for ($i = 0; $i < sizeof($languageslist); $i++) {
                 if (!empty($languageslist[$i])) {
                     echo "<option name=\"alanguage\" value=\"{$languageslist[$i]}\" ";
                     if ($languageslist[$i] == $alanguage) {
                         echo "selected";
                     }
                     echo ">" . ucfirst($languageslist[$i]) . "\n</option>";
                 }
             }
             if (empty($alanguage)) {
                 $sellang = "selected";
             } else {
                 $sellang = "";
             }
             echo "<option value=\"\" {$sellang}>" . _ALL . "</option></select>";
         } else {
             echo "<input type=\"hidden\" name=\"alanguage\" value=\"\">";
         }
         echo "<br><br><b>" . _STORYTEXT . "</b><br>" . "<textarea wrap=\"virtual\" cols=\"100\" rows=\"15\" name=\"hometext\">{$hometext}</textarea><br><br>" . "<b>" . _EXTENDEDTEXT . "</b><br>" . "<textarea wrap=\"virtual\" cols=\"100\" rows=\"15\" name=\"bodytext\">{$bodytext}</textarea><br>" . "<font class=\"content\">" . _AREYOUSURE . "</font><br><br>" . "<b>" . _NOTES . "</b><br>" . "<textarea wrap=\"virtual\" cols=\"100\" rows=\"10\" name=\"notes\">{$notes}</textarea><br><br>" . "<input type=\"hidden\" NAME=\"sid\" size=\"50\" value=\"{$sid}\">" . "<input type=\"hidden\" name=\"op\" value=\"ChangeStory\">" . "<input type=\"submit\" value=\"" . _SAVECHANGES . "\">" . "</form>";
         CloseTable();
         include 'footer.php';
     } else {
         include 'header.php';
         GraphicAdmin();
         OpenTable();
         echo "<center><font class=\"title\"><b>" . _ARTICLEADMIN . "</b></font></center>";
         CloseTable();
         echo "<br>";
         OpenTable();
         echo "<center><b>" . _NOTAUTHORIZED1 . "</b><br><br>" . "" . _NOTAUTHORIZED2 . "<br><br>" . "" . _GOBACK . "";
         CloseTable();
         include "footer.php";
     }
 }