Jump to content

Login before downloads


5wayshost

Recommended Posts

Here would be the easiest way to block the downloads section from users that are not logged in. Just replace your templates\WHMCSDefault\downloads.tpl contents with this.

 




{$LANG.downloadsintrotext}</p>

{if $loggedin}

<blockquote>
{foreach key=num item=download from=$downloads}


{$download.type} [url="{$download.link}"][b]{$download.title}[/b][/url]
{$download.description}
</p>
{foreachelse}
<p align=center>[b]{$LANG.downloadsnone}[/b]</p>
{/foreach}
</blockquote>

{else}
SHOW THIS
{/if}

 

Replace SHOWTHIS with whatever text, links, etc, that you want to how to users that arent logged in.

Link to comment
Share on other sites

We really should change the delimiter thought to something different, the default one can cause inuse with in document styles and javascript. I always change it to . Its easier to read as well.

 

Also, I noticed that the smarty library is encoded. Thats just plain wrong and their is absolutely no reason to encode a open source library. I might be remembering wrong, but this also does no allow us to tweak smarty settings or change the patch to to templates_c directory. I always move that to a sub site root location.

Link to comment
Share on other sites

  • WHMCS CEO

Hi,

 

I prefer the {$tag} style. The smarty library is not intended to be encoded so I will correct this for the stable release.

 

However, the path to the templates_c directory can be changed in the configuration.php file.

 

Matt

Link to comment
Share on other sites

ah, i had issues with beta 5.5, so i havent updated to that yet. 5.3 didnt have the smarty config paths in it.

 

And like a said, smarty is going to have an issue any time it sees a bracket thats not smarty related, so if you try to do something like:

 

<SCRIPT language="JavaScript">
       <!--

       function printKB(article_id) 
       { ........

 

or

 


<style type="text/css">
td {
text-align:left;
...................

 

Smarty will fail if you try either of those in the templates.

Link to comment
Share on other sites

  • 5 weeks later...
Here would be the easiest way to block the downloads section from users that are not logged in. Just replace your templates\WHMCSDefault\downloads.tpl contents with this.

 




{$LANG.downloadsintrotext}</p>

{if $loggedin}

<blockquote>
{foreach key=num item=download from=$downloads}


{$download.type} [url="{$download.link}"][b]{$download.title}[/b][/url]
{$download.description}
</p>
{foreachelse}
<p align=center>[b]{$LANG.downloadsnone}[/b]</p>
{/foreach}
</blockquote>

{else}
SHOW THIS
{/if}

 

Replace SHOWTHIS with whatever text, links, etc, that you want to how to users that arent logged in.

 

 

Can I replace SHOWTHIS with {$LANG.downloadsnotlogged} and add like

$_LANG['downloadsnotlogged'] = "Client's area only. Log in to access this area.";

to the language file?

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