Ignore:
Timestamp:
Jul 28, 2009, 9:33:06 PM (15 years ago)
Author:
vdigital
Message:

Minor release: 2009-07-28 2.0.j

Minor changes in Config management
Additionnal flags (Ireland, Armenia, Estonia, Kazakhstan, Belarus,
Andorra, Turkey, Albania, Bosnia and Herzegovina, Azerbaijan, Iceland, European Union,
Israel, Morocco, New Caledonia and some other revised)
Search Engine trapping

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/whois_online/reload.php

    r3319 r3695  
    99                define('IN_ADMIN', true);
    1010                include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
     11                $conf['show_gt'] = true;
    1112                $included = false;
    1213                load_language('plugin.lang', WHOIS_ONLINE_PATH);
     
    7980$limit = 20;
    8081$ql = 0;
     82$inlist = '0';
     83foreach ($online as $k => $v) {
     84  $inlist .= ', ' . implode( ', ', explode(' ',$online[$k]['last_elm_ids']));
     85        $ql++;
     86        if ($ql >= $conf_whois['Radar limit']) break;
     87}
     88$image = array();
     89$result = pwg_query('SELECT * FROM ' . IMAGES_TABLE .
     90        ' WHERE id IN (' . $inlist .');');
     91while ($row = mysql_fetch_assoc($result)) {
     92        $images[$row['id']] = $row;
     93        $images[$row['id']]['tn_url'] = get_thumbnail_url($row);
     94}
    8195foreach ($online as $k => $v) {
    8296  // The stupid History search will be reused instead of created... (even if History search will recreate it)
     
    100114                $online[$k]['guest'] =  false;
    101115        }
    102         $ql++;
    103116        // Images queries are limited (no cluetip over $conf_whois['Radar limit'])
    104117        // For performance reasons
    105         if ($ql <= $conf_whois['Radar limit']) {
    106                 $result = pwg_query('SELECT * FROM ' . IMAGES_TABLE .
    107                         ' WHERE id IN (' . implode(', ',explode(' ',$online[$k]['last_elm_ids'])) .');');
    108                 while ($row = mysql_fetch_assoc($result)) {
    109                         $online[$k]['images'][$row['id']] = $row;
    110                         $online[$k]['images'][$row['id']]['ws_level'] = ($row['level']>$online[$k]['user']['level']) ? 'ws':'';
    111                         $online[$k]['images'][$row['id']]['tn_url'] = get_thumbnail_url($row);
    112                         $online[$k]['images'][$row['id']]['url_modify'] = PHPWG_ROOT_PATH . 'admin.php?page=picture_modify&image_id='.$row['id'];
    113                 }
    114         } else {
    115         // Only the id is available for links (NO LEVEL CONTROL)
    116                 foreach (explode(' ',$online[$k]['last_elm_ids']) as $id) {
    117                         if ($id > 0) {
     118        $online[$k]['Bot'] = is_a_bot($online[$k]['user_agent']);
     119        $online[$k]['last_ids'] = explode(' ',$online[$k]['last_elm_ids']);
     120        foreach ($online[$k]['last_ids'] as $id) {
     121                        if (isset($images[$id])) {
     122                                $online[$k]['images'][$id] = $images[$id];
     123                                $online[$k]['images'][$id]['ws_level'] = ($images[$id]['level']>$online[$k]['user']['level']) ? 'ws':'';
     124                        }
    118125                        $online[$k]['images'][$id]['id'] = $id;
    119                         $online[$k]['images'][$row['id']]['url_modify'] = PHPWG_ROOT_PATH . 'admin.php?page=picture_modify&image_id='.$id;
    120                         }
     126                        $online[$k]['images'][$id]['url_modify'] = PHPWG_ROOT_PATH . 'admin.php?page=picture_modify&image_id='.$id;
    121127                }
    122128        }
    123 }
     129
    124130pwg_debug('*********** Radar reloaded ***********');
    125131$template->assign('search_results', $online);
Note: See TracChangeset for help on using the changeset viewer.