forum.coppermine-gallery.net

No Support => General discussion (no support!) => Topic started by: haloki on November 10, 2004, 02:25:46 pm

Title: Add Download Link
Post by: haloki on November 10, 2004, 02:25:46 pm
Hello,
i added a download link in the theme.php..

Code: [Select]
<p class="album_stat">{ALB_INFOS}<br><br><a href="{ALB_DOWN_TGT}" class="albums">{ALB_DOWN_LOG}<br /></a></p>
i want to make that link invisable for the user, which are not registered.

http://www.uni-dortmund.com/download.JPG

How can i make that link invisable for the anonymus user?

THX
Title: Re: Add Download Link
Post by: Nibbler on November 10, 2004, 09:03:42 pm
Surround it with an if (USER_ID) { <code here> } condition.
Title: Re: Add Download Link
Post by: haloki on November 11, 2004, 02:06:35 am
It didnt worked unfortunately. I didnt understood , where I muss add the code. Could you write please the code exactly?
thx
Title: Re: Add Download Link
Post by: Joachim Müller on November 11, 2004, 07:04:17 am
Use the code snippet similar to the one I posted here: http://forum.coppermine-gallery.net/index.php?topic=11619.msg52319#msg52319

Joachim
Title: Re: Add Download Link
Post by: haloki on November 11, 2004, 02:08:05 pm
I did it exactly, how you said me. That didn't worked.
Code: [Select]
<!-- BEGIN c_album_cell -->
        <td width="{COL_WIDTH}%" height="100%" valign="top">
        <table width="100%" height="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" valign="top" class="tableh2">
                        <a href="{ALB_LINK_TGT}" class="alblink"><b>{ALBUM_TITLE}</b></a>
                </td>
        </tr>
        <tr>
                <td colspan="3">
                        <img src="images/spacer.gif" width="1" height="1"><br />
                </td>
        </tr>
        <tr height="100%">
                <td align="center" height="100%" valign="middle" class="thumbnails">
                        <img src="images/spacer.gif" width="{THUMB_CELL_WIDTH}" height="1" class="image" style="margin-top: 0px;
 margin-bottom: 0px; border: none;"><br />
                        <a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
                </td>
                <td height="100%">
                        <img src="images/spacer.gif" width="1" height="1">
                </td>
                <td width="100%" height="100%" valign="top" class="tableb_compact">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br><br>
<?
if (USER_ID) {

print "<a href='login.php'>login</a>";

} else { print 'download';
}
?>
</p>

</td>
        </tr>
        </table>
        </td>
<!-- END c_album_cell -->


the download link ist nicht shown, although i logged in
Title: Re: Add Download Link
Post by: Nibbler on November 11, 2004, 08:10:23 pm
That link does not work for me. You have it set to display 'login' to logged in users, you probably want it the other way around.
Title: Re: Add Download Link
Post by: haloki on November 12, 2004, 12:29:36 am
That link works now. It doesn't matter, how the link looks like. It is important for me, that i make a link invisable for the anonymus users. it would be very nice, if you could help me. I couldnt get it up to now.  thank you for your help..

Title: Re: Add Download Link
Post by: Joachim Müller on November 12, 2004, 08:47:38 am
a link to your actual page and a test user account would be better than just a screenshot.

Joachim

P.S. You can add screenshots to your postings on this board, no need to host them somewhere else. Use "additional options" at the bottom left of the screen when composing a message.
Title: Re: Add Download Link
Post by: haloki on November 12, 2004, 01:23:26 pm
http://www.uni-dortmund.com/party

User: test
Passwort:test

I send you my theme.php too.

It would be better, if you change the code on theme.php

Thank you very much..
Title: Re: Add Download Link
Post by: Casper on November 12, 2004, 09:09:06 pm
Nibbler already told you what was wrong, you had it the wrong way around.  Your code;

