Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4255
Latest: andreios
New This Month: 3
New This Week: 1
New Today: 0
Stats
Total Posts: 43259
Total Topics: 7518
Most Online Today: 64
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 74
Total: 74

Author Topic: Bulk Upload Many Pictures  (Read 1314 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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: 16436
    • 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
4424 Views
Last post February 10, 2013, 02:50:11 pm
by Dragracegossip
9 Replies
4625 Views
Last post November 29, 2017, 02:37:59 am
by Dalek
6 Replies
935 Views
Last post August 13, 2021, 01:35:41 am
by Anmer
9 Replies
3399 Views
Last post November 17, 2021, 08:58:50 am
by SMFHacks
7 Replies
2330 Views
Last post August 08, 2023, 10:30:22 am
by SMFHacks

+- Recent Topics

No thumbnails on new uploads by SMFHacks
March 27, 2024, 02:10:41 pm

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

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

Powered by EzPortal