echo $target == 'vc' ? ' active' : ''; ?> ">コンテンツダンプ</a> </div> <h4>ウィジット設定</h4> <div class="list-group"> <?php $list = dlist('widget'); foreach ($list as $value) { echo " <a href=\"index.php?mode=5&target=widget&widget={$value}\" class=\"list-group-item" . ($widget == $value ? ' active' : '') . "\">{$value}</a>\n"; } ?> </div> <h4>テーマ編集</h4> <div class="list-group"> <?php $list = dlist('themes'); foreach ($list as $value) { echo " <a href=\"index.php?mode=5&target=themes&themes={$value}\" class=\"list-group-item" . ($themes == $value ? ' active' : '') . "\">{$value}</a>\n"; } ?> </div> </div> <div class="col-sm-10"> <?php include $inc; ?> </div> </div> <?php $sysftr();
function dlist($dir,$ver){ global $dlist; $mod = preg_match('/(album|forum|portal)/im', $dir,$match); $mod = $match[0]; foreach (glob($dir.'/*') as $filename) { if(is_dir($filename)){ dlist($filename,$ver); } else { $filename = str_replace(DISCUZ_ROOT."/data/attachment/{$mod}/",'',stripslashes($filename)); if ($mod == 'album') { $aid = DB::result_first("SELECT count(picid) FROM ".DB::table('home_pic')." WHERE filepath = '$filename'"); } elseif ($mod == 'forum') { if($ver >= 2){ $aid = 0; for($i=0;$i<=9;$i++){ $aid += DB::result_first("SELECT count(aid) FROM ".DB::table('forum_attachment_'.$i)." WHERE attachment = '$filename'"); } } else { $aid += DB::result_first("SELECT count(aid) FROM ".DB::table('forum_attachment')." WHERE attachment = '$filename'"); } } elseif($mod == 'portal') { $aid = DB::result_first("SELECT count(attachid) FROM ".DB::table('portal_attachment')." WHERE attachment = '$filename'"); if($aid == 0) { $aid = DB::result_first("SELECT count(itemid) FROM ".DB::table('common_block_item')." WHERE pic = '$mod/$filename'"); } } if($aid == 0 && !strpos($filename,'index.html') && !strpos($filename,'thumb.jpg')){ $dlist[$filename] = $mod.'/'.$filename; } } } }
@unlink(DISCUZ_ROOT . '/data/attachment/' . $value . '.thumb.jpg'); } cpmsg($toolslang['clearatt_done'], "action=plugins&operation={$operation}&do={$do}&identifier={$identifier}&pmod=maintain&cp=clean_att", 'succeed'); } } if (submitcheck('att_submit')) { set_time_limit(0); if (function_exists(ini_set)) { ini_set('memory_limit', '256M'); } $dlist = array(); $dir = $_G['gp_dira']; $mod = preg_match('/(album|forum|portal)/im', $dir, $match); $mod = $match[0]; $att = ''; dlist($dir, intval($xver)); if (count($dlist) <= 0) { cpmsg($toolslang['clearatt_nolaji'], "action=plugins&operation={$operation}&do={$do}&identifier={$identifier}&pmod=maintain&cp=clean_att", 'error'); } foreach ($dlist as $key => $value) { $att .= showtablerow('', array('class="td25"', ''), array("<input type=\"checkbox\" name=\"attarray[]\" value=\"{$value}\" class=\"checkbox\">", "<a href=\"data/attachment/{$mod}/{$key}\" target=\"_blank\">{$value}</a>"), TRUE); } showformheader("plugins&operation={$operation}&do={$do}&identifier={$identifier}&pmod=maintain&cp=clean_att"); showtableheaders($toolslang['clearatt_lajiatt']); echo $att; showsubmit('att_clean_submit', 'submit', '<input type="checkbox" name="chkall" onclick="checkAll(\'prefix\', this.form, \'attarray\')" class="checkbox">' . cplang('del'), ''); showtablefooter(); showformfooter(); } else { if (intval($xver) >= 2) { $tablearray = array('forum_attachment_0' => 'attachment', 'forum_attachment_1' => 'attachment', 'forum_attachment_2' => 'attachment', 'forum_attachment_3' => 'attachment', 'forum_attachment_4' => 'attachment', 'forum_attachment_5' => 'attachment', 'forum_attachment_6' => 'attachment', 'forum_attachment_7' => 'attachment', 'forum_attachment_8' => 'attachment', 'forum_attachment_9' => 'attachment', 'home_pic' => 'filepath', 'portal_attachment' => 'attachment');