// // http://www.chezgreg.net/coppermine/ // // -------------------------------------------------------------------- // // Updated by the Coppermine Dev Team // // (http://coppermine.sf.net/team/) // // see /docs/credits.html for details // // ---------------------------------------------------------------------// // New Port by GoldenTroll // // http://coppermine.findhere.org/ // // Based on coppermine 1.1d by Surf http://www.surf4all.net/ // /************************************************************************/ if (eregi("modules/", $_SERVER['PHP_SELF'])) { die ("You can't access this file directly..."); } define('UPLOAD_PHP', true); require("modules/" . $name . "/include/load.inc"); if (!USER_CAN_UPLOAD_PICTURES){ cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__); } // Type 0 => input // 1 => file input // 2 => album list $data = array( sprintf($lang_upload_php['max_fsize'], $CONFIG['max_upl_size']), array($lang_upload_php['album'], 'album', 2), array($lang_upload_php['picture'], 'userpicture', 1), array($lang_upload_php['pic_title'], 'title', 0, 255), array($lang_upload_php['description'], 'caption', 3, $CONFIG['max_img_desc_length']), array($lang_upload_php['keywords'], 'keywords', 0, 255), array($CONFIG['user_field1_name'], 'user1', 0, 255), array($CONFIG['user_field2_name'], 'user2', 0, 255), array($CONFIG['user_field3_name'], 'user3', 0, 255), array($CONFIG['user_field4_name'], 'user4', 0, 255) ); function form_label($text) { echo << $text EOT; } function form_input($text, $name, $max_length) { if ($text == ''){ echo " \n"; return; } echo << $text EOT; } function form_file_input($text, $name) { global $CONFIG; $max_file_size = $CONFIG['max_upl_size'] << 10; echo << $text EOT; } function form_alb_list_box($text, $name) { global $CONFIG; global $user_albums_list, $public_albums_list; $sel_album = isset($_GET['album']) ? $_GET['album'] : 0; echo << $text EOT; } function create_form(& $data) { foreach($data as $element){ if ((is_array($element))){ switch ($element[2]){ case 0 : form_input($element[0], $element[1], $element[3]); break; case 1 : form_file_input($element[0], $element[1]); break; case 2 : form_alb_list_box($element[0], $element[1]); break; case 3 : form_textarea($element[0], $element[1], $element[3]); break; default: cpg_die(ERROR, 'Invalid action for form creation', __FILE__, __LINE__); } // switch }else{ form_label($element); } } } $public_albums_list = get_albumlist(USER_ID); $user_albums_list = array(); if (!count($public_albums_list) && !count($user_albums_list)){ cpg_die (ERROR, $lang_upload_php['err_no_alb_uploadables'], __FILE__, __LINE__); } pageheader($lang_upload_php['title']); starttable("100%", $lang_upload_php['title'], 2); if (defined('IN_POSTNUKE')) { $pn=' '; } else { $pn=''; } echo '
'; create_form($data); echo << $pn EOT; endtable(); pagefooter(); ?>