inherit
153310
0
Jun 29, 2013 10:46:59 GMT -8
Bend The Light
199
April 2010
cmansell
|
Post by Bend The Light on Feb 25, 2011 14:47:48 GMT -8
bendthelight.proboards.comI used the following code (Todge's) to reduce images to a given size so they don't stretch the forum width. It works great, and puts the link above the image to get to a full size image. This link is important, as I run a photography board - they want things big, sometimes. Problem...when I click thelink I get THREE new pages - one with the full size image (this is ok) and then TWo with the image on the Flickr site it is linked to. Obviously this is an issue with Flickr - all their images when shown on a Bulletin Board should be linked back, and they provide code to display the images on Bulletin Boards. Clicking on the image SHOULD take you to the Flickr site. Obviously this is doing two (actually 3?) things with the mouse click. So, is it poissible to have the option to view the image full size in a new window, but NOT by clicking on the image. The clicking on the image should take you to Flickr...Make sense? Thanks Craig
|
|
inherit
134992
0
May 26, 2012 2:38:57 GMT -8
SubDevo
Creator of LSD...
3,861
December 2008
subdevo
|
Post by SubDevo on Feb 25, 2011 16:14:27 GMT -8
Hi. Do you have a link that you see this behaviour (opens three windows)? I tried THIS thread using IE and FF, and after clicking the pic, only one window opened up and it went to the Flickr image page.
|
|
inherit
153310
0
Jun 29, 2013 10:46:59 GMT -8
Bend The Light
199
April 2010
cmansell
|
Post by Bend The Light on Feb 25, 2011 23:44:45 GMT -8
|
|
inherit
134992
0
May 26, 2012 2:38:57 GMT -8
SubDevo
Creator of LSD...
3,861
December 2008
subdevo
|
Post by SubDevo on Feb 26, 2011 0:28:31 GMT -8
Hmm ok. In "Modify image size to fit forum By Todge". Find this section (near bottom), and add the Blue line. picLoaded.setAttribute('href',pics.src); picLoaded.setAttribute('target','_blank'); if(pics.parentNode.nodeName=="A"){picLoaded=document.createElement("span");} picLoaded.innerHTML = '<font size="0">This image is reduced by '+newWidth+'%, click it to view full size.</font><br><img src="'+pics .src+'" width="'+thisPicWidth+'" border="0">'; Cross fingers! Regards, SubDevo
|
|
inherit
153310
0
Jun 29, 2013 10:46:59 GMT -8
Bend The Light
199
April 2010
cmansell
|
Post by Bend The Light on Feb 26, 2011 0:48:14 GMT -8
Hi SubDevo, Thanks for your help. That stopped lots of windows...it links to the Flickr page in a single extra window. That's great, clicking on the image should send you to flickr (Part of Flickr's ToS). Is it possible to have the text "This image has been resized by XX% Click HERE to see full size" as a link to just a single page with the full size image on it? So, in summary: 1. click the picture - get Flickr 2. Click the link, get a page with just the picture on? Don't worry if it's too much work...the current situation is workable.
|
|
inherit
134992
0
May 26, 2012 2:38:57 GMT -8
SubDevo
Creator of LSD...
3,861
December 2008
subdevo
|
Post by SubDevo on Feb 26, 2011 1:12:59 GMT -8
I didn't mind adding a line to Todge's code. But, to do what you want to do, will require more modifications to make it work with regular images and I do not want to do that much to someone else's code. I could do it. But, I would need Todge's permission to feel good about it. Or, you could put Todge's name in the thread subject to get his attention and he could modify his own code.
Regards, SubDevo
|
|
inherit
153310
0
Jun 29, 2013 10:46:59 GMT -8
Bend The Light
199
April 2010
cmansell
|
Post by Bend The Light on Feb 26, 2011 1:20:25 GMT -8
Thanks, SubDevo...your help so far is great. I will amend my title, see if Todge is around. Thanks again.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,285
January 2004
todge
|
Post by Todge on Feb 26, 2011 4:46:51 GMT -8
Go for it SubD.
|
|
inherit
134992
0
May 26, 2012 2:38:57 GMT -8
SubDevo
Creator of LSD...
3,861
December 2008
subdevo
|
Post by SubDevo on Feb 26, 2011 5:05:57 GMT -8
Go for it SubD. Alrighty then! lol Give this a shot... The Blue part is what I added/changed. <script type="text/javascript"> <!-- /* Modify image size to fit forum By Todge Please keep this header intact */
var picWidth = '800'; //Maximum image width.. var picHeight = '600'; //Maximum image height..
var pics = document.images;
if(window.addEventListener) { window.addEventListener('load', imageSize, false); } else if(window.attachEvent) { window.attachEvent('onload', imageSize); } else { window.onload = imageSize; }
function imageSize() { var p=pics.length-1; while(p>-1) { if(pics.alt=='[image] ') { if(pics .width>picWidth || pics .height>picHeight) { var thisPicWidth = picWidth; if(pics .height/(pics .width/picWidth)>picHeight) { thisPicWidth = pics .width/(pics .height/picHeight) } var newWidth = 100-parseInt(thisPicWidth/pics .width*100); var picLoaded = document.createElement('A'); picLoaded.setAttribute('href',pics .src); picLoaded.setAttribute('target','_blank'); var picP=pics.parentNode; var picF='<font size="0">This image is reduced by '+newWidth+'%, click it to view full size.</font><br>'; if(picP.nodeName=="A"){ var nP=picLoaded.cloneNode(false); nP.innerHTML=picF; picF=""; picP.parentNode.insertBefore(nP,picP); picLoaded=document.createElement("span"); } picLoaded.innerHTML = picF+'<img src="'+pics .src+'" width="'+thisPicWidth+'" border="0">'; pics .parentNode.replaceChild(picLoaded,pics ); }} p--; }} // --> </script>
|
|
inherit
153310
0
Jun 29, 2013 10:46:59 GMT -8
Bend The Light
199
April 2010
cmansell
|
Post by Bend The Light on Feb 26, 2011 5:44:14 GMT -8
That works an absolute treat! Thank you SubDevo, and thank you Todge for allowing the code change.
|
|
inherit
134992
0
May 26, 2012 2:38:57 GMT -8
SubDevo
Creator of LSD...
3,861
December 2008
subdevo
|
Post by SubDevo on Feb 26, 2011 12:45:02 GMT -8
Thank you Todge. And you are welcome cmansell.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,285
January 2004
todge
|
Post by Todge on Feb 26, 2011 15:06:22 GMT -8
|
|