Jump to content

Required login to access Downloads


ddg8176

Recommended Posts

I'm curious to know if the Downloads page was added to this section of code on the header.tpl file would Downloads automatically require login when clicked from the homepage?

 

{if $loggedin}<br />

<table width="100%" cellspacing="1" class="clientlinks">

<tr>

<td class="clientlinks"><a href="clientarea.php?action=details"><img src="images/clientarea/details.gif" alt="{$LANG.clientareanavdetails}" align="middle" /></a>  <a href="clientarea.php?action=details">{$LANG.clientareanavdetails}</a></td>

<td class="clientlinks"><a href="clientarea.php?action=invoices"><img src="images/clientarea/invoices.gif" alt="{$LANG.invoices}" align="middle" /></a>  <a href="clientarea.php?action=invoices">{$LANG.invoices}</a></td>

<td class="clientlinks"><a href="clientarea.php?action=hosting"><img src="images/clientarea/hosting.gif" alt="{$LANG.clientareanavhosting}" align="middle" /></a>  <a href="clientarea.php?action=hosting">{$LANG.clientareanavhosting}</a></td>

<td class="clientlinks"><a href="clientarea.php?action=domains"><img src="images/clientarea/domains.gif" alt="{$LANG.clientareanavdomains}" align="middle" /></a>  <a href="clientarea.php?action=domains">{$LANG.clientareanavdomains}</a></td>

</tr>

<tr>

<td class="clientlinks"><a href="supporttickets.php"><img src="images/clientarea/supporttickets.gif" alt="{$LANG.clientareanavsupporttickets}" align="middle" /></a>  <a href="supporttickets.php">{$LANG.clientareanavsupporttickets}</a></td>

<td class="clientlinks"><a href="order.php"><img src="images/clientarea/order.gif" alt="{$LANG.clientareanavorder}" align="middle" /></a>  <a href="order.php">{$LANG.clientareanavorder}</a></td>

<td class="clientlinks"><a href="clientarea.php?action=products"><img src="images/clientarea/products.gif" alt="{$LANG.clientareaproducts}" align="middle" /></a>  <a href="clientarea.php?action=products">{$LANG.clientareaproducts}</a></td>

<td class="clientlinks"><a href="clientarea.php?action=emails"><img src="images/clientarea/emails.gif" alt="{$LANG.clientareaemails}" align="middle" /></a>  <a href="clientarea.php?action=emails">{$LANG.clientareaemails}</a></td>

</tr>

</table>

{/if}

Link to comment
Share on other sites

No. Do not add or edit anything in the header.tpl for access to the downloads. What you want to do is put at the beginning of the downloads.tpl file

 

{if $loggedin}

 

and at the very bottom put

 

{else}
Please Login to view downloads section.
{/if}

 

You can change the text above for directions to login. What you are telling the template is IF user is logged in display this, ELSE display this. That is what you are looking for.

 

You will also want to do this for the downloadscat.tpl file as well.

Link to comment
Share on other sites

  • 2 months later...

Thanks for this solution guys. I'd like to add an enhancement.

 

I wanted to do this same mod to both my KB and downloads, but there would be little incentive for the potential client to register, (if there was little info). On the other hand, didn;'t want potential clients to stroll through and 'cherry pick' without giving me the chance to do business with them.

 

So by applying this mod to the knowlegdebasecat.tpl and downloadscat.tpl files, the potential client gets to see the first page of your DL & KB, but if they clieck a categorie, they get a login or register code.

On the donside, they can access your top5 Kb or Dl articles, but thats a small price to pay. Don't you agree?

 

The following slight hack displays the login/reg link

 

{else}

<p><h4>Please <a href="/whmcs/clientarea.php" target="_blank">Login</a> or <a href="/whmcs/register.php" target="_blank">Register</a> to use our knowledgebase.</h4></p>

{/if}

 

or change KB to DL.

 

 

 

 

Cheers

Dan

Link to comment
Share on other sites

  • 4 weeks later...

I think this would be a great feature. I used to use phpcoin and the knowledgebase for that would allow certain categories be only for clients logged in. This was very handy so I could put links for the cpanel and ftp as well has paths for GD, imagemagik, etc...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated