Changeset 889
- Timestamp:
- 11/27/05 15:46:37 (3 years ago)
- Files:
-
- trunk/feedmelinks/feedmelinks/categorize.php (modified) (2 diffs)
- trunk/feedmelinks/feedmelinks/delete.php (modified) (3 diffs)
- trunk/feedmelinks/feedmelinks/edit-folder.php (modified) (5 diffs)
- trunk/feedmelinks/feedmelinks/edit.php (modified) (1 diff)
- trunk/feedmelinks/feedmelinks/folder-as-rss.php (modified) (4 diffs)
- trunk/feedmelinks/feedmelinks/folder-as-xml.php (modified) (1 diff)
- trunk/feedmelinks/feedmelinks/folder-by-tag-name.php (modified) (1 diff)
- trunk/feedmelinks/feedmelinks/folder.php (modified) (4 diffs)
- trunk/feedmelinks/feedmelinks/funnel.php (modified) (2 diffs)
- trunk/feedmelinks/feedmelinks/modules/folder-list.inc.php (modified) (1 diff)
- trunk/feedmelinks/feedmelinks/modules/folder-menu.inc.php (modified) (1 diff)
- trunk/feedmelinks/feedmelinks/modules/list-public-compact.inc.php (modified) (1 diff)
- trunk/feedmelinks/feedmelinks/modules/public.inc.php (modified) (2 diffs)
- trunk/feedmelinks/feedmelinks/modules/tag-cloud.inc.php (modified) (2 diffs)
- trunk/feedmelinks/feedmelinks/modules/utils.inc.php (modified) (20 diffs)
- trunk/feedmelinks/feedmelinks/modules/view-link.inc.php (modified) (2 diffs)
- trunk/feedmelinks/feedmelinks/script/fajax.js (modified) (7 diffs)
- trunk/feedmelinks/feedmelinks/script/fml-behaviours.js (modified) (2 diffs)
- trunk/feedmelinks/feedmelinks/search-as-xml.php (modified) (2 diffs)
- trunk/feedmelinks/feedmelinks/search.php (modified) (2 diffs)
- trunk/feedmelinks/feedmelinks/style/new-portal.css (modified) (1 diff)
- trunk/feedmelinks/feedmelinks/tag-cloud.php (modified) (1 diff)
- trunk/feedmelinks/feedmelinks/testing/ajax-tag-rename.php (modified) (2 diffs)
- trunk/feedmelinks/feedmelinks/testing/is-public-tag.php (added)
- trunk/feedmelinks/feedmelinks/testing/layout.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/feedmelinks/feedmelinks/categorize.php
r823 r889 194 194 while( $count < $numRows ) { 195 195 $idx = $catsRendered; # $i*$rows+$j; 196 $id = mysql_result($q, $idx, "ID");197 $ options = mysql_result($q, $idx, "options");196 $id = mysql_result($q, $idx, "ID"); 197 $isPrivate = mysql_result($q, $idx, "isPrivate"); 198 198 $catName = makeSafeName( mysql_result($q, $idx, "name")); 199 199 $public = 0; 200 if( isPublic( $catName )) {200 if( ! $isPrivate ) { 201 201 $catName = makePrettyFolderName( $catName ); 202 202 ++$public; 203 203 } 204 $categories[$count] = array( $catName, $options, $id, $public );204 $categories[$count] = array( $catName, "", $id, $public ); 205 205 $catsRendered++; 206 206 $count++; … … 250 250 $idx = $catsRendered; # $i*$rows+$j; 251 251 $id = $category[2]; 252 $options = $category[1];253 252 $catName = $category[0]; 254 253 $public = $category[3]; trunk/feedmelinks/feedmelinks/delete.php
r559 r889 45 45 $numRows2 = mysql_num_rows($q2); 46 46 if( $numRows2 ) { 47 $folder = urldecode( mysql_result($q2,0,"name")); 48 $folderID = urldecode( mysql_result($q2,0,"ID")); 47 $tag = urldecode( mysql_result($q2,0,"name")); 48 $tagID = urldecode( mysql_result($q2,0,"ID")); 49 $isPrivate = urldecode( mysql_result($q2,0,"isPrivate")); 49 50 } 50 51 } else 51 $ folder= "unnamed";52 $tag = "unnamed"; 52 53 $public = 0; 53 if( isPublic( $folder )) {54 $ folder = makePrettyFolderName( $folder);54 if( ! $isPrivate ) { 55 $tag = makePrettyFolderName( $tag ); 55 56 ++$public; 56 57 } … … 66 67 %> 67 68 <form action="index"> 68 <input type="hidden" name="folder" value="<%= $ folderID %>" />69 <input type="hidden" name="folder" value="<%= $tagID %>" /> 69 70 <input type="hidden" name="from" value="popup" /> 70 71 <div class="attention"> … … 73 74 74 75 <p> 75 <input type="button" value="Delete" class="default button" onClick="location.replace( '/index?op=delete&id=<%= $id %>&folder=<%= urlencode( $ folder) %>');" />76 <input type="button" value="Delete" class="default button" onClick="location.replace( '/index?op=delete&id=<%= $id %>&folder=<%= urlencode( $tag ) %>');" /> 76 77 <input type="button" value="Cancel" class="default button" onClick="javascript:window.close();" /> 77 78 trunk/feedmelinks/feedmelinks/edit-folder.php
r881 r889 33 33 echo "<br />DEBUG: saving \"$name\", id $id<br />"; 34 34 35 $name = $isPrivate ? $name : makePublicFolderName( $name );36 35 $name = urlencode( $name ); 37 $qs = "UPDATE linksGroups SET name = '$name' WHERE id = $id AND userid = '$u'"; 36 $isPrivate = $isPrivate ? 1 : "NULL"; 37 $qs = "UPDATE linksGroups SET name = '$name', isPrivate = $isPrivate WHERE id = $id AND userid = '$u'"; 38 38 39 39 if( $debug ) { … … 43 43 $q = mysql_query( $qs ); 44 44 if( $q ) { 45 if( $isPrivate ) {45 if( $isPrivate == 1 ) { 46 46 if( $debug ) 47 47 echo "DEBUG: the " . getCatName() . " \"$name\" is now/still private; making links private:<br/>"; … … 55 55 %> 56 56 <div class="attention"> 57 <%= getCatName() %> renamed!57 <%= getCatName() %> updated! 58 58 </div> 59 59 <% … … 61 61 echo bounceTo( "/index" ); 62 62 } 63 } else 64 echo "fail!"; 63 } else { 64 echo "$qs fail!"; 65 } 65 66 } else if( $op == "confirmDelete" ) { 66 67 $shouldShowCreateEditForm = 0; … … 273 274 $links = array(); 274 275 while ($i < $numRows) { 275 $id = mysql_result($q,$i,"ID");276 $ options = mysql_result($q,$i,"options");277 $name = makeSafeName( mysql_result($q,$i,"name"));276 $id = mysql_result($q,$i,"ID"); 277 $isPrivate = mysql_result($q,$i,"isPrivate"); 278 $name = makeSafeName( mysql_result($q,$i,"name")); 278 279 $public = 0; 279 if( isPublic( $name )) {280 if( ! $isPrivate ) { 280 281 $name = makePrettyFolderName( $name ); 281 282 ++$public; 282 283 } 283 284 $i++; 284 $links[$i] = array( $name, $id, $public, $options);285 $links[$i] = array( $name, $id, $public, "" ); 285 286 } 286 287 conClose( $con_editFolder ); trunk/feedmelinks/feedmelinks/edit.php
r874 r889 50 50 $folder = urldecode( mysql_result($q2,0,"name")); 51 51 $folderID = urldecode( mysql_result($q2,0,"ID")); 52 $isPrivate = urldecode( mysql_result($q2,0,"isPrivate")); 52 53 } 53 54 } else 54 55 $folder = "unnamed"; 55 56 $public = 0; 56 if( isPublic( $folder )) {57 if( ! $isPrivate ) { 57 58 $folder = makePrettyFolderName( $folder ); 58 59 ++$public; trunk/feedmelinks/feedmelinks/folder-as-rss.php
r839 r889 45 45 $singleGroupName = makeSafeName( mysql_result($q,$i,"name") ); 46 46 $owner = mysql_result($q,$i,"userid"); 47 $isPrivate = mysql_result($q,$i,"isPrivate"); 47 48 } else 48 49 $singleGroupName = "unfiled"; … … 50 51 if( $debug ) { 51 52 echo "singleGroupName: $singleGroupName<br />"; 52 if( isPublic( $singleGroupName ))53 echo "isPublic( $singleGroupName ) = true<br />";54 else55 echo "isPublic( $singleGroupName ) = false<br />";56 53 } 57 54 … … 62 59 $owned = true; 63 60 } 64 if( $owned || isPublic( $singleGroupName )) {61 if( $owned || ! $isPrivate ) { 65 62 if( $debug && $owned ) echo "owned: TRUE<br />"; 66 if( isPublic( $singleGroupName )) {63 if( ! $isPrivate ) { 67 64 $pubFolder = true; 68 65 $singleGroupName = substr( $singleGroupName, 2, strlen( $singleGroupName ) ); … … 95 92 while ($i < $numRows) { 96 93 $id = mysql_result($q,$i,"ID"); 97 $name = makeSafeName( mysql_result($q,$i,"name")); 98 if( isPublic( $name )) { 94 $isPrivate = mysql_result($q,$i,"isPrivate"); 95 $name = makeSafeName( mysql_result($q,$i,"name" )); 96 if( ! $isPrivate ) { 99 97 $groups[$id] = substr( $name, 2, strlen( $name ) ); 100 98 if( $j != 0 ) trunk/feedmelinks/feedmelinks/folder-as-xml.php
r804 r889 20 20 21 21 $raw_tag_name = urldecode( mysql_result($q,0,"t.name")); 22 $tag_privacy = urldecode( mysql_result($q,0,"t.isPrivate")); 22 23 $tag_name = makePrettyFolderName( $raw_tag_name ); 23 24 24 25 %> 25 <posts tag="<%= $tag_name %>" is-public="<%= isPublic( $raw_tag_name) ? 'true' : 'false' %>" tag-id="<%= $folder %>" user="<%= $u %>">26 <posts tag="<%= $tag_name %>" is-public="<%= (! $isPrivate) ? 'true' : 'false' %>" tag-id="<%= $folder %>" user="<%= $u %>"> 26 27 <% 27 28 $numRows = mysql_num_rows($q); trunk/feedmelinks/feedmelinks/folder-by-tag-name.php
r812 r889 22 22 23 23 # allow authenticated users to view their own private tags 24 $taglist_clause = " name = 'p/$tag' OR name = 'p%2F$tag'" . ($authed ? " OR name = '$tag'" : "");24 $taglist_clause = "isPrivate IS NULL" . ($authed ? " OR name = '$tag'" : ""); 25 25 26 26 $qs = getQuery( "tag_by_name", $user, "($taglist_clause)" ); trunk/feedmelinks/feedmelinks/folder.php
r869 r889 37 37 $fName = getNameForFolder( $id ); 38 38 if( $folder != "unfiled" ) { 39 $public = isPublic ( getNameForFolder( $id )) ? "1" : "0";39 $public = isPublicFolder( $id ) ? "1" : "0"; 40 40 $owner = getOwnerForFolder( $folder ); 41 41 if( $_internal == 1 ) { … … 97 97 $singleGroupName = "unfiled"; 98 98 99 if( $debug ) {99 if( $debug ) 100 100 echo d( "singleGroupName: $singleGroupName"); 101 if( isPublic( $singleGroupName ))102 echo d( "isPublic( $singleGroupName ) = true" );103 else104 echo d( "isPublic( $singleGroupName ) = FALSE" );105 }106 101 107 102 if( $unfiled || $q ) { … … 113 108 $owned = true; 114 109 } 115 if( $owned || isPublic( $singleGroupName )) {116 if( isPublic( $singleGroupName )) {110 if( $owned || $public ) { 111 if( $public ) { 117 112 $pubFolder = true; 118 113 $singleGroupName = substr( $singleGroupName, 2, strlen( $singleGroupName ) ); … … 167 162 while ($i < $numRows) { 168 163 $id = mysql_result($q,$i,"ID"); 164 $isPrivate = mysql_result($q,$i,"isPrivate"); 169 165 $name = makeSafeName( mysql_result($q,$i,"name")); 170 if( isPublic( $name )) {166 if( !$isPrivate ) { 171 167 $groups[$id] = substr( $name, 2, strlen( $name ) ); 172 168 if( $j != 0 ) trunk/feedmelinks/feedmelinks/funnel.php
r559 r889 159 159 $idx = $catsRendered; # $i*$rows+$j; 160 160 $id = mysql_result($q, $idx, "ID"); 161 $ options = mysql_result($q, $idx, "options");161 $isPrivate = mysql_result($q, $idx, "isPrivate"); 162 162 $catName = makeSafeName( mysql_result($q, $idx, "name")); 163 163 $public = 0; 164 if( isPublic( $catName )) {164 if( !$isPrivate ) { 165 165 $catName = makePrettyFolderName( $catName ); 166 166 ++$public; 167 167 } 168 $categories[$count] = array( $catName, $options, $id, $public );168 $categories[$count] = array( $catName, "", $id, $public ); 169 169 $catsRendered++; 170 170 $count++; … … 211 211 $idx = $catsRendered; # $i*$rows+$j; 212 212 $id = $category[2]; 213 $options = $category[1];214 213 $catName = $category[0]; 215 214 $public = $category[3]; trunk/feedmelinks/feedmelinks/modules/folder-list.inc.php
r703 r889 21 21 22 22 $id = $row["catID"]; 23 $isPrivate = $row["isPrivate"]; 23 24 $numLinks = $row["num_links"]; 24 25 $name = makeSafeName( $row["name"] ); 25 26 26 27 $public = false; 27 if( isPublic( $name )) {28 if( ! $isPrivate ) { 28 29 $name = makePrettyFolderName( $name ); 29 30 $public = true; trunk/feedmelinks/feedmelinks/modules/folder-menu.inc.php
r294 r889 20 20 while ($i < $numRows) { 21 21 $id = mysql_result($q,$i,"ID"); 22 $isPrivate = mysql_result($q,$i,"isPrivate"); 22 23 $folderName = makeSafeName( mysql_result($q,$i,"name")); 23 24 24 25 # we use our own hashtables instead of the raw DB, 25 26 # so that we can re-sort without the leading "p-slash" fucking us up.... 26 if( isPublic( $folderName )) {27 if( ! $isPrivate ) { 27 28 $folderName = makePrettyFolderName( $folderName ); 28 29 $folderName = $folderName . " (pub)"; trunk/feedmelinks/feedmelinks/modules/list-public-compact.inc.php
r379 r889 71 71 while ($i < $numRows) { 72 72 $name = makeSafeName( mysql_result($q,$i,"name")); 73 $isPublic = isPublic( $name ) ? 1 : 0; 73 $isPrivate = makeSafeName( mysql_result($q,$i,"isPrivate")); 74 $isPublic = ! $isPrivate; 74 75 if( $viewedByOwner || $isPublic ) { 75 76 $id = mysql_result($q,$i,"ID"); trunk/feedmelinks/feedmelinks/modules/public.inc.php
r441 r889 43 43 if( $q ) { 44 44 $singleGroupName = urldecode( mysql_result($q,$i,"name") ); 45 $isPrivate = mysql_result($q,$i,"isPrivate"); 45 46 if( $debug) 46 47 echo "group id $folder (named $singleGroupName) exists<br>"; 47 if( isPublic( $singleGroupName )) {48 if( ! $isPrivate ) { 48 49 $singleGroupName = substr( $singleGroupName, 2, strlen( $singleGroupName ) ); 49 50 $qs = "SELECT * FROM links WHERE groupid=$folder … … 65 66 while ($i < $numRows) { 66 67 $id = mysql_result($q,$i,"ID"); 68 $isPrivate = mysql_result($q,$i,"isPrivate"); 67 69 $name = urldecode( mysql_result($q,$i,"name")); 68 if( isPublic( $name )) {70 if( ! $isPrivate ) { 69 71 $groups[$id] = substr( $name, 2, strlen( $name ) ); 70 72 if( $j != 0 ) trunk/feedmelinks/feedmelinks/modules/tag-cloud.inc.php
r838 r889 2 2 $u == $user ? $auth = 1 : $auth = 0; 3 3 $u = $user ? $user : $u; 4 $qs_max = "SELECT count(*) as num_links, ID as catID, name FROM linksGroups, linksCategoriesXRef WHERE linksGroups.ID = linksCategoriesXRef.catID AND linksGroups.userid = '$u' GROUP BY name ORDER BY num_links DESC LIMIT 1;";4 $qs_max = "SELECT count(*) as num_links, ID as catID, name, isPrivate FROM linksGroups, linksCategoriesXRef WHERE linksGroups.ID = linksCategoriesXRef.catID AND linksGroups.userid = '$u' GROUP BY name ORDER BY num_links DESC LIMIT 1;"; 5 5 6 $qs = "SELECT count(*) as num_links, ID as catID, name FROM linksGroups, linksCategoriesXRef WHERE linksGroups.ID = linksCategoriesXRef.catID AND linksGroups.userid = '$u' GROUP BY name ORDER BY name ASC;";6 $qs = "SELECT count(*) as num_links, ID as catID, name, isPrivate FROM linksGroups, linksCategoriesXRef WHERE linksGroups.ID = linksCategoriesXRef.catID AND linksGroups.userid = '$u' GROUP BY name ORDER BY name ASC;"; 7 7 8 8 %> … … 48 48 for( $i = 0; $i < $numRows; $i++ ) { 49 49 $name = makePrettyFolderName( urldecode( mysql_result($q, $i, "name"))); 50 if( $auth || isPublic( mysql_result($q, $i, "name"))) {50 if( $auth || ! ( mysql_result($q, $i, "isPrivate"))) { 51 51 $id = mysql_result($q, $i, "catID"); 52 52 $size = floor( $min_font + ($scale * mysql_result($q, $i, "num_links"))); trunk/feedmelinks/feedmelinks/modules/utils.inc.php
r887 r889 17 17 18 18 if( $debug ) echo "DEBUG: $qs<br>"; 19 $arg = "$u, $tok, $type, $subtype, $l, $new_value, $use_xajax"; 19 20 20 21 $q = mysql_query( $qs ); … … 34 35 $objResponse = new xajaxResponse(); 35 36 if( $success ) 36 $objResponse->addScript( "update_" . $type . "_after_save( ' " . $l . "', '$safe_value' );" );37 $objResponse->addScript( "update_" . $type . "_after_save( '$safe_value' );" ); 37 38 else 38 $objResponse->addAssign( "edit-ui", "innerHTML", "holy shit, that totally fucking failed: <b>$e</b>!!!" ); 39 $objResponse->addAssign( "content-hook", "innerHTML", "Oops, we messed up: <b>$qs / $arg)</b>!!!" ); 40 #$objResponse->addAssign( "content-hook", "innerHTML", "Oops, we messed up: <b>Database $e (edit_$subtype / $qs / $arg)</b>!!!" ); 41 // FIXME: in the above else case, also unroll the edit also so the user can try again 39 42 return $objResponse->getXML(); 40 43 } else … … 367 370 "SELECT ID FROM linksGroups 368 371 WHERE 369 (name = 'linkpocket' OR name = 'p/linkpocket' OR name = 'p%2Flinkpocket')372 name = 'linkpocket' 370 373 AND userid = '$argUser';"; 371 374 $q = mysql_query( $qs ); … … 449 452 global $prof; 450 453 #if( isset( $prof )) $prof->startTimer( "print_css_folder_funcall" ); 454 455 $owned = ( $argUser == get_user() ) ? 1 : 0; 451 456 452 457 $n = $argFlipFlop ? 1 : 0; 453 458 %> 454 <% if( $ argUser == get_user()|| $argIsPub ) { %>455 456 <div class="fr r<%= $n %> ">459 <% if( $owned || $argIsPub ) { %> 460 461 <div class="fr r<%= $n %> tag"<%= $owned ? " fid='$argId'" : "" %>> 457 462 <div style="float: left;"> 458 463 <span class="subtle"><%= printLinkCount( $argNumLinks ) %> links </span> 459 464 <big><%= makeFolderLink( $argId, $argName ) %></big> 460 465 </div> 461 <% if( $ argUser == get_user()) { %>466 <% if( $owned ) { %> 462 467 <div style="float: right"> 463 468 <a href="edit-folder?op=edit&id=<%= $argId %>&name=<%= urlencode( $argIsPub ? makePublicFolderName( $argName ) : $argName) %>" title="edit <%= $argName %>"><img src="img/edit.gif" alt="edit <%= $argName %>" border="0" /></a> … … 517 522 518 523 function get_taglist_query( $argUser ) { 519 return "SELECT count(*) as num_links, ID as catID, name FROM linksGroups, linksCategoriesXRef WHERE linksGroups.ID = linksCategoriesXRef.catID AND linksGroups.userid = \"$argUser\" GROUP BY name ORDER BY num_links desc;";524 return "SELECT count(*) as num_links, ID as catID, name, isPrivate FROM linksGroups, linksCategoriesXRef WHERE linksGroups.ID = linksCategoriesXRef.catID AND linksGroups.userid = \"$argUser\" GROUP BY name ORDER BY num_links desc;"; 520 525 } 521 526 522 527 function get_category_counts_query( $argUser ) { 523 return "SELECT COUNT(*) AS num_links, lxf.catID, g.name FROM linksCategoriesXRef As lxf, linksGroups AS g WHERE g.ID = lxf.catID AND g.userid = \"$argUser\" GROUP BY catID ORDER BY g.name;";528 return "SELECT COUNT(*) AS num_links, lxf.catID, g.name, g.isPrivate FROM linksCategoriesXRef As lxf, linksGroups AS g WHERE g.ID = lxf.catID AND g.userid = \"$argUser\" GROUP BY catID ORDER BY g.name;"; 524 529 } 525 530 … … 1218 1223 UPDATE links SET url = '" . urlencode( $args[1] ) . "' WHERE ID = " . $args[2] . " AND submitter = '" . $args[3] . "'"; 1219 1224 1225 } else if( $argWhichQuery == "edit_tag" ) { 1226 return " 1227 UPDATE linksGroups SET name = '" . urlencode( $args[1] ) . "' WHERE ID = " . $args[2] . " AND userid = '" . $args[3] . "'"; 1228 1220 1229 } else if( $argWhichQuery == "edit_link_privacy" ) { 1221 1230 return " … … 1266 1275 ON linksGroups.ID = linksCategoriesXRef.catID 1267 1276 WHERE 1268 (links.isPrivate IS NULL 1269 AND 1270 (linksGroups.name LIKE 'p/%' OR linksGroups.name LIKE 'p%%F%') 1271 )"; 1277 links.isPrivate IS NULL AND linksGroups.isPrivate IS NULL 1278 "; 1272 1279 1273 1280 } … … 1946 1953 $name = urlencode( $argName ); 1947 1954 1948 $qs = "INSERT intolinksUsers values(NULL,'$userId','$email', '$password', '$name','');";1955 $qs = "INSERT INTO linksUsers values(NULL,'$userId','$email', '$password', '$name','');"; 1949 1956 1950 1957 l( "new_user: $argUserId, $argEmail" ); … … 1969 1976 if( $argFolderName && $argUserId ) { 1970 1977 1971 if( ! $argIsPrivate ) {1972 # first make sure the folder is public,1973 # because we want new folders created public by default:1974 $folderName = makePublicFolderName( $argFolderName );1975 } else1976 $folderName = $argFolderName;1977 1978 1978 $con_addFolderDriver = mysql_connect(); 1979 1979 mysql_selectdb( getDBName() ); … … 1994 1994 if( $debug ) 1995 1995 echo "DEBUG: did not see the folder already<br/>"; 1996 $qs = "INSERT into linksGroups VALUES(NULL,'$argUserId','$folderName','');";1996 $qs = "INSERT INTO linksGroups VALUES(NULL,'$argUserId','$folderName','', $argIsPrivate);"; 1997 1997 if( $debug ) 1998 1998 echo "$qs<br/>"; … … 2000 2000 if( ! $q ) { 2001 2001 echo "Sorry, something bad happened and your new folder wasn't created.<br />"; 2002 echo "$qs"; 2002 2003 echo "Please click your back button and choose a different folder, or email admins@feedmelinks.com.<br />\n"; 2003 2004 conClose( $con_addFolderDriver ); … … 2089 2090 # check to make sure the folder is not private; if it is, make the link private too: 2090 2091 $folderName = getNameForFolder( $argFolderId ); 2091 if( $folderName && (! isPublic ( $folderName ))) {2092 if( $folderName && (! isPublicFolder( $argFolderId ))) 2092 2093 $isPrivate = 1; 2093 }2094 2094 2095 2095 $qs = "INSERT into links values(NULL,'$argUrl','$argName', NULL, NULL,'$argSubmitter', $argFolderId, '$argOptions', $isPrivate );"; … … 2351 2351 function isInPublicFolder( $argId ) { 2352 2352 return true; 2353 #return isPublic( getNameForFolder( getFolderForLink( $id )));2354 2353 } 2355 2354 … … 2430 2429 mysql_selectdb( getDBName() ); 2431 2430 $qs = "SELECT ID FROM linksGroups WHERE USERID = '$argUserId' AND " 2432 . "(name = ' p%2F$argName' OR name = 'p/$argName' OR name = '$argName' OR name = '" . urlencode( $argName ) . "');";2431 . "(name = '$argName' OR name = '" . urlencode( $argName ) . "');"; 2433 2432 $q = mysql_query( $qs ); 2434 2433 if( $q ) … … 2662 2661 } 2663 2662 2663 # deprecated 2664 2664 function makePrettyFolderName( $name ) { 2665 return str_replace ( "p/", "", $name); 2666 } 2667 2665 return $name; 2666 } 2667 2668 # deprecated 2668 2669 function makePublicFolderName( $name ) { 2669 if( ! isPublic( $name )) 2670 return "p/$name"; 2671 else 2672 return $name; 2670 return $name; 2673 2671 } 2674 2672 … … 2862 2860 } 2863 2861 2862 function makeAJAXDeleteButton( $type ) { 2863 %> 2864 AJAX Delete Button 2865 <% 2866 } 2867 2868 function makeInflowAJAXEditLink( $type ) { 2869 %><input type="image" class="editor inflow_<%= $type %>" src="img/icons/edit.png" 2870 height="26" width="26" hspace="5" alt="edit" border="0" /></a><% 2871 } 2872 2864 2873 function makeAJAXEditLink( $type ) { 2865 2874 %><input type="image" class="editor <%= $type %>" src="img/icons/edit.png" … … 2869 2878 function makeAJAXToggle( $type, $id, $toggle ) { 2870 2879 %> 2871 <span class="<%= $type %>" fid="<%= $id %>">2880 <span ftype="<%= $type %>" fid="<%= $id %>"> 2872 2881 <input type="checkbox" <%= $toggle ? "checked" : "" %> 2873 2882 onClick="execute_ajax_cb( '<%= $type %>', this.parentNode.getAttribute( 'fid' ), this);" /> … … 2900 2909 $con = mysql_connect(); 2901 2910 mysql_selectdb( getDBName() ); 2902 $qs = "SELECT name FROM linksGroups WHERE id = $argFolderId;";2911 $qs = "SELECT isPrivate FROM linksGroups WHERE id = $argFolderId;"; 2903 2912 if( $debug ) 2904 2913 echo $qs . "<br/>"; … … 2910 2919 return false; 2911 2920 } else { 2912 return isPublic( mysql_result($q,0,"name"));2921 return ! (mysql_result($q,0,"isPrivate")); 2913 2922 } 2914 2923 conClose( $con ); … … 2918 2927 2919 2928 function isPublic( $folderName ) { 2920 if( $folderName ) 2921 if( substr( $folderName, 0, 2 ) == "p/" || substr( $folderName, 0, 4 ) == "p%2F" ) 2922 return true; 2929 echo "FUCKED!"; 2923 2930 return false; 2924 2931 } trunk/feedmelinks/feedmelinks/modules/view-link.inc.php
r886 r889 53 53 %> 54 54 55 <div class="name" fid="<%= $l %>">55 <div ftype="name" fid="<%= $l %>"> 56 56 <a class="biglink" title="<%= $name %>" href="/t/<%= $l %>"><%= $name %></a><% if( $owned ) {makeAJAXEditLink( "name" );} %> 57 57 <% if( $owned ) { %> … … 73 73 <br /> 74 74 <%= insertBigThumb( $link ) %> 75 <div class="url" fid="<%= $l %>">75 <div ftype="url" fid="<%= $l %>"> 76 76 <a title="<%= $link %>" href="/t/<%= $l %>"><%= $displayLink %></a><% if( $owned ) {makeAJAXEditLink( "url" ); } %> 77 77 </div> trunk/feedmelinks/feedmelinks/script/fajax.js
r882 r889 4 4 var keyCode = evt.which ? evt.which : evt.keyCode; 5 5 if( keyCode == 13) { 6 7 var item_type = e.parentNode.parentNode.getAttribute( "class" ); 8 execute_ajax( 9 "link", 10 item_type, 11 e.parentNode.parentNode.getAttribute( "fid" ), // ID from the parent div 12 e.value 13 ); 14 6 execute_ajax( "link", e.getAttribute( "ftype" ), e.getAttribute( "fid" ), e.value ); 15 7 return false; 16 8 } … … 21 13 /* link renaming ******************************** */ 22 14 23 // make this an array:15 // FIXME: use/make this an array: 24 16 var link_node; 25 17 var edit_button_node; … … 27 19 28 20 function update_checkbox_after_save( edited_id, name ) { 29 var ui = document.getElementById( "edit-ui " );21 var ui = document.getElementById( "edit-ui-hook" ); 30 22 31 23 var message_slot = document.createElement("span"); … … 38 30 } 39 31 40 function update_link_after_save( edited_id, name ) { 41 var ui = document.getElementById( "edit-ui" ); 42 var p = ui.parentNode; 32 function update_link_after_save( name ) { 43 33 link_node.setAttribute( "title", name ); 44 34 link_node.innerHTML = name; 45 46 p.insertBefore( edit_button_node, p.firstChild ); 47 p.insertBefore( link_node, p.firstChild ); 48 49 p.removeChild( ui ); 50 Behaviour.apply(); 35 unroll_edit(); 51 36 } 52 37 53 function unroll_edit(e) { 54 var p = e.parentNode.parentNode; 55 var id = p.getAttribute( "fid" ); // ID from the parent div 56 var ui = document.getElementById( "edit-ui" ); 38 function unroll_edit() { 39 var content = document.getElementById( "content-hook" ); 40 if( content ) 41 content.parentNode.replaceChild( link_node, content ); 42 var ui = document.getElementById( "edit-ui-hook" ); 43 if( ui ) 44 ui.parentNode.replaceChild( edit_button_node, ui ); 57 45 58 // restore the form 59 p.insertBefore( edit_button_node, p.firstChild ); 60 p.insertBefore( link_node, p.firstChild ); 61 62 // clean up the editing chuff 63 ui.parentNode.removeChild( ui ); 64 Behaviour.apply(); 46 if( ui || content ) 47 Behaviour.apply(); 65 48 } 66 67 49 68 50 function execute_ajax_cb( item, id, e ) { 69 51 // FIXME: messy, clean up 70 var old_ui = document.getElementById( "edit-ui " );52 var old_ui = document.getElementById( "edit-ui-hook" ); 71 53 if( old_ui ) 72 54