Changeset 1352
- Timestamp:
- 03/01/07 18:58:29 (2 years ago)
- Files:
-
- feedmelinks/.t (modified) (1 diff)
- feedmelinks/FAQ/index.php (modified) (3 diffs)
- feedmelinks/admin/disable-user.php (added)
- feedmelinks/admin/expire-old-users.php (modified) (4 diffs)
- feedmelinks/admin/index.php (modified) (1 diff)
- feedmelinks/admin/re-enable-user.php (deleted)
- feedmelinks/api/add.php (modified) (1 diff)
- feedmelinks/api/comment.php (modified) (1 diff)
- feedmelinks/api/restricted/secure-call.php (modified) (1 diff)
- feedmelinks/categorize.php (modified) (1 diff)
- feedmelinks/export (added)
- feedmelinks/export/index.php (added)
- feedmelinks/export/stevedore.php (added)
- feedmelinks/funnel.php (modified) (1 diff)
- feedmelinks/img/search-just-my-links.png (added)
- feedmelinks/modules/recent-with-times.inc.php (modified) (1 diff)
- feedmelinks/modules/utils.inc.php (modified) (17 diffs)
- feedmelinks/modules/view-link.inc.php (modified) (1 diff)
- feedmelinks/search-as-xml.php (modified) (1 diff)
- feedmelinks/search.php (modified) (3 diffs)
- feedmelinks/set-up/IM.php (modified) (2 diffs)
- feedmelinks/style/main.css (modified) (2 diffs)
- feedmelinks/testing/get_tag_name.php (added)
- feedmelinks/testing/get_tags.php (added)
- feedmelinks/testing/search.php (modified) (1 diff)
- feedmelinks/testing/view-link.php (modified) (1 diff)
- feedmelinks/user (added)
- feedmelinks/user-as-rss.php (modified) (1 diff)
- feedmelinks/user/re-enable.php (added)
- feedmelinks/user/remove-me.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/.t
r1325 r1352 1 1 <?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 ); 20 6 ?> 21 7 8 <?php 9 include( "$modules/footer.inc.php" ); 10 ?> 22 11 23 24 <?php } ?>feedmelinks/FAQ/index.php
r1350 r1352 36 36 <ol> 37 37 <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> 38 39 <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> 40 41 <li><a href="#usage_email">Can I add links via email?</a></li> 41 42 <li><a href="#q2_1">What the heck is a tag?</a></li> … … 206 207 <a href="#top">back to top</a> 207 208 </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 208 221 209 222 <div> … … 268 281 269 282 <div> 270 <a name=" q6"></a>283 <a name="export"></a> 271 284 <div class="q">Can I export my bookmarks from Feed Me Links to something else?</div> 272 285 <div class="a"> 273 Yes. we support connections via HTTP and286 Yes. 274 287 can make your links available to you as XML 275 288 over HTTP or RSS. <a href="mailto:<%= get_spamsafe_email() %>">Contact us</a> for access and feedmelinks/admin/expire-old-users.php
r1269 r1352 12 12 $qs = getQuery( "all_users" ); 13 13 $q = run_query( $qs ); 14 $ttl = 90;14 $ttl = get_num_days_allowed_idle(); 15 15 ?> 16 16 … … 30 30 return; 31 31 32 $ deadbeats = 0;32 $idlers = 0; 33 33 while( $row = mysql_fetch_assoc( $q )) { 34 34 $user = $row["userid"]; … … 37 37 if( $delta > $ttl ) { 38 38 $expired = true; 39 ++ $ deadbeats;40 disable_user( $user );39 ++ $idlers; 40 expire_user( $user ); 41 41 } else { 42 42 $expired = false; … … 56 56 57 57 </table> 58 <h1><?= $ deadbeats ?> deadbeats</h1>58 <h1><?= $idlers ?> idlers</h1> 59 59 feedmelinks/admin/index.php
r1289 r1352 34 34 <li><a href="/admin/delete-all-comments-from-spammer">delete all comments from spammer</a></li> 35 35 <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> 37 37 <li><a href="/admin/expire-old-users">expire old users</a></li> 38 38 <li><a href="/admin/snuff">snuff a user</a></li> feedmelinks/api/add.php
r1350 r1352 54 54 } 55 55 } else { 56 header('WWW-Authenticate: Basic realm="Feed Me Links XMLAPI"');56 header('WWW-Authenticate: Basic realm="Feed_Me_Links_XML_API"'); 57 57 header('HTTP/1.0 401 Unauthorized'); 58 58 echo "login first, please."; feedmelinks/api/comment.php
r580 r1352 19 19 echo "</response>"; 20 20 } else { 21 header('WWW-Authenticate: Basic realm="Feed Me Links XMLAPI"');21 header('WWW-Authenticate: Basic realm="Feed_Me_Links_XML_API"'); 22 22 header('HTTP/1.0 401 Unauthorized'); 23 23 echo "<response>login first, please. feedmelinks/api/restricted/secure-call.php
r1350 r1352 7 7 $u = $PHP_AUTH_USER ? $PHP_AUTH_USER : ( $user ? $user : $_COOKIE["c_uid"] ); 8 8 $tok = $authenticated = $_COOKIE["c_pass_token"]; 9 header( "Content-type: text/xml"); 9 10 10 11 if( $pass && $pass == getPasswdForUser( $u ) || ($tok && $tok == md5( getPasswdForUser( $u )))) { 11 12 12 13 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>"; 14 15 return; 15 16 } 16 17 17 header( "Content-type: text/xml"); 18 echo "<call>\n"; 18 echo "<rest>\n"; 19 19 echo " <request>$call($user)</request>\n"; 20 20 echo " <response>" . call_user_func( $call, $user ) . "</response>\n"; 21 echo "</ call>";21 echo "</rest>"; 22 22 23 if( $error ) {24 Header("HTTP/1.0 404 Not Found");25 echo $error;26 }27 23 } else { 28 header('WWW-Authenticate: Basic realm="Feed Me Links XMLAPI"');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>"; 31 27 } 32 28 ?> feedmelinks/categorize.php
r1334 r1352 100 100 $url = $li['url']; 101 101 102 $rawCats = get CategoriesForLink( $id, $u );102 $rawCats = get_tag_IDs( $id, $u ); 103 103 if( $debug ) { 104 104 print "rawCats:<br />"; feedmelinks/funnel.php
r1178 r1352 50 50 $url = $li['url']; 51 51 52 $rawCats = get CategoriesForLink( $id, $u );52 $rawCats = get_tag_IDs( $id, $u ); 53 53 if( $debug ) { 54 54 print "rawCats:<br />"; feedmelinks/modules/recent-with-times.inc.php
r1331 r1352 148 148 <%= $i == 0 ? getCommentCSS() : "" %> 149 149 <%= getCommentsForLink( $id, "nobody", $debug ) %> 150 <% $cats = get CategoriesForLinkAsRss( $id, "nobody", "add-trailing-noun=1", 0 ); %>150 <% $cats = get_tag_IDs( $id, "nobody", "add-trailing-noun=1", 0 ); %> 151 151 ]]></content:encoded> 152 152 <dc:subject><%= $cats ? "$cats" : "(" . getUnCattedName() . ")" %></dc:subject> feedmelinks/modules/utils.inc.php
r1350 r1352 6 6 include_once( "env.inc.php" ); 7 7 include( get_root() . "/modules/prep-cache.inc.php" ); 8 9 # user status constants 10 define( "ACTIVE", 0 ); 11 define( "IDLENESS", 1 ); 12 define( "SPAMMING", 2 ); 13 14 function 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 27 function 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 40 function 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 55 function encode_url_for_xml( $url ) { 56 $pieces = explode("?", $url); 57 return count( $pieces ) > 1 ? $pieces[0] . "?" . preg_replace( "/_FML_AMP_/", "&", preg_replace( "/_FML_EQUALS_/", "=", urlencode( preg_replace( "/&/", "_FML_AMP_", preg_replace( "/=/", "_FML_EQUALS_", $pieces[1] ))))) : $url; 58 } 59 60 function 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 66 function 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 73 EOT; 74 } 75 76 function export_as_html( $u, $select ) { 77 return "<ul>\n" . export( $u, "html", $select ) . "</ul>"; 78 } 79 80 function render_as_html ( $u, $id, $url, $name, $createDate ) { 81 return " <li>not yet implemented</li>\n"; 82 } 83 84 function 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( '/"/', "&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 118 function h1( $s ) { echo "<h1>$s</h1>"; } 119 function h2( $s ) { echo "<h2>$s</h2>"; } 120 function h3( $s ) { echo "<h3>$s</h3>"; } 8 121 9 122 function is_im_account_known( $im_name ) { … … 234 347 235 348 function re_enable_user( $u ) { 349 notify_returning( $u ); 236 350 return( get_simple_rs( getQuery( "re-enable_user", $u ))); 237 351 } … … 265 379 266 380 function 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()); 268 382 } 269 383 … … 316 430 function enable_user( $user ) { 317 431 $q = run_query( getQuery( "enable_user", $user )); 318 return "success "; # FIXME: replace with a real status432 return "success: re-enabled user $user"; 319 433 } 320 434 321 435 function 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 446 function 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"; 325 451 } 326 452 … … 435 561 } 436 562 563 function get_num_days_allowed_idle() { 564 return 90; # FIXME: move into server config 565 } 566 567 function notify_expired( $u ) { 568 $site = "http://" . get_domain(); 569 $body = "Hello, $u. 570 571 It 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 573 Because 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 575 To 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 581 Sorry 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 591 function notify_expiring_soon( $u ) { 592 $site = get_site(); 593 $body = "Hi $u, and thanks for trying Feed Me Links. 594 595 We've noticed you haven't been using your Feed Me Links account very much. 596 Maybe you've been busy -- we understand. We hope you'll give Feed Me 597 Links another try. We've been working on some cool improvements to the 598 site and we'd love to show them to you. You can read about what's new on 599 the blog at http://blog.feedmelinks.com, or just log in: 600 601 $site/login 602 603 To keep the site fresh, we normally expire unused accounts after 90 604 days of inactivity, which for you will be in about a week. Don't worry: if 605 you don't respond, your links and tags and peeps will NOT be deleted -- 606 we simply freeze your password to keep your account safe from potential 607 hackers or spammers. 608 609 To ensure that your account stays active, simply log in ($site/login) 610 and link something, and your account will remain active as it is. 611 612 If decide you'd rather leave Feed Me Links behind (sad!), we can help 613 you to export your links (to use elsewhere), or, if you like,completely 614 remove 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 620 We hope you'll give Feed Me Links another try. Either way, thanks for signing up! 621 622 Sincerely, 623 624 -- 625 626 John Manoogian III 627 Feed Me Links 628 www.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 639 function 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 643 You can start using Feed Me Links immediately; your current account password is: " . getPasswdForUser( $u ) ." 644 If you would like to re-set your account password, just click here: $site/account 645 646 Thanks, 647 648 -- 649 650 The 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 437 659 function notify_added_as_peep( $u, $by ) { 438 660 $body = "Hi, $u. … … 451 673 $headers = get_mail_headers(); 452 674 $to = getEmailAddressForUser( $u ); 453 454 675 $success = mail( $to, "Someone has added you as a contact", $body, $headers); 455 676 if( $success ) … … 1369 1590 $user = $row["userid"]; 1370 1591 $users[$user] ++; 1371 #echo "user: |" . $user . "| ";1372 #echo "(" . $users[$user] . ") ";1373 1374 1592 if( $users[$user] < $links_per_user ) { 1375 1376 1593 $name = urldecode( $row["name"] ); 1377 1594 $name = preg_replace( '/("|&quot;)/', '"', $name ); 1378 1595 $name = preg_replace( '/&/', '&', $name ); 1379 1380 ob_start(); 1596 ob_start(); 1381 1597 ?> 1382 1598 … … 2108 2324 } else if( $argWhichQuery == "disable_user" ) { 2109 2325 return " 2110 UPDATE users SET disabled = 1WHERE userid = '" . urlencode($args[1]) . "';";2326 UPDATE users SET disabled = " . $args[2] . " WHERE userid = '" . urlencode($args[1]) . "';"; 2111 2327 2112 2328 } else if( $argWhichQuery == "snuff_pass" ) { … … 3527 3743 } 3528 3744 3745 # deprecated, use get_tag_name 3529 3746 function getNameForFolder( $argId ) { 3530 if( $argId != "unfiled" ) 3531 return urldecode( getFieldForFolder( $argId, "name" ) ); 3747 return get_tag_name( $argId ); 3748 } 3749 3750 function get_tag_name( $id ) { 3751 if( $id != "unfiled" ) 3752 return urldecode( getFieldForFolder( $id, "name" ) ); 3532 3753 else 3533 return $ argId;3754 return $id; 3534 3755 } 3535 3756 … … 3589 3810 } 3590 3811 3591 function getCategoriesForLink( $argId, $argUserId ) { 3812 function get_tag_names( $argId, $argUserId ) { 3813 return get_tag_IDs( $argId, $argUserId, true ); 3814 } 3815 3816 function get_tag_IDs( $argId, $argUserId, $as_names ) { 3817 $type = $as_names ? "as_names" : "as_IDs"; 3592 3818 if( $argId ) { 3593 3819 if( $debug ) { 3594 3820 print "<br />"; 3595 echo "get CategoriesForLink($argId, $argUserId) called<br />";3821 echo "get_tag_IDs($argId, $argUserId) called<br />"; 3596 3822 } 3597 3823 if( getOwnerForLink( $argId ) == $argUserId || ! isPrivate( $argId ) ) { 3598 $con_get CategoriesForLink= mysql_connect();3824 $con_get_tag_IDs = mysql_connect(); 3599 3825 mysql_selectdb( getDBName() ); 3600 3826 $qs = "SELECT tagID FROM links_tags_xref WHERE linkID = $argId"; 3601 3827 $q = mysql_query( $qs ); 3602 3828 if( $debug ) 3603 echo "get CategoriesForLink: qs : $qs<br />";3829 echo "get_tag_IDs: qs : $qs<br />"; 3604 3830 if( $q ) 3605 3831 $numRows = mysql_num_rows($q); 3606 3832 else if( $debug ) 3607 echo "get CategoriesForLink: DB call failed!<br >";3833 echo "get_tag_IDs: DB call failed!<br >"; 3608 3834 3609 3835 $cats = Array(); 3610 3836 for( $i = 0; $i < $numRows; $i++ ) { 3611 3837 if( $debug ) 3612 echo "get CategoriesForLink: found category " . mysql_result($q,$i,"tagID") . "<br />";3838 echo "get_tag_IDs: found category " . mysql_result($q,$i,"tagID") . "<br />"; 3613 3839 if( canSeeCategory( mysql_result($q,$i,"tagID"), $argUserId )) { 3614 3840 if( $debug ) 3615 3841 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)); 3617 3847 } else { 3618 3848 if( $debug ) … … 3621 3851 } 3622 3852 if( $debug ) { 3623 echo "get CategoriesForLink: found " . count( $cats ) . " cats<br />";3853 echo "get_tag_IDs: found " . count( $cats ) . " cats<br />"; 3624 3854 print_r( $cats ); 3625 3855 print "<br />"; … … 3627 3857 } 3628 3858 } else { 3629 echo "get CategoriesForLink: permissions issue: $argUserId can't touch $argId<br />";3630 } 3631 conClose( $con_get CategoriesForLink);3859 echo "get_tag_IDs: permissions issue: $argUserId can't touch $argId<br />"; 3860 } 3861 conClose( $con_get_tag_IDs ); 3632 3862 if( sizeof( $cats )) { 3633 3863 return $cats; … … 3638 3868 } 3639 3869 3640 function get CategoriesForLinkAsString( $argId, $argUserId ) {3870 function get_tag_IDs_as_string( $argId, $argUserId ) { 3641 3871 if( $argId && $argUserId ) { 3642 3872 return( implode( ", ", getCategoriesForLink( $argId ))); … … 3644 3874 } 3645 3875 3646 function getShortCategoriesForLinkAsHTML( $argId, $argUserId ) {3647 return getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, 0, 0, 0 );3876 function getShortCategoriesForLinkAsHTML( $argId, $argUserId, $no_prefix ) { 3877 return getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, 0, 0, 0, $no_prefix ); 3648 3878 } 3649 3879 3650 3880 function getCategoriesForLinkAsRss( $argId, $argUserId, $showNoun, $showChange ) { 3651 $cats = get CategoriesForLinkAsHTML( $argId, $argUserId, $showNoun, $showChange );3881 $cats = get_tags_as_HTML( $argId, $argUserId, $showNoun, $showChange ); 3652 3882 $cats = preg_replace( "/^in /", "", $cats ); 3653 3883 $cats = preg_replace( "/^$/", "", $cats ); # kill newlines … … 3657 3887 } 3658 3888 3659 function get CategoriesForLinkAsHTML( $argId, $argUserId, $showNoun, $showChange ) {3889 function get_tags_as_HTML( $argId, $argUserId, $showNoun, $showChange ) { 3660 3890 return getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, $showNoun, $showChange, 1 ); 3661 3891 } 3662 3892 3663 function getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, $showNoun, $showChange, $showPreposition ) {3893 function getCategoriesForLinkAsHTMLDriver( $argId, $argUserId, $showNoun, $showChange, $showPreposition, $no_prefix ) { 3664 3894 if( $argId ) { 3665 $cats = get CategoriesForLink( $argId, $argUserId );3895 $cats = get_tag_IDs( $argId, $argUserId ); 3666 3896 $s = ""; 3667 3897 … … 3683 3913 ? (!$owned 3684 3914 ? ("Tagged with: " . getUserLink( $owner ) . "'s ") 3685 : "Tagged with: ")3915 : ($no_prefix ? "" : "Tagged with: ") ) 3686 3916 : "") . $s . $noun . ($owned 3687 3917 ? ($showChange … … 4087 4317 function formatAsSimpleDate( $ts ) { 4088 4318 return preg_replace( "/T.*$/", "", formatAsDCDate( $ts )); 4319 } 4320 4321 function format_mysql_date_as_DC_date( $d ) { 4322 return preg_replace( "/ /", "T", $d ) . "Z"; 4089 4323 } 4090 4324 feedmelinks/modules/view-link.inc.php
r1342 r1352 100 100 $createDate != "today" && $createDate != "yesterday" ? " on" : "," %> <%= $createDate %>. 101 101 102 <%= get CategoriesForLinkAsHTML( $l, $u, $add_trailing_noun = false, 1 ) %>102 <%= get_tags_as_HTML( $l, $u, $add_trailing_noun = false, 1 ) %> 103 103 104 104 <% feedmelinks/search-as-xml.php
r1334 r1352 65 65 <link> 66 66 <% 67 $cats = get CategoriesForLinkAsHTML( $id, $u, "add-trailing-noun=1", 0 );67 $cats = get_tags_as_HTML( $id, $u, "add-trailing-noun=1", 0 ); 68 68 69 69 $name = preg_replace( "/'/", "'", $name ); feedmelinks/search.php
r1334 r1352 59 59 <td class="header"> 60 60 <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 <% 68 if( $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> 84 within: 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 </label> 103 <% } %> 104 </center> 105 106 </div> 107 108 </form> 109 110 <% } %> 111 62 112 </td> 63 113 </tr> … … 85 135 <td <%= $bg %>> 86 136 <% 87 $cats = get CategoriesForLinkAsHTML( $id, $u, "add-trailing-noun=1", 0 );137 $cats = get_tags_as_HTML( $id, $u, "add-trailing-noun=1", 0 ); 88 138 %> 89 139 <big><%= makeLinkOut( $id ) %></big> … … 167 217 168 218 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 </label> 207 <% } %> 208 </center> 209 210 </div> 211 212 </form> 213 214 <% } %> 219 <% %> 215 220 <br /> 216 221 <br /> feedmelinks/set-up/IM.php
r1350 r1352 26 26 <div id="challenge"> 27 27 <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 & 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> 30 30 <br /><br /><br /><br /> 31 31 <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();" /> 33 33 </form> 34 34 </div> … … 52 52 <input type="hidden" name="op" value="update-im" /> 53 53 My AIM name: 54 <input type="text" name="im" size="24" value=" " />54 <input type="text" name="im" size="24" value="<?= $im_name ?>" /> 55 55 <input type="submit" class="default button" style="padding: 0.4em; font-size: 14px;" value="Add AIM Account" /> 56 56 <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> 58 58 </form> 59 59 </div> 60 This will connect your AIM name <b><?= $im_name ?></b> to your Feed Me Links account <b><?= $u ?></b>. 60 61 </form> 61 62 </div> feedmelinks/style/main.css
r1349 r1352 44 44 } 45 45 46 /* for buttons: */47 .big {48 padding: 0.4em;49 font-size: 150%;50 }51 52 46 .folder_row {} 53 47 .fr { … … 171 165 margin: 0px; 172 166 font-size: 9px; 167 } 168 169 bigbutton, input.bigbutton { 170 background-color: #FF6600; 171 color: white; 172 font-family: inherit; 173 padding: 0.4em; 174 margin: 0px; 175 font-size: 14px;; 173 176 } 174 177 feedmelinks/testing/search.php
r1334 r1352 91 91 <td <%= $bg %>> 92 92 <% 93 $cats = get CategoriesForLinkAsHTML( $id, $u, "add-trailing-noun=1", 0 );93 $cats = get_tags_as_HTML( $id, $u, "add-trailing-noun=1", 0 ); 94 94 %> 95 95 <big><%= makeLinkOut( $id ) %></big> feedmelinks/testing/view-link.php