Author Topic: Link to an image file  (Read 7151 times)

0 Members and 1 Guest are viewing this topic.

Offline i8yurdog

  • Pre-Newbie
  • Posts: 2
    • View Profile
Link to an image file
« on: July 22, 2008, 11:49:10 PM »
I would like to display a link directly to the image file URL so that registered users can refer to them on BBs etc. What is the easiest way to retrieve the enitre url?

Something like:

Code: [Select]
$image_url=ROOT_PATH."data/media/".$cat_id."/".$image_name\."."JPG";
I would suspect, but I'm getting a bit frustrated.

Version 1.7.6 on mysql

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Link to an image file
« Reply #1 on: July 23, 2008, 01:25:51 AM »
you probably will need edit each template in templates/<your template>/media/ directory and add something like:

http://yoursiteaddress/{media_src}

[EDIT]
and in case you don't like the dot in the path, you can use this line instead:
Code: [Select]
<?php global $script_url; echo $script_url.str_replace(ROOT_PATH"/"$this->val_cache['media_src']);?>
« Last Edit: July 23, 2008, 01:54:18 AM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline i8yurdog

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: Link to an image file
« Reply #2 on: July 23, 2008, 01:42:48 AM »
You're awesome. Thanks!

Offline relu

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Pulsarmedia
Re: Link to an image file
« Reply #3 on: February 01, 2009, 07:10:30 PM »
Can you help me to list the complete url in detail page?  {image_url}

i use this code on detail page and i think is good for image share on messenger

<a href="ymsgr:im?+&msg={image_url}" title="Send to friend" class="icon-space"><img src="../images/button_ym.png" alt="Send to friend" /> 

i prefere html link and not with image ID


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Link to an image file
« Reply #4 on: February 01, 2009, 09:45:14 PM »
try this:
Code: [Select]
<?php
global $script_url$image_id;
?>

<a href="ymsgr:im?+&msg=<?=urlencode($script_url."details.php?".URL_IMAGE_ID."=".$image_id);?>" title="Send to friend" class="icon-space"><img src="../images/button_ym.png" alt="Send to friend" />
(not tested)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline relu

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Pulsarmedia
Re: Link to an image file
« Reply #5 on: February 13, 2009, 07:44:50 PM »
Some / not show up and the image id is=0  Anyways i find an improvisation and also image complete with .html
In thumbnail_bit  i have
<a href="ymsgr:im?+&msg=http://www.pulsarmedia.eu/{image_url}" title="Send to friend on messenger" class="icon-space"><img src="../images/yahoo.png" alt="Send to friend" /></a>

and in categories.php i changed define('ROOT_PATH', './');  to  define('ROOT_PATH', ''); 

Only problem was with {url_home}  but i replaced with my url  (in my case http://www.pulsarmedia.eu )

I really don't know how i discovered but is working :) You can add it in your page if will work like this for you.

Example: http://pulsarmedia.eu/k_club_music_wallpapers_24_magic_turntables_-_turntable_rocker_842.html

Thank you V@no

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Link to an image file
« Reply #6 on: February 14, 2009, 12:46:33 AM »
and in categories.php i changed define('ROOT_PATH', './');  to  define('ROOT_PATH', '');

That was a bad move...
If anything you should use this instead:

Code: (Template) [Select]
<a href="ymsgr:im?+&msg=http://www.pulsarmedia.eu/<?=str_replace(ROOT_PATH, "", "{image_url}")?>" title="Send to friend on messenger" class="icon-space"><img src="../images/yahoo.png" alt="Send to friend" /></a>
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline relu

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Pulsarmedia
Re: Link to an image file
« Reply #7 on: February 23, 2009, 07:10:45 PM »
If i want to put it also on details page under the image? In detail page the link is't show up and {cat_url} the same...