PageRenderTime 38ms CodeModel.GetById 10ms RepoModel.GetById 1ms app.codeStats 0ms

/modules/myalbum/submit.php

https://github.com/severnaya99/Sg-2010
PHP | 473 lines | 360 code | 70 blank | 43 comment | 94 complexity | 4ed4a49e8c44d27577d596c6e0c98e4e MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0, GPL-2.0
  1. <?php
  2. // ------------------------------------------------------------------------- //
  3. // myAlbum-P - XOOPS photo album //
  4. // <http://www.peak.ne.jp/>
  5. // su server //
  6. // ------------------------------------------------------------------------- //
  7. include( 'header.php' ) ;
  8. include_once( XOOPS_ROOT_PATH . '/class/xoopstree.php' ) ;
  9. include_once( 'class/myuploader.php' ) ;
  10. include_once( 'class/myalbum.textsanitizer.php' );
  11. $id_foto_principale_tmp = empty( $_GET['id_foto_principale'] ) ? 0 : intval( $_GET['id_foto_principale'] ) ;
  12. $result = $xoopsDB->query("SELECT * FROM $table_photos WHERE lid = ".$id_foto_principale_tmp." AND submitter = ".$xoopsUser->getVar('uid')."");
  13. $RowsNum = $xoopsDB->getRowsNum($result);
  14. if ($RowsNum == 0 && $id_foto_principale_tmp != 0) {
  15. redirect_header("../../user.php?op=logout", 5 , "Non puoi fare questo!");
  16. exit();
  17. } else {
  18. $myrow_cid = $xoopsDB->fetchArray($result);
  19. $cid_tmp = $myrow_cid['cid'];
  20. }
  21. //global $xoopsUser;
  22. // inizio hack limite foto - slyss
  23. //Hack by Danilo Tomasino (aka Dantom)
  24. //Non permette l'inserimento di piu di $totaleFoto nell'album
  25. if($xoopsUser) {
  26. $totaleFoto = 1000;
  27. $result = $xoopsDB->query("SELECT * FROM $table_photos WHERE submitter = ".$xoopsUser->getVar('uid')."");
  28. $RowsNum = $xoopsDB->getRowsNum($result);
  29. if($RowsNum > $totaleFoto -1 )
  30. {
  31. redirect_header("../../modules/smartprofile/userinfo.php?uid=".$xoopsUser->getVar('uid')."", 5 , "Non puoi inserire piu di ".$totaleFoto." immagine/i nel tuo profilo");
  32. exit();
  33. }
  34. }
  35. // fine hack limite foto - slyss
  36. $myts =& MyAlbumTextSanitizer::getInstance() ;
  37. $cattree = new XoopsTree( $table_cat , "cid" , "pid" ) ;
  38. // GET variables
  39. $caller = @$_GET['caller'] == 'imagemanager' ? 'imagemanager' : '' ;
  40. // POST variables
  41. $preview_name = empty( $_POST['preview_name'] ) ? '' : $_POST['preview_name'] ;
  42. // check INSERTABLE
  43. if( ! ( $global_perms & GPERM_INSERTABLE ) ) {
  44. redirect_header( XOOPS_URL."/user.php" , 2 , _ALBM_MUSTREGFIRST ) ;
  45. exit ;
  46. }
  47. // check Categories exist
  48. $result = $xoopsDB->query( "SELECT count(cid) as count FROM $table_cat" ) ;
  49. list( $count ) = $xoopsDB->fetchRow( $result ) ;
  50. if( $count < 1 ) {
  51. redirect_header( XOOPS_URL."/modules/$mydirname/" , 2 , _ALBM_MUSTADDCATFIRST ) ;
  52. exit ;
  53. }
  54. // check file_uploads = on
  55. if( ! ini_get( "file_uploads" ) ) $file_uploads_off = true ;
  56. // get flag of safe_mode
  57. $safe_mode_flag = ini_get( "safe_mode" ) ;
  58. // check or make photos_dir
  59. if( ! is_dir( $photos_dir ) ) {
  60. if( $safe_mode_flag ) {
  61. redirect_header(XOOPS_URL."/modules/$mydirname/",10,"At first create & chmod 777 '$photos_dir' by ftp or shell.");
  62. exit ;
  63. }
  64. $rs = mkdir( $photos_dir , 0777 ) ;
  65. if( ! $rs ) {
  66. redirect_header(XOOPS_URL."/modules/$mydirname/",10,"$photos_dir is not a directory");
  67. exit ;
  68. } else @chmod( $photos_dir , 0777 ) ;
  69. }
  70. // check or make thumbs_dir
  71. if( $myalbum_makethumb && ! is_dir( $thumbs_dir ) ) {
  72. if( $safe_mode_flag ) {
  73. redirect_header(XOOPS_URL."/modules/$mydirname/",10,"At first create & chmod 777 '$thumbs_dir' by ftp or shell.");
  74. exit ;
  75. }
  76. $rs = mkdir( $thumbs_dir , 0777 ) ;
  77. if( ! $rs ) {
  78. redirect_header(XOOPS_URL."/modules/$mydirname/",10,"$thumbs_dir is not a directory");
  79. exit ;
  80. } else @chmod( $thumbs_dir , 0777 ) ;
  81. }
  82. // check or set permissions of photos_dir
  83. if( ! is_writable( $photos_dir ) || ! is_readable( $photos_dir ) ) {
  84. $rs = chmod( $photos_dir , 0777 ) ;
  85. if( ! $rs ) {
  86. redirect_header(XOOPS_URL."/modules/$mydirname/",5,"chmod 0777 into $photos_dir failed");
  87. exit ;
  88. }
  89. }
  90. // check or set permissions of thumbs_dir
  91. if( $myalbum_makethumb && ! is_writable( $thumbs_dir ) ) {
  92. $rs = chmod( $thumbs_dir , 0777 ) ;
  93. if( ! $rs ) {
  94. redirect_header(XOOPS_URL."/modules/$mydirname/",5,"chmod 0777 into $thumbs_dir failed");
  95. exit ;
  96. }
  97. }
  98. if( ! empty( $_POST['submit'] ) ) {
  99. // Ticket Check
  100. if ( ! $xoopsGTicket->check() ) {
  101. redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
  102. }
  103. $submitter = $my_uid ;
  104. $cid = empty( $_POST['cid'] ) ? 0 : intval( $_POST['cid'] ) ;
  105. //*******************************Dati aggiuntivi************************************
  106. $trattabile = empty( $_POST['trattabile'] ) ? 0 : intval( $_POST['trattabile'] ) ;
  107. $carico = empty( $_POST['carico_spedizione'] ) ? 0 : intval( $_POST['carico_spedizione'] ) ;
  108. $pagam= empty( $_POST['pagamento'] ) ? 0 : intval( $_POST['pagamento'] ) ;
  109. $loco = $myts->stripSlashesGPC( $_POST["luogo"] ) ;
  110. //**********************************************************************************
  111. $newid = $xoopsDB->genId( $table_photos."_lid_seq" ) ;
  112. // Check if cid is valid
  113. if( $cid <= 0 ) {
  114. redirect_header( 'submit.php' , 2 , 'Category is not specified.' ) ;
  115. exit ;
  116. }
  117. // Check if upload file name specified
  118. $field = $_POST["xoops_upload_file"][0] ;
  119. if( empty( $field ) || $field == "" ) {
  120. die( "UPLOAD error: file name not specified" ) ;
  121. }
  122. $field = $_POST['xoops_upload_file'][0] ;
  123. if( $_FILES[$field]['name'] == '' ) {
  124. // No photo uploaded
  125. if( trim( $_POST["title"] ) === "" ) {
  126. $_POST['title'] = 'no title' ;
  127. }
  128. if( $preview_name != '' && is_readable( "$photos_dir/$preview_name" ) ) {
  129. $tmp_name = $preview_name ;
  130. } else {
  131. if( empty( $myalbum_allownoimage ) ) {
  132. redirect_header( 'submit.php' , 2 , _ALBM_NOIMAGESPECIFIED ) ;
  133. exit ;
  134. } else {
  135. @copy( "$mod_path/images/pixel_trans.gif" , "$photos_dir/pixel_trans.gif" ) ;
  136. $tmp_name = 'pixel_trans.gif' ;
  137. }
  138. }
  139. } else if( $_FILES[$field]['tmp_name'] == "" ) {
  140. // Fail to upload (wrong file name etc.)
  141. redirect_header( 'submit.php' , 2 , _ALBM_FILEERROR ) ;
  142. exit ;
  143. } else {
  144. if( $myalbum_canresize ) $uploader = new MyXoopsMediaUploader( $photos_dir , $array_allowed_mimetypes , $myalbum_fsize , null , null , $array_allowed_exts ) ;
  145. else $uploader = new MyXoopsMediaUploader( $photos_dir , $array_allowed_mimetypes , $myalbum_fsize , $myalbum_width , $myalbum_height , $array_allowed_exts ) ;
  146. $uploader->setPrefix( 'tmp_' ) ;
  147. if( $uploader->fetchMedia( $field ) && $uploader->upload() ) {
  148. // Succeed to upload
  149. // The original file name will be the title if title is empty
  150. if( trim( $_POST["title"] ) === "" ) {
  151. $_POST['title'] = $uploader->getMediaName() ;
  152. }
  153. $tmp_name = $uploader->getSavedFileName() ;
  154. } else {
  155. // Fail to upload (sizeover etc.)
  156. include(XOOPS_ROOT_PATH."/header.php");
  157. echo $uploader->getErrors();
  158. @unlink( $uploader->getSavedDestination() ) ;
  159. include( XOOPS_ROOT_PATH . "/footer.php" ) ;
  160. exit ;
  161. }
  162. }
  163. if( ! is_readable( "$photos_dir/$tmp_name" ) ) {
  164. redirect_header( 'submit.php' , 2 , _ALBM_FILEREADERROR ) ;
  165. exit ;
  166. }
  167. $title = $myts->stripSlashesGPC( $_POST["title"] ) ;
  168. //$loco = $myts->stripSlashesGPC( $_POST["luogo"] ) ;
  169. $desc_text = $myts->stripSlashesGPC( $_POST["desc_text"] ) ;
  170. $giorni_asta = empty( $_POST['giorni_asta'] ) ? 0 : intval( $_POST['giorni_asta'] ) ;
  171. if($giorni_asta == 0) $date = time() + (86400*90); //di default gli oggetti sono in vendita 3 mesi
  172. else if($giorni_asta == 10) $date = time() + (86400*10) ;
  173. else if($giorni_asta == 7) $date = time() + (86400*7) ;
  174. else if($giorni_asta == 5) $date = time() + (86400*5) ;
  175. else if($giorni_asta == 1) $date = time() + (86400*1) ;
  176. $ext = substr( strrchr( $tmp_name , '.' ) , 1 ) ;
  177. $status = ( $global_perms & GPERM_SUPERINSERT ) ? 1 : 0 ;
  178. $prezzo = empty( $_POST['prezzo'] ) ? 0 : intval( $_POST['prezzo'] ) ;
  179. $RowsNum = 0;
  180. $id_foto_principale = empty( $_POST['id_foto_principale'] ) ? 0 : intval( $_POST['id_foto_principale'] ) ;
  181. if($id_foto_principale != 0) {
  182. $result = $xoopsDB->query("SELECT * FROM $table_photos WHERE submitter = ".$xoopsUser->getVar('uid')." AND lid = ".$id_foto_principale."");
  183. $RowsNum = $xoopsDB->getRowsNum($result);
  184. $myrow = $xoopsDB->fetchArray($result);
  185. }
  186. if($RowsNum > 0) $sql = "INSERT INTO $table_photos (lid, cid, title, ext, submitter, status, date, hits, rating, votes, comments) VALUES ($newid, $cid, '".addslashes($title)."', '$ext', $submitter, $status, $date, '$id_foto_principale', '$prezzo', 0, 0)";
  187. else {
  188. $sql = "INSERT INTO $table_photos (lid, cid, title, ext, submitter, status, date, hits, rating, votes, comments, trattabile, carico_spedizione, pagamento,luogo) VALUES ($newid, $cid, '".addslashes($title)."', '$ext', $submitter, $status, $date, 0, '$prezzo', 0, 0, $trattabile, $carico, $pagam, '".addslashes($loco)."')";
  189. $id_foto_principale = $newid;
  190. }
  191. $xoopsDB->query( $sql ) or die( "DB error: INSERT photo table" ) ;
  192. if( $newid == 0 ) {
  193. $newid = $xoopsDB->getInsertId();
  194. }
  195. myalbum_modify_photo( "$photos_dir/$tmp_name" , "$photos_dir/$newid.$ext" ) ;
  196. $dim = GetImageSize( "$photos_dir/$newid.$ext" ) ;
  197. if( $dim ) $xoopsDB->query( "UPDATE $table_photos SET res_x='{$dim[0]}', res_y='{$dim[1]}' WHERE lid='$newid'") ;
  198. if( ! myalbum_create_thumb( "$photos_dir/$newid.$ext" , $newid , $ext ) ) {
  199. $xoopsDB->query( "DELETE FROM $table_photos WHERE lid=$newid" ) ;
  200. redirect_header( 'submit.php' , 2 , _ALBM_FILEREADERROR ) ;
  201. exit ;
  202. }
  203. $xoopsDB->query( "INSERT INTO $table_text (lid, description) VALUES ($newid, '".addslashes($desc_text)."')") or die( "DB error: INSERT text table" ) ;
  204. // Update User's Posts (Should be modified when need admission.)
  205. $user_handler =& xoops_gethandler('user') ;
  206. $submitter_obj =& $user_handler->get( $submitter ) ;
  207. for( $i = 0 ; $i < $myalbum_addposts ; $i ++ ) {
  208. $submitter_obj->incrementPost() ;
  209. }
  210. // Trigger Notification
  211. if( $status ) {
  212. $notification_handler =& xoops_gethandler( 'notification' ) ;
  213. // Global Notification
  214. $notification_handler->triggerEvent( 'global' , 0 , 'new_photo' , array( 'PHOTO_TITLE' => $title , 'PHOTO_URI' => "$mod_url/photo.php?lid=$newid&cid=$cid" ) ) ;
  215. // Category Notification
  216. $rs = $xoopsDB->query( "SELECT title FROM $table_cat WHERE cid=$cid" ) ;
  217. list( $cat_title ) = $xoopsDB->fetchRow( $rs ) ;
  218. $notification_handler->triggerEvent( 'category' , $cid , 'new_photo' , array( 'PHOTO_TITLE' => $title , 'CATEGORY_TITLE' => $cat_title , 'PHOTO_URI' => "$mod_url/photo.php?lid=$newid&cid=$cid" ) ) ;
  219. }
  220. // Clear tempolary files
  221. myalbum_clear_tmp_files( $photos_dir ) ;
  222. //riga qui sotto modificata da slyss
  223. $redirect_uri = "viewcat.php?cid=$cid&amp;orderby=dateD" ;
  224. //$redirect_uri = "../../user.php" ;
  225. if( $caller == 'imagemanager' ) $redirect_uri = 'close.php' ;
  226. //redirect_header( $redirect_uri , 2 , _ALBM_RECEIVED ) ;
  227. //redirect_header( XOOPS_URL.'/userinfo.php?uid=".$xoopsUser->getvar("uid")."' , 2 , "MESSAGGIO...." ) ;
  228. if($id_foto_principale == 0) $id_foto_principale = $newid;
  229. redirect_header("../../modules/myalbum/prodotto_dettaglio.php?id_prodotto=".$id_foto_principale, 5 , "Grazie per aver inserito un oggetto!");
  230. exit () ;
  231. }
  232. // Editing Display
  233. if( $caller == 'imagemanager' ) {
  234. echo "<html><head>
  235. <link rel='stylesheet' type='text/css' media='all' href='".XOOPS_URL."/xoops.css' />
  236. <link rel='stylesheet' type='text/css' media='all' href='".XOOPS_URL."/modules/system/style.css' />
  237. <meta http-equiv='content-type' content='text/html; charset="._CHARSET." />
  238. <meta http-equiv='content-language' content='"._LANGCODE."' />
  239. </head><body>\n" ;
  240. } else {
  241. include( XOOPS_ROOT_PATH . "/header.php" ) ;
  242. OpenTable() ;
  243. myalbum_header() ;
  244. }
  245. include_once( "../../class/xoopsformloader.php" ) ;
  246. include_once( "../../include/xoopscodes.php" ) ;
  247. // Preview
  248. if( $caller != 'imagemanager' && ! empty( $_POST['preview'] ) ) {
  249. $photo['description'] = $myts->stripSlashesGPC( $_POST["desc_text"] ) ;
  250. $photo['title'] = $myts->stripSlashesGPC( $_POST["title"] ) ;
  251. $photo['cid'] = empty( $_POST['cid'] ) ? 0 : intval( $_POST['cid'] ) ;
  252. $field = $_POST['xoops_upload_file'][0] ;
  253. if( is_readable( $_FILES[$field]['tmp_name'] ) ) {
  254. // new preview
  255. if( $myalbum_canresize ) $uploader = new MyXoopsMediaUploader( $photos_dir , $array_allowed_mimetypes , $myalbum_fsize , null , null , $array_allowed_exts ) ;
  256. else $uploader = new MyXoopsMediaUploader( $photos_dir , $array_allowed_mimetypes , $myalbum_fsize , $myalbum_width , $myalbum_height , $array_allowed_exts ) ;
  257. $uploader->setPrefix( 'tmp_' ) ;
  258. if( $uploader->fetchMedia( $field ) && $uploader->upload() ) {
  259. $tmp_name = $uploader->getSavedFileName() ;
  260. $preview_name = str_replace( 'tmp_' , 'tmp_prev_' , $tmp_name ) ;
  261. myalbum_modify_photo( "$photos_dir/$tmp_name" , "$photos_dir/$preview_name" ) ;
  262. list( $imgsrc , $width_spec , $ahref ) = myalbum_get_img_attribs_for_preview( $preview_name ) ;
  263. } else {
  264. @unlink( $uploader->getSavedDestination() ) ;
  265. $imgsrc = "$mod_url/images/pixel_trans.gif" ;
  266. $width_spec = "width='$myalbum_thumbsize' height='$myalbum_thumbsize'" ;
  267. $ahref = '' ;
  268. }
  269. } else if( $preview_name != '' && is_readable( "$photos_dir/$preview_name" ) ) {
  270. // old preview
  271. list( $imgsrc , $width_spec , $ahref ) = myalbum_get_img_attribs_for_preview( $preview_name ) ;
  272. } else {
  273. // preview without image
  274. $imgsrc = "$mod_url/images/pixel_trans.gif" ;
  275. $width_spec = "width='$myalbum_thumbsize' height='$myalbum_thumbsize'" ;
  276. $ahref = '' ;
  277. }
  278. // Display Preview
  279. $photo_for_tpl = array(
  280. 'description' => $myts->displayTarea( $photo['description'] , 0 , 1 , 1 , 1 , 1 , 1 ) ,
  281. 'title' => $myts->makeTboxData4Show( $photo['title'] ) ,
  282. 'width_spec' => $width_spec ,
  283. 'submitter' => $my_uid ,
  284. 'submitter_name' => myalbum_get_name_from_uid( $my_uid ) ,
  285. 'imgsrc_thumb' => $imgsrc ,
  286. 'ahref_photo' => $ahref
  287. ) ;
  288. $tpl = new XoopsTpl() ;
  289. include( 'include/assign_globals.php' ) ;
  290. $tpl->assign( $myalbum_assign_globals ) ;
  291. $tpl->assign( 'photo' , $photo_for_tpl ) ;
  292. echo "<table class='outer' style='width:100%;'>" ;
  293. $tpl->display( "db:myalbum{$mydirnumber}_photo_in_list.html" ) ;
  294. echo "</table>\n" ;
  295. } else {
  296. $photo = array(
  297. 'cid' => ( empty( $_GET['cid'] ) ? 0 : intval( $_GET['cid'] ) ) ,
  298. 'description' => '' ,
  299. 'title' => ''
  300. ) ;
  301. }
  302. // Show the form
  303. $form = new XoopsThemeForm( _ALBM_PHOTOUPLOAD , "uploadphoto" , "submit.php?caller=$caller" ) ;
  304. $pixels_text = "$myalbum_width x $myalbum_height" ;
  305. if( $myalbum_canresize ) $pixels_text .= " (auto resize)" ;
  306. $pixels_label = new XoopsFormLabel( _ALBM_MAXPIXEL , $pixels_text ) ;
  307. $size_label = new XoopsFormLabel( _ALBM_MAXSIZE , $myalbum_fsize . ( empty( $file_uploads_off ) ? "" : ' &nbsp; <b>"file_uploads" off</b>' ) ) ;
  308. $form->setExtra( "enctype='multipart/form-data'" ) ;
  309. $title_text = new XoopsFormText( _ALBM_PHOTOTITLE , "title" , 50 , 255 , $myts->makeTboxData4Edit( $photo['title'] ) ) ;
  310. $prezzo_text = new XoopsFormText( "Prezzo base &euro; (es. 29,00)" , "prezzo" , 10 , 255 ) ;
  311. $cat_select = new XoopsFormSelect( "Tipo oggetto" , "cid" ) ;
  312. $cat_select->addOption( "4" , "Altro" ) ;
  313. $cat_select->addOption( "2" , "Tavole" ) ;
  314. $cat_select->addOption( "3" , "Attacchi" ) ;
  315. $cat_select->addOption( "1" , "Scarponi" ) ;
  316. $nuova_foto = new XoopsFormHidden( "id_foto_principale" , $_GET['id_foto_principale'] ) ;
  317. //$giorni_asta = new XoopsFormSelect( "Durata della vendita?" , "giorni_asta" ) ;
  318. //$giorni_asta->addOption( "10" , "10 giorni" ) ;
  319. //$giorni_asta->addOption( "7" , "7 giorni" ) ;
  320. //$giorni_asta->addOption( "5" , "5 giorni" ) ;
  321. //$giorni_asta->addOption( "1" , "1 giorno" ) ;
  322. $prezzo_trattabile = new XoopsFormSelect( "Prezzo trattabile?" , "trattabile" ) ;
  323. $prezzo_trattabile->addOption( "0" , "No" ) ;
  324. $prezzo_trattabile->addOption( "1" , "Si" ) ;
  325. $carico_spedizione = new XoopsFormSelect( "Spedizione a carico del:" , "carico_spedizione" ) ;
  326. $carico_spedizione->addOption( "0" , "Mittente" ) ;
  327. $carico_spedizione->addOption( "1" , "Destinatario" ) ;
  328. $pagamento = new XoopsFormSelect( "Tipo di pagamento:" , "pagamento" ) ;
  329. $pagamento->addOption( "0" , "Altro" ) ;
  330. $pagamento->addOption( "1" , "Contrassegno" ) ;
  331. $pagamento->addOption( "2" , "Bonifico" ) ;
  332. $pagamento->addOption( "3" , "Vaglia" ) ;
  333. $pagamento->addOption( "4" , "PostPay" ) ;
  334. $pagamento->addOption( "5" , "PayPal" ) ;
  335. $luogo = new XoopsFormText( "Luogo in cui si trova l'oggetto:" , "luogo" , 50 , 255 ) ;
  336. $desc_tarea = new XoopsFormTextArea( _ALBM_PHOTODESC , "desc_text" , $myts->makeTareaData4Edit( $photo['description'] ) , 1 , 50 ) ;
  337. $file_form = new XoopsFormFile( _ALBM_SELECTFILE , "photofile" , $myalbum_fsize ) ;
  338. $file_form->setExtra( "size='30'" ) ;
  339. $op_hidden = new XoopsFormHidden( "op" , "submit" ) ;
  340. $counter_hidden = new XoopsFormHidden( "fieldCounter" , 1 ) ;
  341. $preview_hidden = new XoopsFormHidden( "preview_name" , htmlspecialchars( $preview_name ) , ENT_QUOTES ) ;
  342. $submit_button = new XoopsFormButton( "" , "submit" , _SUBMIT , "submit" ) ;
  343. $preview_button = new XoopsFormButton( "" , "preview" , _PREVIEW , "submit" ) ;
  344. $reset_button = new XoopsFormButton( "" , "reset" , _CANCEL , "reset" ) ;
  345. $submit_tray = new XoopsFormElementTray( '' ) ;
  346. $submit_tray->addElement( $submit_button ) ;
  347. $submit_tray->addElement( $reset_button ) ;
  348. if($id_foto_principale_tmp == 0) $form->addElement( $title_text ) ;
  349. if( $caller != 'imagemanager' && $id_foto_principale_tmp == 0)
  350. $form->addElement( $desc_tarea ) ;
  351. $form->addElement( $nuova_foto ) ;
  352. $id_foto_principale = empty( $_GET['id_foto_principale'] ) ? 0 : intval( $_GET['id_foto_principale'] ) ;
  353. if($id_foto_principale == 0)
  354. {
  355. $form->addElement( $prezzo_text );
  356. //$form->addElement( $giorni_asta );
  357. $form->addElement( $prezzo_trattabile );
  358. $form->addElement( $carico_spedizione );
  359. $form->addElement( $pagamento);
  360. $form->addElement( $cat_select );
  361. $form->addElement( $luogo ) ;
  362. $form->setRequired( $cat_select );
  363. }
  364. else
  365. {
  366. $cat_select = new XoopsFormHidden( "cid" , $cid_tmp ) ;
  367. $form->addElement( $cat_select ) ;
  368. }
  369. $form->addElement( $file_form ) ;
  370. $form->addElement( $preview_hidden ) ;
  371. $form->addElement( $counter_hidden ) ;
  372. $form->addElement( $op_hidden ) ;
  373. $form->addElement( $submit_tray ) ;
  374. // Ticket
  375. $GLOBALS['xoopsGTicket']->addTicketXoopsFormElement( $form , __LINE__ ) ;
  376. $form->display() ;
  377. if( $caller == 'imagemanager' ) {
  378. echo "</body></html>" ;
  379. } else {
  380. CloseTable() ;
  381. myalbum_footer() ;
  382. include( XOOPS_ROOT_PATH . "/footer.php" ) ;
  383. }
  384. ?>