News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Long download names?

Started by Iomega0318, May 13, 2012, 04:36:40 PM

Previous topic - Next topic

Iomega0318

Is there a way to shorten long download names?
For example the following would be:
RUU_HOLIDAY_ICS_35_S_Cingular_US_3.26.502.56_Radio_3.02.4740.14_34.22.701040.19L_release_246712_signed.exe
but would be shown as:
RUU_HOLIDAY_ICS_35_S_Cingular_US_3.26.502.56_Radio_..._signed.exe
but when you mouse over it would still show you the long name or whatever..

Just curious if this is possible, let me know and thank you for any assistance.
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

kat

tinyurl?

snipurl?

Not exactly what you asked for, I know.

But, the only other way that I can think of by using aliases.

emanuele

Do you mean attachments names?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Iomega0318

Quote from: emanuele on May 13, 2012, 05:16:56 PM
Do you mean attachments names?
Yeah I mean long attachment names.
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

emanuele

The only similar thing is the shorten_subject function, but the result will be: "this_is_my_long..." with "..." at the end and not in the middle.


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Iomega0318

Hmm that could still work...
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

MrPhil

Maybe you could modify Sources/Subs.php's shorten_subject() to preserve a bit of the right end plus the extension, if there is a recognized extension (.exe, etc.). Instead of taking "length" of left end, take left end(length-len(right end)) ... right end. You might even do that in general (say, 8 characters off the right end, regardless of whether there's a real extension or not):

return $smcFunc['substr']($subject, 0, $len-8) . '...' . $smcFunc['substr']($subject, -8, 8);


Assuming -n works the same way as with the substr() function... I haven't tried it. My code assumes that $len will always be 9 or larger... you may want to check $len.

Advertisement: