Attachment File Renamer (V1.2.1)

Started by ディン1031, April 05, 2007, 08:47:50 AM

Previous topic - Next topic

ディン1031

Link to Mod

With this mod you can rename filenames of Attachments. With help of the Attachment Manager or with in (over?) the post.

The mod have also a setting for permission that can allow the user to rename the attachment of the post or not.

Languages: English, German


Version 1.0.0
!*+- First Release


Version 1.1.0
+ Add a Option for Censoring Attachment names
- Upgrade Included


Version 1.1.0 (25.06.07)
- 1.1.3 Compatible


Version 1.1.0 (11.07.07)
- Changed the installer for the db changes so that this use the SSI.php if it not used with smf package parser (Easier handling for manual installing)


Version 1.1.2 (12.08.07)
! fix a eval bug in avatar loading (Thx to ApplianceJunk for the info)
! take the original filename if no renamed file exists.
* change the redirect in the Attachment Manager (Now it try to go where you where last).
- Upgrade Included


Version 1.2.0 (02.06.09)
- SMF 1.1.9 Compatible
- This Version is not compatible to old SMF Versions! Please uninstall old Versions.
! Removed the Attachment Thumbs it's not logical to rename them.
* Changed Coding Style better viewable.


Version 1.2.1 (15.07.09)
- SMF 1.1.10 Compatible
- This Version is not compatible to old SMF Versions! Please uninstall old Versions.



Legend:
! Bugfix
+ New Feature
* Change
- Info Only
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

ディン1031

Version 1.1.0
+ Add a Option for Censoring Attachment names

Upgrade for the old Version included. (The Option to enable, is found in the Attachment Settings).

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

Flammifer

I'm getting some errors with my tinyportal template when using this mod. It works fine but I'll have to uninstall it for now to keep the log file from filling up and causing problems. I'm using smf 1.1.2 and tp 0.983

The errors are

2: fgets(): supplied argument is not a valid stream resource
File: /home/******/public_html/******/Themes/default/TPortal.template.php (eval?)
Line: 32

2: feof(): supplied argument is not a valid stream resource
File: /home/******/public_html/******/Themes/default/TPortal.template.php (eval?)
Line: 30

ディン1031

It's not from my mod, i don't use this functions in my mod ;). It must something to do with the tiny portal (and i know nothing about the the tiny portal).

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

FreeSporePrints

Hello,
i installed your mod on SMF 1.1.2 and it worked greatly, no on SMF 1.1.3 the rename buttons seems disappeared. I've unistalled the previous one and installed the new versione, activated the permission for the members, moderators and global moderators but nothing..

Can you help me!?

Thank you,
F.

ディン1031

Hmmm i tested it on SMF 1.1.3 and it should work.
Any Theme Changes lately?

And the button don't appear even for you (the Admin)?

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

FreeSporePrints

I was using "Juno" theme but doesn't work, instead it works on the "Default Core" theme.

However thank you for your support!  ;)
F.

ディン1031

You can try to make the Theme changes on the Jumo Theme:

Theme Changes

Look if you can make the Display.template.php changes :).

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

ApplianceJunk

#8
Hi,

I would like to use this mod. Downloaded and installed it and got this.

QuoteInstalling this package will perform the following actions:  Type Action Description
1. Execute Code install_1.x.x.php 
2. Execute Modification ./index.php Test successful
3. Execute Modification ./Sources/Display.php Test successful
4. Execute Modification ./Sources/Security.php Test successful
5. Execute Modification ./Sources/ManageAttachments.php Test successful
6. Execute Modification ./Sources/ManagePermissions.php Test successful
7. Execute Modification ./Sources/Subs-Post.php Test successful
8. Execute Modification ./Themes/default/Display.template.php Test successful
9. Execute Modification ./Themes/default/ManageAttachments.template.php Test successful
10. Execute Modification ./Themes/default/languages/ManagePermissions.english.php Test successful
11. Execute Modification ./Themes/default/languages/index.english.php Test successful
12. Execute Modification ./Themes/default/languages/ManagePermissions.german.php Skipping file
13. Execute Modification ./Themes/default/languages/index.german.php Test failed


Does that mean it will work, just not for any german languages?

Running SMF 1.1.3 @ ApplianceJunk.com

thanks,

shadow82x

Will work fine without German files. Thats only used if your using the German language. So you can proceed. ;)
Colin B
Former Spammer, Customize, & Support Team Member


ディン1031

Normal it should skip the second file, too but i don't know why it sometimes not done.

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

ApplianceJunk

#12
Here is something I found in my forum error log today.

QuoteAJ       Today at 02:06:02 PM
Apply Filter: Only show the error messages of this IP address 24.111.253.113      Apply Filter: Only show the error messages of this session 4959849a25a69212769603a222317ba8
Apply Filter: Only show the error messages of this URL http://appliancejunk.com/forums/index.php?action=dlattach;attach=28;type=avatar
Apply Filter: Only show the errors with the same message
8: Undefined offset: 3
File: /home/content/a/p/p/appliancejunk/html/forums/Sources/Display.php
Line: 972

Here are the mods I have.


   Mod Name             Version     
1. SMF 1.1.2 Update Package              1.1.2    
2. SMF 1.0.11 / 1.1.3 Update              1.1
3. SMF Gallery Lite                              1.7.6    
4. Ad Managment                              2.3    
5. Streaming 3                              4.2.2b    
6. nwsw.nwswAdminAttachAnything 1.1 RC3    
7. Attachment File Renamer              1.1.0    
8. Website Button                              1.1.4    
9. SMF Sitemap                              1.2.1


Here is the code around line 972

// Make sure this attachment is on this board.
$request = db_query("
SELECT a.filename, a.ID_ATTACH, a.attachmentType, a.renamedfilename
FROM ({$db_prefix}boards AS b, {$db_prefix}messages AS m, {$db_prefix}attachments AS a)
WHERE b.ID_BOARD = m.ID_BOARD
AND $user_info[query_see_board]
AND m.ID_MSG = a.ID_MSG
AND a.ID_ATTACH = $_REQUEST[attach]
LIMIT 1", __FILE__, __LINE__);
}
if (mysql_num_rows($request) == 0)
fatal_lang_error(1, false);
list ($real_filename, $ID_ATTACH, $attachmentType, $renamedfilename) = mysql_fetch_row($request);
mysql_free_result($request);

//if the renamed filename empty than i replace it with teh orginal :) And remove some not so nice html inserts ;D
if(!empty($modSettings['attachmentCheckCensor'])) {
$pregReplace = !empty($renamedfilename);
$renamedfilename = empty($renamedfilename) ? $real_filename : $renamedfilename;
censorText($renamedfilename);
if($pregReplace)
$renamedfilename = preg_replace('%(&)(.*?)(;)%is', '_', $renamedfilename);
}
else
$renamedfilename = empty($renamedfilename) ? $real_filename : preg_replace('%(&)(.*?)(;)%is', '_', $renamedfilename);


Line 972 was this part.

list ($real_filename, $ID_ATTACH, $attachmentType, $renamedfilename) = mysql_fetch_row($request);

I asked about this error in this topic.

http://www.simplemachines.org/community/index.php?topic=188329.0

I was told there that I should report the bug in the modifications topic to give the author of the mod the chance to fix it.

Everything seems to work ok for me and your mod works great.

I have no idea if this is anything or not, but thought I would let you know about it.

Thanks again for the mod.





ディン1031

Version 1.1.2 (12.08.07)
! fix a eval bug in avatar loading (Thx to ApplianceJunk for the info)
! take the original filename if no renamed file exists.
* change the redirect in the Attachment Manager (Now it try to go where you where last).
- Upgrade Included

@ApplianceJunk
If you upgrade to the new Version it will remove this eval bug ;).

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

ApplianceJunk

#14
QuoteIf you upgrade to the new Version it will remove this eval bug

How should I go about doing the upgrade?

Do I need to uninstall or delete the old version first?

ディン1031

Nope upload the new version and go to the package parser and than there will stand upgrade instead of install ;) as long the old version is installed.

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

ApplianceJunk

Quote from: ディン1031 on August 12, 2007, 01:14:16 PM
Nope upload the new version and go to the package parser and than there will stand upgrade instead of install ;) as long the old version is installed.

Bye
DIN1031

That worked great, thanks again..


ApplianceJunk

Does this one have anything to do with your mod?

Quotehttp://appliancejunk.com/forums/index.php?topic=16.0
Apply Filter: Only show the errors with the same message
8: Undefined index: renameattach
File: /home/content/a/p/p/appliancejunk/html/forums/Themes/default/Display.template.php (eval?)
Line: 471

Thanks,

ディン1031

Yes you did not insert the Translations for the Mod for the language that you use ;).

Here are the overview of the language changes -> http://jmusic.ddo.jp/DIN1031/modparser/index.php?action=installMod&smfVersion=1.1.3&name=AttachmentFileRenamer112&language

Now make the English changes also in the language that you use.

Bye
DIN1031
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

evulness

i was just looking for a way to do something like this...
Thanks man ;)

You know... this would be so sweet if it automaticaly renamed attachments to something like
Quote'$FileName'_by_'$UserName'.(jpg/gif/png/zip)
or what ever configuration Admin sets, and alowed users to set a file name, in the attachments part of the post page...
this would be best mostly for images, but would be good for other filetypes too...

Advertisement: