vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Moderators Functions - [AJAX] Edit Attachment Filenames (https://vborg.vbsupport.ru/showthread.php?t=178937)

Abe1 05-11-2008 10:00 PM

[AJAX] Edit Attachment Filenames
 
Edit Attachment Filenames 3.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 max
Updates:

Version 3.0 (05/11/08):
  • First release of this hack for vb 3.7.

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

MAKE SURE YOU CLICK INSTALL!
You will get an email when a new version is released.

veenuisthebest 05-12-2008 01:30 AM

reserved !!

RvG2 05-12-2008 02:18 AM

installed!

Boofo 05-12-2008 07:24 AM

Will this work for attachments as files as well as attachments in the db?

Milad 05-12-2008 09:30 AM

I wish you can eliminate the template edits! Can you?

Stoebi 05-12-2008 09:57 AM

Quote:

Originally Posted by Milad (Post 1516990)
I wish you can eliminate the template edits! Can you?

Do you have installed Template Modification System from Andreas? Use the attachment. ;)

@Abe1
Better use $vbphrase[save] and $vbphrase[cancel], please. :)

Javascript error, if I want inline edit an attachment in postbit template (see attached thumbnail, please):
Error: document.getElementById("attachment_filename_" + attachmentid) has no properties
Source file: .../clientscript/edit_attachment_filenames.js
Line: 9
Code:

document.getElementById('attachment_filename_' + attachmentid).innerHTML = ''
Edit:
Updated templateedits, because copy & paste error. Please download the templateedits-abe1_edit_attachment_name.xml again and reimport. sorry. :(

Regards

Abe1 05-12-2008 10:54 AM

Quote:

Originally Posted by Stoebi (Post 1517012)
Do you have installed Template Modification System from Andreas? Use the attachment. ;)

@Abe1
Better use $vbphrase[save] and $vbphrase[cancel], please. :)

Will be hard. It hard codes this into the plugin because I use 'button' and not 'submit'. It right now compares the Save or Cancel text.

Quote:

Originally Posted by Stoebi (Post 1517012)
Javascript error, if I want inline edit an attachment in postbit template (see attached thumbnail, please):
Error: document.getElementById("attachment_filename_" + attachmentid) has no properties
Source file: .../clientscript/edit_attachment_filenames.js
Line: 9
Code:

document.getElementById('attachment_filename_' + attachmentid).innerHTML = ''
Regards

You did not do the template edits perfectly then. It seems like you are missing the 2nd template edit for postbit_attachment

Abe1 05-12-2008 11:00 AM

Quote:

Originally Posted by Boofo (Post 1516904)
Will this work for attachments as files as well as attachments in the db?

Sure.

Abe1 05-12-2008 11:01 AM

Quote:

Originally Posted by Milad (Post 1516990)
I wish you can eliminate the template edits! Can you?

Nope. I wish I was able to though. I can make the headinclude edit go automatic. Maybe for next version.

Stoebi 05-12-2008 11:32 AM

Thank you very much Abe1 for this hint, this was a typically copy & paste error. Copied twice same text for find and replace :(

Regards

TWTCommish 05-12-2008 02:45 PM

This looks awfully slick. Nice addition. :)

Stoebi 05-12-2008 03:46 PM

Quote:

Originally Posted by Abe1 (Post 1517054)
Will be hard. It hard codes this into the plugin because I use 'button' and not 'submit'. It right now compares the Save or Cancel text.

Hm, i see no differents, if I use $vbphrase[save] instead save etc.

Abe1 05-12-2008 11:00 PM

Quote:

Originally Posted by Stoebi (Post 1517345)
Hm, i see no differents, if I use $vbphrase[save] instead save etc.

If you change the language, it wont work.

NAZIA 05-13-2008 04:41 PM

Opps.
not working.. It is leading to downloading the file..
And when I ve import the second attachment this is leading to

Quote:

Invalid File Specified
Please help because I want to rename the attachment...
Thanks in advance

Abe1 05-14-2008 10:52 PM

Quote:

Originally Posted by NAZIA (Post 1518464)
Opps.
not working.. It is leading to downloading the file..
And when I ve import the second attachment this is leading to



Please help because I want to rename the attachment...
Thanks in advance

I would need to test on your site to figure out what is wrong.

maxicep 06-02-2008 07:25 AM

if new attachment filename value including latin characters ( like "ş, ğ, İ" ) it is looking

How can i use a replacement about Turkish some characters to English character

Like

ş > s
ğ > g
İ > i

Thanks

Boofo 06-03-2008 12:30 AM

Abe1, any way to get this to work on attachment thumbnail file names?

Boofo 06-03-2008 12:50 AM

I just recieved a security token error while editing a filename. Here is the info:

Quote:

Missing or Invalid Security Token detected.

