[$ include( catfile( get_setting("dir_templates"), "tpl_header.html") ) $]


<!-- care to subscribe to a channel we don't know about? -->
<br /><table cellspacing="8" cellpadding="4" border="0" align="center"><tr align="center"><td bgcolor="#cccccc">
   <form action="my_channels.html" method="POST" style="margin:0">
   <table width="100%" cellpadding="5" cellspacing="1" border="0"><tr align="center">
      <td bgcolor="#ffffff"><small>If you know the address to<br />another channel, enter it here<br />(else, choose below):</small></td>
      <td bgcolor="#ffffff"><input type="text" name="add_url" value="http://" size="35" /><br /><small><small>TIP: <a href="http://www.disobey.com/amphetadesk/finding_more.html">Finding More Channels</a></small></small></td>
      <td bgcolor="#ffffff"><input type="submit" name="submit" value="Add This Channel" /></td>
   </tr></table>
   </form>
</td></tr></table>


<!-- begin the instructions for how to use this page. -->
<form action="add_a_channel.html" method="post" style="margin:0">
<input type="hidden" name="letter" value="[$ param('letter') || 0 $]" />
<table cellspacing="8" cellpadding="4" border="0" width="90%" align="center"><tr align="center"><td>
   <table width="100%"><tr><td align="center">Below are channels you may subscribe to.
   <br /><strong>To add channels</strong>, check its box and then the "Subscribe" button.</td></tr></table>
   <input type="submit" name="add" value="Subscribe to the Channels I've Checked Below" />
</td></tr></table>


