Changeset 1100 for trunk/common


Ignore:
Timestamp:
12/28/09 15:20:20 (2 years ago)
Author:
bogdan2412
Message:

Updated database dump

Updated db-strip script to remove user's remote ip information and also cleanup
entries previously left orphan in ia_user_round, ia_round_task and in
ia_*_tags. Also made it erase more useless stuff from the forum while keeping
more users, more jobs and more textblock history.

The total size of the dump is actually smaller now, even though it has more
relevant data.

Also fixed a bug in textblock_grep which caused the grep macro to stop working.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/common/db/textblock.php

    r1086 r1100  
    244244// Grep through textblocks. This is mostly a hack needed for macro_grep.php 
    245245// Also used for round deletion 
    246 function textblock_grep($substr, $page, $regexp = false, $offset = 0, $count = 0) { 
     246function textblock_grep($substr, $page, $regexp = false, $offset = null, $count = null) { 
    247247    if (!$regexp) { 
    248248        $compare = "LIKE"; 
     
    256256                      WHERE `name` LIKE '%s' AND 
    257257                            (`text` $compare '%s' OR `title` $compare '%s') 
    258                       ORDER BY `name` 
    259                       LIMIT %s, %s", 
    260                       db_escape($page), db_escape($substr), db_escape($substr), 
    261                       db_escape($offset), db_escape($count)); 
     258                      ORDER BY `name`", 
     259                      db_escape($page), db_escape($substr), db_escape($substr)); 
     260 
     261    if (is_whole_number($offset) && is_whole_number($count)) { 
     262        $query .= sprintf(" LIMIT %s, %s", 
     263                          db_escape($offset), db_escape($count)); 
     264    } 
    262265    return db_fetch_all($query); 
    263266} 
Note: See TracChangeset for help on using the changeset viewer.