4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 17, 2018, 07:03:30 AM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [Mod] Display image codes on details page (image permalink)
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: «« « 1 [2] 3 4 5 6 7 » »» Print
Current Topic Rating: *****
Author Topic: [Mod] Display image codes on details page (image permalink)  (Read 119766 times)
satine88
Sr. Member
****
Offline Offline

Posts: 265

Thank You
-Given: 56
-Receive: 0


View Profile
« Reply #15 on: March 11, 2008, 02:31:02 PM »

Thanks Smile
Logged
ccsakuweb
Sr. Member
****
Offline Offline

Posts: 498

Thank You
-Given: 1
-Receive: 0

Patri


View Profile WWW
« Reply #16 on: March 21, 2008, 08:36:10 PM »

Can this be made to work with images hosted off site?
I get something like this:

1
<a href="http://mysite.com"><img src="http://mysite.com/data/media/3/http://i140.photobucket.com/albums/r32/image.gif" border="0" alt="http://i140.photobucket.com/albums/r32/image.gif"></a>

Notice the "img src" tag, the path is wrong...

Thanks!

There is a function named: is_remote(_) that it see if the image is remote. Ok you need to do the next
Find into the mod:
1
2
      $uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
      $uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
and remplace:
1
2
3
4
5
6
7
8
9
10
if(is_remote($new_name)){
      $uploaded_image_path = $new_name;
}else{
  $uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
}
if(is_remote($image_row['image_thumb_file']))
  $uploaded_thumb_path = $image_row['image_thumb_file'];
else
  $uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
 
Logged

Arrow 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more
jany.yar
Pre-Newbie

Offline Offline

Posts: 9

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #17 on: March 24, 2008, 12:39:19 AM »

Can this be made to work with images hosted off site?
I get something like this:

1
<a href="http://mysite.com"><img src="http://mysite.com/data/media/3/http://i140.photobucket.com/albums/r32/image.gif" border="0" alt="http://i140.photobucket.com/albums/r32/image.gif"></a>

Notice the "img src" tag, the path is wrong...

Thanks!

There is a function named: is_remote(_) that it see if the image is remote. Ok you need to do the next
Find into the mod:
1
2
      $uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
      $uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
and remplace:
1
2
3
4
5
6
7
8
9
10
if(is_remote($new_name)){
      $uploaded_image_path = $new_name;
}else{
  $uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
}
if(is_remote($image_row['image_thumb_file']))
  $uploaded_thumb_path = $image_row['image_thumb_file'];
else
  $uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
 


It didn't work for me Sad and I am sure I have not made any mistakes.. because I did exactly as you instructed.
Logged
bogiayeu
Pre-Newbie

Offline Offline

Posts: 8

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #18 on: March 24, 2008, 01:21:59 PM »

Can this be made to work with images hosted off site?
I get something like this:

1
<a href="http://mysite.com"><img src="http://mysite.com/data/media/3/http://i140.photobucket.com/albums/r32/image.gif" border="0" alt="http://i140.photobucket.com/albums/r32/image.gif"></a>

Notice the "img src" tag, the path is wrong...

Thanks!

There is a function named: is_remote(_) that it see if the image is remote. Ok you need to do the next
Find into the mod:
1
2
      $uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
      $uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
and remplace:
1
2
3
4
5
6
7
8
9
10
if(is_remote($new_name)){
      $uploaded_image_path = $new_name;
}else{
  $uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
}
if(is_remote($image_row['image_thumb_file']))
  $uploaded_thumb_path = $image_row['image_thumb_file'];
else
  $uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$new_name;
 


Not work ! Can you fix it ?
Logged
ccsakuweb
Sr. Member
****
Offline Offline

Posts: 498

Thank You
-Given: 1
-Receive: 0

Patri


View Profile WWW
« Reply #19 on: March 24, 2008, 03:22:12 PM »

In details.php i have this code. please try it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

$new_name = $image_row['image_media_file'];

if(is_remote($new_name)){
      $uploaded_image_path = $new_name;
}else{
  $uploaded_image_path = $script_url."/".MEDIA_DIR."/".$cat_id."/".$new_name;
}
if(is_remote($image_row['image_thumb_file']))
  $uploaded_thumb_path = $image_row['image_thumb_file'];
