bb-attachments modified nice permalink
-
in .htaccess add
RewriteRule ^attachments/([^/]+)/download/([0-9]+)/inline/?$ /?bb_attachments=$1&bbat=$2&inline [L,QSA]
RewriteRule ^attachments/([^/]+)/download/([0-9]+)/?$ /?bb_attachments=$1&bbat=$2 [L,QSA]
in bb-attachments.php line 234 edit like this
if ($attachment->status==0) {
$output.=" "."<a href='".$uri."attachments/$attachment->post_id/download/$attachment->id/'>".$attachment->filename."</a> "." ";
}in bb-attachments.php line 289
if (file_exists($fullpath)) { // it's been resized, so it's likely on AWS, show directly
$aws=$bb_attachments['aws']['url'].$file->id.'.'.$file->filename;
$replace="<a class='bb_attachments_link' href='".$uri."attachments/".$match[1]."/download/".$match[2]."'><img src='$aws' /></a>";
if (is_bb_feed()) {$replace=wp_specialchars($replace);}
$text=str_replace($match[0],$replace,$text);
}in bb-attachments.php line 298
so now your attachments have permalink like this
example.com/attachments/*postid*/download/*attachmentid*/
and embed image url
example.com/attachments/*postid*/download/*attachmentid*/inline/
Related thread : http://bbpress.org/forums/topic/on-attachment-file-permalink
-
I applied your modifications and it works but now my old images dont show up. How can i fix this?
is your old image permalink like this ?
xxx.com?bb_attachments=51644&bbat=8&inline
Its in the form:
http://www.mysite.com/forum/?bb_attachments=xxx&bbat=xxx&inline
can you show me your bbpress web?
hmm you not use the mod
I placed just the backup back
Otherwise i put
RewriteRule ^attachments/([^/]+)/download/([0-9]+)/inline/?$ /?bb_attachments=$1&bbat=$2&inline [L,QSA]
RewriteRule ^attachments/([^/]+)/download/([0-9]+)/?$ /?bb_attachments=$1&bbat=$2 [L,QSA]oke now i modified the htaccess with that. Is that what you meant?
this mod only edit the output result with new link but the old link still can be used. so i dont know about your error problem.
to Moderator : move this topic to plugin section >.<
- You must be logged in to reply to this topic.