<?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         */
/********************************************************/

//$lid = intval($lid);
$pagetitle = " - "._ML_ADMIN." ".$ml_config['version_number'];
incoh();
title(_ML_ADMIN." ".$ml_config['version_number']);
ML_Admin();
echo "<br />\n";
Max_OpenTable();
if(strlen($text) > 0) { $text = stripslashes($text)."\n"; }
if(strlen($htmltext) > 0) { $htmltext = stripslashes($htmltext)."\n"; }
if(count($lid) > 0) {
  for($i=0; $i < count($lid); $i++) {
    $result = $db->sql_query("SELECT title, version, description FROM ".TABLE_NSNGD_DOWNLOADS." WHERE lid='$lid[$i]'");
    list($title, $version, $description) = $db->sql_fetchrow($result);
    if(strlen($title) == 0) {
      print "lidtype";
      $lidtype = '0';
    }
    switch($lidtype) {
      case '1' : // Send link only
        $text = $text."$title $version\n"._ML_DOWNLOADTEXT."\n$nukeurl/modules.php?name=Downloads&amp;op=getit&amp;lid=$lid[$i]\n";
        $htmltext = $htmltext."<a href=\"$nukeurl/modules.php?name=Downloads&amp;op=getit&amp;lid=$lid[$i]\">$title</a> $version\n";
      break;

      case '2' : // Send shorttext and link
        $text = $text."$title $version\n$description\n\n"._ML_DOWNLOADTEXT."\n$nukeurl/modules.php?name=Downloads&amp;op=getit&amp;lid=$lid[$i]\n";
        $htmltext = $htmltext."$title $version<br /><br />$description<br /><br /><a href=\"$nukeurl/modules.php?name=Downloads&amp;op=getit&amp;lid=$lid[$i]\">"._ML_DOWNLOADTEXT."</a>\n";
      break;
    }
    if ($seperator == '1') {
      $text = $text._ML_TEXTSEPERATOR;
      $htmltext = $htmltext._ML_HTMLSEPERATOR;
    }
  }
}
echo "<center><b>"._ML_DOWNLOADADDED."</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();

?>