php forum
php mysql forum
php mysql smarty
 
Topic Options
#312103 - 11/28/06 08:09 AM Prefix - Attachments - (Done)
Mark_S Offline
Power User

Registered: 11/15/03
Posts: 86
Loc: UK
I posted this in the wrong forum so i'm posting it again.
Sorry for the duplicate. But i think ive sorted it.

Hi, is there away that i can prefix
my attachements with a name as well as the
incremntal number?

Currently

1-mysillypic.jpg

Could this be changed too

1-ubbdevelopers-mysillypic.jpg
============================================

\scripts\filemanager.inc.php

Line 149

Code:
 			$FileName = "$file_id-$_FILES['userfile']['name']}";
			$FileName = preg_replace("/ +/","",$FileName);


Change to

Code:
			$FileName = "$file_id-yourprefix-{$_FILES['userfile']['name']}";
			$FileName = preg_replace("/ +/","",$FileName); 
All ive added is yourprefix-

I have tested it on my test forum and works well.
I can upload, and view the images no problem.

And now i have a prefix with my site name.
Note: i havent included in my prefix any "dots" (yourprefix)
so i cant tell you if that would break things.

I only dug around, i dont know if there are any knock on
effects, but its working fine.

Enjoy smile

Top
#312105 - 11/28/06 08:30 AM Re: Prefix - Attachments - (Done) [Re: Mark_S]
Mark_S Offline
Power User

Registered: 11/15/03
Posts: 86
Loc: UK
Looks like you can spin it around too smile

Code:
			$FileName = "yourprfix-$file_id-{$_FILES['userfile']['name']}";
			$FileName = preg_replace("/ +/","",$FileName); 


yourprefix-26-mysillypic.jpg
yourprefix-27-mysillypic.jpg
yourprefix-28-mysillypic.jpg

As you continue adding attachments smile

Top
#312108 - 11/28/06 06:04 PM Re: Prefix - Attachments - (Done) [Re: Mark_S]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
moved old post to request, and moving this to the other forum since it's now a working modification wink
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#312139 - 12/02/06 03:34 PM Re: Prefix - Attachments - (Done) [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

How about appending the display name of the person who uploaded it? That'd be a nice feature if you need to remove pics by a troublesome user or something.

PersonsDisplayName-OptionalSiteName-#-pic.jpg

e.g., jgeoff-ubbdev-1-nudepic.jpg

Though I would think you'd have to remove spaces from the person's display name. And/or use their login name. And/or shorten their name to say 6-8 characters or so...

_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#312202 - 12/08/06 12:13 AM Re: Prefix - Attachments - (Done) [Re: jgeoff]
Z65_Paul Offline
Lurker

Registered: 09/12/06
Posts: 6
Instead of member name or login name, the member number would probably be a better choice.
_________________________
UBB since 1999: MonteCarloSS.com

Top
#312203 - 12/08/06 12:18 AM Re: Prefix - Attachments - (Done) [Re: Z65_Paul]
Gizmo Offline

Wizard

Registered: 01/10/00
Posts: 5354
Loc: Portland, OR, USA
haha, i just noticed that jgeoff's photo example says nudepic.jpg... I hope its not of him :x
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

Top
#312204 - 12/08/06 12:55 AM Re: Prefix - Attachments - (Done) [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ
Originally Posted By: Gizmo
haha, i just noticed that jgeoff's photo example says nudepic.jpg... I hope its not of him :x


whistle laugh
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#312205 - 12/08/06 12:57 AM Re: Prefix - Attachments - (Done) [Re: jgeoff]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 97
Loc: NJ

Umm... bug report? Why is my post above horizontally-challenged?
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#312209 - 12/08/06 12:07 PM Re: Prefix - Attachments - (Done) [Re: jgeoff]
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
I don't see a problem, I do know Rick is working on the ubbcode sections - should be better with the next beta release.
_________________________
- Allen wavey
- What Drives You?

Top
#314656 - 07/08/07 06:50 PM Re: Prefix - Attachments - (Done) [Re: AllenAyres]
Mark_S Offline
Power User

Registered: 11/15/03
Posts: 86
Loc: UK
7.2x
\scripts\filemanager.inc.php
File Manager - Gallery will be the same too

This no longer works?
The images seem to be uploaded and names replaced with an incremental number now frown

10.jpg
11.jpg
12.jpg

If someone can look at the new set up to allow a prefix again
that would be great. May as well have your site name in the
file name for google wink

It just seems a little more tricky this time around. smile

Top



Moderator:  sirdude 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks