Hello,
Is it possible to achive this:
When a user clicks the intermediate image and arrives at the screen where you can add comments and rate the file etc. And when they click the image again it would be a link to another website. (this is the same a when you click on the thumbnail of a .zip, but instead of going to the download, it would go to another URL). I tried to upload a .html with a meta redirect in it. But it is not allowed file type even when i allowed in config as an allowed document type.
Is this possible?
Thanks,
just_some_guy
edit your theme, find the section that created the link to the full-size pop-up and modify the code accordingly to make the link point to your link instead of the full-size image.
Okay, thanks. Is there anyway to apply this to only one category?
thanks,
If you code it: yes.
Ok, its something to look into...
Thanks,
Would an if/else argument work on this?
example.
if - category id = 6
then you would define a site to link to.
else - the usal
I have decided to do this another way. But i cant seem to get the code to work. When i paste the code under the {image} section of theme.php it just shows it as text.
See here for more info: http://forums.devshed.com/php-development-5/mysql-php-select-if-row-has-content-480976.html#post1912070 . I have been trying to code this with some help from the people there.
The following code is from the help i got in that link.
$query = "SELECT download_link FROM cpg1411_pictures WHERE pid='".mysql_real_escape_string($pid)."'"; // add this if you haven't already sanitized your inputs.
$result = mysql_query($query);
if (mysql_num_rows($result) > 0) { // check to see that the row does exist
$row = mysql_fetch_assoc($result);
if ($row['download_link'] != '') {
echo "<a href="{$row['download_link']}"> DOWNLOAD </a><br>"; // make sure your download link data is pointed to the right path to the files
}
} else {
echo 'click above to download this file';
}
But i need this to be displayed here:
</td>
</tr>
EOT;
// HTML template for intermediate image display
$template_display_media = <<<EOT
<tr>
<td align="center" class="display_media" nowrap="nowrap">
<table cellspacing="2" cellpadding="0" class="imageborder">
<tr>
<td align="center">
{IMAGE}
</td>
</tr>
</table>
</td></tr>
Below the {image}. It works as simple html <a href
But when i use the mysql code there it just errors or display nothing.
Can you help please.
Thanks.
Hello,
i have a problem. I have the following code, which returns a url from the database if there is one in that row and if not it then display a link called home.
here is the code:
$query = "SELECT download_link FROM cpg1411_pictures WHERE pid='".mysql_real_escape_string($pid)."'"; // add this if you haven't already sanitized your inputs.
$result = mysql_query($query);
if (mysql_num_rows($result) > 0) { // check to see that the row does exist
$row = mysql_fetch_assoc($result);
if ($row['download_link'] != '') {
$download_link = ' echo <a href="'.$row['download_link'].'"> DOWNLOAD </a><br>';// make sure your download link data is pointed to the right path to the files
}
} else {
$download_link = '<a href="http://www.mysimtractor.com">Home </a>';
}
as you can see the revelent parts are defined as $download_link i need to echo that variable around the {image}
here:
$template_display_media = <<<EOT
<tr>
<td align="center" class="display_media" nowrap="nowrap">
<table cellspacing="2" cellpadding="0" class="imageborder">
<tr>
<td align="center">
{IMAGE}
</td>
</tr>
</table>
</td></tr>
<tr><td>
However the problem is that when i echo the variable below the {image} it just displays the home link despite thre being content in the download_coloum. I have been getting help form here (http://forums.devshed.com/php-development-5/mysql-php-select-if-row-has-content-480976-2.html#post1912676) and they say it is something in coppermine that is preventing this.
Can you please help me.
Thanks!
would an easier way to do this just echo $CURRENT_PIC_DATA['download_link'] below the {image}
How would i do this?
If there was no content in that field would it still work?
please help,
thanks.
if you want to go the plugin way, then have a look at my bbcode plugin. It demonstrates how to add data below the intermediate image
http://forum.coppermine-gallery.net/index.php?topic=36302.0
Ok that helps alot. I have figured out away to do manally, but the plugin way looks better.
Thanks!
you can mark this as solved bow.