Changeset 1272
- Timestamp:
- 12/03/06 23:16:37 (2 years ago)
- Files:
-
- feedmelinks/contacts/feed.php (added)
- feedmelinks/edit-folder.php (modified) (3 diffs)
- feedmelinks/modules/header.inc.php (modified) (7 diffs)
- feedmelinks/modules/utils.inc.php (modified) (1 diff)
- feedmelinks/style/new-portal.css (modified) (1 diff)
- feedmelinks/testing/peeps-feed.php (added)
- feedmelinks/users.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/edit-folder.php
r1205 r1272 24 24 25 25 if( $op == "edit" ) { 26 $mesg = " editing " . getCatName() . " ";26 $mesg = "Editing " . getCatName() . " "; 27 27 $folderID = $id; 28 $buttonMesg = " save";28 $buttonMesg = "Save it!"; 29 29 $folderToEdit = $name; 30 30 } else if( $op == "commitEdit" ) { … … 213 213 } 214 214 %> 215 editing <%= getCatName() %> '<%= makeFolderLinkSimple( $id ) %>' 215 <h2>Editing <%= getCatName() %> '<%= makeFolderLinkSimple( $id ) %>'</h2> 216 216 <% } else { %> 217 217 <%= $mesg %> 218 218 <% } %></b> 219 219 <br /> 220 <img src="/img/dk-gray.gif" height="1" width="250" />221 <br />222 <br />223 220 224 221 <%= $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> 226 225 <% if( $op == "edit" ) { %> 227 226 <input type="hidden" name="id" value="<%= $folderID %>" /> 228 227 <input type="hidden" name="op" value="commitEdit" /> 229 <br /> 228 <p /> 229 230 230 <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" : "" %> /> 241 233 </label> 234 242 235 <% } else { %> 243 236 <input type="hidden" name="op" value="createGroup" /> … … 248 241 <% } %> 249 242 <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 %>" /> 251 245 </p> 252 246 <br /> feedmelinks/modules/header.inc.php
r952 r1272 1 < %1 <?php 2 2 # $Id$ 3 3 include_once( "$modules/utils.inc.php" ); … … 9 9 $site = getSiteUrl(); 10 10 if( ! $noBoiler ) { 11 %>11 ?> 12 12 <!DOCTYPE html 13 13 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 14 14 "http://www.w3.org/TR/html4/loose.dtd"> 15 < % } %>15 <?php } ?> 16 16 <html> 17 17 <head> … … 23 23 <link rel="stylesheet" type="text/css" href="/style/new-portal.css"> 24 24 <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"> 26 26 27 27 <meta name="description" content="And You Will Know Us By Our Trail of Links"> … … 32 32 <meta name="DC.title" content="Feed Me Links!"> 33 33 34 < %34 <?php 35 35 if( ! $noJS ) 36 36 include_once( "$modules/scripts.inc.php" ); … … 44 44 include_once( "$modules/track.inc.php" ); 45 45 if( ! $noFAJAX ) { 46 %>46 ?> 47 47 <script language="javascript" src="script/fajax.js"></script> 48 48 <script language="javascript"> … … 50 50 fml.tok = "<%= $tok %>"; 51 51 </script> 52 < %52 <?php 53 53 } 54 54 if( ! $noHead ) … … 58 58 if( ! $noMenu ) 59 59 include( "$modules/menu.inc.php" ); 60 %>60 ?> 61 61 feedmelinks/modules/utils.inc.php
r1271 r1272 1006 1006 function get_recent_for_user_footer_cb() { return "<a href='/u/" . func_get_arg( 0 ) . "'>See more of " . func_get_arg( 0 ) . "'s links...</a>"; } 1007 1007 1008 function get_feed_key( $user ) { 1009 return md5( get_salt() . $user ); 1010 } 1011 1012 function get_peeps_feed_url( $user ) { 1013 return "/contacts/feed?user=$user&key=" . get_feed_key( $user ); 1014 } 1015 1016 function 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 1008 1037 function get_contacts_links_rss( $users, $links_per_user ) { 1009 1038 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;)/', '"', $name ); 1070 $name = preg_replace( '/&/', '&', $name ); 1071 1072 ob_start(); 1073 ?> 1021 1074 1022 1075 <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> 1036 1083 </item> 1037 </channel> 1038 <% 1039 } 1084 <?php 1085 $result .= ob_get_clean(); 1086 1087 1088 } 1089 } 1090 } 1091 1092 return $result; 1093 } 1094 1095 function 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>jm3@codeswami.com</managingEditor> 1111 <webMaster>jm3@codeswami.com</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(); 1040 1127 } 1041 1128 feedmelinks/style/new-portal.css
r1188 r1272 13 13 } 14 14 input[type=button][disabled], input[type=submit][disabled], 15 input[type=reset][disabled] {15 .cancel, input[type=reset][disabled] { 16 16 background: #f6f6f6; 17 17 border-style: solid; feedmelinks/users.php
r1267 r1272 156 156 $users = get_someone_elses_contacts( $who ); 157 157 %> 158 <link rel="alternate" type="application/rss+xml" title="<%= $who == $u ? "Your" : $userId . "'s" %> Recent Links" href="<?= getSiteUrl() ?>/u/r/<%= $userId %>"> 159 158 160 <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 ?> 159 176 <%= get_contactlist_grid( $users, get_ownoun() . " peeps", $who ) %> 160 177 </div> … … 171 188 <p style="margin-bottom: 0px;"> 172 189 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>. 175 191 <small>(<a href="http://feedmelinks.com/help/including-feeds">What's RSS?</a>)</small> 176 192 </p>