Changeset 1395

Show
Ignore:
Timestamp:
03/05/07 22:48:05 (2 years ago)
Author:
jm3
Message:

smart tags (the start of action tgs on FML?) -- tagging a link as private makes the link private; the reverse is now true too

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/modules/utils.inc.php

    r1394 r1395  
    987987 
    988988function apply_tag_by_ID( $link_ID, $tag_ID ) { 
    989         log_mesg_to( "apply_tag_by_ID( $link_ID, $tag_ID )", "global" ); 
    990989        run_query( getQuery( "add_new_category_xref", $link_ID, $tag_ID )); 
     990} 
     991 
     992function remove_tag_by_ID( $link_ID, $tag_ID ) { 
     993        log_mesg_to( "get_private_tag_ID( $link_ID, $tag_ID )", "global" ); 
     994        run_query( getQuery( "delete_category_xref", $link_ID, $tag_ID )); 
    991995} 
    992996 
     
    13661370                        $new = $old == 1 ? "NULL" : 1; 
    13671371                        $new_label = $new == 1 ? "private" : "public"; 
    1368                         if( $new == "NULL" ) 
     1372                        if( $new == "NULL" ) { 
    13691373                                run_heuristics( "publicize_link", $arg_user, array( "link" => $arg_link_id )); 
    1370                         else 
     1374                                remove_tag_by_ID( $arg_link_id, get_private_tag_ID( get_user())); 
     1375                        } else 
    13711376                                apply_tag_by_ID( $arg_link_id, get_private_tag_ID( get_user())); 
    13721377 
     
    24992504 
    25002505  } else if( $argWhichQuery  == "edit_link_privacy" ) { 
    2501                 if( $args[1] != 1 ) 
     2506                if( $args[1] != 1 ) { 
    25022507                        run_heuristics( "publicize_link", $args[3], array( "link" => $link )); 
    2503                 else 
     2508                        remove_tag_by_ID( $args[2], get_private_tag_ID($args[3])); 
     2509                } else 
    25042510                        apply_tag_by_ID( $args[2], get_private_tag_ID($args[3])); 
    25052511    return " 
     
    25172523    return " 
    25182524    INSERT INTO links_tags_xref VALUES( " . $args[1] . ", " . $args[2] . " ) "; 
     2525   
     2526  } else if( $argWhichQuery  == "delete_category_xref" ) { 
     2527    return " 
     2528    DELETE FROM links_tags_xref where linkID=" . $args[1] . " AND tagID=" . $args[2]; 
    25192529   
    25202530  } else if( $argWhichQuery  == "add_link" ) { 
     
    37153725 
    37163726function setPublic( $argId ) { 
     3727        remove_tag_by_ID( $argId, get_private_tag_ID( get_user())); 
    37173728  togglePrivate( $argId, "NULL" ); 
    37183729}