Changeset 1326

Show
Ignore:
Timestamp:
02/08/07 14:56:56 (2 years ago)
Author:
jm3
Message:
  • added compiler test page to make it easier to check every change to utils for site breakage
  • fixed focus for "contact us" form
  • added "report a bug" link to footer
  • cleaned up the today's users list
  • fixed svn instructions in FAQ
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • feedmelinks/FAQ/index.php

    r1302 r1326  
    154154                        Of course! We're all about sharing. The code is a total mess, so, you know -- be forewarned.<p/> 
    155155                         
    156                         if you just want to <b>read</b> the source code, you can browse it online at: <a href="/code">Download the source to Feed Me Links at <u>feedmelinks.com/code</u></a> 
    157                         <p/> 
    158                         if you want to check-out / download it, you'll need <a href="http://subversion.tigris.org/">Subversion</a>. From a command-line, type: <p/> 
     156                        if you just want to <b>look at</b> the source code, you can browse it online at <a href="/code">Tools to Make Tools</a>. 
     157                        <p/> 
     158                        if you want to download a complete working copy, you need <a href="http://subversion.tigris.org/">Subversion</a>. From a command-line, type: <p/> 
    159159                        <code> 
    160                         svn co http://toolstomaketools.svnrepository.com/svn/codepot/feedmelinks/ 
     160                        svn export <a href="http://toolstomaketools.svnrepository.com/svn/codepot/feedmelinks/">http://toolstomaketools.svnrepository.com/svn/codepot/feedmelinks/</a> 
     161                        <br /> 
     162                        <br /> 
     163                        User: anonymous<br /> 
     164                        Password:  &lt;none&gt; 
    161165                        </code> 
     166                        <br /> 
    162167 
    163168                </div> 
     
    172177                        <p /> 
    173178                        If you're sure you've found a bug, please check first that it hasn't been reported already by someone else.  
    174                         Duplicate bug reports just slow us down. 
    175                         To see the list of reported bugs, view our <a href="/bugs/">bug list in SourceForge</a>. 
     179                        To see the list of reported bugs/issues, view the <a href="/bugs/">list of open tickets</a>. 
    176180                        <p /> 
    177                         If you don't see it already reported, please  
    178                         <a href="https://sourceforge.net/tracker/?func=add&group_id=153430&atid=787735">report the bug</a>. 
     181                        If you don't see it already reported, please <a href="javascript:;" onClick="openContactUs( 'Report a bug: ' )">Let us know</a>! 
    179182                </div> 
    180183                <a href="#top">back to top</a> 
  • feedmelinks/admin/snuff.php

    r1313 r1326  
    5454</form> 
    5555 
     56<h2>or <a href="/admin">go back to the admin dashboard</a></h2> 
     57 
    5658        <h1> 
    5759                snuffing <%= $user %>: <%= $status %> 
    5860        </h1> 
    59  
    60  
    6161 
    6262<% 
  • feedmelinks/admin/todays-users.php

    r1198 r1326  
    1515                        background-color: #dddddd;; 
    1616                } 
     17                .header { 
     18                        font-weight: bold; 
     19                        color: white; 
     20                        background-color: black; 
     21                        padding: 15px; 
     22                        font-size: 180%; 
     23                } 
    1724        </style> 
    1825 
    1926<table> 
     27        <th> 
     28                <tr> 
     29                        <td class="header"> 
     30                                user 
     31                        </td> 
     32                        <td class="header"> 
     33                                # links 
     34                        <td class="header"> 
     35                                # tags 
     36                        </td> 
     37                        <td class="header"> 
     38                                &nbsp; 
     39                        </td> 
     40                </tr> 
     41        </th> 
     42        <tbody> 
    2043<% 
    2144        $q = run_query(  getQuery( "new_users_today" )); 
     
    2750                <tr> 
    2851                        <td <%= $css %>> 
    29                                 <%= getUserLink( $user ) %> 
     52                                <big><?= getUserLink( $user ) ?></big> 
     53                                </td> 
     54                        <td <%= $css %>> 
     55                                        links: <?= run_count( getQuery( "links_per_user", $user )) ?>,  
     56                                </td> 
     57                        <td <%= $css %>> 
     58                                        tags: <?= get_simple_rs( getQuery( "tags_per_user", $user )) - 3 ?> 
    3059                        </td> 
    3160                        <td <%= $css %>> 
     
    3867        echo $q; 
    3968%> 
    40  
     69        </tbody> 
    4170</table> 
    4271 
  • feedmelinks/modules/footer.inc.php

    r1313 r1326  
    44                        <div style="width: 668px;"> 
    55                                <div class="left"> 
    6                                         &nbsp; [ <a href="/">Feed Me Links</a> is an <a href="http://toolstomaketools.svnrepository.com/codepot/trac.cgi/browser/feedmelinks">Open Source</a> creation by the <a class="hot" href="http://codeswami.com/">Code Swami</a>. ] 
     6                                        &nbsp; Something not working?  
     7                                        <a href="javascript:;" onClick="openContactUs( 'Something went wrong: ' )">Let us know!</a> 
     8                                        &nbsp; &nbsp; [ <a href="/">Feed Me Links</a> is an  
     9                                        <a href="http://toolstomaketools.svnrepository.com/codepot/trac.cgi/browser/feedmelinks">Open Source</a>  
     10                                        creation by the <a class="hot" href="http://codeswami.com/">Code Swami</a>. ] 
    711                                </div> 
    812                                <% 
  • feedmelinks/modules/menu.inc.php

    r1286 r1326  
    55 
    66<div class="topNav"> 
    7 <a class="tn" href="portal">Feed Me Links</a> : Social Bookmarking since 2002. 
     7<a class="tn" href="/portal">Feed Me Links</a> : Social Bookmarking since 2002. 
    88&nbsp; 
    99&nbsp; 
  • feedmelinks/modules/utils.inc.php

    r1313 r1326  
    9191 
    9292function report_spammer( $alleged_spammer, $reporter ) { 
     93        $reporter = $reporter ? $reporter : "anonymous"; 
     94        log_mesg_to( get_ip() . ": $reporter reported $alleged_spammer as a spammer", "security" ); 
    9395  $body = "$alleged_spammer was reported as a spammer (gasp!). 
    9496http://feedmelinks.com/u/$alleged_spammer 
     
    109111 
    110112  return "Filed Successfully!"; 
    111   if( $success ) 
    112     log_mesg_to( "user $alleged_spammer reported as a spammer by $reporter", "global" ); 
    113113} 
    114114 
     
    162162  $q = run_query( getQuery( "snuff_user", $user )); 
    163163 
    164   log_mesg_to( "snuffed out user $user", "global" ); 
     164  log_mesg_to( get_ip() . ": " . get_user() . " snuffed out user $user", "security" ); 
    165165  echo get_snuffed_mesg(); 
    166166?> 
     
    339339} 
    340340 
    341 function get_simple_rs( $qs ) { 
    342   $con = mysql_connect(); 
    343   mysql_selectdb( getDBName() ); 
    344   $q = mysql_query( $qs ); 
    345   if( ! $q ) 
    346     return undefined; 
    347    
    348   return mysql_result($q,0); 
    349 } 
    350  
    351341function get_fuq_threshold() { return 2; } 
    352342 
     
    418408} 
    419409 
    420 function run_query( $qs ) { 
     410function get_simple_rs( $qs ) { 
    421411  $con = mysql_connect(); 
    422412  mysql_selectdb( getDBName() ); 
    423413  $q = mysql_query( $qs ); 
    424   return $q; 
     414  if( ! $q ) 
     415    return undefined; 
     416  return mysql_result($q,0); 
     417
     418 
     419function run_query( $qs ) { 
     420        return run_query_driver( $qs, 0 ); 
     421
     422 
     423function run_insert( $qs ) { 
     424        return run_query_driver( $qs, 1 ); 
     425
     426 
     427function run_query_driver( $qs, $return_inserted_ID ) { 
     428  $con = mysql_connect(); 
     429  mysql_selectdb( getDBName() ); 
     430  $q = mysql_query( $qs ); 
     431  return $return_inserted_ID ?  $mysql_insert_id : $q; 
    425432} 
    426433 
     
    18211828    return " 
    18221829                UPDATE linksUsers SET disabled = NULL WHERE userid = '" . urlencode( $args[1]) . "';"; 
    1823          
     1830 
    18241831        } else if( $argWhichQuery  == "last_login_for_user" ) { 
    18251832    return " 
    18261833    SELECT lastLogin FROM linksUsers WHERE userid = '" . urlencode( $args[1]) . "';"; 
    1827          
     1834 
    18281835        } else if( $argWhichQuery  == "new_login_for_user" ) { 
    18291836    return " 
     
    18371844    return " 
    18381845    SELECT COUNT(id) FROM linksUsers WHERE bornOn < DATE_FORMAT(DATE_ADD(CURRENT_TIMESTAMP(), INTERVAL 1 DAY),'%Y%m%d000000') AND bornOn >= DATE_FORMAT(CURRENT_TIMESTAMP(),'%Y%m%d000000');"; 
     1846 
     1847  } else if( $argWhichQuery  == "num_new_users_this_week" ) { 
     1848    return " 
     1849    SELECT COUNT(id) FROM linksUsers WHERE bornOn < DATE_FORMAT(DATE_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAYS),'%Y%m%d000000') AND bornOn >= DATE_FORMAT(CURRENT_TIMESTAMP(),'%Y%m%d000000');"; 
    18391850 
    18401851  } else if( $argWhichQuery  == "find_user" ) { 
     
    27452756    #disabled because it got too noisy: 
    27462757    #fire( "Possible spammer-birth in progress!", "Multiple accounts being requested from the same IP ($ip) -- user: http://feedmelinks.com/u/$argUserId, $argEmail" ); 
    2747     log_mesg_to( "WARN. potential spammer $argUserId ($argEmail) creating multiple accounts from the same IP", "global" ); 
     2758    log_mesg_to( "$ip: potential spammer $argUserId ($argEmail) creating multiple accounts from the same IP", "security" ); 
    27482759    $q = run_query( getQuery( "log_ip", $argUserId, $argEmail, $ip )); 
    27492760    return; 
     
    28772888     
    28782889  # spammers and newbies' links are private 
    2879   if( get_tag_to_link_ratio( $argSubmitter ) > get_max_ttl_ratio() ) 
     2890  if( get_tag_to_link_ratio( $argSubmitter ) > get_max_ttl_ratio() ) { 
    28802891    $isPrivate = 1; 
    2881     log_mesg_to( get_ip(), "security" ); 
     2892    log_mesg_to( get_ip() . ": privatizing new link from $argSubmitter due to T:L ratio", "security" ); 
     2893        } 
    28822894 
    28832895  $qs = "INSERT INTO links VALUES(NULL,'" . urlencode( $argUrl ) . "','" . urlencode(escapeQuotes($argName)) . "', NULL, NULL,'" . urlencode( $argSubmitter ) . "', NULL, $isPrivate );"; 
     
    29032915 
    29042916    # spammers and newbies' links are private 
    2905     if( get_tag_to_link_ratio( $argSubmitter ) > get_max_ttl_ratio() ) 
     2917    if( get_tag_to_link_ratio( $argSubmitter ) > get_max_ttl_ratio() ) { 
    29062918      $isPrivate = 1; 
     2919                        log_mesg_to( get_ip() . ": privatizing new link from $argSubmitter due to T:L ratio", "security" ); 
     2920                } 
    29072921 
    29082922    mysql_connect(); 
     
    29142928      $isPrivate = 1; 
    29152929 
    2916     log_mesg_to( get_ip(), "security" ); 
    29172930    $qs = "INSERT INTO links VALUES(NULL,'$argUrl','$argName', NULL, NULL,'$argSubmitter', $argFolderId, '$argOptions', $isPrivate );"; 
    29182931    $q = mysql_query( $qs ); 
     
    35823595 
    35833596function get_report_link( $usr, $id ) { 
     3597        if( $usr == get_user() ) 
     3598                return ""; 
     3599        $is_peep = inList( $usr, "contacts", get_cache() ); 
     3600        if( $is_peep ) 
     3601                return ""; 
    35843602        if( ! $usr  || ! $id )  
    35853603                return ""; 
  • feedmelinks/script/funcs.js

    r1288 r1326  
    6060function openContactUs( argSubj ) { 
    6161        var u = "/contact-us" + (argSubj ? "?subject=" + argSubj : ""); 
    62                 window.open( u, "contact_us", "width=500,height=600,resizable=1,status=0" ); 
     62        contactus=window.open( u, "contact_us", "width=500,height=600,resizable=1,status=0" ); 
     63        if (window.focus) {contactus.focus()} 
    6364} 
    6465 
  • feedmelinks/stats.php

    r670 r1326  
    1 <% 
     1<?php 
    22        # $Id$ 
    33        include_once( "modules/utils.inc.php" ); 
     
    88        $selectMax = 40; 
    99        $max = 10; 
    10 %
     10?
    1111 
    1212<h3> The Top <%= $max %> Busiest Linkers on FEED ME LINKS:</h3> 
    1313 
    1414<div class="reminderBox" style="width: 400px;"> 
    15 <% 
     15<?php 
     16 
     17        echo getQuery( "num_new_users_this_week" ); 
     18 
    1619        $qs = "SELECT COUNT(*) AS lc, submitter FROM links GROUP BY submitter ORDER BY lc DESC LIMIT $selectMax;"; 
    1720        $q = mysql_query( $qs ); 
     
    1922                $numRows = mysql_num_rows($q); 
    2023        if( $q && $numRows ) { 
    21 %
     24?
    2225<ol> 
    2326<%