Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Add Download Link  (Read 8976 times)

0 Members and 1 Guest are viewing this topic.

haloki

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Add Download Link
« 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
Logged

Nibbler

  • Guest
Re: Add Download Link
« Reply #1 on: November 10, 2004, 09:03:42 pm »

Surround it with an if (USER_ID) { <code here> } condition.
Logged

haloki

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Add Download Link
« Reply #2 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add Download Link
« Reply #3 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
Logged

haloki

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Add Download Link
« Reply #4 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
« Last Edit: November 12, 2004, 01:46:07 pm by haloki »
Logged

Nibbler

  • Guest
Re: Add Download Link
« Reply #5 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.
Logged

haloki

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Add Download Link
« Reply #6 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..

Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add Download Link
« Reply #7 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.
Logged

haloki

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Add Download Link
« Reply #8 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..
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: Add Download Link
« Reply #9 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.
Logged
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

haloki

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
Re: Add Download Link
« Reply #10 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;
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Add Download Link
« Reply #11 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
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 21 queries.