else
  $uploaded_thumb_path = $script_url."/".THUMB_DIR."/".$cat_id."/".$image_row['image_thumb_file'];
   
      $uploaded_image_link = $script_url."/details.php?image_id=".$image_id;
      $uploaded_thumb_hotlink = "<a href=\"".$uploaded_image_link."\"><img src=\"".$uploaded_thumb_path."\" border=\"0\" alt=\"".$image_row['image_thumb_file']."\"></a>";
      $uploaded_image_hotlink = "<a href=\"".$script_url."\"><img src=\"".$uploaded_image_path."\" border=\"0\" alt=\"".$new_name."\"></a>";
      $uploaded_image_bbcode = "[URL=".$script_url."][IMG]".$uploaded_image_path."[/IMG][/URL]";
      $uploaded_thumb_bbcode = "[URL=".$uploaded_image_link."][IMG]".$uploaded_thumb_path."[/IMG][/URL]";
      $uploadinfo .= "<font size='2' face='Tahoma'><b>Image Codes:</b><br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_hotlink."' type='text' name='image'> Thumbnail for websites<br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_bbcode."' type='text' name='image'> Thumbnail for forums<br /><br />";
      $uploadinfo .= "<font size='1' face='Tahoma'>Use the below codes to post the full sized image on other websites or forums</font><br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_hotlink."' type='text' name='image'> Hotlink for websites<br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_bbcode."' type='text' name='image'> Hotlink for forums<br /><br />";
      $uploadinfo .= "<font size='1' face='Tahoma'>Share this image with your friends</font><br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_link."' type='text' name='image'> Share this image<br />";
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_path."' type='text' name='image'> Direct path to image<br /><br /></font>";
      $icodes .= "<table border=\"0\" width=\"500px\" align=\"center\">\n<tr>\n<td>\n".$uploadinfo."\n</td>\n</tr>\n</table>\n";

      $site_template->register_vars("image_codes", $icodes);

//-----------------------------------------------------
//--- end of ImageCodes v1.0 --------------------------
//-----------------------------------------------------
i modified the original mod because i think that the thubnail dont have to have the same name that original file
and i think that it is not necessary the SELECT consult because all that exist in $image_row in detail.php
i hope help you all

Logged

Arrow 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more
DilnüvaZ
4images Moderator
Hero Member
*****
Offline Offline

Posts: 527

Thank You
-Given: 1
-Receive: 2

Gönül Okşayıcı


View Profile WWW
« Reply #20 on: March 29, 2008, 10:17:29 AM »

thanks lots  it is very good.... i did it and it worked.http://www.nuvanda.net/r-cicek-resimleri-50-cicekler-771.htm
Logged

cpuswe
Newbie
*
Offline Offline

Posts: 47

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #21 on: March 31, 2008, 12:45:37 AM »

Really nice mod!

For us who have added this mod http://www.4homepages.de/forum/index.php?topic=17598.0 to create Googlefriendly URL:s, is it possible to display the page URL as in the mod <a href="http://www.site.net/img-imagename-12345.htm> instead of <a href="http://www.site.net/details.php?image_id=12345">

Thanks!

/Thomas
Logged
Percolator
Pre-Newbie

Offline Offline

Posts: 3

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #22 on: March 31, 2008, 06:06:12 AM »

Worked like a charm thank you!
Logged
saggel
Newbie
*
Offline Offline

Posts: 10

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #23 on: April 19, 2008, 12:44:59 AM »

Great Mod Smile
Logged
LeaX
Newbie
*
Offline Offline

Posts: 12

Thank You
-Given: 0
-Receive: 0


View Profile WWW
« Reply #24 on: May 22, 2008, 01:36:33 PM »

I can't undertand why after all these steps only registered people can see these codes.  Shocked
And I have only one registrated user  Rolling Eyes admin
How can I make it work for everybody?
Logged
rockboy_62
Newbie
*
Offline Offline

Posts: 12

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #25 on: June 04, 2008, 09:21:48 AM »

.i want use image link(permalink) in the home page(index).please help me
Logged
masumcis
Newbie
*
Offline Offline

Posts: 13

Thank You
-Given: 0
-Receive: 0

Masum


View Profile WWW
« Reply #26 on: June 04, 2008, 12:37:47 PM »

Nice
« Last Edit: June 04, 2008, 12:53:34 PM by masumcis » Logged

<<M@sum>>
HowdoI
Newbie
*
Offline Offline

Posts: 12

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #27 on: August 15, 2008, 08:20:29 PM »

I am extremely new to this program and I am still feeling my way around with different mods etc.

I have successfully installed this mod without a problem, but the problem arises when I try to limit the options to just the second last one, the one titles 'Share this image'  I want to get rid of all the other links as this one would allow for posting to other sites but force the person to come to my site to view it which results in a new member (hopefully).  I am taking something out of the code that results in an error in the detail.php file, can some please advise on what I am sure is a newbie error.

Also I just noticed that you can not highlight the link and then right click to copy as a copyright message appears preventing this.  To me this makes the link option nonvalid.  I am playing around with version 1.7.6 which memory serves me correctly this has only been test to 1.7.4 so is there a way around this second problem?

Any help is appriecated and also I just want to say that I have looked at about 20 - 25 websites offering this type of program and this one blow everyone one of them out of the water 3 times over so Kudos to all that support and work on this program.
Logged
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #28 on: August 16, 2008, 12:25:50 AM »

Hello and welcome to 4images forum.

I try to limit the options to just the second last one, the one titles 'Share this image'  I want to get rid of all the other links as this one would allow for posting to other sites but force the person to come to my site to view it which results in a new member (hopefully).  I am taking something out of the code that results in an error in the detail.php file, can some please advise on what I am sure is a newbie error.
Next time please show the exact error message (quote it), it might help and speedup the solution.

