附件下載檔名追加版權 (完整針對FireFox修正)

Home Home
引用 | 編輯 香吉士
2008-08-14 11:30
樓主
推文 x0
【原作】:已忘記
【5.0】:翡璃月
【5.5】:翡璃月
【修正 by 風星】
【數據升級】:
【數據查詢增加】:

附註:使用此插件 請將後台附件設置 修改 下載附件來路檢查 打勾:

演示圖




==================================================

attachment.php


複製程式
 
periodscheck('attachbanperiods'); 
$attachexists = $ispaid = FALSE; 
if(!empty($aid)) { 
  $query = $db->query("SELECT * FROM {$tablepre}attachments WHERE aid='$aid'"); 
  if($attach = $db->fetch_array($query)) { 
      $query = $db->query("SELECT tid, fid, price, special FROM {$tablepre}threads WHERE tid='$attach[tid]' AND displayorder>=Ɔ'"); 
      $thread = $db->fetch_array($query); 
      if($thread['fid']) { 
          $query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE pid='$attach[pid]' AND invisible=Ɔ'"); 
          if($db->result($query, 0)) { 
            $attachexists = TRUE; 
          } 
      } 
  } 
}

改成


periodscheck('attachbanperiods');
$attachexists = $ispaid = FALSE;
if(!empty($aid)) {
  $query = $db->query("SELECT * FROM {$tablepre}attachments WHERE aid='$aid'");
  if($attach = $db->fetch_array($query)) {
      $query = $db->query("SELECT tid, fid, price, special FROM {$tablepre}threads WHERE tid='$attach[tid]' AND displayorder>=Ɔ'");
      $thread = $db->fetch_array($query);
      if($thread['fid']) {
          $query = $db->query("SELECT COUNT(*) FROM {$tablepre}posts WHERE pid='$attach[pid]' AND invisible=Ɔ'");
          $query = $db->query("SELECT author FROM {$tablepre}posts WHERE pid='$attach[pid]' AND invisible=Ɔ'");
          if($db->result($query, 0)) {
          if($db->num_rows($query)) {
            $attach['author'] = $db->result($query, 0);
            $attachexists = TRUE;
            }
          }
      }
  }
}




複製程式
 dheader('Content-Disposition: inline; filename='.$attach['filename'].'.thumb.jpg'); 

改成


dheader('Content-Disposition: inline; filename="['.$bbname.' by '.$attach['author'].'] '.$attach['filename'].'.thumb.jpg"');



複製程式
 
if($isimage && !empty($noupdate)) { 
dheader('Content-Disposition: inline; filename='.$attach['filename']); 
} else { 
dheader('Content-Disposition: attachment; filename='.$attach['filename']); 
} 


改成

if($isimage && !empty($noupdate)) {
  dheader('Content-Disposition: inline; filename="['.$bbname.' by '.$attach['author'].'] '.$attach['filename'].'"');
} else {
  dheader('Content-Disposition: attachment; filename="['.$bbname.' by '.$attach['author'].'] '.$attach['filename'].'"');
}


獻花 x0