Changeset 1392

Show
Ignore:
Timestamp:
03/05/07 20:51:27 (2 years ago)
Author:
jm3
Message:
  • bugs with selecting tags by clean URLs with weird names now fixed.
  • default for new tags is now public (as it used to be)
  • flagging a link as private now automatically adds an additional tag of "private" (so you can get at them later and operate on them as a batch)
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/.htaccess-global

    r1390 r1392  
    5353RewriteRule    ^xml/set/comment         /api/comment 
    5454RewriteRule    ^(xml|api)/peeps$        /peeps-as-xml [L] 
     55RewriteRule    ^(xml|api)/recent$       /api/recent-as-xml.php [L] 
     56RewriteRule    ^(xml|api)/recent/(.+)$  /api/recent-as-xml.php?user=$1 [L] 
    5557RewriteRule    ^api/backroom/(.*)$      /api/restricted/secure-call.php?call=$1 [L] 
    5658 
  • feedmelinks/folder-by-tag-name.php

    r1340 r1392  
    2020        # allow authenticated users to view their own private tags 
    2121        $query_to_get = $authed ? "your_tag_by_name" : "tag_by_name"; 
    22         $qs = getQuery( $query_to_get, $user, $tag ); 
     22        $qs = getQuery( $query_to_get, $user, $tag, false ); 
     23        #echo $query_to_get ; 
     24        #echo "first try: <br>$qs<br>"; 
    2325 
    2426        $q = mysql_query( $qs ); 
    25         if( !$q || !( $numRows = mysql_num_rows($q))) 
    26                 croak( "<p>Sorry, we screwed up. We're currently working on fixing this. </p>$who_hath no tag called '$tag', dog!" ); 
    27  
     27        if( !$q || !( $numRows = mysql_num_rows($q))) { 
     28                $qs = getQuery( $query_to_get, $user, $tag, true ); 
     29                #echo "second try: <br>$qs<br>"; 
     30                $q = mysql_query( $qs ); 
     31                if( !$q || !( $numRows = mysql_num_rows($q))) { 
     32                        include( "$modules/header.inc.php" ); 
     33                        include( "$modules/private-tag.inc.php" ); 
     34                        include( "$modules/footer.inc.php" ); 
     35                        return; 
     36                         
     37                } 
     38        } 
    2839 
    2940        # TODO: either handle this case or remove the if/for statements 
     
    3344        $folder = $tagID =  mysql_result($q, $i, "ID"); 
    3445        $singleGroupName = $tag; 
    35         comment( "<!-- redirect to folder from folder-by-tag-name: tag = $tagID, name = $tag -->" ); 
     46        comment( "redirect to folder from folder-by-tag-name: tag = $tagID, name = $tag" ); 
    3647        include( "folder.php" ); 
    3748 
  • feedmelinks/folder.php

    r1388 r1392  
    455455<div class="welcome"> 
    456456 
    457         <small>(<?= $title ?>)</small><br /> 
    458         You have no links tagged with: <nobr><u><?= $singleGroupName ?></u></nobr>. 
    459 </div> 
    460 <br /> 
    461 <br /> 
    462  
    463 view <a href="/list-public">other <?= getCatsName() ?></a>. 
     457        <small>(<?= $tag_name ?>)</small><br /> 
     458        You haven't used this tag on any of your links 
     459</div> 
     460 
    464461</form> 
    465462<?php  
  • feedmelinks/modules/tag-list-header.inc.php

    r1387 r1392  
    2626                                        onClick="deleteSelected()"/> 
    2727                                &nbsp;  
    28                                 &nbsp;<input class="medbutton" type="button" name="untagButton" value="&quot;Un-tag&quot; Selected Links"  
     28                                &nbsp;<input class="medbutton" type="button" name="untagButton" value="Remove This Tag from Selected Links"  
    2929                                        onClick="untagSelected()"/> 
    3030                        </div> 
  • feedmelinks/modules/utils.inc.php

    r1390 r1392  
    986986} 
    987987 
    988 function add_tags_from_request( $u, $newLinkID, $known_tag_IDs, $con, $possibly_new_tag_names ) { 
     988function add_tags_from_request( $u, $newLinkID, $known_tag_IDs, $con, $possibly_new_tag_names, $link_is_private ) { 
    989989        if( $u != getOwnerForLink( $newLinkID )) { 
    990990                log_mesg_to( "[failed tag hijacking attempt] $u, $newLinkID", "security" ); 
    991991                return "failed"; 
    992992        } 
     993 
    993994  # if we were called with a big list of possible tags, use that,  
    994995        # otherwise, slurp them out of the request (_GET + _POST arrays) 
     
    10051006                                array_push( $new_tag_names, $new_tag_name ); 
    10061007        } 
     1008 
     1009        if( $link_is_private ) 
     1010                array_push( $new_tag_names, "private" ); 
    10071011 
    10081012  if( $debug ) { 
     
    25122516   
    25132517  } else if( $argWhichQuery  == "tag_by_name" ) { 
     2518                $tag_name = ($args[3] == true) ? urlencode( $args[2] ) : $args[2]; 
    25142519    return " 
    2515     SELECT * FROM tags WHERE userid = '" . $args[1] . "' AND (isPrivate IS NULL or isPrivate = 0) AND name='" . urlencode( $args[2] ) . "'"; 
     2520    SELECT * FROM tags WHERE userid = '" . $args[1] . "' AND (isPrivate IS NULL or isPrivate = 0) AND name='$tag_name'"; 
    25162521 
    25172522  } else if( $argWhichQuery  == "your_tag_by_name" ) { 
     2523                        $tag_name = ($args[3] == true) ? urlencode( $args[2] ) : $args[2]; 
    25182524    return " 
    2519     SELECT * FROM tags WHERE userid = '" . $args[1] . "' AND name='" . urlencode( $args[2] ) . "'"; 
     2525    SELECT * FROM tags WHERE userid = '" . $args[1] . "' AND name='$tag_name'"; 
    25202526 
    25212527  } else if( $argWhichQuery  == "unused_tags" ) { 
     
    33303336 
    33313337function addFolder( $argFolderName, $argUserId ) { 
    3332   return addFolderDriver( $argFolderName, $argUserId, 0 ); 
     3338  return addFolderDriver( $argFolderName, $argUserId, 1 ); 
    33333339} 
    33343340 
  • feedmelinks/submit-link.php

    r1360 r1392  
    4141                if( $debug ) { 
    4242                        echo "DEBUG: operation: $op<br/>"; 
    43                         echo "DEBUG: current " . getCatName() . " is: $folder<br/>"; 
    44                         echo "<br />"; 
    4543                        echo "DEBUG: url: $url<br />"; 
    4644                        echo "DEBUG: name: $name<br />"; 
     
    5250                        mysql_selectdb( getDBName() ); 
    5351                        if( $op == "submit" ) { 
    54 ?> 
    55  
    56 tagging link "<a href="<?= $url ?>"><?= $name ?></a>"...<br /> 
    57  
    58 <?php 
    5952                        if( $debug ) { 
    60                                 echo "<br />"; 
    61                                 echo "DEBUG: \$url : $url<br />"; 
    62                                 echo "DEBUG: \$name : $name<br />"; 
    6353                                echo "DEBUG: \$u : $u<br />"; 
    6454                                echo "DEBUG: \$is_private : $is_private<br />"; 
     
    7363                        if( $q ) { 
    7464 
     65                        log_mesg_to( "passing link_is_private = $is_private", "global" ); 
     66 
    7567                                # then add any new tags, and tag this link with them: 
    76                                 $q = add_tags_from_request( $u, $newLinkID, $catNums, $con_submit ); 
     68                                $q = add_tags_from_request( $u, $newLinkID, $catNums, $con_submit, "", $is_private); 
    7769 
    7870                                if( $q ) { 
     
    9082?> 
    9183<div class="attention"> 
    92 link added, mobile bitch 
     84        link added, mobile baby 
    9385</div> 
    9486<?php