Script Call Backtrace
=====================
#0 /xxxx/xxxx/public_html/forums/includes/functions.php line 2592: eval()
#1 /xxxx/xxxx/public_html/forums/includes/init.php line 419: fetch_error(security_token_missing,ltr,sendmessage .php)
#2 /xxxx/xxxx/public_html/forums/global.php line 20: require_once(/xxxx/xxxx/public_html/forums/includes/init.php)
#3 /xxxx/xxxx/public_html/forums/ajax.php line 58: require_once(/xxx/xxxx/public_html/forums/global.php)

POST Variables
==============

Array
(
[ajax] => 1
[securitytoken] =>
)

Request URI
===========
/forums/ajax.php

Referrer
========
http://www.fathers-rights-forums.com...read.php?t=261

Fonzi 06-23-2008 06:52 PM

Quote:

Originally Posted by Boofo (Post 1539287)
I just recieved a security token error while editing a filename. Here is the info:

I'm getting the same error, did you find a fix for it?

Boofo 06-23-2008 07:45 PM

Not fixed yet, waiting on Abe to do the support thing.

ErrorLog 07-25-2008 07:38 PM

Thanks ..

İnstalled Button =}

testebr 09-09-2008 01:04 AM

How to I can edit one image file name with this tool?

thumbnails are enabled in my board.

Makc666 05-22-2009 06:00 AM

Quote:

Originally Posted by Boofo (Post 1539274)
Abe1, any way to get this to work on attachment thumbnail file names?

Quote:

Originally Posted by testebr (Post 1617837)
How to I can edit one image file name with this tool?

thumbnails are enabled in my board.

1st,
if you click on page forumdisplay.php on the URL -->> https://vborg.vbsupport.ru/external/2009/05/5.gif <<-- for the thread where you need to edit thumbnail image name then you will be able to do so.

2nd,
You can do so...

Open template:
Code:

postbit_attachmentmoderated
Find:
Code:

<tr>
REPLACE with this:
Code:

<tr<if condition="can_moderate($threadinfo['forumid'], 'canmoderateattachments')"> ondblclick="edit_attachment_name($attachment[attachmentid]);"</if>>
Find:
Code:

<td><if condition="$show['modattachmentlink']"><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if>>$attachment[filename]</a> ($attachment[filesize])<else />$attachment[filename]</if></td>
REPLACE with this:
Code:

<td><if condition="$show['modattachmentlink']"><a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]"<if condition="$show['newwindow']"> target="_blank"</if> id="attachment_filename_$attachment[attachmentid]">$attachment[filename]</a><a id="attachment_filename_edit_$attachment[attachmentid]"></a> ($attachment[filesize])<else />$attachment[filename]</if></td>
  • After that you can take any post.
  • Select it with inline moderation.
  • Then "Unapprove Attachments"
  • By double clicking on file name icon change the file name you like.
  • Then "Approve Attachments" for that post again.

3rd,

You can open the template:
Code:

postbit_attachmentthumbnail
ADD to the END of the template:
Code:

<if condition="can_moderate($threadinfo['forumid'], 'canmoderateattachments')"><a id="attachment_filename_$attachment[attachmentid]" ondblclick="edit_attachment_name($attachment[attachmentid]);">$attachment[filename]</a><a id="attachment_filename_edit_$attachment[attachmentid]"></a></if>
  • After that in the thread up to the right of any thumbnail you will see the filename.
  • Double click on it and you can change the name.

I know that it's not beautiful, but I could not find a better way to do so for that template.

You can try to add:
Code:

<if condition="can_moderate($threadinfo['forumid'], 'canmoderateattachments')"><a id="attachment_filename_$attachment[attachmentid]" ondblclick="edit_attachment_name($attachment[attachmentid]);">*</a><a id="attachment_filename_edit_$attachment[attachmentid]"></a></if>
Then you will only have "*" after each thumbnail and not file name.

shyguy82 02-16-2010 03:26 PM

Any way you can make it work with vB 4.x???

Thanks

shyguy82 08-08-2010 12:52 AM

Any news on this plugin working for vB 4 ?

:)

majidmozaffari 02-27-2011 01:43 PM

please working this plugin for vB 4

p30suite 09-24-2011 07:21 PM

it is not work on v4 :( please ...
i need this mod for v4 :(

xorex 12-25-2012 10:33 PM

SECURITY WARNING

This hack allow execute scripts e.t.c

try rename file as

PHP Code:

<script>alert('hi');</script

and it work

same situation in admincp if you view attachements stats

Farsisat 03-21-2013 10:08 AM

please make it for vb 4.2


All times are GMT. The time now is 03:28 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01401 seconds
  • Memory Usage 1,814KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_code_printable
  • (1)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (29)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete