<?php

if ( ! @include_once( './mainfile.php' ) ) { exit( '!! INCLUDE ERROR. ACCESS DENIED !!' ); }
error_reporting( _E_VALUE );


/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | myPHPNuke Version 188_8 RC2                                          |
// +----------------------------------------------------------------------+
// | License: GNU/GPL - http://www.gnu.org/copyleft/gpl.html              |
// +----------------------------------------------------------------------+
// | Support: http://myphpnuke.com/                                       |
// +----------------------------------------------------------------------+
// | Author: myPHPNuke Dev Team                                           |
// +----------------------------------------------------------------------+
// | Copyright: © 2001-2004 myPHPNuke Dev Team                            |
// +----------------------------------------------------------------------+
// $Id: createmedia.php,v 1.5.2.2 2004/04/18 12:46:51 ajvwaay Exp $




function createmedia()
{
    global $module_name, $version, $maxSize, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $gallerypath, $mpnTables, $textcolor1;

    OpenTable();
    echo "<center><font size=\"4\"><b>"._GALADMIN."</b></font></center>";
    CloseTable();
    echo "<br>";
    OpenTable();
    echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>";

    echo "<form method=\"POST\" action=\"admin.php\" enctype=\"multipart/form-data\">
          <input type=\"hidden\" name=\"fct\" value=\"gallery\">
          <input type=\"hidden\" name=\"op\" value=\"doeditmedia\">
          <input type=\"hidden\" name=\"type\" value=\"new\">
          <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" >
          <tr>
          <td align=\"left\" >
          <font face=\"Verdana, Arial\" size=\"2\"><a href=\"admin.php?fct=gallery\">"._GALCONFIG."</a></font> &gt;
          <font face=\"Verdana, Arial\" size=\"2\"><b>"._GALINSERTNMEDIA."</b></font>
          </td>
          </tr>
          </table>
          </td>
      <tr>
          <td width=\"100%\" bgcolor=\"$bgcolor1\">
          <table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" ><tr>
          <td align=\"left\" valign=\"top\" >
          <font size=\"1\" face=\"Verdana, Arial\">"._GALSELECTCATEGORY."</font><br>
          <select size=\"1\" name=\"Category\">";
    $categories = listcategories("$gallerypath");
    $categories = explode(" ", trim($categories));

    while(list($key, $val) = each($categories))
    {
        $result = mysql_query("select gallid, gallname, parent from ".$mpnTables['gallery_categories']." where gallid=".$val);
        list($gallid, $gallname, $parent) = mysql_fetch_row($result);
        $nbtabs = indent($gallid);
        $tab = "";
        for($k=0; $k<$nbtabs; $k++)
        {
            $tab .= "&nbsp;&nbsp;";
        }

        echo "<option value=\"$gallid\">$tab$gallname</option>\n";
    }

    echo "</select><br>
          <font size=\"1\" face=\"Verdana, Arial\">"._GALMEDIANAME."<br></font>
          <input type=\"text\" name=\"MediaName\" size=\"14\" value=\"\"><br>
      <font size=\"1\" face=\"Verdana, Arial\">"._GALFILENAME."</font><br>
      <INPUT TYPE=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"$maxSize\">
      <input type=\"file\" name=\"userfile\" size=\"14\"><br>
      <font size=\"1\" face=\"Verdana, Arial\">"._GALSUBMITTER."</font><br>
      <input type=\"text\" name=\"Submitter\" size=\"14\" value=\"\"><br>
      </td>
      <td align=\"left\" valign=\"top\"><font size=\"1\" face=\"Verdana, Arial\">"._GALDESCRIPTION."</font><br>
      <textarea  name=\"Description\" rows=\"9\" cols=\"25\"></textarea>
      </td></tr>
      </table>
      </td>
      </tr>
      <tr><td align=\"center\"><input class=\"button\" type=\"submit\" value=\"Insert\" name=\"add\"></form></td></tr>
      </tr></table>";

    echo "<br>";
    CloseTable();

    // Start Of Footer
    OpenTable();
    print '<table><tr><td>'
         ."<font face=\"Verdana,Arial\" color=\"$textcolor1\">mpn eGallery Version - $version<br>"._GALVISITUPDATE.'</font>
       </td>
       </tr></table>';

    CloseTable();
}

?>
