<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* 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.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
/********************************************************/
/* NSN Mailing List                                     */
/* By: NukeScripts Network (webmaster@nukescripts.net)  */
/* http://www.nukescripts.net                           */
/* Copyright  2000-2005 by NukeScripts Network         */
/********************************************************/

//$sid = intval($sid);
$pagetitle = " - "._ML_ADMIN." ".$ml_config['version_number'];
incoh();
title(_ML_ADMIN." ".$ml_config['version_number']);
ML_Admin();
br('1');
Max_OpenTable();
if(strlen($text) > 0) { $text = stripslashes($text)."\n"; }
if(strlen($htmltext) > 0) { $htmltext = stripslashes($htmltext)."\n"; }
if(count($sid) > 0) {
  for($i=0; $i < count($sid); $i++) {
    $result = $db->sql_query("SELECT title, hometext, bodytext FROM ".TABLE_STORIES." WHERE sid='$sid[$i]'");
    list($title, $hometext, $bodytext) = $db->sql_fetchrow($result);
    if(strlen($title) == 0) {
      print "sidtype";
      $sidtype = '0';
    }
    switch($sidtype) {
      case '1' : // Send link only
        $text = $text."$title\n"._ML_STORYLINKTEXT."\n$nukeurl/modules.php?name=News&file=article&sid=$sid[$i]&mode=nested\n";
        $htmltext = $htmltext."<a href=\"$nukeurl/modules.php?name=News&file=article&sid=$sid[$i]&mode=nested\">$title</a>\n";
      break;

      case '2' : // Send hometext and link
        $text = $text."$title\n$hometext\n\n"._ML_STORYLINKTEXT."\n$nukeurl/modules.php?name=News&file=article&sid=$sid[$i]&mode=nested\n";
        $htmltext = $htmltext."$title<br /><br />$hometext<br /><br /><a href=\"$nukeurl/modules.php?name=News&file=article&sid=$sid[$i]&mode=nested\">"._ML_STORYLINKTEXT."</a>\n";
      break;

      case '3' : // Send full Story
        $text = $text."$title\n$hometext\n$bodytext\n\n"._ML_STORYLINKTEXT."\n$nukeurl/modules.php?name=News&file=article&sid=$sid[$i]&mode=nested\n";
        $htmltext = $htmltext."$title<br /><br />$hometext<br />$bodytext<br /><br /><a href=\"$nukeurl/modules.php?name=News&file=article&sid=$sid[$i]&mode=nested\">"._ML_STORYLINKTEXT."</a>\n";
      break;
    }
    if ($seperator == '1') {
      $text = $text._ML_TEXTSEPERATOR;
      $htmltext = $htmltext._ML_HTMLSEPERATOR;
    }
  }
}
echo "<center><b>"._ML_STORYADDED."</b></center><br />\n";
echo "<form action='".$admin_file.".php?op=MLAddIssue' method='POST'>\n";
echo "<input type='hidden' name='sub' value='".htmlspecialchars($sub, ENT_QUOTES)."'>\n";
echo "<input type='hidden' name='text' value='".htmlspecialchars($text, ENT_QUOTES)."'>\n";
echo "<input type='hidden' name='htmltext' value='".htmlspecialchars($htmltext, ENT_QUOTES)."'>\n";
echo "<center><input type='submit' value='"._ML_RESUME."'></center>\n";
echo "</form>\n";
Max_CloseTable();
incof();

?>