Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4257
Latest: Alex998.
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43293
Total Topics: 7522
Most Online Today: 79
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 79
Total: 79

Author Topic: Bulk Upload Many Pictures  (Read 1357 times)

0 Members and 1 Guest are viewing this topic.

Offline mickjav

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Database Dreams
Bulk Upload Many Pictures
« on: January 27, 2022, 01:05:05 pm »
Would it be possible to remove the extension from the Image Title when using the Bulk Upload Many Pictures.

all the best mick


Home of Chart Tracker Elite, Apollo & DJ 2020, Coming soon The Librarian.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Bulk Upload Many Pictures
« Reply #1 on: January 27, 2022, 10:52:46 pm »
It just requires a code change in bulkadd2 function to strip everything after and including the last period.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline mickjav

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Database Dreams
Re: Bulk Upload Many Pictures
« Reply #2 on: January 28, 2022, 01:58:10 am »
Thanks I'll have a go at it access has functions for it I'll look for the php equivalent

Home of Chart Tracker Elite, Apollo & DJ 2020, Coming soon The Librarian.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Bulk Upload Many Pictures
« Reply #3 on: January 28, 2022, 10:00:10 am »
You can also do
$tmp = explode(".",$filename);

$newFileName = $tmp[0];
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline mickjav

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Database Dreams
Re: Bulk Upload Many Pictures
« Reply #4 on: January 28, 2022, 10:16:43 am »
Sorry still trying to understand PHP Don't know where to put above

This is what I posted

Tried a number of ways to do this but this is the one that don't brake the site
Found the code on Stack Overflow All I have managed to do is remove the file name
Code: [Select]
$newFileName = $_FILES['picture']['name'][$n];
$title = $smcFunc['htmlspecialchars'](substr($newFileName, 0 , (strrpos($newFileName, "."))),ENT_QUOTES);

Thanks mick

Home of Chart Tracker Elite, Apollo & DJ 2020, Coming soon The Librarian.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Bulk Upload Many Pictures
« Reply #5 on: January 28, 2022, 10:19:40 am »
You can change to
Code: [Select]
$newFileName = $_FILES['picture']['name'][$n];
$tmpFile = explode(".",$newFileName);
$title = $smcFunc['htmlspecialchars']($tmpFile[0],ENT_QUOTES);
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline mickjav

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Database Dreams
Re: Bulk Upload Many Pictures
« Reply #6 on: January 28, 2022, 11:03:25 am »
Sorry that's doing the same as what I was playing with I.E. The title is blank

https://www.databasedreams.co.uk/charts/index.php?action=gallery;cat=341

Home of Chart Tracker Elite, Apollo & DJ 2020, Coming soon The Librarian.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Bulk Upload Many Pictures
« Reply #7 on: January 28, 2022, 11:09:00 am »
Attach the file you are modifying.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline mickjav

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Database Dreams
Re: Bulk Upload Many Pictures
« Reply #8 on: January 28, 2022, 11:36:55 am »
Thanks Attached

Home of Chart Tracker Elite, Apollo & DJ 2020, Coming soon The Librarian.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Bulk Upload Many Pictures
« Reply #9 on: January 28, 2022, 11:45:04 am »
This should make it better you were missing brackets to group the code for the if statement.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline mickjav

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Database Dreams
Re: Bulk Upload Many Pictures
« Reply #10 on: January 28, 2022, 12:14:18 pm »
Just tried Another using the file you sent And still got the Ext.
https://www.databasedreams.co.uk/charts/index.php?action=gallery;sa=view;id=12635

Home of Chart Tracker Elite, Apollo & DJ 2020, Coming soon The Librarian.

Offline mickjav

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Database Dreams
Re: Bulk Upload Many Pictures
« Reply #11 on: January 28, 2022, 01:00:52 pm »
just checked The Install file And It Doesn't have brackets?

Code: [Select]
if (empty($title))
 $title = $smcFunc['htmlspecialchars']($_FILES['picture']['name'][$n],ENT_QUOTES);

 $description = $smcFunc['htmlspecialchars']($_REQUEST['description'][$n],ENT_QUOTES);

Home of Chart Tracker Elite, Apollo & DJ 2020, Coming soon The Librarian.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Bulk Upload Many Pictures
« Reply #12 on: January 28, 2022, 01:05:42 pm »
For the one changed should be
Code: [Select]
$title = $smcFunc['htmlspecialchars']($_REQUEST['title'][$n],ENT_QUOTES);

if (empty($title))
{
//Remove Ext Edit
$newFileName = $_FILES['picture']['name'][$n];
$tmpFile = explode(".", $newFileName);
$title = $smcFunc['htmlspecialchars']($tmpFile[0], ENT_QUOTES);
}
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline mickjav

  • Full Member
  • ***
  • Posts: 142
    • View Profile
    • Database Dreams
Re: Bulk Upload Many Pictures
« Reply #13 on: January 28, 2022, 01:22:38 pm »
Sorted It There seemed to be un-needed code As Below Commented out

Code: [Select]
//$title = $smcFunc['htmlspecialchars']($_REQUEST['title'][$n],ENT_QUOTES);

 //if (empty($title))
 //{
 //Remove Ext Edit
 $newFileName = $_FILES['picture']['name'][$n];
 $tmpFile = substr($newFileName, 0 , (strrpos($newFileName, ".")));
 $title = $smcFunc['htmlspecialchars']($tmpFile, ENT_QUOTES);
 //}

https://www.databasedreams.co.uk/charts/index.php?action=gallery;sa=view;id=12637

Home of Chart Tracker Elite, Apollo & DJ 2020, Coming soon The Librarian.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16451
    • View Profile
Re: Bulk Upload Many Pictures
« Reply #14 on: January 28, 2022, 01:52:32 pm »
Glad you have it solved!
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
4445 Views
Last post February 10, 2013, 02:50:11 pm
by Dragracegossip
9 Replies
4669 Views
Last post November 29, 2017, 02:37:59 am
by Dalek
6 Replies
959 Views
Last post August 13, 2021, 01:35:41 am
by Anmer
9 Replies
3449 Views
Last post November 17, 2021, 08:58:50 am
by SMFHacks
7 Replies
2409 Views
Last post August 08, 2023, 10:30:22 am
by SMFHacks

+- Recent Topics

Rate own images by fvlog19
April 11, 2024, 10:56:53 am

Tidy Child Boards on 2.1.4 by SMFHacks
April 04, 2024, 03:54:12 pm

Problems SMF 2.0.19 > 2.1.4 SMF Gallery Pro - Recents Images to overall header by Michel68
March 30, 2024, 12:41:08 pm

Can't DROP 'id_member'; check that column/key exists Datei: by SMFHacks
March 30, 2024, 11:58:20 am

No thumbnails on new uploads by Tonyvic
March 29, 2024, 06:26:18 am

Display the Contact Page for guests by SMFHacks
March 27, 2024, 10:55:43 am

is it possible to add support for odysee.com by fvlog19
March 21, 2024, 08:47:51 am

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

Powered by EzPortal