Changeset 1205
- Timestamp:
- 11/05/06 22:01:18 (2 years ago)
- Files:
-
- feedmelinks/edit-folder.php (modified) (2 diffs)
- feedmelinks/import/ready-to-import.php (modified) (1 diff)
- feedmelinks/modules/utils.inc.php (modified) (5 diffs)
- feedmelinks/testing/ratio.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/edit-folder.php
r1178 r1205 1 1 <% 2 2 # $Id$ 3 $page = " edit-folder";3 $page = "index"; 4 4 $errorPage = "index"; 5 5 $shouldShowCreateEditForm = 1; … … 81 81 82 82 <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> 84 84 <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> 86 86 <br /> 87 87 <a href="<%= $page %>"><b>no way, man!</b></a> feedmelinks/import/ready-to-import.php
r1198 r1205 47 47 { 48 48 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" ); 50 51 51 52 #tell( "Debugging Check:", "We found " . $ls . " links and " . $ts . " tags, which is allowed. Proceeding." ); feedmelinks/modules/utils.inc.php
r1198 r1205 1 1 <% 2 2 3 if( ! $cached_page_include ) 3 4 session_register("cache"); 5 4 6 include_once( "env.inc.php" ); 5 7 include( get_root() . "/modules/prep-cache.inc.php" ); … … 18 20 function fire( $sub, $mesg ) { 19 21 $success = mail( get_maintainer_email(), "WHAT THE CHOPSTICKS!?! $sub", $mesg, get_mail_headers()); 22 } 23 24 function get_max_ttl_ratio() { 25 return 0.2; 26 } 27 28 function 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 ))); 20 32 } 21 33 … … 1581 1593 } 1582 1594 1595 # QUERIES 1596 ####################################################### 1597 1583 1598 function getQuery() { 1584 1599 $args = func_get_args(); … … 2556 2571 mysql_connect(); 2557 2572 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 2558 2578 $qs = "INSERT INTO links VALUES(NULL,'" . urlencode( $argUrl ) . "','" . urlencode(escapeQuotes($argName)) . "', NULL, NULL,'" . urlencode( $argSubmitter ) . "', NULL, $isPrivate );"; 2559 2579 if( $debug ) … … 2576 2596 } else { 2577 2597 $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; 2578 2602 2579 2603 mysql_connect();