Changeset 1352

Show
Ignore:
Timestamp:
03/01/07 18:58:29 (2 years ago)
Author:
jm3
Message:

lots o changes (big ones in bold):

  • added export in delicious format xml
  • account removal
  • much, much nicer (as in, they actually exist) reminder emails for pending account expiration
  • added self-service account re-enablement for auto-disabled users
  • much, much nicer emails for
  • added two new answers to the FAQ
  • re-arranged search to move the options to the top (duh)
  • refactored tag-ame related functions
  • added AIM as a valid profile field
  • wrote validation code process to linking your AIM account to FML
  • whee!!!!
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/.t

    r1325 r1352  
    11<?php 
    2         include_once( "modules/utils.inc.php" ); 
    3         include( "$modules/header.insecure.inc.php" ); 
    4  
    5 if( $tok && $tok == md5( getPasswdForUser( $u ))) { 
    6  
    7         $con_pageName = mysql_connect(); 
    8         mysql_selectdb( getDBName() ); 
    9         $qs = ""; 
    10         $q = mysql_query( $qs ); 
    11         if( $numRows = $q ? mysql_num_rows($q) : 0 ) { 
    12                 #echo "$numRows matches.<br />"; 
    13                 for( $i = 0; $i < $numRows; $i++ ) { 
    14                 } 
    15         } 
    16  
    17         $id = mysql_result($q,$i,"id"); 
    18  
    19         conClose( $con_pageName ); 
     2        include( "../modules/utils.inc.php" ); 
     3        $title = "Export your links:"; 
     4        include( "$modules/header.inc.php" ); 
     5        h1( $title ); 
    206?> 
    217 
     8<?php 
     9        include( "$modules/footer.inc.php" ); 
     10?> 
    2211 
    23  
    24 <?php } ?> 
  • feedmelinks/FAQ/index.php

    r1350 r1352  
    3636                        <ol> 
    3737                                <li><a href="#q2"  >How do I add a link?</a></li> 
     38                                <li><a href="#search_my_links"  >How do I search just my own links?</a></li> 
    3839                                <li><a href="#q5"  >Can I import all my favorites/bookmarks at once?</a></li> 
    39                                 <li><a href="#q6"  >Can I export my bookmarks out of Feed Me Links?</a></li> 
     40                                <li><a href="#export"  >Can I export my bookmarks out of Feed Me Links?</a></li> 
    4041                                <li><a href="#usage_email">Can I add links via email?</a></li> 
    4142                                <li><a href="#q2_1">What the heck is a tag?</a></li> 
     
    206207                <a href="#top">back to top</a> 
    207208        </div> 
     209 
     210        <div> 
     211                <a name="search_my_links"></a> 
     212                <div class="q">How do I add a link?</div> 
     213                <div class="a"> 
     214                        Use the search box on the top of the page and then press the "my links only" checkbox on the results page, like so 
     215                        <p/> 
     216                        <a href="/search"><img src="/img/search-just-my-links.png" border="0"/></a> 
     217                </div> 
     218                <a href="#top">back to top</a> 
     219        </div> 
     220 
    208221 
    209222        <div> 
     
    268281 
    269282        <div> 
    270                 <a name="q6"></a> 
     283                <a name="export"></a> 
    271284                <div class="q">Can I export my bookmarks from Feed Me Links to something else?</div> 
    272285                <div class="a"> 
    273                         Yes. we support connections via HTTP and 
     286                        Yes.  
    274287                        can make your links available to you as XML 
    275288                        over HTTP or RSS. <a href="mailto:<%= get_spamsafe_email() %>">Contact us</a> for access and 
  • feedmelinks/admin/expire-old-users.php

    r1269 r1352  
    1212        $qs = getQuery( "all_users" ); 
    1313        $q = run_query( $qs ); 
    14         $ttl = 90
     14        $ttl = get_num_days_allowed_idle()
    1515?> 
    1616 
     
    3030                return; 
    3131 
    32         $deadbeats = 0; 
     32        $idlers = 0; 
    3333        while( $row = mysql_fetch_assoc( $q )) { 
    3434                $user = $row["userid"]; 
     
    3737                if( $delta > $ttl ) { 
    3838                        $expired = true; 
    39                         ++ $deadbeats; 
    40                         disable_user( $user ); 
     39                        ++ $idlers; 
     40                        expire_user( $user ); 
    4141                } else { 
    4242                        $expired = false; 
     
    5656 
    5757</table> 
    58 <h1><?= $deadbeats ?> deadbeats</h1> 
     58<h1><?= $idlers ?> idlers</h1> 
    5959 
  • feedmelinks/admin/index.php

    r1289 r1352  
    3434                <li><a href="/admin/delete-all-comments-from-spammer">delete all comments from spammer</a></li> 
    3535                <li><a href="/admin/todays-users">today's new users</a></li> 
    36                 <li><a href="/admin/re-enable-user">re-enable user</a></li> 
     36                <li><a href="/admin/disable-user">disable/enable/expire user</a></li> 
    3737                <li><a href="/admin/expire-old-users">expire old users</a></li> 
    3838                <li><a href="/admin/snuff">snuff a user</a></li> 
  • feedmelinks/api/add.php

    r1350 r1352  
    5454                } 
    5555        } else { 
    56                 header('WWW-Authenticate: Basic realm="Feed Me Links XML API"'); 
     56                header('WWW-Authenticate: Basic realm="Feed_Me_Links_XML_API"'); 
    5757                header('HTTP/1.0 401 Unauthorized'); 
    5858                echo "login first, please."; 
  • feedmelinks/api/comment.php

    r580 r1352  
    1919                echo "</response>"; 
    2020        } else { 
    21                 header('WWW-Authenticate: Basic realm="Feed Me Links XML API"'); 
     21                header('WWW-Authenticate: Basic realm="Feed_Me_Links_XML_API"'); 
    2222                header('HTTP/1.0 401 Unauthorized'); 
    2323                echo "<response>login first, please. 
  • feedmelinks/api/restricted/secure-call.php

    r1350 r1352  
    77        $u    = $PHP_AUTH_USER ? $PHP_AUTH_USER : ( $user ? $user : $_COOKIE["c_uid"] ); 
    88        $tok =  $authenticated = $_COOKIE["c_pass_token"]; 
     9        header( "Content-type: text/xml"); 
    910 
    1011        if( $pass && $pass == getPasswdForUser( $u ) || ($tok && $tok == md5( getPasswdForUser( $u )))) { 
    1112 
    1213                if( ! isSuperUser( $u )) { 
    13                         echo "This is a restricted API call. go away."; 
     14                        echo "<rest><response>This is a restricted API call. go away.</response></rest>"; 
    1415                        return; 
    1516                } 
    1617 
    17                 header( "Content-type: text/xml"); 
    18                 echo "<call>\n"; 
     18                echo "<rest>\n"; 
    1919                echo "  <request>$call($user)</request>\n"; 
    2020                echo "  <response>" . call_user_func( $call, $user ) . "</response>\n"; 
    21                 echo "</call>"; 
     21                echo "</rest>"; 
    2222 
    23                 if( $error ) { 
    24                         Header("HTTP/1.0 404 Not Found"); 
    25                         echo $error; 
    26                 } 
    2723        } else { 
    28                 header('WWW-Authenticate: Basic realm="Feed Me Links XML API"'); 
    29                 header('HTTP/1.0 401 Unauthorized'); 
    30                 echo "login first, please."; 
     24                header('WWW-Authenticate: Basic realm="Feed_Me_Links_XML_API"'); 
     25                #header('HTTP/1.0 401 Unauthorized'); 
     26                echo "<rest><response>login first, please.</response></rest>"; 
    3127        } 
    3228?> 
  • feedmelinks/categorize.php

    r1334 r1352  
    100100                        $url = $li['url']; 
    101101 
    102                         $rawCats = getCategoriesForLink( $id, $u ); 
     102                        $rawCats = get_tag_IDs( $id, $u ); 
    103103                        if( $debug ) { 
    104104                                print "rawCats:<br />"; 
  • feedmelinks/funnel.php

    r1178 r1352  
    5050                        $url = $li['url']; 
    5151 
    52                         $rawCats = getCategoriesForLink( $id, $u ); 
     52                        $rawCats = get_tag_IDs( $id, $u ); 
    5353                        if( $debug ) { 
    5454                                print "rawCats:<br />"; 
  • feedmelinks/modules/recent-with-times.inc.php

    r1331 r1352  
    148148                <%= $i == 0 ? getCommentCSS() : "" %> 
    149149                <%= getCommentsForLink( $id, "nobody", $debug ) %> 
    150                 <% $cats = getCategoriesForLinkAsRss( $id, "nobody", "add-trailing-noun=1", 0 ); %> 
     150                <% $cats = get_tag_IDs( $id, "nobody", "add-trailing-noun=1", 0 ); %> 
    151151        ]]></content:encoded> 
    152152        <dc:subject><%= $cats ? "$cats" : "(" . getUnCattedName() . ")" %></dc:subject> 
  • feedmelinks/modules/utils.inc.php

    r1350 r1352  
    66include_once( "env.inc.php" ); 
    77include( get_root() . "/modules/prep-cache.inc.php" ); 
     8 
     9# user status constants 
     10define( "ACTIVE",   0 ); 
     11define( "IDLENESS", 1 ); 
     12define( "SPAMMING", 2 ); 
     13 
     14function get_mime_type( $format ) { 
     15        switch( $format ){ 
     16                case "xml_delicious"    :     
     17                        return "text/XML"; 
     18                case "html"       :     
     19                        return "text/HTML"; 
     20                case "rss"       :     
     21                        return "text/mark-pilgrim-is-crazy"; 
     22                default:  
     23                        return "text/plain"; 
     24        }     
     25} 
     26 
     27function get_extension( $format ) { 
     28        switch( $format ){ 
     29                case "xml_delicious"    :     
     30                        return ".xml"; 
     31                case "html"       :     
     32                        return ".html"; 
     33                case "rss"       :     
     34                        return ".rss"; 
     35                default:  
     36                        return ".txt"; 
     37        }     
     38} 
     39 
     40function force_valid_xml( $s ) { 
     41        if( ! $s ) return; 
     42        $raw_xml = tempnam( "/tmp", "$u_export" ); 
     43        $clean_xml = "$raw_xml-clean.xml"; 
     44        $handle = fopen( $raw_xml, "w" ); 
     45        fwrite( $handle, $s ); 
     46        fflush( $handle ); 
     47 
     48        $output = shell_exec( get_bin() . "/tidy -q -xml -n $raw_xml > $clean_xml" ); 
     49        fclose( $handle ); # unlinks raw_xml 
     50        $valid_xml = file_get_contents( $clean_xml ); 
     51        unlink( $clean_xml ); 
     52        return $valid_xml; 
     53} 
     54 
     55function encode_url_for_xml( $url ) { 
     56        $pieces = explode("?", $url); 
     57        return count( $pieces ) > 1 ? $pieces[0] . "?" . preg_replace( "/_FML_AMP_/", "&amp;", preg_replace( "/_FML_EQUALS_/", "=", urlencode( preg_replace( "/&/", "_FML_AMP_", preg_replace( "/=/", "_FML_EQUALS_", $pieces[1] ))))) : $url; 
     58} 
     59 
     60function export_as_xml_delicious( $u, $select ) { 
     61        $now = format_mysql_date_as_DC_date( get_now_db()); 
     62        return "<?xml version='1.0' standalone='yes'?> 
     63<posts update='$now' user='$u'>\n" . export( $u, "xml_delicious", $select ) . "</posts>"; 
     64} 
     65         
     66function render_as_xml_delicious( $u, $id, $url, $name, $createDate ) { 
     67        $hash = md5( $url ); 
     68        $tags = preg_replace( "/ /", "_", implode( ",", get_tag_names( $id, $u ))); 
     69        $url = encode_url_for_xml( $url ); 
     70        return <<<EOT 
     71  <post href="$url" description="$name" hash="$hash" tag="$tags"/> 
     72 
     73EOT; 
     74} 
     75 
     76function export_as_html( $u, $select ) { 
     77        return "<ul>\n" .  export( $u, "html", $select ) . "</ul>"; 
     78} 
     79 
     80function render_as_html ( $u, $id, $url, $name, $createDate ) { 
     81        return "  <li>not yet implemented</li>\n"; 
     82} 
     83 
     84function export( $u, $format, $select ) { 
     85        if( ! $u ) return; 
     86         
     87        $qs = "SELECT ID, url, name, createDate, isPrivate FROM links WHERE userid = '" . urlencode( $u ) . "'"; 
     88        if( $select == "private" ) 
     89                $qs .= " AND isPrivate = 1"; 
     90        else if( $select == "public" ) 
     91                $qs .= " AND isPrivate IS NULL"; 
     92 
     93        # FIXME: remove limiter!!!! 
     94        $qs .= " ORDER BY createDate DESC LIMIT 500;"; 
     95         
     96        ob_start(); 
     97        $q = run_query( $qs ); 
     98 
     99        if( $q && mysql_num_rows($q) ) { 
     100                while( $row = mysql_fetch_assoc( $q )) {  
     101                        $id        = $row["ID"]; 
     102                        $url       = urldecode( $row["url"] ); 
     103                        $name      = preg_replace( '/"/', "&amp;quot;", o( urldecode( $row["name"] ))); 
     104                        $date      = format_mysql_date_as_DC_date( $row["createDate"] ); 
     105                        $isPrivate = $row["isPrivate"]; 
     106 
     107                        if( $select == "public" && $isPrivate == 1 ) 
     108                                continue; 
     109 
     110                        echo call_user_func( "render_as_$format", $u, $id, $url, $name, $createDate ); 
     111                } 
     112        } 
     113 
     114        $data = force_valid_xml( ob_get_clean()); 
     115        return $data; 
     116} 
     117 
     118function h1( $s ) { echo "<h1>$s</h1>"; } 
     119function h2( $s ) { echo "<h2>$s</h2>"; } 
     120function h3( $s ) { echo "<h3>$s</h3>"; } 
    8121 
    9122function is_im_account_known( $im_name ) { 
     
    234347 
    235348function re_enable_user( $u ) { 
     349        notify_returning( $u ); 
    236350  return( get_simple_rs( getQuery( "re-enable_user", $u ))); 
    237351} 
     
    265379 
    266380function fire( $sub, $mesg ) { 
    267   $success = mail( get_maintainer_email(), "WHAT THE CHOPSTICKS!?! $sub", $mesg, get_mail_headers()); 
     381  $success = mail( get_maintainer_email(), "FML: $sub", $mesg, get_mail_headers()); 
    268382} 
    269383 
     
    316430function enable_user( $user ) { 
    317431  $q = run_query( getQuery( "enable_user", $user )); 
    318   return "success"; # FIXME: replace with a real status 
     432  return "success: re-enabled user $user"; 
    319433} 
    320434 
    321435function disable_user( $user ) { 
    322   $q = run_query( getQuery( "disable_user", $user )); 
    323   log_mesg_to( "disabled user $user", "global" ); 
    324   return "disabled user"; # FIXME: replace with a real status 
     436  $q = run_query( getQuery( "disable_user", $user, SPAMMING )); 
     437  log_mesg_to( "disabled user $user for spammming", "global" ); 
     438  return "disabled user $user for spamming"; 
     439
     440 
     441# user status constants 
     442# ACTIVE 
     443# IDLENESS 
     444# SPAMMING 
     445 
     446function expire_user( $user ) { 
     447  $q = run_query( getQuery( "disable_user", $user, IDLENESS )); 
     448  log_mesg_to( "disabled idle user $user", "global" ); 
     449        notify_expired( $user ); 
     450  return "expired idle user $user"; 
    325451} 
    326452 
     
    435561} 
    436562 
     563function get_num_days_allowed_idle() { 
     564        return 90; # FIXME: move into server config 
     565} 
     566 
     567function notify_expired( $u ) { 
     568        $site = "http://" . get_domain(); 
     569  $body = "Hello, $u. 
     570 
     571It looks like you've been busy and haven't been using your Feed Me Links account ($site/u/$u) lately. We tried to send you a reminder email last week, but perhaps you didn't receive it or weren't interested in continuing to use Feed Me Links. That's OK. :-)i 
     572 
     573Because your account has been unused for " . get_num_days_allowed_idle() . ", in order to protect your account and as a safegaurd against spammers, we have temporarly disabled your login until we hear from you that you would like to keep linking. Do NOT worry -- all your links are just fine are will be kept safely in Feed Me Links.  
     574 
     575To Re-Enable your account, just click this link: $site/user/re-enable?user=$u&code=" . md5( getPasswdForUser( $u )) .  " 
     576 
     577(To completely REMOVE your account, please click $site/user/remove-me?user=$u) 
     578 
     579-- 
     580 
     581Sorry for any inconvenience this may have caused you. If you have any questions, please email jm3@feedmelinks.com"; 
     582  $headers = get_mail_headers(); 
     583  $to = getEmailAddressForUser( $u ); 
     584  $success = mail( $to, "Long time, no link : You haven't used Feed Me Links lately", $body, $headers); 
     585  if( $success ) 
     586    log_mesg_to( "sent expiration notification mail to $to", "mail" ); 
     587  return $success; 
     588} 
     589 
     590# FIXME: add blog.feedmelinks.com to servers.xml config 
     591function notify_expiring_soon( $u ) { 
     592        $site = get_site(); 
     593  $body = "Hi $u, and thanks for trying Feed Me Links. 
     594 
     595We've noticed you haven't been using your Feed Me Links account very much. 
     596Maybe you've been busy -- we understand. We hope you'll give Feed Me 
     597Links another try. We've been working on some cool improvements to the 
     598site and we'd love to show them to you. You can read about what's new on 
     599the blog at http://blog.feedmelinks.com, or just log in: 
     600 
     601  $site/login 
     602 
     603To keep the site fresh, we normally expire unused accounts after 90 
     604days of inactivity, which for you will be in about a week. Don't worry: if 
     605you don't respond, your links and tags and peeps will NOT be deleted -- 
     606we simply freeze your password to keep your account safe from potential 
     607hackers or spammers. 
     608 
     609To ensure that your account stays active, simply log in ($site/login) 
     610and link something, and your account will remain active as it is. 
     611 
     612If decide you'd rather leave Feed Me Links behind (sad!), we can help 
     613you to export your links (to use elsewhere), or, if you like,completely 
     614remove your account (although we'd obviously love for you to stay :-) 
     615 
     616  To export your links, go to: $site/export/ 
     617   
     618  To REMOVE your account, go to: $site/user/remove-me?user=$u&code=" . md5( getPasswdForUser( $u )) . " 
     619 
     620We hope you'll give Feed Me Links another try. Either way, thanks for signing up! 
     621 
     622Sincerely,  
     623 
     624-- 
     625 
     626John Manoogian III 
     627Feed Me Links 
     628www.jm3.net 
     629"; 
     630 
     631$headers = get_mail_headers(); 
     632  $to = getEmailAddressForUser( $u ); 
     633  $success = mail( $to, "Feed Me Links: Was it something we said?", $body, $headers); 
     634  if( $success ) 
     635    log_mesg_to( "sent impending expiration warning mail to $to", "mail" ); 
     636  return $success; 
     637} 
     638 
     639function notify_returning( $u ) { 
     640        $site = get_site(); 
     641  $body = "Hello $u -- welcome back! We're stoked that you've decided to keep using Feed Me Links. 
     642         
     643You can start using Feed Me Links immediately; your current account password is: " . getPasswdForUser( $u ) ." 
     644If you would like to re-set your account password, just click here: $site/account 
     645 
     646Thanks,  
     647 
     648-- 
     649 
     650The Feed Me Links Robot"; 
     651  $headers = get_mail_headers(); 
     652  $to = getEmailAddressForUser( $u ); 
     653  $success = mail( $to, "Welcome back to Feed Me Links!", $body, $headers); 
     654  if( $success ) 
     655    log_mesg_to( "sent welcome back mail to $to", "mail" ); 
     656  return $success; 
     657} 
     658 
    437659function notify_added_as_peep( $u, $by ) { 
    438660  $body = "Hi, $u. 
     
    451673  $headers = get_mail_headers(); 
    452674  $to = getEmailAddressForUser( $u ); 
    453  
    454675  $success = mail( $to, "Someone has added you as a contact", $body, $headers); 
    455676  if( $success ) 
     
    13691590                        $user = $row["userid"]; 
    13701591      $users[$user] ++; 
    1371       #echo "user: |" . $user . "| "; 
    1372       #echo "(" . $users[$user] . ") "; 
    1373  
    13741592      if( $users[$user] < $links_per_user ) { 
    1375  
    13761593                        $name = urldecode( $row["name"] ); 
    13771594                        $name = preg_replace( '/(&quot;|&amp;quot;)/', '"', $name ); 
    13781595                        $name = preg_replace( '/&/', '&amp;', $name ); 
    1379  
    1380   ob_start(); 
     1596                        ob_start(); 
    13811597?> 
    13821598 
     
    21082324  } else if( $argWhichQuery  == "disable_user" ) { 
    21092325    return " 
    2110     UPDATE users SET disabled = 1 WHERE userid = '" . urlencode($args[1]) . "';"; 
     2326    UPDATE users SET disabled = " . $args[2] . " WHERE userid = '" . urlencode($args[1]) . "';"; 
    21112327   
    21122328  } else if( $argWhichQuery  == "snuff_pass" ) { 
     
    35273743} 
    35283744 
     3745# deprecated, use get_tag_name 
    35293746function getNameForFolder( $argId ) { 
    3530   if( $argId != "unfiled" ) 
    3531     return urldecode( getFieldForFolder( $argId, "name" ) ); 
     3747        return get_tag_name( $argId ); 
     3748
     3749 
     3750function get_tag_name( $id ) { 
     3751  if( $id != "unfiled" ) 
     3752    return urldecode( getFieldForFolder( $id, "name" ) ); 
    35323753  else 
    3533     return $argId; 
     3754    return $id; 
    35343755} 
    35353756 
     
    35893810} 
    35903811 
    3591 function getCategoriesForLink( $argId, $argUserId ) { 
     3812function get_tag_names( $argId, $argUserId ) { 
     3813        return get_tag_IDs( $argId, $argUserId, true ); 
     3814
     3815 
     3816function get_tag_IDs( $argId, $argUserId, $as_names ) { 
     3817        $type = $as_names ? "as_names" : "as_IDs"; 
    35923818  if( $argId ) { 
    35933819    if( $debug ) { 
    35943820      print "<br />"; 
    3595       echo "getCategoriesForLink($argId, $argUserId) called<br />"; 
     3821      echo "get_tag_IDs($argId, $argUserId) called<br />"; 
    35963822    } 
    35973823    if( getOwnerForLink( $argId ) == $argUserId || ! isPrivate( $argId ) ) { 
    3598       $con_getCategoriesForLink = mysql_connect(); 
     3824      $con_get_tag_IDs = mysql_connect(); 
    35993825      mysql_selectdb( getDBName() ); 
    36003826      $qs = "SELECT tagID FROM links_tags_xref WHERE linkID = $argId"; 
    36013827      $q = mysql_query( $qs ); 
    36023828      if( $debug ) 
    3603         echo "getCategoriesForLink: qs : $qs<br />"; 
     3829        echo "get_tag_IDs: qs : $qs<br />"; 
    36043830      if( $q ) 
    36053831        $numRows = mysql_num_rows($q); 
    36063832      else if( $debug ) 
    3607         echo "getCategoriesForLink: DB call failed!<br >"; 
     3833        echo "get_tag_IDs: DB call failed!<br >"; 
    36083834         
    36093835      $cats = Array(); 
    36103836      for( $i = 0; $i < $numRows; $i++ ) { 
    36113837        if( $debug ) 
    3612           echo "getCategoriesForLink: found category " . mysql_result($q,$i,"tagID") . "<br />"; 
     3838          echo "get_tag_IDs: found category " . mysql_result($q,$i,"tagID") . "<br />"; 
    36133839        if( canSeeCategory( mysql_result($q,$i,"tagID"), $argUserId )) { 
    36143840          if( $debug ) 
    36153841            echo "pushing cat into cats"; 
    3616           array_push( $cats, mysql_result($q,$i,"tagID")); 
     3842                                                $id = mysql_result($q,$i,"tagID"); 
     3843          if( $type == "as_IDs" ) 
     3844                                                array_push( $cats, $id); 
     3845                                        else 
     3846                                                array_push( $cats, get_tag_name($id)); 
    36173847        } else { 
    36183848          if( $debug ) 
     
    36213851      } 
    36223852      if( $debug ) { 
    3623         echo "getCategoriesForLink: found " . count( $cats ) . " cats<br />"; 
     3853        echo "get_tag_IDs: found " . count( $cats ) . " cats<br />"; 
    36243854        print_r( $cats ); 
    36253855        print "<br />"; 
     
    36273857      } 
    36283858    } else { 
    3629       echo "getCategoriesForLink: permissions issue: $argUserId can't touch $argId<br />"; 
    3630     } 
    3631     conClose( $con_getCategoriesForLink ); 
     3859      echo "get_tag_IDs: permissions issue: $argUserId can't touch $argId<br />"; 
     3860    } 
     3861    conClose( $con_get_tag_IDs ); 
    36323862    if( sizeof( $cats )) { 
    36333863      return $cats; 
     
    36383868} 
    36393869 
    3640 function getCategoriesForLinkAsString( $argId, $argUserId ) { 
     3870function get_tag_IDs_as_string( $argId, $argUserId ) { 
    36413871  if( $argId && $argUserId ) { 
    36423872    return( implode( ", ",  getCategoriesForLink( $argId ))); 
     
    36443874} 
    36453875 
    3646 function getShortCategoriesForLinkAsHTML( $argId, $argUserId ) { 
    3647   return getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, 0, 0, 0 ); 
     3876function getShortCategoriesForLinkAsHTML( $argId, $argUserId, $no_prefix ) { 
     3877  return getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, 0, 0, 0, $no_prefix ); 
    36483878} 
    36493879 
    36503880function getCategoriesForLinkAsRss( $argId, $argUserId, $showNoun, $showChange ) { 
    3651   $cats = getCategoriesForLinkAsHTML( $argId, $argUserId, $showNoun, $showChange ); 
     3881  $cats = get_tags_as_HTML( $argId, $argUserId, $showNoun, $showChange ); 
    36523882  $cats = preg_replace( "/^in /", "", $cats ); 
    36533883  $cats = preg_replace( "/^$/", "", $cats ); # kill newlines 
     
    36573887} 
    36583888 
    3659 function getCategoriesForLinkAsHTML( $argId, $argUserId, $showNoun, $showChange ) { 
     3889function get_tags_as_HTML( $argId, $argUserId, $showNoun, $showChange ) { 
    36603890  return getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, $showNoun, $showChange, 1 ); 
    36613891} 
    36623892 
    3663 function getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, $showNoun, $showChange, $showPreposition ) { 
     3893function getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, $showNoun, $showChange, $showPreposition, $no_prefix ) { 
    36643894  if( $argId ) { 
    3665     $cats = getCategoriesForLink( $argId, $argUserId ); 
     3895    $cats = get_tag_IDs( $argId, $argUserId ); 
    36663896    $s = ""; 
    36673897   
     
    36833913          ? (!$owned  
    36843914            ? ("Tagged with: " . getUserLink( $owner ) . "'s ")  
    3685               : "Tagged with: " )  
     3915              : ($no_prefix ? "" : "Tagged with: ") )  
    36863916          : "") . $s . $noun . ($owned  
    36873917            ? ($showChange  
     
    40874317function formatAsSimpleDate( $ts ) { 
    40884318  return preg_replace( "/T.*$/", "", formatAsDCDate( $ts )); 
     4319} 
     4320 
     4321function format_mysql_date_as_DC_date( $d ) { 
     4322  return preg_replace( "/ /", "T", $d ) . "Z"; 
    40894323} 
    40904324 
  • feedmelinks/modules/view-link.inc.php

    r1342 r1352  
    100100$createDate != "today" && $createDate != "yesterday" ? " on" : "," %> <%= $createDate %>. 
    101101&nbsp; 
    102 <%= getCategoriesForLinkAsHTML( $l, $u, $add_trailing_noun = false, 1 ) %> 
     102<%= get_tags_as_HTML( $l, $u, $add_trailing_noun = false, 1 ) %> 
    103103 
    104104<%  
  • feedmelinks/search-as-xml.php

    r1334 r1352  
    6565<link> 
    6666<%  
    67         $cats = getCategoriesForLinkAsHTML( $id, $u, "add-trailing-noun=1", 0 );  
     67        $cats = get_tags_as_HTML( $id, $u, "add-trailing-noun=1", 0 );  
    6868 
    6969        $name = preg_replace( "/&apos;/", "'", $name ); 
  • feedmelinks/search.php

    r1334 r1352  
    5959                <td class="header"> 
    6060                        <b><%= $numRows %> <%= $numRows == 1 ? "match" : "matches" %></b> 
    61                         for "<%= str_replace( "%", " ", $searchTerm ) %>" (searched <%= number_format( $totalNumLinks ) %> <%= $searchWhat %>)<br /> 
     61                        for "<%= str_replace( "%", " ", $searchTerm ) %>" (searched <%= number_format( $totalNumLinks ) %> <%= $searchWhat %>) 
     62                </td> 
     63        </tr> 
     64 
     65        <tr> 
     66                <td> 
     67<% 
     68if( $showInputForm ) { %> 
     69<form action="search" method="get" name="search_form"> 
     70<div id="bigBox" style="margin: auto; height: inherit; width: 35em;"> 
     71 
     72<table border="0" cellpadding="0"> 
     73        <tr> 
     74                <td> 
     75                        Search <%= $my ? "my links " : "" %><%= $searchTerm ? "again" : "" %>: <input name="q" size="30" style="padding: 3px;" maxlength="40" value="<%= str_replace( "%", " ", $searchTerm ) %>"> 
     76                </td> 
     77                <td align="center"> 
     78                        <input type="image" onMouseOver="btn_370.src='/img/search-on.png';" onMouseOut="btn_370.src='/img/search.png';" src="img/search.png" border="0" /> 
     79                </td> 
     80        </tr> 
     81</table> 
     82 
     83<center> 
     84within: 
     85 
     86<% if( $debug ) { %> 
     87 
     88<p> 
     89$searchTerm <%= $searchTerm %><br> 
     90$my <%= $my %><br> 
     91$search_only <%= $search_only %><br> 
     92 
     93</p> 
     94 
     95<% } %> 
     96 
     97 
     98        <label><input type="radio" name="search_only" value="links" <%= $search_only != "users" && $search_only != "folders" ? "checked" : "" %> /> links</label> 
     99        <label><input type="radio" name="search_only" value="users" <%= $search_only == "users" ? "checked" : "" %> /> users</label> 
     100        <label><input type="radio" name="search_only" value="tags" <%= $search_only == "tags" ? "checked" : "" %> /> <%= getCatsName() %></label> 
     101<% if( $sessionUserId ) { %> 
     102        <label><input type="checkbox" name="my" <%= $my ? "checked" : "" %> /> my links only &nbsp;</label> 
     103<% } %> 
     104</center> 
     105 
     106</div> 
     107 
     108</form> 
     109 
     110<% } %> 
     111 
    62112                </td> 
    63113        </tr> 
     
    85135                <td <%= $bg %>> 
    86136<%  
    87         $cats = getCategoriesForLinkAsHTML( $id, $u, "add-trailing-noun=1", 0 );  
     137        $cats = get_tags_as_HTML( $id, $u, "add-trailing-noun=1", 0 );  
    88138%> 
    89139                        <big><%= makeLinkOut( $id ) %></big> 
     
    167217 
    168218 
    169 <% if( $showInputForm ) { %> 
    170 <br /> 
    171 <form action="search" method="get" name="search_form"> 
    172  
    173 <div id="bigBox" style="margin: auto; height: inherit; width: 35em;"> 
    174  
    175 <table border="0" cellpadding="0"> 
    176         <tr> 
    177                 <td> 
    178                         Search <%= $my ? "my links " : "" %><%= $searchTerm ? "again" : "" %>: <input name="q" size="30" style="padding: 3px;" maxlength="40" value="<%= str_replace( "%", " ", $searchTerm ) %>"> 
    179                 </td> 
    180                 <td align="center"> 
    181                         <input type="image" onMouseOver="btn_370.src='/img/search-on.png';" onMouseOut="btn_370.src='/img/search.png';" src="img/search.png" border="0" /> 
    182                 </td> 
    183         </tr> 
    184 </table> 
    185  
    186 <br /> 
    187 <center> 
    188 within: 
    189  
    190 <% if( $debug ) { %> 
    191  
    192 <p> 
    193 $searchTerm <%= $searchTerm %><br> 
    194 $my <%= $my %><br> 
    195 $search_only <%= $search_only %><br> 
    196  
    197 </p> 
    198  
    199 <% } %> 
    200  
    201  
    202         <label><input type="radio" name="search_only" value="links" <%= $search_only != "users" && $search_only != "folders" ? "checked" : "" %> /> links</label> 
    203         <label><input type="radio" name="search_only" value="users" <%= $search_only == "users" ? "checked" : "" %> /> users</label> 
    204         <label><input type="radio" name="search_only" value="tags" <%= $search_only == "tags" ? "checked" : "" %> /> <%= getCatsName() %></label> 
    205 <% if( $sessionUserId ) { %> 
    206         <label><input type="checkbox" name="my" <%= $my ? "checked" : "" %> /> my links only &nbsp;</label> 
    207 <% } %> 
    208 </center> 
    209  
    210 </div> 
    211  
    212 </form> 
    213  
    214 <% } %> 
     219<% %> 
    215220<br /> 
    216221<br /> 
  • feedmelinks/set-up/IM.php

    r1350 r1352  
    2626<div id="challenge"> 
    2727        <h1>Success! Your Validation Code is:</h1> 
    28         <input class="copyable" name="secret" value="<?= get_im_validation_phrase_for_user( $u ) ?>" size="22" /> 
    29         <small>Copy &amp; paste the above phrase into AIM when asked for your challenge code</small> 
     28        <input class="copyable" name="secret" value="validate me: <?= get_im_validation_phrase_for_user( $u ) ?>" size="32" /> 
     29        <small>Paste the above text into your AIM window to finish the setup process</small> 
    3030        <br /><br /><br /><br /> 
    3131        <form> 
    32                 <input type="button" class="default button" style="padding: 0.4em; font-size: 14px;" value="All done, close window" onClick="window.close();" /> 
     32                <input type="button" class="bigbutton" value="All done, close window" onClick="window.close();" /> 
    3333        </form> 
    3434</div> 
     
    5252                                        <input type="hidden" name="op" value="update-im" /> 
    5353                                        My AIM name: 
    54                                         <input type="text" name="im" size="24" value="" /> 
     54                                        <input type="text" name="im" size="24" value="<?= $im_name ?>" /> 
    5555                                        &nbsp; <input type="submit" class="default button" style="padding: 0.4em; font-size: 14px;" value="Add AIM Account" /> 
    5656                                        <br /> 
    57                                         <em>(will not be displayed publicly on the site)</em> 
     57                                        <em>(your AIM name will not be displayed publicly on the site)</em> 
    5858                                </form> 
    5959                </div> 
     60                This will connect your AIM name <b><?= $im_name ?></b> to your Feed Me Links account <b><?= $u ?></b>. 
    6061        </form> 
    6162</div> 
  • feedmelinks/style/main.css

    r1349 r1352  
    4444} 
    4545 
    46 /* for buttons: */ 
    47 .big { 
    48         padding: 0.4em; 
    49         font-size: 150%; 
    50 } 
    51  
    5246.folder_row {} 
    5347.fr { 
     
    171165        margin: 0px; 
    172166        font-size: 9px; 
     167} 
     168 
     169bigbutton, input.bigbutton { 
     170        background-color: #FF6600; 
     171        color: white; 
     172        font-family: inherit; 
     173        padding: 0.4em; 
     174        margin: 0px; 
     175        font-size: 14px;; 
    173176} 
    174177 
  • feedmelinks/testing/search.php

    r1334 r1352  
    9191                <td <%= $bg %>> 
    9292<%  
    93         $cats = getCategoriesForLinkAsHTML( $id, $u, "add-trailing-noun=1", 0 );  
     93        $cats = get_tags_as_HTML( $id, $u, "add-trailing-noun=1", 0 );  
    9494%> 
    9595                        <big><%= makeLinkOut( $id ) %></big> 
  • feedmelinks/testing/view-link.php