(max 1 MB each) ", "tèlècharger
(max 1 MB chacun) ", "upload
(max 1 MB cada uno) "); $label_ll['where'] = array("where (city, country)", "là où (ville, pays)", "donde (ciudad, paìs)"); $label_ll['from'] = array("from", "de", "de"); $label_ll['to'] = array("to", "à", "a"); $label_ll['types'] = array("types *", "types *", "tipos *"); $label_ll['select'] = array("select:", "choisi:", "selecto:"); $label_ll['mandatory'] = array("Mandatory field", "Champ obligatoire", "Campo obligatorio"); $label_ll['submit'] = array("search", "recherche", "búsqueda"); $label_ll['typo_1'] = array("typo_1", "typo_1_fr", "typo_1_es"); $label_ll['typo_2'] = array("typo_2", "typo_2_fr", "typo_2_es"); $label_ll['typo_3'] = array("typo_3", "typo_3_fr", "typo_3_es"); $label_ll['language'] = array("language", "langue", "lengua"); $label_ll['default'] = array("default", "défaut", "defecto"); $label_ll['english'] = array("english", "anglais", "inglés"); $label_ll['french'] = array("french", "français", "francés"); $label_ll['spanish'] = array("spanish", "espagnol", "espagnol"); $label_ll['draft'] = array("draft", "ébauche", "bosquejo"); $label_ll['rejected'] = array("reviewed & rejected", "passé en revue et a rejeté", "repasado y rechazado"); $label_ll['published'] = array("reviewed & published", "passé en revue et a édité", "repasado y publicado"); $label_ll['country'] = array("Countries", "Countries fr", "Countries fr"); $label_ll['africa'] = array("Africa (RAF) ", "Africa (RAF) fr", "Africa (RAF) es"); $label_ll['asia'] = array("Asia and the Pacific (RAP)", "Asia and the Pacific (RAP) fr", "Asia and the Pacific (RAP) es"); $label_ll['europe'] = array("Europe (REU)", "Europe (REU) fr", "Europe (REU) es"); $label_ll['latin_america'] = array("Latin America and the Caribbean (RLC)", "Latin America and the Caribbean (RLC) fr", "Latin America and the Caribbean (RLC) es"); $label_ll['near_east'] = array("Near East (RNE)", "Near East (RNE) fr", "Near East (RNE) es"); $label_ll['topics'] = array("Topics", "Thème", "tema"); $label_ll['topics_msg'] = array("select a topic", "select a topic fr", "select a topic es"); $label_ll['country_msg'] = array("select a country", "select a country fr", "select a country es"); $content = ""; // $this->tslib_pibase(); $language_mode = ($GLOBALS['TSFE']->config['config']['sys_language_uid'])?$GLOBALS['TSFE']->config['config']['sys_language_uid']:0; // $news_class = new tslib_pibase(); // data statistic $pidtheme1 = 238; //Programs Projects $pidtheme2 = 247; //documents report $pidtheme3 = 248; // how to $pidtheme4 = 249; // multimedia $pidtheme5 = 250; // website $pidtheme6 = 251; $actions['new'] = "325"; $actions['news_type'] = "80"; $actions['intro'] = "738"; $actions['saved_editor']= $GLOBALS["TSFE"]->tmpl->setup['config.']['UID_NEWS_SAVED'];; $actions['saved_other']= $GLOBALS["TSFE"]->tmpl->setup['config.']['UID_NEWS_SAVED'];; if($_GET['fromType']<2){ $actions['back'] = $GLOBALS["TSFE"]->tmpl->setup['config.']['PID_NEWS_EDIT_BACK']; } else { $actions['back'] = $GLOBALS["TSFE"]->tmpl->setup['config.']['PID_NEWS_EDIT_BACK']; } $FE_Group_Editor = $GLOBALS["TSFE"]->tmpl->setup['config.']['UID_GRP_EDITORS']; $FE_Group_Registered = $GLOBALS["TSFE"]->tmpl->setup['config.']['UID_GRP_REGISTERED'];; $numoffile = 5; // 3 = editor // 5 = registered $FE_user = $GLOBALS["TSFE"]->fe_user->user["uid"]; $FE_group = $GLOBALS["TSFE"]->fe_user->groupData['uid']; // is editor ??? $username = $GLOBALS["TSFE"]->fe_user->user['username']; // t3lib_div::debug($GLOBALS["TSFE"]->fe_user); $my_uid = ""; $my_oldfiles = ""; $checkisevent = ""; if($_GET['uid']){ $my_uid = $_GET['uid']; $query = "SELECT * FROM tt_news WHERE uid = ".$_GET['uid'] ; $res = mysql(TYPO3_db, $query); $data = mysql_fetch_array($res, MYSQL_ASSOC); //t3lib_div::debug($data); //$my_type = $data['my_type']; $my_oldfiles = $data['news_files']; }else{ $data['tx_mblnewsevent_from'] = time(); $data['tx_mblnewsevent_to'] = ""; $data['author'] = $username; $data['my_status'] = "0"; //$my_type = 2; } $query = "SELECT uid,header,pid,t3_origuid FROM tt_content WHERE pid in(326,327,328,329,330,331) and deleted=0 and hidden=0 and sys_language_uid=".$language_mode." ORDER BY pid,header"; $res = mysql(TYPO3_db, $query); if (mysql_error()){ echo mysql_errno() . ": select topics " . mysql_error() . "\n"; }else{ $topics_types = ""; $topics_types .= ""; } $query = "SELECT uid,header,pid,t3_origuid FROM tt_content WHERE pid in(238,248,249,250) and deleted=0 and hidden=0 and sys_language_uid=".$language_mode." ORDER BY pid,header"; $res = mysql(TYPO3_db, $query); if (mysql_error()){ echo mysql_errno() . ": select topics " . mysql_error() . "\n"; }else{ $themes_types = ""; $themes_types .= ""; } $query = "SELECT uid,cn_short_en FROM static_countries ORDER BY cn_short_en"; $res = mysql(TYPO3_db, $query); if (mysql_error()){ echo mysql_errno() . ": select country " . mysql_error() . "\n"; }else{ $country = ""; $country .= ""; } $content_status = " "; // load type list $query = "SELECT * FROM tt_content WHERE deleted=0 and hidden=0 and pid=".$actions['news_type']." and sys_language_uid=".$language_mode." ORDER BY header"; // $news_class->pi_loadLL(); // $this->initLanguages(); //*********************************************************************************************************** // print($news_class->pi_getLL('archiveHeader')); $res = mysql(TYPO3_db, $query); if (mysql_error()){ echo mysql_errno() . ": select type " . mysql_error() . "\n"; } // t3lib_div::debug($my_type); $content_types = ""; $content_types .= ""; if($my_oldfiles != ""){ $table_files = ""; $listfiles = explode(",",$data['news_files']); $table_files .= ""; foreach($listfiles as $value){ $table_files .= ""; } $table_files .= "
file/sremove
".$value."
"; } if(@$_POST['title']){ $time = time(); $date_from = $time; $date_to = '0'; $cruser_id = '8'; // fixed user id (max) $pid = $GLOBALS["TSFE"]->tmpl->setup['config.']['PID_NEWS_LIST']; // news list page $if_theme = 0; $if_topic = 0; if ($_POST['themes']!='') { $if_theme = 1; } if ($_POST['topics']!='') { $if_topic = 1; $topics = implode(",",$_POST['topics']); } else { $topics = 0; } //---------------------------------------------------------------------------------------------------buono end $file_dir = PATH_site . "/uploads/media/"; $i = 0; // $filelist = ""; $allfiles = array(); foreach ($_FILES['myfiles']['name'] as $value) { if($value){ array_push($allfiles,$value); $newfile = $file_dir.$_FILES['myfiles']['name'][$i]; move_uploaded_file($_FILES['myfiles']['tmp_name'][$i], $newfile); $i++; } } if(!empty($_POST['my_oldfiles'])){ foreach(explode(",",$_POST['my_oldfiles']) as $value){ if(!in_array($value,$allfiles)) array_push($allfiles,$value); } } // t3lib_div::debug($allfiles); if($_POST['del_files']){ foreach($_POST['del_files'] as $delvalue){ foreach($allfiles as $key=>$newvalue){ if($delvalue==$newvalue) unset($allfiles[$key]); } } } // t3lib_div::debug($_POST); $filelist = sizeof($allfiles)>0?implode(",",$allfiles):""; $imagelist = sizeof($allimages)>0?implode(",",$allimages):""; $fields = "title='".$_POST['title']."'"; if(isset($_POST['my_status'])){ $fields .= ",my_status=".$_POST['my_status']; }else{ $fields .= ",my_status=0"; } $fields .= ",bodytext='".$_POST['bodytext']."'"; $fields .= ",short='".$_POST['short']."'"; $fields .= ",author='".$_POST['author']."'"; $fields .= ",pid=".intval($pid); $fields .= ",crdate=".$time; $fields .= ",cruser_id=".intval($cruser_id); $fields .= ",tstamp=".$time; $fields .= ",ext_url='".$_POST['ext_url']."'"; $fields .= ",news_files='".$filelist."'"; if ($_POST['themes']) { $fields .= ",tx_documentum_theme='".implode(",",$_POST['themes'])."'"; }else{ $fields .= ",tx_documentum_theme=0"; } if ($_POST['topics']) { $fields .= ",topics='".implode(",",$_POST['topics'])."'"; }else{ $fields .= ",topics=0"; } //$fields .= ",topics='".implode(",",$_POST['topics'])."'"; //$fields .= ",topics='".$_POST['topics']."'"; $fields .= ",my_type=9"; $fields .= ",if_theme=".$if_theme; //'".$_POST['my_type']."' $fields .= ",if_topic=".$if_topic; //'".$_POST['my_type']."' //$fields .= ",my_doc_3=".$my_doc_3; //'".$_POST['my_type']."' //$fields .= ",my_doc_4=".$my_doc_4; //'".$_POST['my_type']."' //$fields .= ",my_doc_5=".$my_doc_5; //'".$_POST['my_type']."' //$fields .= ",my_doc_6=".$my_doc_6; //'".$_POST['my_type']."' $fields .= ",tx_mblnewsevent_where='".$_POST['where']."'"; $fields .= ",tx_mblnewsevent_from=".$date_from; $fields .= ",tx_mblnewsevent_to=".$date_to; $fields .= ",sys_language_uid=".$_POST['language']; //if($imagelist){ //$fields .= ",image='".$imagelist."'"; //} // print_r($_POST); $name_author=$_POST['author']; if($_POST['my_uid']){ $query = "UPDATE tt_news SET ".$fields." WHERE uid=".$_POST['my_uid']; }else{ $query = "INSERT INTO tt_news SET ".$fields; mail("Roberto.DiCarlo@fao.org", "Documents Repository", $name_author." has inserted a new document in Docs Rep the title of the document is :".$_POST['title']." (now is just a test)", "From:info@e-agriculture.org"); mail("Charlotte.Masiello@fao.org", "Documents Repository", $name_author." has inserted a new document in Docs Rep the title of the document is :".$_POST['title']." (now is just a test)", "From:info@e-agriculture.org"); mail("Nathaniel.Heller@fao.org", "Documents Repository", $name_author." has inserted a new document in Docs Rep the title of the document is :".$_POST['title']." (now is just a test)", "From:info@e-agriculture.org"); } //$res = mysql(TYPO3_db, $query); if (mysql_error()) echo mysql_errno() . ": insert news " . mysql_error() . "\n"; // t3lib_div::debug($query); $javascript_load = ""; if(in_array($FE_Group_Editor, $FE_group)){ $content .= LoadContent($actions['saved_editor']); // $content .= "

