Changeset 1576
- Timestamp:
- 03/29/08 13:09:18 (5 months ago)
- Files:
-
- branches/punbb-1.3-dev/extras/db_update.php (modified) (1 diff)
- branches/punbb-1.3-dev/upload/install.php (modified) (3 diffs)
- branches/punbb-1.3-dev/upload/lang/English/search.php (modified) (1 diff)
- branches/punbb-1.3-dev/upload/search.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/punbb-1.3-dev/extras/db_update.php
r1575 r1576 768 768 $db->add_field($db->prefix.'users', 'date_format', 'INT(10)', false, 0, 'dst'); 769 769 770 // Add the last_search column to the users table 771 $db->add_field($db->prefix.'users', 'last_search', 'INT(10)', true, null, 'last_post'); 772 770 773 // Add the last_email_sent column to the users table and the g_send_email and 771 774 // g_email_flood columns to the groups table 772 $db->add_field($db->prefix.'users', 'last_email_sent', 'INT(10)', true, null, 'last_ post');775 $db->add_field($db->prefix.'users', 'last_email_sent', 'INT(10)', true, null, 'last_search'); 773 776 $db->add_field($db->prefix.'groups', 'g_send_email', 'TINYINT(1)', false, 1, 'g_search_users'); 774 777 $db->add_field($db->prefix.'groups', 'g_email_flood', 'INT(10)', false, 60, 'g_search_flood'); branches/punbb-1.3-dev/upload/install.php
r1575 r1576 1265 1265 num_posts INT(10) UNSIGNED NOT NULL DEFAULT 0, 1266 1266 last_post INT(10) UNSIGNED, 1267 last_search INT(10) UNSIGNED, 1267 1268 last_email_sent INT(10) UNSIGNED, 1268 1269 registered INT(10) UNSIGNED NOT NULL DEFAULT 0, … … 1314 1315 num_posts INT NOT NULL DEFAULT 0, 1315 1316 last_post INT, 1317 last_search INT 1316 1318 last_email_sent INT, 1317 1319 registered INT NOT NULL DEFAULT 0, … … 1363 1365 num_posts INTEGER NOT NULL DEFAULT 0, 1364 1366 last_post INTEGER, 1367 last_search INTEGER, 1365 1368 last_email_sent INTEGER, 1366 1369 registered INTEGER NOT NULL DEFAULT 0, branches/punbb-1.3-dev/upload/lang/English/search.php
r1241 r1576 7 7 'No search permission' => 'You do not have permission to use the search feature.', 8 8 'Search heading' => 'Search forums using your own criteria or predefined searches', 9 'Search flood' => 'At least %s seconds have to pass between searches. Please wait a while and try searching again.', 9 10 'Predefined searches' => 'Predefined searches', 10 11 'Using criteria' => 'Using your own criteria', branches/punbb-1.3-dev/upload/search.php
r1569 r1576 95 95 message($lang_common['Bad request']); 96 96 } 97 98 // Flood protection 99 if (!$pun_user['is_guest'] && $pun_user['last_search'] != '' && (time() - $pun_user['last_search']) < $pun_user['g_search_flood'] && (time() - $pun_user['last_search']) >= 0) 100 message(sprintf($lang_search['Search flood'], $pun_user['g_search_flood'])); 97 101 98 102 // First of all lets find out if we need to cache the results, we only need to do this for detailed queries, not quicksearches or for mysql(i) … … 697 701 else 698 702 $result = $db->query($query) or error(__FILE__, __LINE__); 703 704 if (!$pun_user['is_guest']) 705 { 706 // Set the user's last_search time 707 $query = array( 708 'UPDATE' => 'users', 709 'SET' => 'last_search='.time(), 710 'WHERE' => 'id='.$pun_user['id'], 711 'PARAMS' => array( 712 'LOW_PRIORITY' => 1 // MySQL only 713 ) 714 ); 715 716 ($hook = get_hook('se_qr_update_last_search_time')) ? eval($hook) : null; 717 $db->query_build($query) or error(__FILE__, __LINE__); 718 } 699 719 700 720 // Make sure we actually have some results
