Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 11832
Latest: balasahu
New This Month: 7
New This Week: 1
New Today: 1
Stats
Total Posts: 42228
Total Topics: 7368
Most Online Today: 51
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 27
Total: 27

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

0 Members and 1 Guest are viewing this topic.

Offline mickjav

  • Badge Awards Customer
  • Full Member
  • *****
  • Posts: 112
    • 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: 16003
    • 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

  • Badge Awards Customer
  • Full Member
  • *****
  • Posts: 112
    • 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: 16003
    • 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

  • Badge Awards Customer
  • Full Member
  • *****
  • Posts: 112
    • 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: 16003
    • 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

  • Badge Awards Customer
  • Full Member
  • *****
  • Posts: 112
    • 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: 16003
    • 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

  • Badge Awards Customer
  • Full Member
  • *****
  • Posts: 112
    • 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: 16003
    • 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

  • Badge Awards Customer
  • Full Member
  • *****
  • Posts: 112
    • 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

  • Badge Awards Customer
  • Full Member
  • *****
  • Posts: 112
    • 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: 16003
    • 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

  • Badge Awards Customer
  • Full Member
  • *****
  • Posts: 112
    • 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: 16003
    • 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
2753 Views
Last post September 05, 2010, 08:55:27 am
by SMFHacks
4 Replies
3088 Views
Last post February 10, 2013, 02:50:11 pm
by Dragracegossip
9 Replies
3139 Views
Last post November 29, 2017, 02:37:59 am
by Dalek
6 Replies
514 Views
Last post August 13, 2021, 01:35:41 am
by Anmer
9 Replies
2436 Views
Last post November 17, 2021, 08:58:50 am
by SMFHacks

+- Recent Topics

Dark background text color help needed by Shades
May 22, 2022, 04:51:25 pm

Database Error During Store Purchase After SMF 2.1 and Store 5.0 Beta Upgrades by Michael Vail
May 20, 2022, 08:58:15 pm

Default License Agreement by SMFHacks
May 18, 2022, 08:18:15 pm

Email Note - Included in order purchase by Shades
May 18, 2022, 02:54:54 pm

[Feature Request] Keywords by Shades
May 18, 2022, 02:20:19 pm

Undefined index: down_path by Shades
May 18, 2022, 10:19:09 am

Delete custom rating and change default icons/change icons back to default? by SMFHacks
May 18, 2022, 10:06:01 am

Thumbnails on topic page not resizing correctly by SMFHacks
May 14, 2022, 10:45:34 pm

Server Issues by PapaFrizArcade
May 12, 2022, 11:50:04 am

Funky Pagination by SMFHacks
May 11, 2022, 11:38:24 pm

Powered by EzPortal