All you need is remove this block:
1
2
3
4
5
      $uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_hotlink."' type='text' name='image'> Thumbnail for websites<br />";
      
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_thumb_bbcode."' type='text' name='image'> Thumbnail for forums<br /><br />";
      
$uploadinfo .= "<font size='1' face='Tahoma'>Use the below codes to post the full sized image on other websites or forums</font><br />";
      
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_hotlink."' type='text' name='image'> Hotlink for websites<br />";
      
$uploadinfo .= "<input onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='".$uploaded_image_bbcode."' type='text' name='image'> Hotlink for forums<br /><br />";


Also I just noticed that you can not highlight the link and then right click to copy as a copyright message appears preventing this.  To me this makes the link option nonvalid.  I am playing around with version 1.7.6 which memory serves me correctly this has only been test to 1.7.4 so is there a way around this second problem?

You can try this:
in header.html template replace
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

With this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      msg(e);
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      msg(e);
      return false;
    }
    return true;
  }

  function msg(e)
  {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (target.type != "text" && target.type != "textarea" && target.type != "password")
    {
      alert("© Copyright by <?=str_replace("'","\'", "{site_name}");?>");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = msg;
This will allow right click on any input fields, text areas and password fields. Tested on FF 3 and IE 6
« Last Edit: February 09, 2009, 07:47:37 AM by V@no » Logged

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)
V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 577

mmm PHP...


View Profile WWW
« Reply #29 on: August 16, 2008, 01:51:25 AM »

I believe in unnecessary HTML code should NOT be used inside PHP code, simply because it's hard to adopt it to your template.
Here is a replacement for entire Step 3 that also gives support for remote images:

In details.php find:
1
show_image($image_row$mode01);

Insert above:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//-----------------------------------------------------
//--- ImageCodes v1.1 Begins --------------------------
//-----------------------------------------------------

// Mod: ImageCodes v1.1
// Version: 1.1
// Description : Get image path, link and bbcode on the details page
// Contact: arjoon@gmail.com
// Last update: August 15 2008

$site_template->register_vars(array(
  "uploaded_image_path" => str_replace("'", "&#39;", (is_remote($image_row['image_media_file']) ? $image_row['image_media_file'] : $script_url."/".str_replace(ROOT_PATH, "", get_file_path($image_row['image_media_file'], "media", $cat_id, 0, 0)))),
  "uploaded_thumb_path" => str_replace("'", "&#39;", (is_remote($image_row['image_thumb_file']) ? $image_row['image_thumb_file'] : $script_url."/".str_replace(ROOT_PATH, "", get_file_path($image_row['image_thumb_file'], "thumb", $cat_id, 0, 0)))),
  "uploaded_image_link" => $script_url."/details.php?".URL_IMAGE_ID."=".$image_id,
  "uploaded_file_name"  => str_replace("'", "&#39;", $image_row['image_media_file']),
  "homepage"   => $script_url."/index.php"
));
//-----------------------------------------------------
//--- end of ImageCodes v1.1 --------------------------
//-----------------------------------------------------

After that in Step 2 instead of using {image_codes} you'll have more control over your design, you can use these new tags:
{uploaded_image_path} - full image path
{uploaded_thumb_path} - thumbnail image path
{uploaded_image_link} - url to image details page
{uploaded_file_name} - image filename
{homepage} - site homepage url

i.e.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<table border="0" width="500px" align="center">
  <tr>
    <td>
      <font size="2" face="Tahoma"><b>Image Codes:</b></font><br />
      <input onfocus='highlight(this);' onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='<a href="{uploaded_image_link}"><img src="{uploaded_thumb_path}" border="0" alt="{uploaded_file_name}"></a>' type='text' name='image'> Thumbnail for websites<br />
      <input onfocus='highlight(this);' onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='[URL={uploaded_image_link}][IMG]{uploaded_thumb_path}[/IMG][/URL]' type='text' name='image'> Thumbnail for forums<br /><br />
      <font size='1' face='Tahoma'>Use the below codes to post the full sized image on other websites or forums</font><br />
      <input onfocus='highlight(this);' onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='<a href="{homepage}"><img src="{uploaded_image_path}" border="0" alt="{uploaded_file_name}"></a>' type='text' name='image'> Hotlink for websites<br />
      <input onfocus='highlight(this);' onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='[URL={homepage}][IMG]{uploaded_image_path}[/IMG][/URL]' type='text' name='image'> Hotlink for forums<br /><br />
      <font size='1' face='Tahoma'>Share this image with your friends</font><br />
      <input onfocus='highlight(this);' onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='{uploaded_image_link}' type='text' name='image'> Share this image<br />
      <input onfocus='highlight(this);' onclick='highlight(this);' style='border-style:solid; border-width:1; padding:2; width: 300px; background-color:#FFFFFF; color:#000000' size='70' value='{uploaded_image_path}' type='text' name='image'> Direct path to image<br /><br />
    </td>
  </tr>
</table>
Logged

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)
Pages: «« « 1 [2] 3 4 5 6 7 » »» Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.056 seconds with 19 queries.