Changeset 1272

Show
Ignore:
Timestamp:
12/03/06 23:16:37 (2 years ago)
Author:
jm3
Message:

new peeps feeds, general RSS cleanup.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/edit-folder.php

    r1205 r1272  
    2424 
    2525                if( $op == "edit" ) { 
    26                         $mesg = "editing " . getCatName() . " "; 
     26                        $mesg = "Editing " . getCatName() . " "; 
    2727                        $folderID = $id; 
    28                         $buttonMesg = "save"; 
     28                        $buttonMesg = "Save it!"; 
    2929                        $folderToEdit = $name; 
    3030                } else if( $op == "commitEdit" ) { 
     
    213213                } 
    214214%> 
    215 editing <%= getCatName() %> '<%= makeFolderLinkSimple( $id ) %>' 
     215<h2>Editing <%= getCatName() %> '<%= makeFolderLinkSimple( $id ) %>'</h2> 
    216216<% } else { %> 
    217217        <%= $mesg %> 
    218218<% } %></b> 
    219219        <br /> 
    220         <img src="/img/dk-gray.gif" height="1" width="250" /> 
    221         <br /> 
    222         <br /> 
    223220         
    224221        <%= $debug ? "editing " . getCatName() . " \"$folderToEdit\" (id# $folderID)<br><br>" : "" %> 
    225         <%= getCatName() %> name: <input name="name" size="25" value="<%= makePrettyFolderName( $folderToEdit ) %>" type="text" /> 
     222        <label> 
     223                <%= ucfirst( getCatName()) %> name: <input name="name" size="25" value="<%= makePrettyFolderName( $folderToEdit ) %>" type="text" /> 
     224        </label> 
    226225        <% if( $op == "edit" ) { %> 
    227226                <input type="hidden" name="id" value="<%= $folderID %>" /> 
    228227                <input type="hidden" name="op" value="commitEdit" /> 
    229                 <br /> 
     228                <p />    
     229 
    230230                <label> 
    231                         <table border="0"> 
    232                                 <tr> 
    233                                         <td valign="center"> 
    234                                                 <input type="checkbox" name="isPrivate" <%= $isPrivate ? "checked" : "" %> /> 
    235                                         </td> 
    236                                         <td valign="center"> 
    237                                                 private 
    238                                         </td> 
    239                                 </tr> 
    240                         </table> 
     231                        Make this tag Private: 
     232                        <input type="checkbox" name="isPrivate" <%= $isPrivate ? "checked" : "" %> /> 
    241233                </label> 
     234 
    242235        <% } else {  %> 
    243236                <input type="hidden" name="op" value="createGroup" /> 
     
    248241        <% } %> 
    249242        <p style="text-align: right;"> 
    250         <input type="submit" value="<%= $buttonMesg %>" /> 
     243        <input type="button" onClick="javascript:history.go( -1 );" class="button" style="background-color: #bbbbbb; padding: 1.0em;" value="Cancel" /> 
     244        <input type="submit" class="default button" style="padding: 1.0em;" value="<%= $buttonMesg %>" /> 
    251245        </p> 
    252246<br /> 
  • feedmelinks/modules/header.inc.php

    r952 r1272  
    1 <% 
     1<?php 
    22  # $Id$ 
    33        include_once( "$modules/utils.inc.php" ); 
     
    99        $site = getSiteUrl(); 
    1010        if( ! $noBoiler ) { 
    11 %
     11?
    1212<!DOCTYPE html 
    1313        PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
    1414         "http://www.w3.org/TR/html4/loose.dtd"> 
    15 <% } %
     15<?php } ?
    1616<html> 
    1717<head> 
     
    2323        <link rel="stylesheet" type="text/css" href="/style/new-portal.css"> 
    2424        <link rel="stylesheet" type="text/css" href="/style/notebox.css"> 
    25         <link rel="alternate" type="application/rss+xml" title="RSS Feed for Feed Me Links" href="rss"> 
     25        <link rel="alternate" type="application/rss+xml" title="Feed Me Links" href="<?= $site ?>/rss"> 
    2626 
    2727        <meta name="description" content="And You Will Know Us By Our Trail of Links"> 
     
    3232        <meta name="DC.title" content="Feed Me Links!"> 
    3333 
    34 <% 
     34<?php 
    3535        if( ! $noJS ) 
    3636                include_once( "$modules/scripts.inc.php" ); 
     
    4444                include_once( "$modules/track.inc.php" ); 
    4545  if( ! $noFAJAX ) { 
    46 %
     46?
    4747        <script language="javascript" src="script/fajax.js"></script> 
    4848        <script language="javascript"> 
     
    5050                fml.tok  = "<%= $tok %>"; 
    5151        </script> 
    52 <% 
     52<?php 
    5353        } 
    5454  if( ! $noHead ) 
     
    5858        if( ! $noMenu ) 
    5959                include( "$modules/menu.inc.php" );  
    60 %
     60?
    6161 
  • feedmelinks/modules/utils.inc.php

    r1271 r1272  
    10061006function get_recent_for_user_footer_cb() { return "<a href='/u/" . func_get_arg( 0 ) . "'>See more of " . func_get_arg( 0 ) . "'s links...</a>";  } 
    10071007 
     1008function get_feed_key( $user ) { 
     1009        return md5( get_salt() . $user ); 
     1010} 
     1011 
     1012function get_peeps_feed_url( $user ) { 
     1013        return "/contacts/feed?user=$user&key=" . get_feed_key( $user ); 
     1014} 
     1015 
     1016function get_peeps_feed( $user, $user_key ) { 
     1017        #echo "<br>"; 
     1018        #echo "user is: $user<br>"; 
     1019        #echo "user_key is: $user_key<br>"; 
     1020        #echo "get_feed_key($user)  is: " . get_feed_key( $user ) . "<br>"; 
     1021        #echo "<br>"; 
     1022        $users = get_someone_elses_contacts( $user ); 
     1023        #print_r( $users ); 
     1024        #echo "<br>"; 
     1025        if( ! $user || $user_key != get_feed_key( $user )) { 
     1026                echo "no user or invalid key."; 
     1027                return; 
     1028                exit; 
     1029        } 
     1030 
     1031        #echo "no done yet!!!<br>"; 
     1032        $users = get_someone_elses_contacts( $user ); 
     1033        Header( "Content-type: Text/XML" ); 
     1034        echo get_rss_feed( get_contacts_links_rss( $users, 5 )); 
     1035} 
     1036 
    10081037function get_contacts_links_rss( $users, $links_per_user ) { 
    10091038 
    1010   #ksort($users); 
    1011   foreach ($users as $user => $junk) { 
    1012     echo "\n$user"; 
    1013   } 
    1014  
    1015 return; 
    1016  
    1017  
    1018   $n = 3; # FIXME: number of users 
    1019   for( $i = 0; $i < $n; $i++ ) { 
    1020 %> 
     1039        # first make sure we have users and that we have less than say 100 users 
     1040        # then build a query 
     1041        # we have two choices:  
     1042        # 1 per user, or last  
     1043        # how many (subject to overruns, but more current) 
     1044        # run it and let the DB sort it by date; 
     1045         
     1046        # STRICT NUM_USERS MOST RECENT 
     1047        $c = 0; 
     1048        $qs = "SELECT ID, name, submitter, url, lastMod FROM links WHERE ("; 
     1049        foreach( $users as $user => $junk ) { 
     1050                $qs .= "submitter = '" . urlencode( $user ) . "'"; 
     1051                $c++; 
     1052                if( $c < sizeof( $users )) 
     1053                        $qs .= " OR "; 
     1054        } 
     1055        $qs .= ") AND isPrivate is NULL ORDER BY lastMod DESC LIMIT " . ($links_per_user * sizeof( $users )); 
     1056 
     1057        $q = run_query( $qs ); 
     1058        $result = ""; 
     1059  if( $q && mysql_num_rows($q) ) { 
     1060    while( $row = mysql_fetch_assoc( $q )) { 
     1061                        $user = $row["submitter"]; 
     1062      $users[$user] ++; 
     1063      #echo "user: |" . $user . "| "; 
     1064      #echo "(" . $users[$user] . ") "; 
     1065 
     1066      if( $users[$user] < $links_per_user ) { 
     1067 
     1068                        $name = urldecode( $row["name"] ); 
     1069                        $name = preg_replace( '/(&quot;|&amp;quot;)/', '"', $name ); 
     1070                        $name = preg_replace( '/&/', '&amp;', $name ); 
     1071 
     1072  ob_start(); 
     1073?> 
    10211074 
    10221075    <item> 
    1023       <title>LINK_TITLE</title> 
    1024       <link>LINK_URL</link> 
    1025       <description>added by: LINK_USERNAME</description> 
    1026       <guid isPermaLink="true">http://LINK_URL</guid> 
    1027       <content:encoded> 
    1028         LINK_DESCRIPTION 
    1029       </content:encoded> 
    1030       <dc:subject> 
    1031         Tagged with:  
    1032           <a rel="tag" href="LINK_TAG_URL_1">LINK_TAG_NAME_1</a> 
    1033           <a rel="tag" href="LINK_TAG_URL_2">LINK_TAG_NAME_2</a> 
    1034       </dc:subject> 
    1035       <dc:date>LINK_DC_DATE</dc:date> 
     1076      <title><?= $user ?>: <?= $name ?></title> 
     1077      <link>http://feedmelinks.com/t/<?= $row["ID"] ?></link> 
     1078      <description>added by <?= $user ?></description> 
     1079      <guid isPermaLink="true">http://feedmelinks.com/<?= $row["ID"] ?></guid> 
     1080      <content:encoded><?= $user . ": " . urldecode( $name ) ?></content:encoded> 
     1081      <dc:subject>http://feedmelinks.com/t/<?= $row["ID"] ?></dc:subject> 
     1082      <dc:date><?= formatTS( $row["lastMod"] ) ?></dc:date> 
    10361083      </item> 
    1037     </channel> 
    1038 <% 
    1039   } 
     1084<?php 
     1085  $result .= ob_get_clean(); 
     1086 
     1087 
     1088                        } 
     1089                } 
     1090        } 
     1091 
     1092  return $result; 
     1093
     1094 
     1095function get_rss_feed( $s ) { 
     1096        $x = '<' . '?xml version="1.0" encoding="UTF-8" standalone="no" ?>' . "\n"; 
     1097  ob_start(); 
     1098?><?= $x ?> 
     1099<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"  
     1100"http://my.netscape.com/publish/formats/rss-0.91.dtd"> 
     1101<rss version="2.0"  
     1102        xmlns:dc="http://purl.org/dc/elements/1.1/" 
     1103        xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" 
     1104        xmlns:admin="http://webns.net/mvcb/" 
     1105        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
     1106        xmlns:content="http://purl.org/rss/1.0/modules/content/"> 
     1107  <channel> 
     1108    <title>My Peeps' Links on Feed Me Links</title> 
     1109    <description>your portable public link suitcase</description> 
     1110                <managingEditor>&#106;&#109;&#051;&#064;&#099;&#111;&#100;&#101;&#115;&#119;&#097;&#109;&#105;&#046;&#099;&#111;&#109;</managingEditor> 
     1111                <webMaster>&#106;&#109;&#051;&#064;&#099;&#111;&#100;&#101;&#115;&#119;&#097;&#109;&#105;&#046;&#099;&#111;&#109;</webMaster> 
     1112    <link>http://feedmelinks.com</link> 
     1113    <language>en-us</language> 
     1114  <image> 
     1115  <title>My Peeps' Links on Feed Me Links</title> 
     1116    <url>http://www.jm3.net/img/linkbuttons/jm3.net-linkbutton-01</url> 
     1117    <link>http://feedmelinks.com</link> 
     1118    <height>31</height> 
     1119    <width>88</width> 
     1120    <description> the land that time forgot </description> 
     1121  </image> 
     1122        <?= $s ?> 
     1123  </channel> 
     1124</rss> 
     1125<?php 
     1126  return ob_get_clean(); 
    10401127} 
    10411128 
  • feedmelinks/style/new-portal.css

    r1188 r1272  
    1313} 
    1414input[type=button][disabled], input[type=submit][disabled], 
    15 input[type=reset][disabled] { 
     15.cancel, input[type=reset][disabled] { 
    1616 background: #f6f6f6; 
    1717 border-style: solid; 
  • feedmelinks/users.php

    r1267 r1272  
    156156                $users = get_someone_elses_contacts( $who ); 
    157157%> 
     158<link rel="alternate" type="application/rss+xml" title="<%= $who == $u ? "Your" : $userId . "'s" %> Recent Links" href="<?= getSiteUrl() ?>/u/r/<%= $userId %>"> 
     159 
    158160<div style="float: right;"> 
     161<?php 
     162        if( $who == $u ) { 
     163?> 
     164                <p/> 
     165                <center> 
     166                        <b> 
     167                                New!  
     168                                Subscribe to just your peeps' links: <a href='feed://<?= getSiteUrl() .  get_peeps_feed_url( $u ) ?>'> 
     169                                <img src='/img/xml' border='0' />  Feed of my peeps' links </a> 
     170                        </b> 
     171                </center> 
     172                <link rel="alternate" type="application/rss+xml" title="Your Peeps' Recent Links" href="<?= getSiteUrl() . get_peeps_feed_url( $u ) ?>"> 
     173        <?php 
     174        } 
     175?> 
    159176<%= get_contactlist_grid( $users, get_ownoun() . " peeps", $who )  %> 
    160177</div> 
     
    171188        <p style="margin-bottom: 0px;"> 
    172189                Subscribe to a feed of <%= $userId %>'s links  
    173                 <a title="RSS 2.0" href="/u/r/<%= $userId %>" class="bevelbutton"><img src="/img/xml" alt="RSS Feed" border="0" /></a>. 
    174                 <link rel="alternate" type="application/rss+xml" title="RSS Feed of <%= $userId %>'s recent links" href="/u/r/<%= $userId %>"> 
     190                <a title="RSS 2.0" href="/u/r/<%= $userId %>" class="bevelbutton"><img src="/img/xml" alt="Recent Links on Feed Me Links" border="0" /></a>. 
    175191                <small>(<a href="http://feedmelinks.com/help/including-feeds">What's RSS?</a>)</small> 
    176192        </p>