Donations

Help support Pro_News and become a member of our Sponsors Group
The tip jar is at PayPal, but does not require a PayPal account
User Info
Välkommen Anonym
Medlemskap:
Senaste: Witewolf
Nya idag: 0
Nya igår: 0
Genomsnittligt: 151
Besökare on-line:
Medlemmar: 0
Besökare: 35
Bots: 2
Totalt: 37
Vem är här inne:
Besökare:Support Forums
Pro News Articles
Téléchargement
Pro News Articles
Pro News Articles
Support Forums
Pro News Articles
Support Forums
Support Forums
Downloads
Support Forums
Nedlastninger
Support Forums
Support Forums
Support Forums
Pro News Articles
Support Forums
Support Forums
Support Forums
Pro News Articles
Home
Pro News Articles
Support Forums
Pro News Articles
Support Forums
Support Forums
Téléchargement
Support Forums
Support Forums
Nedlastninger
Pro News Articles
Pro News Articles
Support Forums
Pro News Articles
Pro News Articles
Bots:Google > Pro News Articles
Baidu > Pro News Articles
Ansvariga inloggade:
Inga ansvariga inloggade!
Disable Image pop up
Disable Image pop up
Skrivet: Tor Mar 18, 2010 7:24 am
Hi is there an easy way to turn the image popup off in articles?
Cheers
_________________
OS: Linux /Apache: 2.2.6 /MySQL: 5.0.45/PHP: 5.2.4 /Dragonfly version: (9.2.1) / Firefox: 3.0.3
Rusty_'s server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.14/5.0.90/5.2.11/Dragonfly (9.2.3.1 CVS)

Rusty_- BetaTester

- Inlägg: 30
- Blev medlem: Feb 06, 2007
- Från: Australia
Re: Disable Image pop up
Skrivet: Tis Apr 20, 2010 9:27 pm
Sorry, Rusty_, I missed this one entirely.
Yes and no. I really should have the link and the image separate in the template. Problem is that as it has always been a single combined parameter from functions.php, how do I change it now without breaking everyone's own custom templates? (Unless of course we are the only 2 writing any
)
Meantime the easiest way ought to be to simply upload an image that is smaller than the thumbnail size, then there won't be a need to open up a pop-up. Alas the code was not written that way, so some additional code is needed.
Will look at it in the morning - if I don't forget - but basically find this line in article() in functions.php:
$thumbimage = $pnsettings['imgpath'].'/'.$row['image']; // Check if thumb exists before linking - layingback 061122
and replace with:
$thumbimage = $pnsettings['imgpath'].'/'.$row['image']; // Check if thumb exists before linking - layingback 061122
$nothumb = '1';
and then replace:
$display_image = '<a href="'.$pnsettings['imgpath'].'/'.$row['image'].'" target="'.$target.'"
onclick="PN_openBrWindow(\''.$BASEHREF.$pnsettings['imgpath'].'/'.$row['image'].'\',\''.$target.'\',\'resizable=yes,scrollbars=no,width='.$imagesizeX.',height='.$imagesizeY.'\',\''.$imagesizeX.'\',\''.$imagesizeY.'\');return false;"><img class="pn_image" src="'.$thumbimage.'" alt="'.$row['caption'].'" /></a>';
with something like:
if ($nothumb) {
$display_image = '<img class="pn_image" src="'.$thumbimage.'" alt="'.$row['caption'].'" />';
} else {
$display_image = '<a href="'.$pnsettings['imgpath'].'/'.$row['image'].'" target="'.$target.'"
onclick="PN_openBrWindow(\''.$BASEHREF.$pnsettings['imgpath'].'/'.$row['image'].'\',\''.$target.'\',\'resizable=yes,scrollbars=no,width='.$imagesizeX.',height='.$imagesizeY.'\',\''.$imagesizeX.'\',\''.$imagesizeY.'\');return false;"><img class="pn_image" src="'.$thumbimage.'" alt="'.$row['caption'].'" /></a>';
}
And repeat for image2, and blocks, and preview, and ...
Not tested yet though!
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback- Site Admin

- Inlägg: 1229
- Blev medlem: Mar 18, 2006
Re: Disable Image pop up
Skrivet: Ons Apr 21, 2010 9:49 am
The code in post above should work, but here's a better, cleaner solution.
In functions.php in the article() function look for:
if ($imagesize[0] > $pnsettings['max_w'] || $imagesize[1] > $pnsettings['max_h']) {
$thumbimage = $pnsettings['imgpath'].'/thumb_'.$row['image'];
} else {
$thumbimage = $pnsettings['imgpath'].'/'.$row['image']; // Check if thumb exists before linking - layingback 061122
}
$display_image = '<a href="'.$pnsettings['imgpath'].'/'.$row['image'].'" target="'.$target.'"
onclick="PN_openBrWindow(\''.$BASEHREF.$pnsettings['imgpath'].'/'.$row['image'].'\',\''.$target.'\',\'resizable=yes,scrollbars=no,width='.$imagesizeX.',height='.$imagesizeY.'\',\''.$imagesizeX.'\',\''.$imagesizeY.'\');return false;"><img class="pn_image" src="'.$thumbimage.'" alt="'.$row['caption'].'" /></a>';
and replace with:
if ($imagesize[0] > $pnsettings['max_w'] || $imagesize[1] > $pnsettings['max_h']) {
$thumbimage = $pnsettings['imgpath'].'/thumb_'.$row['image'];
$display_image = '<a href="'.$pnsettings['imgpath'].'/'.$row['image'].'" target="'.$target.'"
onclick="PN_openBrWindow(\''.$BASEHREF.$pnsettings['imgpath'].'/'.$row['image'].'\',\''.$target.'\',\'resizable=yes,scrollbars=no,width='.$imagesizeX.',height='.$imagesizeY.'\',\''.$imagesizeX.'\',\''.$imagesizeY.'\');return false;"><img class="pn_image" src="'.$thumbimage.'" alt="'.$row['caption'].'" /></a>';
} else {
$thumbimage = $pnsettings['imgpath'].'/'.$row['image']; // Check if thumb exists before linking - layingback 061122
$display_image = '<img class="pn_image" src="'.$thumbimage.'" alt="'.$row['caption'].'" />';
}
Now any image at or below the defined image size will not try to pop up the (same sized) image in a pop-up window. So to prevent a pop-up link just resize to dimensions set in Config or less.
Repeat for function gallery() if required. It is already correct in every other location! So must have just missed these 2. Will include this fix in next release. Thanks!
layingback's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
2.6.32 / 1.3.39 - 2.2.12 / 4.4.7 - 5.1.37 / 5.3.0 / 9.2.1

layingback- Site Admin

- Inlägg: 1229
- Blev medlem: Mar 18, 2006
Re: Disable Image pop up
Skrivet: Ons Apr 21, 2010 11:10 am
Thanks for that LB,
I'll try it as soon as I get a chance and let you know how I go.
Cheers
_________________
OS: Linux /Apache: 2.2.6 /MySQL: 5.0.45/PHP: 5.2.4 /Dragonfly version: (9.2.1) / Firefox: 3.0.3
Rusty_'s server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.2.14/5.0.90/5.2.11/Dragonfly (9.2.3.1 CVS)

Rusty_- BetaTester

- Inlägg: 30
- Blev medlem: Feb 06, 2007
- Från: Australia
Du kan inte svara på inlägg i det här forumet
Du kan inte ändra dina inlägg i det här forumet
Du kan inte ta bort dina inlägg i det här forumet
Du kan inte rösta i det här forumet
Du kan inte bifoga filer i det här fourmet
Du kan inte ladda ner filer i detta forum
Alla tider är GMT











