Add Download Link Add Download Link
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Add Download Link

Started by haloki, November 10, 2004, 02:25:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

haloki

Hello,
i added a download link in the theme.php..

<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

Nibbler

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

haloki

It didnt worked unfortunately. I didnt understood , where I muss add the code. Could you write please the code exactly?
thx

Joachim Müller


haloki

#4
I did it exactly, how you said me. That didn't worked.

<!-- 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

Nibbler

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.

haloki

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..


Joachim Müller

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.

haloki

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..

Casper

Nibbler already told you what was wrong, you had it the wrong way around.  Your code;

<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;

<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.
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

I changed the source code, as you wrote. That did not worked. The source code from the homepage looks like that:

<!-- 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;

Joachim Müller

there mustn't be a space in <? PHP - it should be<?PHP

You home page appears to be down for me, can't check more...

Joachim