docs/links & news/events saved."; }else{ $content .= LoadContent($actions['saved_other']); // $content .= "

Your news/events has been uploaded and it will be published after being reviewed by a coordinator.

Thank you."; } }else{ $content .= ""; //$prova = $data['themes[]']; //echo $prova; $content .= "
"; $content .= ""; $content .= ""; $content .= ""; $content .= ""; $content .= ""; $content .= ""; $content .= ""; $content .= ""; $content .= ""; $content .= ""; $content .= "
".$label_ll['themes'][$language_mode]."".$label_ll['topics'][$language_mode]."
"; $content .= "

" . $themes_types."

"; $content .= "
"; $content .= "

" . $topics_types."

"; $content .= "
     
"; $content .= ""; $content .= ""; $content .= "
"; $javascript_load = "hideDiv();"; } function uploaderFiles(){ $numoffile = 5; $ret = ""; for($i=0;$i<$numoffile;$i++) { $ret .= "
"; } return $ret; } echo $content; function LoadPageTitle($uid,$lang){ if($lang>0){ $query = "SELECT title FROM pages_language_overlay WHERE pid=".$uid." AND sys_language_uid=".$lang; }else{ $query = "SELECT title FROM pages WHERE uid=".$uid; } $res = mysql(TYPO3_db, $query); if (mysql_error()){ return ""; }else{ $resRow = mysql_fetch_assoc($res); $resRow = str_replace("Topic ","",$resRow); $resRow = str_replace("Topics ","",$resRow); return $resRow['title']; } } function LoadPageTitleTwo($uid,$lang){ if($lang>0){ $query = "SELECT title FROM pages_language_overlay WHERE pid=".$uid." AND sys_language_uid=".$lang; }else{ $query = "SELECT title FROM pages WHERE uid=".$uid; } $res = mysql(TYPO3_db, $query); if (mysql_error()){ return ""; }else{ $resRow = mysql_fetch_assoc($res); $resRow = str_replace("Themes ","",$resRow); $resRow = str_replace("Theme ","",$resRow); return $resRow['title']; } } function LoadContent($uid){ // $query = "SELECT * FROM tt_content WHERE deleted=0 and hidden=0 and uid=".$uid; $query = "SELECT * FROM tt_content WHERE uid=".$uid; $res = mysql(TYPO3_db, $query); if (mysql_error()){ return ""; }else{ $resRow = mysql_fetch_assoc($res); return $resRow['bodytext']; } return ""; } ?>