[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dunstan 2001-2002 7 | http://e107.org 8 | jalist@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_uploads.php,v $ 14 | $Revision: 1.4 $ 15 | $Date: 2007/01/17 20:47:24 $ 16 | $Author: e107steved $ 17 +----------------------------------------------------------------------------+ 18 */ 19 require_once ("../../class2.php"); 20 21 if(!USER) 22 { 23 header("location:".e_BASE.$PLUGINS_DIRECTORY."forum/forum.php"); 24 exit; 25 } 26 $lan_file = e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_uploads.php'; 27 include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN.'forum/languages/English/lan_forum_uploads.php'); 28 29 if(is_array($_POST['delete'])) 30 { 31 foreach(array_keys($_POST['delete']) as $fname) 32 { 33 $f = explode("_", $fname); 34 if($f[1] == USERID) 35 { 36 $path = e_FILE."public/".$fname; 37 if(unlink($path) == TRUE) 38 { 39 $msg = FRMUP_2.": $path"; 40 } 41 else 42 { 43 $msg = FRMUP_3.": $path"; 44 } 45 } 46 } 47 } 48 49 include_once(e_HANDLER."file_class.php"); 50 include_once(HEADERF); 51 if($msg) 52 { 53 $ns->tablerender(FRMUP_4, $msg); 54 } 55 56 $fi = new e_file; 57 $mask = ".*_".USERID."_FT.*"; 58 $fileList = $fi->get_files(e_FILE."public", $mask); 59 if($sql->db_Select('forum_t','thread_id, thread_thread, thread_parent', "thread_thread REGEXP '.*_".USERID."_FT.*'")) 60 { 61 $threadList = $sql->db_getList(); 62 } 63 64 $filecount = 0; 65 if(is_array($fileList)) 66 { 67 $txt = " 68 <form method='post' action='".e_SELF."'> 69 <table style='width:98%'> 70 <tr> 71 <td class='fcaption'>".FRMUP_5."</td> 72 <td class='fcaption'>".FRMUP_6."</td> 73 </tr>"; 74 foreach($fileList as $finfo) 75 { 76 if($finfo['fname']) 77 { 78 $filecount++; 79 $txt .= "<tr><td class='forumheader3'><a href='".e_FILE."public/{$finfo['fname']}'>{$finfo['fname']}</a></td>"; 80 $found = FALSE; 81 if(is_array($threadList)) 82 { 83 foreach($threadList as $tinfo) 84 { 85 if(strpos($tinfo['thread_thread'], $finfo['fname']) != FALSE) 86 { 87 $found = $tinfo; 88 break; 89 } 90 } 91 } 92 if($found != FALSE) 93 { 94 if($tinfo['thread_parent']) 95 { 96 $txt .= "<td class='forumheader3'>".FRMUP_7.": <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$tinfo['thread_id']}.post'>{$tinfo['thread_parent']}</a></td>"; 97 } 98 else 99 { 100 $txt .= "<td class='forumheader3'>".FRMUP_7.": <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$tinfo['thread_id']}'>{$tinfo['thread_id']}</a></td>"; 101 } 102 103 } 104 else 105 { 106 $txt .= "<td class='forumheader3'>".FRMUP_8." <input class='button' type='submit' name='delete[{$finfo['fname']}]' value='".FRMUP_10."' /></td>"; 107 } 108 $txt .= "</tr>"; 109 } 110 } 111 $txt .= "</table>"; 112 } 113 if(!$filecount) { 114 $ns->tablerender(FRMUP_1,FRMUP_9); 115 include_once(FOOTERF); 116 exit; 117 } 118 119 $ns->tablerender(FRMUP_1, $txt); 120 include_once(FOOTERF); 121 122 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |