RSGallery2 Support Forums
Welcome, Guest. Please login or register.

Login with username, password and session length
  Home    Forum    Help    Search    Login    Register  
*
News : November 22, 2008, 08:22:32 am
+  RSGallery2 Support Forums
|-+  RSgallery2 support forums
| |-+  Display and Templates (Moderators: Jonah, Tomislav Ribicic, Daniel Tulp, Ronald Smit)
| | |-+  How create link to orginal image?
Advanced search
  « previous next »
Pages 1
Author
Topic: How create link to orginal image?  (Read 1686 times)
« on: September 13, 2008, 04:42:32 pm »
gawith Offline
Newbie
*
Posts: 4

View Profile Email

I have problem with corrupted images during download so I decide I'll change both download links to orginal image direction for now but I'm weak in php and I have problems with create valid link  Embarrassed my best shot was around www.somesite.com/orginal.somenumbers.jpg

Is there someone who can give me a hand with that  Wink ??

Code:
function _writeDownloadLink($id, $showtext = true, $type = 'button') {
global $rsgConfig, $mosConfig_live_site;
if ( $rsgConfig->get('displayDownload') ) {
echo "<div class=\"rsg2-toolbar\">";
if ($type == 'button') {
?>
<a href="<?php echo sefRelToAbs('index.php?option=com_rsgallery2&amp;task=downloadfile&amp;id='.$id);?>">
<img src="<?php echo $mosConfig_live_site;?>/administrator/images/download_f2.png" alt="<?php echo _RSGALLERY_DOWNLOAD?>" />
<?php
if ($showtext == true) {
?>

<br /><span style="font-size:smaller;"><?php echo _RSGALLERY_DOWNLOAD?></span>
<?php
}
?>

</a>
<?php
} else {
?>

<a href="<?php echo sefRelToAbs('index.php?option=com_rsgallery2&amp;task=downloadfile&amp;id='.$id);?>"><?php echo _RSGALLERY_DOWNLOAD?></a>
<?php
}
echo "</div>";
}
}

Please give me some solution Smiley
Logged
 
Reply #1
« on: September 13, 2008, 09:12:26 pm »
Chef Groovy Offline
Dev Team
Full Member
*
Posts: 110
danshaffer@insightbb.com
View Profile WWW

I wouldn't change the _writeDownloadLink function, way overkill.  There is an easier way to show a link to the original image.

Look in your display.class.php replace the call to _writeDownloadLink with something like

Code:
<a href="<?php echo imgUtils::getImgOriginal$item->name ); ?>" target="_blank">Show Original</a>

Logged

Chef Groovy
RSGallery2: Legacy - Dev
Test Site: dev.fantasyartwork.net
 
Reply #2
« on: September 14, 2008, 05:34:21 am »
gawith Offline
Newbie
*
Posts: 4

View Profile Email

I Create something similar yesterday but it just "almost" working. It just pointing folder www.somesite.com/images/orginal/ but there is no direct link to image. But maybe I did some mistake?

I just changed link
Code:
<a href="<?php echo sefRelToAbs('index.php?option=com_rsgallery2&amp;task=downloadfile&amp;id='.$id);?>">
to the
Code:
<a href="<?php echo imgUtils::getImgOriginal$item->name ); ?>

So now it's look like that. What else i should add?
Code:
function _writeDownloadLink($id, $showtext = true, $type = 'button') {
global $rsgConfig, $mosConfig_live_site;
if ( $rsgConfig->get('displayDownload') ) {
echo "<div class=\"rsg2-toolbar\">";
if ($type == 'button') {
?>
<a href="<?php echo imgUtils::getImgOriginal$item->name ); ?>">
<img src="<?php echo $mosConfig_live_site;?>/administrator/images/download_f2.png" alt="<?php echo _RSGALLERY_DOWNLOAD?>" />
<?php
if ($showtext == true) {
?>

<br /><span style="font-size:smaller;"><?php echo _RSGALLERY_DOWNLOAD?></span>
<?php
}
?>

</a>
<?php
} else {
?>

<a href="<?php echo imgUtils::getImgOriginal$item->name ); ?>"><?php echo _RSGALLERY_DOWNLOAD?></a>
<?php
}
echo 
"</div>";
}
}
Logged
 
Reply #3
« on: September 27, 2008, 11:59:01 pm »
Chef Groovy Offline
Dev Team
Full Member
*
Posts: 110
danshaffer@insightbb.com
View Profile WWW

Sorry, I really don't know, I would think that would work.

I'd trim all the conditional stuff down and just try to get the link to origianl to work first then work backwards

Logged

Chef Groovy
RSGallery2: Legacy - Dev
Test Site: dev.fantasyartwork.net
 
Print  Pages 1
« previous next »
Jump to: