Info
- 9 posts
- 2 voices
- Started 2 years ago by psycheangels
- Latest reply from psycheangels
- This topic is not a support question
bb-attachments modified nice permalink
-
- Posted 2 years ago #
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
-
- Posted 2 years ago #
I applied your modifications and it works but now my old images dont show up. How can i fix this?
-
- Posted 2 years ago #
is your old image permalink like this ?
xxx.com?bb_attachments=51644&bbat=8&inline -
- Posted 2 years ago #
Its in the form:
http://www.mysite.com/forum/?bb_attachments=xxx&bbat=xxx&inline
-
- Posted 2 years ago #
can you show me your bbpress web?
-
- Posted 2 years ago #
-
- Posted 2 years ago #
hmm you not use the mod
-
- Posted 2 years ago #
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?
-
- Posted 2 years ago #
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 log in to post.