PDA

View Full Version : [SOLVED]Change attachments name in post acoording type ( for 2 types only )


danyxxx
08-01-2011, 01:10 PM
Hello,

I need a change, a plugin or something that when I attach a file. txt ( whatever name for exemple: vbulletin.txt ) and make de thread\post , in the attachments will show:

get file

Instead to see:

vbulletin.txt

The same thing for .rar type , exemple for: vbulletin.rar archive to show ->

get archive

Instead to see:

vbulletin.rar

Please nice help me with this kind of modification :erm:

ps: sorry for my bad english .

danyxxx
08-04-2011, 03:20 PM
In 3 days no answer?
Maybe this is "up" or "bump" but even then, no answer !?
It's really a god modification guys :cool:

Lynne
08-04-2011, 05:27 PM
I don't really understand what you are trying to do. If the extension is .txt or .rar then instead of showing the attachment name, you want to just say "get file" or "get archive"?

danyxxx
08-04-2011, 06:33 PM
Exactly :) ( in postbit, obviously ... for 3.8.x )

danyxxx
08-07-2011, 12:32 PM
01 Aug 2011, 14:10 -> 1 week and nobody want's to offer a little help with this modification?
Sad ... :erm:

kh99
08-07-2011, 01:05 PM
Create a plugin using hook postbit_attachment,

if (substr($attachment['filename'], -4) === ".txt")
$attachment['filename'] = "get file";
else if (substr($attachment['filename'], -4) === ".rar")
$attachment['filename'] = "get archive";

danyxxx
08-07-2011, 01:38 PM
Ok... I will try and I will return with the answer .

EDIT:

Yeah it's working .
Kind Regards!