Changeset 1205

Show
Ignore:
Timestamp:
11/05/06 22:01:18 (2 years ago)
Author:
jm3
Message:

adding t:l ratio confirmation and fixed "delete tag" response page

Files:

Legend:

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

    r1178 r1205  
    11<% 
    22        # $Id$ 
    3         $page = "edit-folder"; 
     3        $page = "index"; 
    44        $errorPage = "index"; 
    55        $shouldShowCreateEditForm = 1; 
     
    8181 
    8282                <p style="text-align: right;"> 
    83                         <a href="<%= $page %>?op=deleteGroup&id=<%= $id %><%= $debug ? "&debug=y" : ""%>"><b>yup!</b> (just delete the <%= getCatName() %>)</a>  
     83                        <a href="<%= $page %>op=deleteGroup&id=<%= $id %><%= $debug ? "&debug=y" : ""%>"><b>yup!</b> (just delete the <%= getCatName() %>)</a>  
    8484                        <br /> 
    85                         <a href="<%= $page %>?op=deleteGroup&deleteLinks=y&id=<%= $id %><%= $debug ? "&debug=y" : ""%>"><b>yes</b>, and delete the links too</a> 
     85                        <a href="<%= $page %>op=deleteGroup&deleteLinks=y&id=<%= $id %><%= $debug ? "&debug=y" : ""%>"><b>yes</b>, and delete the links too</a> 
    8686                        <br /> 
    8787                        <a href="<%= $page %>"><b>no way, man!</b></a> 
  • feedmelinks/import/ready-to-import.php

    r1198 r1205  
    4747                        { 
    4848                                fire( "FML Debug: import request - $ls, $ts, $tr", "user $u importing $ls links and $ts tags with T:L ratio of $tr" ); 
    49                                 log_mesg_to( "WARN. user $u importing $ls links and $ts tags with T:L ratio of $tr", "security" ); 
     49                                if( $tr > .1 ) 
     50                                        log_mesg_to( "WARN. user $u importing $ls links and $ts tags with T:L ratio of $tr", "security" ); 
    5051 
    5152                                #tell( "Debugging Check:", "We found " . $ls . " links and " . $ts . " tags, which is allowed. Proceeding." ); 
  • feedmelinks/modules/utils.inc.php

    r1198 r1205  
    11<% 
     2 
    23if( ! $cached_page_include ) 
    34        session_register("cache"); 
     5 
    46include_once( "env.inc.php" ); 
    57include( get_root() . "/modules/prep-cache.inc.php" ); 
     
    1820function fire( $sub, $mesg ) { 
    1921  $success = mail( get_maintainer_email(), "WHAT THE CHOPSTICKS!?! $sub", $mesg, get_mail_headers()); 
     22} 
     23 
     24function get_max_ttl_ratio() { 
     25        return 0.2; 
     26} 
     27 
     28function get_tag_to_link_ratio( $user ) { 
     29        if( ! $user )  
     30                return 0; 
     31        return( get_simple_rs( getQuery( "tags_per_user", $user )) /  get_simple_rs( getQuery( "links_per_user", $user ))); 
    2032} 
    2133 
     
    15811593} 
    15821594 
     1595# QUERIES 
     1596####################################################### 
     1597 
    15831598function getQuery() { 
    15841599        $args = func_get_args(); 
     
    25562571        mysql_connect(); 
    25572572        mysql_selectdb( getDBName() ); 
     2573                 
     2574        # spammers and newbies' links are private 
     2575        if( get_tag_to_link_ratio( $argSubmitter ) > get_max_ttl_ratio() ) 
     2576                $isPrivate = 1; 
     2577 
    25582578        $qs = "INSERT INTO links VALUES(NULL,'" . urlencode( $argUrl ) . "','" . urlencode(escapeQuotes($argName)) . "', NULL, NULL,'" . urlencode( $argSubmitter ) . "', NULL, $isPrivate );"; 
    25592579        if( $debug )  
     
    25762596        } else { 
    25772597                $isPrivate = $argPrivate ? $argPrivate : "NULL"; 
     2598 
     2599                # spammers and newbies' links are private 
     2600                if( get_tag_to_link_ratio( $argSubmitter ) > get_max_ttl_ratio() ) 
     2601                        $isPrivate = 1; 
    25782602 
    25792603                mysql_connect();