Changeset 1339
- Timestamp:
- 02/21/07 15:12:16 (2 years ago)
- Files:
-
- feedmelinks/_logs/.cvsignore (modified) (1 diff)
- feedmelinks/action.php (modified) (4 diffs)
- feedmelinks/bin/heuristics.sh (modified) (1 diff)
- feedmelinks/contact-us.php (modified) (1 diff)
- feedmelinks/folder-by-tag-name.php (modified) (2 diffs)
- feedmelinks/modules/utils.inc.php (modified) (10 diffs)
- feedmelinks/modules/view-link.inc.php (modified) (1 diff)
- feedmelinks/style/one-page.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
feedmelinks/_logs/.cvsignore
r1318 r1339 2 2 global.log 3 3 comments.log 4 behavior.log 4 5 spam.log 5 6 security.log feedmelinks/action.php
r1336 r1339 1 < %1 <?php 2 2 # $Id$ 3 3 include_once( "modules/utils.inc.php" ); … … 39 39 echo bounceWithDelay( "/index", 1 ); 40 40 include( "$modules/header.inc.php" ); 41 %>41 ?> 42 42 <h1> 43 43 Success! 44 44 </h1> 45 45 <h2>Updating your tags...</h2> 46 < %46 <?php 47 47 } 48 48 } … … 69 69 if( deleteCategorizationForLink( $id ) ) { 70 70 $errors = 1; 71 %>71 ?> 72 72 73 73 <div class="attention warning"> … … 120 120 121 121 foreach( $linkList as $link ) { 122 if( $op == "makePublic" ) 123 run_heuristics( "publicize_link", $u, array( "link" => $link )); 122 124 if( $c != 0 ) { 123 125 if( $debug ) echo ", "; feedmelinks/bin/heuristics.sh
r1325 r1339 56 56 scope=10 57 57 58 double_hyphenated_links=`mysql -u $u -p$p $u -B -e "select count( url ) as 'double_hyphenated_links' from links where submitter= '$USER' and url REGEXP '.+-.+-.+\\.com';" | tail -n1`59 known_spammer_domain_links=`mysql -u $u -p$p $u -B -e "select count( url ) as 'known_spammer_domain_links' from links where submitter= '$USER' and url REGEXP '(ourbigtop|blogspot)\.com';" | tail -n1`60 dot_info_domains=`mysql -u $u -p$p $u -B -e "select count( url ) as 'dot_info_domains' from links where submitter= '$USER' and url REGEXP '\\.info(%2F|$)';" | tail -n1`61 tags_w_commas=`mysql -u $u -p$p $u -B -e "select count( name ) as 'tags_w_commas' from linksGroups where userid = '$USER' and name REGEXP ',';" | tail -n1`62 tags_w_multiple_spaces=`mysql -u $u -p$p $u -B -e "select count( name ) as 'tags_w_multiple_spaces' from linksGroups where userid = '$USER' and name REGEXP '. . ';" | tail -n1`63 links=`mysql -u $u -p$p $u -B -e "select count( url ) as 'links' from links where submitter= '$USER';" | tail -n1`64 tags=`mysql -u $u -p$p $u -B -e "select count( id ) as 'tags' from linksGroups where userid = '$USER';" | tail -n1`65 last_ten_domains_linked=`mysql -u $u -p$p $u -B -e "select lower(substring_index(url, '.', 2)) from links where submitter= '$USER' order by id desc limit ${scope};" | tail -n${scope}`66 has_been_snuffed=`mysql -u $u -p$p $u -B -e "select snuffed from linksUsers where userid = '$USER';" | tail -n1`58 double_hyphenated_links=`mysql -u $u -p$p $u -B -e "select count( url ) as 'double_hyphenated_links' from links where userid = '$USER' and url REGEXP '.+-.+-.+\\.com';" | tail -n1` 59 known_spammer_domain_links=`mysql -u $u -p$p $u -B -e "select count( url ) as 'known_spammer_domain_links' from links where userid = '$USER' and url REGEXP '(ourbigtop|blogspot)\.com';" | tail -n1` 60 dot_info_domains=`mysql -u $u -p$p $u -B -e "select count( url ) as 'dot_info_domains' from links where userid = '$USER' and url REGEXP '\\.info(%2F|$)';" | tail -n1` 61 tags_w_commas=`mysql -u $u -p$p $u -B -e "select count( name ) as 'tags_w_commas' from tags where userid = '$USER' and name REGEXP ',';" | tail -n1` 62 tags_w_multiple_spaces=`mysql -u $u -p$p $u -B -e "select count( name ) as 'tags_w_multiple_spaces' from tags where userid = '$USER' and name REGEXP '. . ';" | tail -n1` 63 links=`mysql -u $u -p$p $u -B -e "select count( url ) as 'links' from links where userid = '$USER';" | tail -n1` 64 tags=`mysql -u $u -p$p $u -B -e "select count( id ) as 'tags' from tags where userid = '$USER';" | tail -n1` 65 last_ten_domains_linked=`mysql -u $u -p$p $u -B -e "select lower(substring_index(url, '.', 2)) from links where userid = '$USER' order by id desc limit ${scope};" | tail -n${scope}` 66 has_been_snuffed=`mysql -u $u -p$p $u -B -e "select snuffed from users where userid = '$USER';" | tail -n1` 67 67 # for freshness idx: 68 first_link=`mysql -u $u -p$p $u -B -e "select to_days( createDate ) from links where submitter= '$USER' ORDER BY id ASC LIMIT 1;" | tail -n1`69 last_link=`mysql -u $u -p$p $u -B -e "select to_days( createDate ) from links where submitter= '$USER' ORDER BY id DESC LIMIT 1;" | tail -n1`68 first_link=`mysql -u $u -p$p $u -B -e "select to_days( createDate ) from links where userid = '$USER' ORDER BY id ASC LIMIT 1;" | tail -n1` 69 last_link=`mysql -u $u -p$p $u -B -e "select to_days( createDate ) from links where userid = '$USER' ORDER BY id DESC LIMIT 1;" | tail -n1` 70 70 71 71 if [ $links -ne 0 ] feedmelinks/contact-us.php
r1163 r1339 87 87 <p/> 88 88 <label><input type="radio" name="from" value="anonymous" > send anonymously</label> 89 <p class="subtle"> 90 (please include your email address if you want a reply!) 91 </p> 89 92 </div> 90 93 <% } else { %> feedmelinks/folder-by-tag-name.php
r1335 r1339 14 14 if( ! $tag ) 15 15 croak( "shit, no tag!" ); 16 16 17 17 comment( "user: $user, tag: $tag" ); 18 18 $con_t = mysql_connect(); … … 20 20 21 21 # allow authenticated users to view their own private tags 22 $taglist_clause = "(isPrivate IS NULL OR isPrivate = 0)" . ($authed ? " AND name = '$tag'" : ""); 23 24 $qs = getQuery( "tag_by_name", $user, "($taglist_clause)" ); 25 26 #echo $qs; 22 $qs = getQuery( "tag_by_name", $user, $tag ); 27 23 28 24 $q = mysql_query( $qs ); feedmelinks/modules/utils.inc.php
r1336 r1339 6 6 include_once( "env.inc.php" ); 7 7 include( get_root() . "/modules/prep-cache.inc.php" ); 8 9 function get_splink_value( $user ) { 10 return 1; 11 } 12 13 function run_heuristics( $event, $user, $context ) { 14 log_mesg_to( "$event: $user: context: " . print_r( $context, true ), "behavior" ); 15 switch( $event ){ 16 case "add_link" : 17 case "publicize_link" : 18 break; 19 case "add_tag" : 20 break; 21 case "add_comment" : 22 break; 23 case "add_peep" : 24 break; 25 default: 26 break; 27 } 28 $qs = getQuery( "update_fuq" ); 29 } 30 8 31 9 32 function get_snuffable_list( $query ) { … … 718 741 $pi["testuser"] = true; 719 742 $pi["samanthers"] = true; 720 $pi["r34l"] = true; 721 $pi["chrishaney"] = true; 722 $pi["tomcarter"] = true; 723 $pi["sameera_man"] = true; 724 743 $pi["khemraj"] = true; 744 745 #$pi["r34l"] = true; 746 #$pi["chrishaney"] = true; 747 #$pi["tomcarter"] = true; 748 #$pi["sameera_man"] = true; 725 749 #$pi["rrhobbs"] = true; 726 750 #$pi["Madrisa"] = true; … … 918 942 ob_start(); 919 943 920 %><a href="<%= $arg_href %>" onMouseOver="<%= $id %>.src='/img/<%= $on %>';" onMouseOut="<%= $id %>.src='/img/<%= $arg_img %>';"><img name="<%= $id %>" src="/img/<%= $arg_img %>" border="0" /></a>< %944 %><a href="<%= $arg_href %>" onMouseOver="<%= $id %>.src='/img/<%= $on %>';" onMouseOut="<%= $id %>.src='/img/<%= $arg_img %>';"><img name="<%= $id %>" src="/img/<%= $arg_img %>" border="0" /></a><?php 921 945 return ob_get_clean(); 922 946 } … … 937 961 $new = $old == 1 ? "NULL" : 1; 938 962 $new_label = $new == 1 ? "private" : "public"; 963 if( $new == "NULL" ) 964 run_heuristics( "publicize_link", $arg_user, array( "link" => $arg_link_id )); 939 965 940 966 $qs = "UPDATE links SET isPrivate = $new WHERE id = $arg_link_id AND userid = '$arg_user';"; … … 1017 1043 function get_thumb( $u, $linkUrl ) { 1018 1044 ob_start(); 1019 %>1045 ?> 1020 1046 <a href="<%= $linkUrl %>"><img src="http://open.thumbshots.org/image.pxf?url=<%= $u %>" border="2" /></a> 1021 1047 … … 1387 1413 function add_contact( $argContact, $argUser ) { 1388 1414 if( $argContact && $argUser && ($argContact != $argUser )) { 1415 run_heuristics( "add_contact", $u, array( "peep" => $argContact )); 1389 1416 $cache = get_cache(); 1390 1417 return cache_item( $argUser, $argContact, "contact", $cache["contacts"], get_contacts_file( $argUser )); … … 2054 2081 2055 2082 } else if( $argWhichQuery == "edit_link_privacy" ) { 2083 if( $args[1] == 1 ) 2084 run_heuristics( "publicize_link", $args[3], array( "link" => $link )); 2056 2085 return " 2057 2086 UPDATE links SET isPrivate = " . $args[1] . " WHERE ID = " .$args[2] . " AND userid = '" . $args[3] . "'"; … … 2070 2099 2071 2100 } else if( $argWhichQuery == "add_link" ) { 2101 if( $args[4] == "NULL" || !$args[4] ) 2102 run_heuristics( $argWhichQuery, $args[3], array( "url" => $args[1], "name" => $args[2] )); # TODO: it May be a problem that we're not passing the tags too... 2072 2103 return " 2073 2104 INSERT INTO links VALUES(NULL,'" . urlencode( $args[1] ) . "','" . urlencode(escapeQuotes($args[2])) . "', NULL, NULL,'" . urlencode( $args[3] ) . "', NULL, " . $args[4] . ");"; 2074 2105 2075 2106 } else if( $argWhichQuery == "add_tag" ) { 2076 $isPrivate = $args[3] ? 1 : 0; 2107 $isPrivate = ( $args[3] == "NULL" || !$args[3] ) ? 1 : 0; 2108 run_heuristics( $argWhichQuery, $args[1], array( "tag" => $args[2])); 2077 2109 return " 2078 2110 INSERT INTO tags VALUES(NULL,'" . urlencode( $args[1] ) . "','" . urlencode( $args[2] ) . "','', $isPrivate);"; … … 2080 2112 } else if( $argWhichQuery == "tag_by_name" ) { 2081 2113 return " 2082 SELECT * FROM tags WHERE userid = '" . $args[1] . "' AND " . $args[2];2114 SELECT * FROM tags WHERE (userid = '" . $args[1] . "' OR isPrivate IS NULL or isPrivate = 0) AND name='" . urlencode( $args[2] ) . "'"; 2083 2115 2084 2116 } else if( $argWhichQuery == "unused_tags" ) { … … 2876 2908 $name = urlencode( $argName ); 2877 2909 2878 $qs = "INSERT INTO users VALUES(NULL,'$userId','$email', '$password', '$name','', 2, 1, NULL, NULL, NULL);";2910 $qs = "INSERT INTO users VALUES(NULL,'$userId','$email', '$password', '$name','', 2, 1, NULL, now(), now());"; 2879 2911 2880 2912 l( "new_user: $argUserId, $argEmail" ); feedmelinks/modules/view-link.inc.php
r1331 r1339 72 72 <a class="biglink" title="<%= $name %>" href="/t/<%= $l %>"><%= $name %></a> <% if( $owned ) {makeAJAXEditLink( "name", "Rename this link" );} %> 73 73 <% if( $owned ) { %> 74 Make <?= $private ? "public" : "private" ?>: <%= makeAJAXToggle( "link_privacy", $l, $isPrivate ) %>74 <label>Make <?= $private ? "public" : "private" ?>: <%= makeAJAXToggle( "link_privacy", $l, $isPrivate ) %></label> 75 75 <% } %> 76 76 </div> feedmelinks/style/one-page.css
r1248 r1339 41 41 margin-right: auto; 42 42 } 43 44 .subtle { 45 font-size: 80%; 46 color: #333333; 47 }