Ignore:
Timestamp:
Mar 6, 2013, 12:38:35 PM (12 years ago)
Author:
plg
Message:

compatibility with Piwigo 2.5: replace mysql_* functions by pwg_db_* equivalent

disable whois online feature for search engine robots to avoid useless CPU usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/whois_online/config.php

    r9145 r21237  
    146146// The whois_online table summary
    147147if (isset($_GET['tab']) and $_GET['tab']=='monitor') {
    148   $whois_status = mysql_fetch_assoc(pwg_query('SHOW TABLE STATUS LIKE "' . WHOIS_ONLINE_TABLE .'%" ;'));
     148  $whois_status = pwg_db_fetch_assoc(pwg_query('SHOW TABLE STATUS LIKE "' . WHOIS_ONLINE_TABLE .'%" ;'));
    149149  $whois_status['table'] = WHOIS_ONLINE_TABLE;
    150150  $whois_status['size'] = ($whois_status['Data_length'] + $whois_status['Index_length']) . ' bytes';
     
    169169        if (!empty($result))
    170170        {
    171                 while ($row = mysql_fetch_assoc($result))
     171                while ($row = pwg_db_fetch_assoc($result))
    172172                {
    173173                        $tpl[$row['session_id']] = $row['username'];
     
    187187        if (!empty($result))
    188188        {
    189                 while ($row = mysql_fetch_assoc($result))
     189                while ($row = pwg_db_fetch_assoc($result))
    190190                {
    191191                        $tpl[$row['session_id']] = $row['username'];
     
    218218          'a:1:{s:6:"fields";a:5:{s:10:"date-after";s:10:"2009-09-09";s:11:"date-before";s:10:"2009-09-09";s:5:"types";a:4:{i:0;s:4:"none";i:1;s:7:"picture";i:2;s:4:"high";i:3;s:5:"other";}s:4:"user";s:2:"-1";s:17:"display_thumbnail";s:26:"display_thumbnail_hoverbox";}}'
    219219          .'\');');
    220           $conf_whois['Search id'] = mysql_insert_id();
     220          $conf_whois['Search id'] = pwg_db_insert_id();
    221221                $conf['Whois Online'] = serialize($conf_whois);
    222222                pwg_query('REPLACE INTO ' . CONFIG_TABLE . " (param,value,comment)
     
    224224        }
    225225        // Get and Set to current date the stupid History search.
    226         list($serialized_rules) = mysql_fetch_row(pwg_query('SELECT rules FROM '.SEARCH_TABLE.'
     226        list($serialized_rules) = pwg_db_fetch_row(pwg_query('SELECT rules FROM '.SEARCH_TABLE.'
    227227          WHERE id = '.$conf_whois['Search id'].';'));
    228228        $page['search'] = unserialize($serialized_rules);
     
    234234        // Most members ever online was
    235235        if (!isset($conf_whois['Users']['count']) or $conf_whois['Users']['count'] == 0) {
    236                 $count = mysql_fetch_assoc(pwg_query('SELECT MAX(`'. $conf['user_fields']['id'] .'`) AS `ctr` FROM ' . USERS_TABLE));
     236                $count = pwg_db_fetch_assoc(pwg_query('SELECT MAX(`'. $conf['user_fields']['id'] .'`) AS `ctr` FROM ' . USERS_TABLE));
    237237                $conf_whois['Users']['count'] = $count['ctr'];
    238238        }
Note: See TracChangeset for help on using the changeset viewer.