Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4220
Latest: agolac
New This Month: 1
New This Week: 1
New Today: 0
Stats
Total Posts: 42854
Total Topics: 7464
Most Online Today: 86
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 47
Total: 47

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

0 Members and 1 Guest are viewing this topic.

Offline mickjav

  • Full Member
  • ***
  • Posts: 141
    • 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: 16257
    • 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: 141
    • 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: 16257
    • 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: 141
    • 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: 16257
    • 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: 141
    • 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: 16257
    • 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: 141
    • 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: 16257
    • 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: 141
    • 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: 141
    • 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: 16257
    • 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: 141
    • 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: 16257
    • 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
1 Replies
2851 Views
Last post September 05, 2010, 08:55:27 am
by SMFHacks
4 Replies
3210 Views
Last post February 10, 2013, 02:50:11 pm
by Dragracegossip
9 Replies
3702 Views
Last post November 29, 2017, 02:37:59 am
by Dalek
6 Replies
628 Views
Last post August 13, 2021, 01:35:41 am
by Anmer
9 Replies
2690 Views
Last post November 17, 2021, 08:58:50 am
by SMFHacks

+- Recent Topics

Is the PayPal Sandbox still working? by Nicole
June 02, 2023, 06:51:18 am

Question on Completed Listing & Reserve Price by Nicole
June 01, 2023, 06:06:12 pm

[Mod]GDPR Helper by Nicole
May 29, 2023, 11:58:49 pm

RSS Feed Poster Database Error by SMFHacks
May 22, 2023, 06:26:18 pm

Errors With Older Version. by Ken.
May 09, 2023, 05:35:40 pm

Pretty Urls SEO Pro by SMFHacks
May 06, 2023, 03:30:11 pm

New Post Image Upload Error by Mike66
April 28, 2023, 07:30:28 am

Copyright Removal Key by SMFHacks
April 03, 2023, 02:44:28 pm

Converting from Aeva Media by sudhakar
April 02, 2023, 11:09:54 am

Using SMF's Built-in Search Algorithm by shuban
March 27, 2023, 09:15:10 am

Powered by EzPortal