Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
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


BOOM 7.6.+ rocks....
Sponsored Links
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
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


BOOM 7.6.+ rocks....
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
moved old post to request, and moving this to the other forum since it's now a working modification wink


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Apr 2001
Posts: 96
Power User
Power User
Joined: Apr 2001
Posts: 96

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
Joined: Sep 2006
Posts: 6
Lurker
Lurker
Joined: Sep 2006
Posts: 6
Instead of member name or login name, the member number would probably be a better choice.

Sponsored Links
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
haha, i just noticed that jgeoff's photo example says nudepic.jpg... I hope its not of him :x


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Apr 2001
Posts: 96
Power User
Power User
Joined: Apr 2001
Posts: 96
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
Joined: Apr 2001
Posts: 96
Power User
Power User
Joined: Apr 2001
Posts: 96

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
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
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?
Joined: Nov 2003
Posts: 329
Beta Tester
Beta Tester
Offline
Joined: Nov 2003
Posts: 329
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


BOOM 7.6.+ rocks....
Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)