PDA

View Full Version : Moderators Functions - [AJAX] Edit Attachment Filenames


Abe1
18 Sep 2006, 15:02
CLICK HERE FOR A LATER VERSION OF THIS HACK

Edit Attachment Filenames 2.0

About this hack:
This hack is a pretty useful hack. It lets you edit filenames of attachments. Only users with 'canmoderateattachments' permissions on the forum that the attachment it posted by will be allowed to edit the filenames.

You access the edit by double clicking right near the filename of an attachment. It will bring up an edit box similar to the edit thread title vb feature. You will get an option to save or cancel the edit.

Now that you can see a list of all attachments in one thread, you would want to name some attachments differently so they can be identified with out looking at the post.

The filename extension cannot be edited.

Installation information on hack:

Files edited: 0
Templates edited: 2
Files to upload via FTP: 1
Time to install: 1 minute maxUpdates:

Version 1.0 (09/18/06):

First release of this hack.

Version 2.0 (04/16/07):

Re-wrote most of the code to optimize AJAX code.

Please post your comments or suggestions for this hack. I read ALL posts.

MAKE SURE YOU CLICK INSTALL (http://www.vbulletin.org/forum/vborg_miscactions.php?do=installhack&threadid=126928)!
You will get an email when a new version is released.

Spiceworld
18 Sep 2006, 15:36
Hi

Have installed, but noticed that the first <tr> statements in each template edit are both missing the ending >

Cheers

Richard

FleaBag
18 Sep 2006, 15:44
Great addition! I'll definately install. Thanks. :)

Abe1
18 Sep 2006, 16:14
Hi

Have installed, but noticed that the first <tr> statements in each template edit are both missing the ending >

Cheers

Richard
I'll look into it.

DPSR
18 Sep 2006, 17:49
Wah, i really need this a loooot!!

Thanks a lot Abe1 for the hack :)

and Spiceworld, its working that way only :)

Abe1
18 Sep 2006, 19:20
Hi

Have installed, but noticed that the first <tr> statements in each template edit are both missing the ending >

Cheers

Richard
I think I know what you mean. The end '>' is right after the </if>

harmor19
18 Sep 2006, 19:30
Great hack.

Snake
18 Sep 2006, 20:00
That's pretty good. Thanks!

Milad
19 Sep 2006, 08:33
This is very good

Basboss
19 Sep 2006, 08:55
This one is should be a standard vb's option...thanks!

Kmaster
22 Nov 2006, 15:26
will it work for vb35?

Abe1
22 Nov 2006, 20:30
will it work for vb35?
I think it should but i'm not sure if it will import into a vb3.5 forum. You can try though. (It wont kill your forum)

testebr
18 Mar 2007, 13:16
The best hack ever!!!

Need be part of default vbulletin.

Doctor Death
19 Mar 2007, 05:57
Installed, but a couple of things I am wondering about

What about the syntax error in the first TR? No one ever corrected that.

In my forums, there doesnt seem to be a place to edit these filenames... in other words, I cannot see any affect this plugin has. I did both template edits and installed the XML file, but there doesnt seem to be any difference.

Thanks

Doctor Death
19 Mar 2007, 05:58
I think I know what you mean. The end '>' is right after the </if>

Did you guys edit this before installing?

Abe1
19 Mar 2007, 14:29
Installed, but a couple of things I am wondering about

What about the syntax error in the first TR? No one ever corrected that.

In my forums, there doesnt seem to be a place to edit these filenames... in other words, I cannot see any affect this plugin has. I did both template edits and installed the XML file, but there doesnt seem to be any difference.

Thanks
You have to double click right by the attachment name.

Abe1
19 Mar 2007, 14:30
Did you guys edit this before installing?
There is no problem. He had thought something was not there.

Abe1
16 Apr 2007, 14:09
Version 2.0 (04/16/07):

Re-wrote most of the code to optimize AJAX code.

Please redo the template edits and revert attachmentbit and postbit_attachment templates before you start.

millionart
20 Apr 2007, 14:48
a good mod
but if i rename a attachment in Chinese, it cant work.
it doesnt Support utf8 character.

Abe1
20 Apr 2007, 16:05
a good mod
but if i rename a attachment in Chinese, it cant work.
it doesnt Support utf8 character.
Sorry, I have no way to test it.

Surviver
08 May 2007, 14:02
In the js File, ist the following Code:

function post_thanks_give(postid, integrate)
{
fetch_object('post_thanks_button_' + postid).style.display = 'none';

if (integrate == true)
{
fetch_object('post_groan_button_' + postid).style.display = 'none';
}

do_thanks_add = new vB_AJAX_Handler(true);
do_thanks_add.postid = postid;
do_thanks_add.onreadystatechange(thanks_add_Done);
do_thanks_add.send('post_thanks.php?do=post_thanks_add&using_ajax=1&p=' + postid);
}
function thanks_add_Done()
{
if (do_thanks_add.handler.readyState == 4 && do_thanks_add.handler.status == 200)
{
fetch_object('post_thanks_box_' + do_thanks_add.postid).innerHTML = do_thanks_add.handler.responseText;
}
}
function post_thanks_remove_all(postid, integrate)
{
do_thanks_remove_all = new vB_AJAX_Handler(true)
do_thanks_remove_all.postid = postid
do_thanks_remove_all.onreadystatechange(thanks_remove_all_Done)
do_thanks_remove_all.send('post_thanks.php?do=post_thanks_remove_all&using_ajax=1&p=' + postid)

fetch_object('post_thanks_button_' + postid).style.display = ''

if (integrate == true)
{
fetch_object('post_groan_button_' + postid).style.display = '';
}
}
function thanks_remove_all_Done()
{
if (do_thanks_remove_all.handler.readyState == 4 && do_thanks_remove_all.handler.status == 200)
{
fetch_object('post_thanks_box_' + do_thanks_remove_all.postid).innerHTML = do_thanks_remove_all.handler.responseText
}
}
function post_thanks_remove_user(postid, integrate)
{
do_thanks_remove_user = new vB_AJAX_Handler(true)
do_thanks_remove_user.postid = postid
do_thanks_remove_user.onreadystatechange(thanks_remove_user_Done)
do_thanks_remove_user.send('post_thanks.php?do=post_thanks_remove_user&using_ajax=1&p=' + postid)

fetch_object('post_thanks_button_' + postid).style.display = ''

if (integrate == true)
{
fetch_object('post_groan_button_' + postid).style.display = '';
}
}
function thanks_remove_user_Done()
{
if (do_thanks_remove_user.handler.readyState == 4 && do_thanks_remove_user.handler.status == 200)
{
fetch_object('post_thanks_box_' + do_thanks_remove_user.postid).innerHTML = do_thanks_remove_user.handler.responseText
}
}

Ist this Correct?

Abe1
09 May 2007, 00:46
How did post thanks hack get it's way into this thread?

Triky
09 May 2007, 12:29
Nice hack, Abe1. :)

millionart
06 Oct 2007, 23:01
Sorry, I have no way to test it.

You can rename any attachment to "中文附件名测试" for testing.
(The character means by "the Chinese attachment name test".

Hope you can fix it , theanks.:)

Abe1
12 May 2008, 03:01
Version 3.0 (05/11/08):

First release of this hack for vb 3.7.

http://www.vbulletin.org/forum/showthread.php?t=178937