[ Index ] |
PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09) |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 Copyright notice 4 5 (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved. 6 7 This script is part of PHPWCMS. The PHPWCMS web content management system is 8 free software; you can redistribute it and/or modify it under the terms of 9 the GNU General Public License as published by the Free Software Foundation; 10 either version 2 of the License, or (at your option) any later version. 11 12 The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html 13 A copy is found in the textfile GPL.txt and important notices to the license 14 from the author is found in LICENSE.txt distributed with these scripts. 15 16 This script is distributed in the hope that it will be useful, but WITHOUT ANY 17 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 18 PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 20 This copyright notice MUST APPEAR in all copies of the script! 21 *************************************************************************************/ 22 23 // ---------------------------------------------------------------- 24 // obligate check for phpwcms constants 25 if (!defined('PHPWCMS_ROOT')) { 26 die("You Cannot Access This Script Directly, Have a Nice Day."); 27 } 28 // ---------------------------------------------------------------- 29 30 31 // initialize Mootools for autocomplete 32 initMootoolsAutocompleter(); 33 34 //Wenn neue Datei hochgeladen werden soll 35 $file_id = isset($_GET["editfile"]) ? intval($_GET["editfile"]) : 0; 36 $file_ext = ''; 37 $ja = 0; 38 $othumb = false; 39 40 //Auswerten des Formulars 41 if(isset($_POST["file_aktion"]) && intval($_POST["file_aktion"]) == 2) { 42 $file_id = intval($_POST["file_id"]); 43 $file_pid = intval($_POST["file_pid"]); 44 $file_aktiv = empty($_POST["file_aktiv"]) ? 0 : 1; 45 $file_public = empty($_POST["file_public"]) ? 0 : 1; 46 $file_name = clean_slweg($_POST["file_name"]); 47 $file_ext = clean_slweg($_POST["file_ext"]); 48 $file_shortinfo = clean_slweg($_POST["file_shortinfo"]); 49 $file_longinfo = slweg(trim($_POST["file_longinfo"])); 50 $file_copyright = clean_slweg($_POST["file_copyright"]); 51 $file_tags = trim( clean_slweg($_POST["file_tags"]), ',' ); 52 $file_granted = empty($_POST["file_granted"]) ? 0 : 1; 53 $file_gallerydownload = empty($_POST["file_gallerydownload"]) ? 0 : 1; 54 $file_sort = intval($_POST["file_sort"]); 55 56 $file_keywords = $_POST["file_keywords"]; 57 if(count($file_keywords)) { 58 $file_keys = ""; 59 foreach($file_keywords as $key => $value) { 60 unset($file_keywords[$key]); 61 $key = intval($key); 62 if($value != "0_1") { 63 $file_keys .= (($file_keys) ? ":" : "").$key."_".intval($value); 64 $file_keywords[$key] = intval($value); 65 } else { 66 $file_error["keywords"][$key] = 1; 67 } 68 } 69 } 70 71 //if(isEmpty($file_shortinfo)) $file_error["shortinfo"] = 1; 72 if(isEmpty($file_name)) { 73 $file_error["name"] = 1; 74 } else { 75 //Wenn Dateiname keine Erweiterung hat, dann Extension anhängen 76 if(trim(strtolower(FileExtension($file_name))) != trim($file_ext)) $file_name .= ".".$file_ext; 77 } 78 //Eintragen der aktualisierten Verzeichnisinfos 79 if(!isset($file_error)) { 80 $sql = "UPDATE ".DB_PREPEND."phpwcms_file SET ". 81 "f_name='".aporeplace($file_name)."', ". 82 "f_pid=".$file_pid.", ". 83 "f_aktiv=".$file_aktiv.", ". 84 "f_public=".$file_public.", ". 85 "f_shortinfo='".aporeplace($file_shortinfo)."', ". 86 "f_longinfo='".aporeplace($file_longinfo)."', ". 87 "f_keywords='".$file_keys."', ". 88 "f_created='".time()."', ". 89 "f_copyright='".aporeplace($file_copyright)."', ". 90 "f_tags='".aporeplace($file_tags)."', ". 91 "f_granted=".$file_granted.", ". 92 "f_gallerystatus=".$file_gallerydownload.", ". 93 "f_sort=".$file_sort." ". 94 "WHERE f_kid=1 AND f_id=".$file_id." AND f_uid=".intval($_SESSION["wcs_user_id"]); 95 if($result = mysql_query($sql, $db) or die ("error while updating file info")) { 96 97 // store tags 98 _dbSaveCategories($file_tags, 'file', $file_id, ','); 99 100 headerRedirect(PHPWCMS_URL."phpwcms.php?do=files&f=0"); 101 } 102 } 103 } 104 //Ende Auswerten Formular 105 106 //Wenn ID angegeben, dann -> oder aber Root Verzeichnis 107 if($file_id) { 108 $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_file WHERE f_id=".$file_id. 109 " AND f_uid=".intval($_SESSION["wcs_user_id"])." AND f_trash=0 AND f_kid=1 LIMIT 1;"; 110 if($result = mysql_query($sql, $db) or die("error while reading file information")) { 111 if($row = mysql_fetch_array($result)) { 112 $file_oldname = html_specialchars($row["f_name"]); 113 $file_created = intval($row["f_created"]); 114 $file_size = intval($row["f_size"]); 115 $file_id = $row["f_id"]; 116 $file_ext = $row["f_ext"]; 117 //$file_makethumb = "thumb=".$row["f_id"]."&ext=".$row["f_ext"]; 118 if(empty($_POST["file_aktion"]) || intval($_POST["file_aktion"]) != 2) { 119 $file_pid = $row["f_pid"]; 120 $file_name = $row["f_name"]; 121 $file_aktiv = $row["f_aktiv"]; 122 $file_public = $row["f_public"]; 123 $file_shortinfo = $row["f_shortinfo"]; 124 $file_longinfo = $row["f_longinfo"]; 125 $file_thumb = $row["f_thumb_list"]; 126 $file_keys = $row["f_keywords"]; 127 $file_copyright = $row["f_copyright"]; 128 $file_tags = $row["f_tags"]; 129 $file_granted = $row["f_granted"]; 130 $file_gallerydownload = $row["f_gallerystatus"]; 131 $file_sort = $row["f_sort"]; 132 133 if($file_keys) { 134 $file_keys_temp = explode(":", $file_keys); 135 if(count($file_keys_temp)) { 136 if(isset($file_keywords)) unset($file_keywords); 137 foreach($file_keys_temp as $value) { 138 list($k1, $k2) = explode("_", $value); 139 $file_keywords[intval($k1)] = intval($k2); 140 } 141 } 142 } 143 } 144 145 if(isset($row["f_hash"])) { 146 $thumb_image = get_cached_image( 147 array( "target_ext" => $row["f_ext"], 148 "image_name" => $row["f_hash"] . '.' . $row["f_ext"], 149 "thumb_name" => md5($row["f_hash"].$phpwcms["img_list_width"].$phpwcms["img_list_height"].$phpwcms["sharpen_level"]) 150 ) 151 ); 152 153 if($thumb_image != false) { 154 $file_thumb_small = '<img src="'.PHPWCMS_IMAGES . $thumb_image[0] .'" border="0" '.$thumb_image[3].'>'; 155 $othumb = true; 156 } 157 } 158 159 160 $ja = 1; 161 } 162 mysql_free_result($result); 163 } 164 } 165 166 if(!$othumb) { 167 $file_thumb_small = '<img src="img/icons/small_'.extimg($file_ext).'" border="0">'; 168 } 169 170 if($ja) { 171 ?> 172 <form action="phpwcms.php?do=files&f=0" method="post" enctype="multipart/form-data" name="editfileinfo"> 173 <table border="0" cellpadding="0" cellspacing="0" bgcolor='#EBF2F4' summary=""> 174 <tr> 175 <td rowspan="2" valign="top"><a href="phpwcms.php?do=files&f=0"><img src="img/button/close_reiter.gif" alt="" width="45" height="12" border="0"></a></td> 176 <td><img src="img/leer.gif" alt="" width="1" height="6"></td> 177 </tr> 178 <tr><td class="title"><?php echo $BL['be_fprivedit_title'] ?></td></tr> 179 <tr> 180 <td colspan="2" valign="top"><img src="img/leer.gif" alt="" width="1" height="5"></td> 181 </tr> 182 <tr> 183 <td align="right" class="v09"><?php echo $BL['be_fprivedit_filename'] ?>: </td> 184 <td class="v10"><table border="0" cellpadding="0" cellspacing="0" summary=""> 185 <tr> 186 <td><?php echo $file_thumb_small ?></td> 187 <td><img src="img/leer.gif" alt="" width="4" height="1"></td> 188 <td><strong><?php echo $file_oldname ?></strong></td> 189 </tr> 190 </table></td> 191 </tr> 192 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="2"></td></tr> 193 <tr> 194 <td><img src="img/leer.gif" alt="" width="1" height="1"></td> 195 <td class="v09"><?php 196 echo $BL['be_fprivedit_created'].': '.date($BL['be_fprivedit_dateformat'], $file_created); 197 echo ' '.$BL['be_fprivedit_size'].': '.fsizelong($file_size); 198 echo ' EXT: '.strtoupper($file_ext); 199 ?></td> 200 </tr> 201 <tr><td colspan="2" valign="top"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr> 202 <tr> 203 <td align="right" class="v09"><?php echo $BL['be_ftptakeover_directory'] ?>: </td> 204 <td class="v10"><select name="file_pid" id="file_pid" class="width400"> 205 <option value="0" <?php if($file_pid == 0) echo "selected"; ?>><?php echo $BL['be_ftptakeover_rootdir'] ?></option> 206 <?php dir_menu(0, $file_pid, $db, "+", $_SESSION["wcs_user_id"], "+") ?> 207 </select></td> 208 </tr> 209 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="6"></td></tr> 210 <tr><td colspan="2"><img src="img/lines/line-bluelight.gif" alt="" width="538" height="1"></td></tr> 211 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="6"></td></tr> 212 <?php if(isset($file_error["name"])) { 213 $file_name = $file_oldname; 214 ?> 215 <tr> 216 <td align="right" class="v09"><img src="img/leer.gif" alt="" width="1" height="1"></td> 217 <td class="v10"><strong style="color:#FF3300"><?php echo $BL['be_fprivedit_err1'] ?></strong></td> 218 </tr> 219 <tr><td colspan="2" valign="top"><img src="img/leer.gif" alt="" width="1" height="2"></td></tr> 220 <?php } ?> 221 <tr> 222 <td align="right" class="v09"><?php echo $BL['be_fpriv_name'] ?>: </td> 223 <td><input name="file_name" type="text" class="width400" id="file_name" value="<?php echo html_specialchars($file_name) ?>" size="40" maxlength="230"></td> 224 </tr> 225 <tr><td colspan="2" valign="top"><img src="img/leer.gif" alt="" width="1" height="6"></td></tr> 226 <tr><td colspan="2" valign="top"><img src="img/lines/line-bluelight.gif" alt="" width="538" height="1"></td></tr> 227 <tr bgcolor="#F5F8F9"><td colspan="2" valign="top"><img src="img/leer.gif" alt="" width="1" height="6"></td></tr> 228 <?php 229 230 //Auswahlliste vordefinierte Keywörter 231 $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_filecat WHERE fcat_deleted=0 ORDER BY fcat_sort, fcat_name"; 232 if($result = mysql_query($sql, $db) or die("error while browsing file categories for selecting keywords")) { 233 $k = ""; 234 while($row = mysql_fetch_array($result)) { 235 if(get_filecat_childcount ($row["fcat_id"], $db)) { 236 237 $ke = isset($file_error["keywords"][$row["fcat_id"]]) ? '<img src="img/symbole/error.gif" width="8" height="9" alt="" /> ' : ''; 238 $k .= "<tr>\n<td class=\"f10b\">".$ke.html_specialchars($row["fcat_name"]).": </td>\n"; 239 $k .= "<td><select name=\"file_keywords[".$row["fcat_id"]."]\" class=\"width300\">\n"; 240 $k .= "<option value=\"".(($row["fcat_needed"])?"0_".$row["fcat_needed"]."\">".$BL['be_ftptakeover_needed']:'0">'.$BL['be_ftptakeover_optional'])."</option>\n"; 241 242 $ksql = "SELECT * FROM ".DB_PREPEND."phpwcms_filekey WHERE fkey_deleted=0 AND fkey_cid=".$row["fcat_id"]." ORDER BY fkey_name"; 243 if($kresult = mysql_query($ksql, $db) or die("error while listing file keywords")) { 244 while($krow = mysql_fetch_array($kresult)) { 245 $k .= "<option value=\"".$krow["fkey_id"]."\""; 246 $k .= isset($file_keywords[$row["fcat_id"]]) && $file_keywords[$row["fcat_id"]] == $krow["fkey_id"] ? " selected" : ""; 247 $k .= ">".html_specialchars($krow["fkey_name"])."</option>\n"; 248 } 249 mysql_free_result($kresult); 250 } 251 252 $k .= "</select></td>\n</tr>\n"; 253 $k .= "<tr>\n<td colspan=\"2\"><img src=\"img/leer.gif\" width=\"1\" height=\"2\"></td>\n</tr>\n"; 254 255 } 256 } 257 mysql_free_result($result); 258 } 259 260 ?> 261 <tr bgcolor="#F5F8F9"> 262 <td align="right" valign="top" class="v09"><img src="img/leer.gif" alt="" width="1" height="13"><?php echo $BL['be_ftptakeover_keywords'] ?>: </td> 263 <td><table border="0" cellpadding="0" cellspacing="0" summary=""> 264 <?php if($k) echo $k; ?> 265 <tr> 266 <td class="f10b"><?php echo $BL['be_ftptakeover_additional'] ?>: </td> 267 <td><input name="file_shortinfo" type="text" class="width300" id="file_shortinfo" value="<?php echo html_specialchars($file_shortinfo) ?>" size="40" maxlength="250"></td> 268 </tr> 269 </table></td> 270 </tr> 271 <tr bgcolor="#F5F8F9"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="6"></td></tr> 272 <tr><td colspan="2"><img src="img/lines/line-bluelight.gif" alt="" width="538" height="1"></td></tr> 273 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="6"></td></tr> 274 <tr> 275 <td align="right" valign="top" class="v09"><img src="img/leer.gif" alt="" width="1" height="13"><?php echo $BL['be_ftptakeover_longinfo'] ?>: </td> 276 <td valign="top"><textarea name="file_longinfo" cols="40" rows="6" class="v12 width400" id="file_longinfo"><?php echo html_specialchars($file_longinfo) ?></textarea></td> 277 </tr> 278 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3"></td></tr> 279 280 281 <tr> 282 <td align="right" class="v09"><?php echo $BL['be_copyright'] ?>: </td> 283 <td><input name="file_copyright" type="text" id="file_copyright" size="40" class="width400" maxlength="255" value="<?php echo html_specialchars($file_copyright) ?>" /></td> 284 </tr> 285 286 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3" /></td></tr> 287 288 <tr> 289 <td align="right" class="v09"> <?php echo $BL['be_tags'] ?>: </td> 290 <td><input name="file_tags" type="text" id="file_tags" size="40" class="width400" maxlength="255" value="<?php echo html_specialchars($file_tags) ?>" /></td> 291 </tr> 292 293 294 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr> 295 296 <tr> 297 <td align="right" class="v09"> <?php echo $BL['be_cnt_sorting'] ?>: </td> 298 <td><input name="file_sort" type="text" id="file_sort" size="10" class="width50" maxlength="10" value="<?php echo intval($file_sort) ?>" /></td> 299 </tr> 300 301 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr> 302 303 <tr> 304 <td align="right" class="v09 tdtop3"><?php echo $BL['be_ftptakeover_status'] ?>: </td> 305 <td><table border="0" cellpadding="0" cellspacing="0" summary=""> 306 <tr> 307 <td><input name="file_aktiv" type="checkbox" id="file_aktiv" value="1"<?php is_checked("1", $file_aktiv) ?> /></td> 308 <td class="v10"><strong><label for="file_aktiv"><?php echo $BL['be_ftptakeover_active'] ?></label></strong> </td> 309 310 <td><input name="file_granted" type="checkbox" id="file_granted" value="1"<?php is_checked("1", $file_granted) ?>></td> 311 <td class="v10"><label for="file_granted"><?php echo $BL['be_granted_download'] ?></label></td> 312 </tr> 313 <tr> 314 <td><input name="file_public" type="checkbox" id="file_public" value="1"<?php is_checked("1", $file_public) ?> /></td> 315 <td class="v10"><strong><label for="file_public"><?php echo $BL['be_ftptakeover_public'] ?></label></strong> </td> 316 317 <td><input name="file_gallerydownload" type="checkbox" id="file_gallerydownload" value="1"<?php is_checked(1, $file_gallerydownload) ?>></td> 318 <td class="v10"><label for="file_gallerydownload"><?php echo $BL['be_gallerydownload'] ?></label></td> 319 </tr> 320 </table></td> 321 </tr> 322 323 324 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr> 325 <tr> 326 <td valign="top"><input name="file_id" type="hidden" id="file_id" value="<?php echo $file_id ?>"><input name="file_aktion" type="hidden" id="file_aktion" value="2"><input name="file_ext" type="hidden" id="file_ext" value="<?php echo strtolower($file_ext) ?>"></td> 327 <td><input name="Submit" type="submit" class="button10" value="<?php echo $BL['be_fprivedit_button'] ?>"></td> 328 </tr> 329 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr> 330 <tr><td colspan="2" bgcolor="#9BBECA"><img src="img/leer.gif" alt="" width="1" height="4" /></td></tr> 331 </table> 332 </form> 333 <script type="text/javascript"> 334 <!-- 335 336 window.addEvent('domready', function(){ 337 338 /* Autocompleter for keywords (=tags) */ 339 var searchKeyword = $('file_tags'); 340 var indicator = new Element('span', {'class': 'autocompleter-loading', 'styles': {'display': 'none'}}).setHTML('').injectAfter(searchKeyword); 341 var completer = new Autocompleter.Ajax.Json(searchKeyword, 'include/inc_act/ajax_connector.php', { 342 multi: true, 343 maxChoices: 30, 344 autotrim: true, 345 minLength: 0, 346 allowDupes: false, 347 postData: {action: 'category', method: 'json'}, 348 onRequest: function(el) { 349 indicator.setStyle('display', ''); 350 }, 351 onComplete: function(el) { 352 indicator.setStyle('display', 'none'); 353 } 354 }); 355 356 357 }); 358 359 360 //--> 361 </script> 362 363 <?php 364 } 365 366 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Dec 30 05:55:15 2009 | Cross-referenced by PHPXref 0.7 |