CoverYourASP --> "/MemberServices.html" --> Source

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
22 active users
764 visitors today
916 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2016 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

This page shows the actual source code used on this site. You can read the article that discusses this code here.

If this is the first CYA source code you've seen you should read this overview first.

Did you know you can download all the source code (and the database) of this site? Then get my newsletter to be emailed when I update the source code!

Please spread the word by recommending my site to your friends and colleagues!

This is JScript (server-side JavaScript), not the more common VBScript. More...

MemberServices.asp

<!--#include file = "/include/Startup.html"-->

<%
// ============================================
// NOTE: all source code downloaded from CoverYourASP was written by
// James Shaw (unless stated otherwise), and is copyright (c) 2000-2002
// by James Shaw. You can use the code for any purpose, but do not
// publish or distribute the content in any way.
//
// See http://CoverYourASP.com/Legal.asp for up-to-date details.
// ============================================

// increment the parent articles counter
sIncArticlePage = '/MemberCode.html';

// output relevant meta tags
Init( "Member Services" );

// output common top of page
Header( 'Member Services' );

// output page content
Content ( );

// output common bottom of page
Footer( );

// ============================================
// the content of this page - every page has a function 'Content' that
// is called above.
// ============================================
function Content ( )
{
   Out ( '<td valign="top" class="content">' );

      // a list of services provided at each level - a > in the first position of
      // the short description shows that the item is on the next level
      // a * means that it only available if signed in
      var sServices = new Array (
         '>Membership explained',      '/MemberHelp.html',      'CoverYourASP membership explained.',
         'Personalize the front page',   '/Personalize.html',      'Set how you want the front page to look!',
         '*Subscribe to newsletter',      '/C_a_s_ampi_0_ampe_.html' + sMemberEmail,   'Stay informed of the latest improvements!',
         '*Unsubscribe to newsletter',   '/C_a_u_ampi_0_ampe_.html' + sMemberEmail,   'Stop receiving our newsletter.',
         '*Sign out',                     '/MemberLogout.html',   'return to "anonymous" CoverYourASP access.',
         'Edit your membership details','/MemberEdit.html',      'e.g. change your email address.',
         'Delete your membership',      '/MemberDelete.html',   'and I\'ll forget you ever existed!',
         '>Component download',         '',                              'Access to the small, discreet and easily customizable component parts of this site. Membership, Banner system, Categories, Newsletter, etc., all available individually.',
         '>Enter Support Area',            '',                              'Extended Support and Contract Programming Services.'
         );

      if ( !IsLoggedIn ( ) )
      {
         Out ( 'Welcome "Anonymous user" to the CoverYourASP member services area!' );
         Out ( '<p><a href="/MemberEdit.html">Sign up</a> for a lifetime ' + sLevels [ 0 ] + ' membership for <b>free</b>, and the ' + sLevels [ 0 ] + ' services below will be available to you:' );
         Out ( '<p>Lifetime access to exclusive ' + sLevels [ 1 ] + ' member-only areas are available for a small fee.' );
      }
      else
      {
         Out ( 'Welcome ' + sMemberName + ' to the CoverYourASP member services area!' );
         Out ( '<p>As a ' + sLevels [ nMemberLevel-1 ] + ' member, here is a list of services available to you:' );
      }

      // put advertiser link at top of list
      if ( nMemberLevel == 4 )
      {
         Out ( '<p><b>Advertiser Services</b>' );
         Out ( '<p>&#0149;&nbsp;<a href="BannerReports.asp">Banner Reports</a>' );
      }

      // display the services
      var nCurrLevel = 0;
      var bShownMissing = false;

      for ( var i=0; i<sServices.length; i+=3 )
      {
         var sDescr = sServices [ i ];
         var sURL = sServices [ i+1 ];
         var sLongDescr = sServices [ i+2 ];

         // incremenbt the level if a > present
         switch ( sDescr.charAt ( 0 ) )
         {
         case '>':
            // lose the >
            sDescr = sDescr.slice ( 1 );

            nCurrLevel++;

            // show "what youre missing" if higher than their level
            if ( nCurrLevel  > nMemberLevel && !bShownMissing )
            {
               Out ( '<p><table width="100%" bgcolor="#dddddd"><tr><td>' );

               if ( IsLoggedIn ( ) )
                  Out ( '..and here is what you\'re missing today! You can access the services below by <a href="/MemberUpgrade.html">upgrading your membership</a> <b>for life</b> - for a small fee. <i>More coming soon!</i>' );

               bShownMissing = true;
            }

            // show level heading
            Out ( '<p><b>' + sLevels [ nCurrLevel-1 ] + ' Membership Services</b><br>' );
            break;

         case '*':
            if ( !IsLoggedIn ( ) )
               continue;

            // lose the *
            sDescr = sDescr.slice ( 1 );
            break;
         }

         // now list the service
         Out ( '<br>&#0149;&nbsp;' );
         
         if ( sURL == '' )
            Out ( sDescr + ' (coming soon!)' );
         else
            Out ( '<a href="' + sURL + '">' + sDescr + '</a>' );

         if ( sLongDescr != '' )
            Out ( ' - ' + sLongDescr );
      }

      if ( bShownMissing )
         Out ( '</td></tr></table>' );

      Out ( '<p>Want to see how this page was made up from an Array of services? Click below to get all the source code!' );

      Out ( '<p><center><a href="/ShowSource_page_MemberServices.html"><img src="images/source.gif" border=0></a></center>' );

      ShowBottomBanner()

   Out ( '</td>' );
   Out ( '<td background="images/gx/navgap.gif" valign="top">' );

      ShowTestimonials ( );

   Out ( '</td>' );
}
%>

Hopefully much of this is self-explanatory. If not, or if you see ways that I can improve the code, please drop me a line.

To see the source code for this page, click on the icon below.

Featured sponsor
My favorite resources

CoverYourASP Mugs, T-shirts, caps - even Boxer shorts...
I don't make a penny from these, but they're a lot of fun! Don't you need a new mouse mat?


I share my content

Supporting ASPRSS

Do you need a quick and easy way to link to my articles? All the information you need is published with ASPRSS...


Qualify for Free Trade Magazines

Free subscriptions to industry leading publications for those who qualify!


New Proposal Kit Professional 5.1
Brand yourself as a top professional: create quotes and amazing proposals and get many legal documents free!

The latter saved me 3 times the purchase price on the first day I owned it!


See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!