Code: [Select]
<td width="100%" height="100%" valign="top" class="tableb_compact">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br><br>
<?
if (USER_ID) {

print "<a href='login.php'>login</a>";

} else { print 'download';
}
?>
</p>

</td>

Should have been this;

Code: [Select]
<td width="100%" height="100%" valign="top" class="tableb_compact">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br><br>
<?
if (USER_ID) {

print 'download';

} else {

print "<a href='login.php'>login</a>";

}
?>
</p>

</td>

Please just change the code to that yourself, and let us know how you got on.
Title: Re: Add Download Link
Post by: haloki on November 13, 2004, 11:31:03 am
I changed the source code, as you wrote. That did not worked. The source code from the homepage looks like that:

Code: [Select]
<!-- Start standard table -->
<table align="center" width="100%" cellspacing="1" cellpadding="0" class="maintable">

        <tr>

        <td width="50%" height="100%" valign="top">
        <table width="100%" height="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" valign="top" class="tableh2">
                        <a href="thumbnails.php?album=2" class="alblink"><b>Limericks - 22.10.2004 -</b></a>
                </td>
        </tr>
        <tr>
                <td colspan="3">
                        <img src="images/spacer.gif" width="1" height="1"><br />
                </td>
        </tr>
        <tr height="100%">
                <td align="center" height="100%" valign="middle" class="thumbnails">
                        <img src="images/spacer.gif" width="52" height="1" class="image" style="margin-top: 0px;
 margin-bottom: 0px; border: none;"><br />
                        <a href="thumbnails.php?album=2" class="albums"><img src="albums/userpics/limericks/thumb_limericks_69.JPG" class="image" " height="50" border="0" alt="limericks_69.JPG"><br /></a>
                </td>
                <td height="100%">
                        <img src="images/spacer.gif" width="1" height="1">
                </td>
                <td width="100%" height="100%" valign="top" class="tableb_compact">
                       
                        <p></p>
                        <p class="album_stat">69 files, last one added on Oct 28, 2004</p><br>
<? PHP if (USER_ID) {

print 'Download';

} else {

print "<a href='/party/albums/userpics/xxx_id.zip'>Download</a>";

}

?>


</td>
        </tr>
        </table>
        </td>

        <td width="50%" height="100%" valign="top">
        <table width="100%" height="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" valign="top" class="tableh2">
                        <a href="thumbnails.php?album=1" class="alblink"><b>Grillparty</b></a>
                </td>
        </tr>
        <tr>
                <td colspan="3">
                        <img src="images/spacer.gif" width="1" height="1"><br />
                </td>
        </tr>
        <tr height="100%">
                <td align="center" height="100%" valign="middle" class="thumbnails">
                        <img src="images/spacer.gif" width="52" height="1" class="image" style="margin-top: 0px;
 margin-bottom: 0px; border: none;"><br />
                        <a href="thumbnails.php?album=1" class="albums"><img src="albums/userpics/grillparty/thumb_grillparty_55.JPG" class="image" " height="50" border="0" alt="grillparty_55.JPG"><br /></a>
                </td>
                <td height="100%">
                        <img src="images/spacer.gif" width="1" height="1">
                </td>
                <td width="100%" height="100%" valign="top" class="tableb_compact">
                       
                        <p></p>
                        <p class="album_stat">55 files, last one added on Oct 28, 2004</p><br>
<? PHP if (USER_ID) {

print 'Download';

} else {

print "<a href='/party/albums/userpics/xxx_id.zip'>Download</a>";

}

?>


</td>
        </tr>
        </table>
        </td>

        </tr>

        <tr>
                <td colspan="2" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       
                                </tr>
                        </table>
                </td>
        </tr>
</table>
<!-- End standard table -->

Those are the Fotos of the Homepage;
Title: Re: Add Download Link
Post by: Joachim Müller on November 14, 2004, 03:48:40 pm
there mustn't be a space in
Code: [Select]
<? PHP - it should be
Code: [Select]
<?PHP
You home page appears to be down for me, can't check more...

Joachim