Attachment File Renamer (V1.2.1)

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

Previous topic - Next topic

Nachtfalke

Well it dosn't fit with 1.1.5. i installed it with no error messages but i didn't get a button to use thar mod in my admin pannel..... (language: german)
>>> Tanja Gräff, Studentin aus Trier, wird seit 14 Monaten vermisst | http://www.findet-tanjagraeff.de <<<

ディン1031

#21
Quote from: Nachtfalke on July 31, 2008, 06:48:30 PM
Well it dosn't fit with 1.1.5. i installed it with no error messages but i didn't get a button to use thar mod in my admin pannel..... (language: german)
There is no button for this in the admin panel ;).
The Admin Settings are in the Attachment Maintain Options there you can rename every file ;).
And than is a text under the posts if you allowed users to rename attachments.

German is installed but if you use utf8 than you need to do the German language strings also in the utf8 files. This mod is currently incompatible to utf8 (Because i had no time to do it ;P).

This Theme Change is normal the most time missed ;).
Change in Filename: $themedir/Display.template.php 
Quote
Search for this

echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" />&nbsp;' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
}


Add after this

if($message['can_rename_attachment'])
echo '
<a href="'.$scripturl.'?action=attachrename;topic='.$context['current_topic'].'.0;msg='.$message['id'].';sesc=', $context['session_id'], '"><span class="smalltext">'.$txt['renameattach'].'</span></a><br />';



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

Sabre™

Installed onto 1.1.6 with little instances of doubles.
Maybe a conflict with the TP mod as someone before me had.
I received no errors in the log, but couldnt get into the attachment section in the AP.
I then manually checked the templates, and found the code had repeated itself in certain areas.

Since deleting the doubles, the mod performs flawless.
Thanks for this mate :)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


ディン1031

Good to hear that it work =).

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

.HuNTeR.

hi Din
i just want to know can you add a feature to this mod that every time a user attach something to forum a text will add to file name automatically?
thanks a lot

ディン1031

So i will say it now:

At the moment the Mod is not compatible to SMF 1.1.9.
I need to change some major things to make it compatible (so that it only work on 1.1.9).

Please uninstall it before you upgrade to SMF 1.1.9!

I work on the update!

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

Sabre™

Yeah I noticed that on the upgrade lol
I made all the appropriate edits, but now Im getting a table error.
I'll wait for your update! lol ;)
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


drhamza

is there any version for 2 RC?

Blinker

I managed to get it working when I got a failed message on some files for the 1.1.9 upgrade.

From memory they were mainly in post and display templates.

For all I know it may not really be working but I'm still able to rename attachments and I'm not getting any errors on the forum, however, I may also not be getting the full security-related benefits of the 1.1.9 upgrade as a result.

When I get a chance I'll post up the relevant code sections if any one wants to have a crack and also for DIN1031 to take a look at.

Quite honestly I wish I'd uninstalled this mod first cos the edits took me about 30 mins to do. :) I didn't know or realise at the time what the upgrade was for, I just saw the alert and applied the package and by then it was too late to back out...

ディン1031

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.

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

FragaCampos

Thanks a lot for this great and useful mod (another one ;))
It's working great!

I would like to ask you something, though: what is "Censor Attachment Filenames" and what is it used for?

ディン1031

Quote from: FragaCampos on June 03, 2009, 07:50:48 PM
Thanks a lot for this great and useful mod (another one ;))
It's working great!

I would like to ask you something, though: what is "Censor Attachment Filenames" and what is it used for?
Use the word cencor on the name of attachment. This prevent that user can use not allowed word for attachment names.

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

FragaCampos

Great. I thought it might be that ;)

Thanks!

Shannar

Sorry for terrible English. My native language is C++ Russian.

ディン1031

No, this is and will be to much to make it for all compatible... (this is not the only one which would not work together with my mod).
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

drhamza

i think i asked about this before: how about having it for 2 rc1? come on man, i'll vote for it being an essential feature in standard smf :D

Sabre™

Change for smf 1.1.10
ManageAttachments.php

Replace
'link' => '<a href="' . ($row['attachmentType'] == 1 ? $modSettings['custom_avatar_url'] . '/' . $row['filename'] : ($scripturl . '?action=dlattach;' . ($context['browse_type'] == 'avatars' ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'])) . '"' . (empty($row['width']) || empty($row['height']) ? '' : ' onclick="return reqWin(this.href + \'' . ($modSettings['custom_avatar_url'] ? '' : ';image') . '\', ' . ($row['width'] + 20) . ', ' . ($row['height'] + 20) . ', true);"') . '>' . htmlspecialchars($row['filename']) . '</a>'


With
'link' => '<a href="' . ($row['attachmentType'] == 1 ? $modSettings['custom_avatar_url'] . '/' . $row['filename'] : ($scripturl . '?action=dlattach;' . ($context['browse_type'] == 'avatars' ? 'type=avatar;' : 'topic=' . $row['ID_TOPIC'] . '.0;') . 'id=' . $row['ID_ATTACH'])) . '"' . (empty($row['width']) || empty($row['height']) ? '' : ' onclick="return reqWin(this.href + \'' . ($modSettings['custom_avatar_url'] ? '' : ';image') . '\', ' . ($row['width'] + 20) . ', ' . ($row['height'] + 20) . ', true);"') . '>' . (empty($row['renamedfilename']) ? htmlspecialchars($row['filename']) : $row['renamedfilename']) . '</a><br /><span class="smalltext">(' . $row['filename'] . ')</span>'.(empty($row['renamedfilename']) ? ' <a href="'.$scripturl.'?action=attachrenamefix"><span class="error"><span class="smalltext"><u>'.$txt['attachemptyrename'].'</u></span></span></a>' : ''),


That was all the changes needed that I could find.
Works flawless as far as I know lol :P
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


ディン1031

#37
Oh less work for me ;) but i will check it, too.
But i think thats okay because i do the htmlspecialchars with the rename, but i need to check this =).

BEFORE YOU UPGRADE THE FORUM TO 1.1.10 UNINSTALL THIS MOD!
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

Neverhurry

Quote from: ディン1031 on June 02, 2009, 09:58:54 AM
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.

Bye
DIN1031

Hello, DIN:

i have problem to uninstall version 1.12. i am using smf 1.1.9 and when i wanted to upgrade to 1.1.10 i found out that the "manageattachments.php" file has error, so i have to uninstall your mod first, but then i can not find the uninstall function, nor the manual parse. Man, please help me! thank you!!!
I am using SMF 2.0.1, curve themes.

Sabre™

You could go into your Packages folder, look for this mod, download it to your desktop, and replace the package-info.xml with the attached one.
Reupload the mod to your Packages folder, then go and see if the uninstall is now there.
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Advertisement: