Changeset 1339

Show
Ignore:
Timestamp:
02/21/07 15:12:16 (2 years ago)
Author:
jm3
Message:

cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/_logs/.cvsignore

    r1318 r1339  
    22global.log 
    33comments.log 
     4behavior.log 
    45spam.log 
    56security.log 
  • feedmelinks/action.php

    r1336 r1339  
    1 <% 
     1<?php 
    22        # $Id$ 
    33        include_once( "modules/utils.inc.php" ); 
     
    3939                                        echo bounceWithDelay( "/index", 1 ); 
    4040                                        include( "$modules/header.inc.php" );  
    41 %
     41?
    4242<h1> 
    4343        Success! 
    4444</h1> 
    4545<h2>Updating your tags...</h2> 
    46 <% 
     46<?php 
    4747                                } 
    4848                        } 
     
    6969                        if( deleteCategorizationForLink( $id ) ) { 
    7070                                $errors = 1; 
    71 %
     71?
    7272 
    7373<div class="attention warning"> 
     
    120120 
    121121                        foreach( $linkList as $link ) { 
     122                                if( $op == "makePublic" ) 
     123                                        run_heuristics( "publicize_link", $u, array( "link" => $link )); 
    122124                                if( $c != 0 ) { 
    123125                                        if( $debug ) echo ", "; 
  • feedmelinks/bin/heuristics.sh

    r1325 r1339  
    5656        scope=10 
    5757 
    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` 
     59known_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` 
    6767      # 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` 
    7070 
    7171        if [ $links -ne 0 ] 
  • feedmelinks/contact-us.php

    r1163 r1339  
    8787                                <p/> 
    8888                                <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> 
    8992                        </div> 
    9093                        <% } else { %> 
  • feedmelinks/folder-by-tag-name.php

    r1335 r1339  
    1414        if( ! $tag ) 
    1515                croak( "shit, no tag!" ); 
    16          
     16 
    1717        comment( "user: $user, tag: $tag" ); 
    1818        $con_t = mysql_connect(); 
     
    2020 
    2121        # 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 ); 
    2723 
    2824        $q = mysql_query( $qs ); 
  • feedmelinks/modules/utils.inc.php

    r1336 r1339  
    66include_once( "env.inc.php" ); 
    77include( 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 
    831 
    932        function get_snuffable_list( $query ) { 
     
    718741    $pi["testuser"] = true; 
    719742    $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; 
    725749    #$pi["rrhobbs"] = true; 
    726750    #$pi["Madrisa"] = true; 
     
    918942    ob_start(); 
    919943 
    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 
    921945    return ob_get_clean(); 
    922946  } 
     
    937961        $new = $old == 1 ? "NULL" : 1; 
    938962        $new_label = $new == 1 ? "private" : "public"; 
     963                                if( $new == "NULL" ) 
     964                                        run_heuristics( "publicize_link", $arg_user, array( "link" => $arg_link_id )); 
    939965 
    940966        $qs = "UPDATE links SET isPrivate = $new WHERE id = $arg_link_id AND userid = '$arg_user';"; 
     
    10171043function get_thumb( $u, $linkUrl ) { 
    10181044ob_start(); 
    1019 %
     1045?
    10201046<a href="<%= $linkUrl %>"><img src="http://open.thumbshots.org/image.pxf?url=<%= $u %>" border="2"  /></a> 
    10211047 
     
    13871413function add_contact( $argContact, $argUser ) { 
    13881414  if( $argContact && $argUser && ($argContact != $argUser )) { 
     1415                run_heuristics( "add_contact", $u, array( "peep" => $argContact )); 
    13891416    $cache = get_cache(); 
    13901417    return cache_item( $argUser, $argContact, "contact", $cache["contacts"], get_contacts_file( $argUser )); 
     
    20542081 
    20552082  } else if( $argWhichQuery  == "edit_link_privacy" ) { 
     2083                if( $args[1] == 1 ) 
     2084                        run_heuristics( "publicize_link", $args[3], array( "link" => $link )); 
    20562085    return " 
    20572086    UPDATE links SET isPrivate = " . $args[1] . " WHERE ID = " .$args[2] . " AND userid = '" . $args[3] . "'"; 
     
    20702099   
    20712100  } 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... 
    20722103    return " 
    20732104                INSERT INTO links VALUES(NULL,'" . urlencode( $args[1] ) . "','" . urlencode(escapeQuotes($args[2])) . "', NULL, NULL,'" . urlencode( $args[3] ) . "', NULL, " . $args[4] . ");"; 
    20742105 
    20752106  } 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])); 
    20772109                return " 
    20782110                INSERT INTO tags VALUES(NULL,'" . urlencode( $args[1] ) . "','" . urlencode( $args[2] ) . "','', $isPrivate);";  
     
    20802112  } else if( $argWhichQuery  == "tag_by_name" ) { 
    20812113    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] ) . "'"
    20832115 
    20842116  } else if( $argWhichQuery  == "unused_tags" ) { 
     
    28762908  $name     = urlencode( $argName ); 
    28772909 
    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());"; 
    28792911 
    28802912  l( "new_user: $argUserId, $argEmail" ); 
  • feedmelinks/modules/view-link.inc.php

    r1331 r1339  
    7272                <a class="biglink" title="<%= $name %>" href="/t/<%= $l %>"><%= $name %></a> <% if( $owned ) {makeAJAXEditLink( "name", "Rename this link" );} %> 
    7373<% if( $owned ) { %> 
    74                         Make&nbsp;<?= $private ? "public" : "private" ?>:&nbsp;<%= makeAJAXToggle( "link_privacy", $l, $isPrivate ) %
     74                        <label>Make&nbsp;<?= $private ? "public" : "private" ?>:&nbsp;<%= makeAJAXToggle( "link_privacy", $l, $isPrivate ) %></label
    7575<% } %> 
    7676        </div> 
  • feedmelinks/style/one-page.css

    r1248 r1339  
    4141        margin-right: auto; 
    4242} 
     43 
     44.subtle { 
     45        font-size: 80%; 
     46        color: #333333; 
     47}