<!-- show our letter navigation bar. -->
<table cellspacing="2" cellpadding="0" border="0" align="center"><tr><td align="center"><small>
  [$ # figure out the next and previous letters
     my $letter = param('letter') || 0;
     my $letter_prev = chr(ord(lc($letter)) - 1);
     my $letter_next = chr(ord(lc($letter)) + 1);
     if ($letter eq "a") { $letter_prev = "0"; }
     if ($letter eq "z") { $letter_next = "0"; }
     if ($letter eq "0") { $letter_prev = "z"; $letter_next = "a"; }
     $OUT .= qq{ <a href="add_a_channel.html?letter=$letter_prev">&lt;&lt;</a> };

    # loop through each letter.
    foreach my $letter_nav ( "0", "a" .. "z" ) {
       my $letter_nav_uc = uc($letter_nav);
       if ($letter_nav eq "0" and $letter_nav ne $letter) { $OUT .= qq{ <a href="add_a_channel.html?letter=$letter_nav">#</a> }; }
       elsif ($letter_nav eq "0" and $letter_nav eq $letter) { $OUT .= qq{ <strong>#</strong> }; }
       elsif ($letter_nav eq $letter) { $OUT .= qq{<strong>$letter_nav_uc</strong>}; }
       else { $OUT .= qq{ <a href="add_a_channel.html?letter=$letter_nav">$letter_nav_uc</a> }; }
    }

   $OUT .= qq{ <a href="add_a_channel.html?letter=$letter_next">&gt;&gt;</a> };
  $]
</small></td></tr></table>


<!-- begin our silly table that creates a grey highlight. -->
<table width="90%" cellpadding="0" cellspacing="0" border="0" align="center"><tr><td bgcolor="#cccccc">


    <!-- header bar for columnar explanations. big words! -->
    <table width="100%" cellpadding="5" cellspacing="1" border="0">
    <tr><td bgcolor="#ffcc33" align="center"><small><strong>Add?</strong></small></td><td bgcolor="#ffcc33"><small><strong>Name / Description</strong></small></td><td bgcolor="#ffcc33">&nbsp;</td><td bgcolor="#ffcc33">&nbsp;</td></tr>


 [$ # load our matching channel letter, defaulting with 0.
    load_channels_by_letter( param('letter') || 0 );
    my @channel_list = get_sorted_channels_list("title", "data");

    # get the user's window target preference (which controls
    # whether links should open up in the current or a new window.
    my $link_target = get_setting( "user_link_target" );

    # and display the HTML for each channel.
    foreach my $channel (@channel_list) { to_browser(qq{
    <tr valign="top" align="center">
       <td bgcolor="#ffffff"><input type="checkbox" name="add_urls" value="$channel->{xmlurl}" /></td>
       <td bgcolor="#ffffff" align="left"><a href="$channel->{htmlurl}" target="$link_target"><strong>$channel->{title}</strong></a><br />$channel->{description}</td>
       <td bgcolor="#ffffff"><a href="$channel->{xmlurl}" target="$link_target"><img src="/images/xml.gif" width="36" height="14" alt="View the raw XML source of '$channel->{title}'" border="0" /></a></td>
       <td bgcolor="#ffffff"><a href="$channel->{htmlurl}" target="$link_target"><img src="/images/globe.gif" width="13" height="13" alt="Go to the '$channel->{title}' Site" border="0" /></a></td>
    </tr>
    }) }

    # and spit it out.
    $OUT = send_to_browser;
 $]


    <!-- footer bar for columnar explanations. big words! -->
    <tr><td bgcolor="#ffcc33" align="center"><small><strong>Add?</strong></small></td><td bgcolor="#ffcc33"><small><strong>Name / Description</strong></small></td><td bgcolor="#ffcc33">&nbsp;</td><td bgcolor="#ffcc33">&nbsp;</td></tr>
    </table>


<!-- end silliness -->
</td></tr></table>


<!-- show our letter navigation bar. -->
<table cellspacing="2" cellpadding="0" border="0" align="center"><tr><td align="center"><small>
  [$ # figure out the next and previous letters
     my $letter = param('letter') || 0;
     my $letter_prev = chr(ord(lc($letter)) - 1);
     my $letter_next = chr(ord(lc($letter)) + 1);
     if ($letter eq "a") { $letter_prev = "0"; }
     if ($letter eq "z") { $letter_next = "0"; }
     if ($letter eq "0") { $letter_prev = "z"; $letter_next = "a"; }
     $OUT .= qq{ <a href="add_a_channel.html?letter=$letter_prev">&lt;&lt;</a> };

    # loop through each letter.
    foreach my $letter_nav ( "0", "a" .. "z" ) {
       my $letter_nav_uc = uc($letter_nav);
       if ($letter_nav eq "0" and $letter_nav ne $letter) { $OUT .= qq{ <a href="add_a_channel.html?letter=$letter_nav">#</a> }; }
       elsif ($letter_nav eq "0" and $letter_nav eq $letter) { $OUT .= qq{ <strong>#</strong> }; }
       elsif ($letter_nav eq $letter) { $OUT .= qq{<strong>$letter_nav_uc</strong>}; }
       else { $OUT .= qq{ <a href="add_a_channel.html?letter=$letter_nav">$letter_nav_uc</a> }; }
    }

   $OUT .= qq{ <a href="add_a_channel.html?letter=$letter_next">&gt;&gt;</a> };
  $]
</small></td></tr></table>


<!-- end the instructions for how to use this page. -->
<table cellspacing="8" cellpadding="4" border="0" width="90%" align="center"><tr align="center"><td>
   <input type="submit" name="add" value="Subscribe to the Channels I've Checked Above" />
   <table width="100%"><tr><td align="center">Above are channels you may subscribe to.
   <br /><strong>To add channels</strong>, check its box and then the "Subscribe" button.</td></tr></table>
</td></tr></table>
</form>


<!-- care to subscribe to a channel we don't know about? -->
<br /><table cellspacing="8" cellpadding="4" border="0" align="center"><tr align="center"><td bgcolor="#cccccc">
   <form action="my_channels.html" method="POST" style="margin:0">
   <table width="100%" cellpadding="5" cellspacing="1" border="0"><tr align="center">
      <td bgcolor="#ffffff"><small>If you know the address to<br />another channel, enter it here<br />(else, choose above):</small></td>
      <td bgcolor="#ffffff"><input type="text" name="add_url" value="http://" size="35" /><br /><small><small>TIP: <a href="http://www.disobey.com/amphetadesk/finding_more.html">Finding More Channels</a></small></small></td>
      <td bgcolor="#ffffff"><input type="submit" name="submit" value="Add This Channel" /></td>
   </tr></table>
   </form>
</td></tr></table>


[$ include( catfile( get_setting("dir_templates"), "tpl_footer.html") ) $]
