Author Topic: {image_media_file} on the details.html (without the extension)  (Read 16944 times)

0 Members and 1 Guest are viewing this topic.

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
{image_media_file} on the details.html (without the extension)
« on: October 29, 2007, 12:36:52 PM »
Hello guys,

Onder the image on the details page you find some information about the image. For example:

Description
Keywords
Date
....

I want to add also the IMAGE MEDIA FILE of the image Something like:

Media file name: google. (without the extension)

I tried {image_media_file} but I get it with the extension.

How can I do that?

Many thanks in advance,  :?
Cruxy
« Last Edit: October 29, 2007, 12:53:46 PM by cruxy »

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #1 on: October 29, 2007, 01:47:11 PM »
In includes/functions.php file,

find:

Quote
"image_file_name" => $image_row['image_media_file'],

add after:

Code: [Select]
"image_file_name_no_extension" => substr($image_row['image_media_file'], 0, -4),

In details.html file, use: {image_file_name_no_extension} for tag. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #2 on: October 29, 2007, 01:59:54 PM »
Thanks thundestrike, it works the way I want. :wink:


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #3 on: October 29, 2007, 03:05:39 PM »
Thank for posting.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #4 on: October 29, 2007, 03:49:48 PM »
Code: [Select]
"image_file_name_no_extension" => substr($image_row['image_media_file'], 0, -4),

... and what about file extensions ... e.g. ... jpeg , html , pano ... a.s.o. ... ;)
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #5 on: October 29, 2007, 04:07:23 PM »
Hi mawenzi,

Quote
... and what about file extensions ... e.g. ... jpeg , html , pano ... a.s.o. ...

I used it with the wmv extension and I did not think about other extensions.
Do you suggest another option? :?:

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #6 on: October 29, 2007, 04:09:33 PM »
Quote
Do you suggest another option?

I take Mawenzi post. I code for 3 and 4 extension. ;)
I post in some min ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #7 on: October 29, 2007, 04:19:34 PM »
Quote
I take Mawenzi post. I code for 3 and 4 extension.
I post in some min ...

And what about rm (-3) extension?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #8 on: October 29, 2007, 05:42:26 PM »
There is better way. Soon I post. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #9 on: October 29, 2007, 06:09:47 PM »
@Mawenzi:
@cruxy:

Ok, here for universal extension size.

In includes/functions.php file,

find:

Quote
else {
    $user_name = format_text($lang['userlevel_guest'], 2);
    $user_name_link = $user_name;
  }

add after:

Code: [Select]
if (isset($image_row['image_media_file']) && !empty($image_row['image_media_file'])) {
      (preg_match("/(.+)\.(.+)/", get_basefile($image_row['image_media_file']), $regs));      
      $image_file_name = $regs[1];          
}

find:

Quote
"image_file_name_no_extension" => substr($image_row['image_media_file'], 0, -4),

replace:

Code: [Select]
"image_file_name_no_extension" => (isset($image_file_name) && !empty($image_file_name)) ? format_text(trim($image_file_name), 2) : $image_row['image_media_file'],
« Last Edit: February 18, 2011, 02:28:47 PM by thunderstrike »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #10 on: October 29, 2007, 06:45:48 PM »
Great job Thunderstrike, now we are talking about a higher level. :wink:
Many thanks man,
Cruxy

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #11 on: October 29, 2007, 06:46:58 PM »
Thank for posting.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #12 on: October 29, 2007, 07:01:13 PM »
Hum ... I no like code before. I replace with better code. Try now. ;)
Now, is for all extension list size in includes/upload_definitions.php file (no limit to 4 if list). ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #13 on: October 29, 2007, 07:07:32 PM »
You are right, this code is shorter, better and is working perfect. :o

Nice work Thunderstrike,
Cruxy

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: {image_media_file} on the details.html (without the extension)
« Reply #14 on: October 29, 2007, 07:08:29 PM »
Very good. Thank for posting. ;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?