Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Spiders - Filtering from Who's Online?

    Here is what I changed in who's online to accomplish filtering out the spiders around line 197 zen 1.3.8:


    changed this:

    PHP Code:
    $whos_online $db->Execute("select customer_id, full_name, ip_address, time_entry, time_last_click,
                                          last_page_url, session_id, host_address, user_agent
                                   from " 
    TABLE_WHOS_ONLINE "
                                   order by 
    $order"); 
    to this:

    PHP Code:
    $whos_online $db->Execute("select customer_id, full_name, ip_address, time_entry, time_last_click,
                                          last_page_url, session_id, host_address, user_agent
                                   from " 
    TABLE_WHOS_ONLINE "
                                   where full_name <> '&yen;Spider'
                                   order by 
    $order"); 
    ~DD

  2. #12
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Spiders - Filtering from Who's Online?

    I also added this around line 334 to show what product they were looking at :

    I changed this:

    PHP Code:

    } else {
                          echo 
    "<a href='" $whos_online->fields['last_page_url'] . "' target=new>" '<u>' $whos_online->fields['last_page_url'] . '</u>' "</a>";
     } 
    to this :

    PHP Code:

     
    } else {
                                            
                            
    $result preg_match("/products_id=([0-9999]*)/"$whos_online->fields['last_page_url'], $matches);
                            
                            if (
    $result) {
                            
                            
    $model_var $matches[1];
                            
                            
    $model_qry $db->Execute("select products_id, products_name
                                   from " 
    TABLE_PRODUCTS_DESCRIPTION "
                                   where " 
    $model_var "= products_id
                                   "
    );
                            
                            
    $model_num =  $model_qry->fields['products_name'];
                            
                            
                            } else {
                            
                            
    $model_num $whos_online->fields['last_page_url'];
                            
                            }
                                
                          echo 
    "<a href='" $whos_online->fields['last_page_url'] . "' target=new>" '<u>' $model_num  '</u>' "</a>";
     } 
    Thought I would share this too.

    ~DD

  3. #13
    Join Date
    Dec 2008
    Location
    Florida
    Posts
    49
    Plugin Contributions
    0

    Default Re: Spiders - Filtering from Who's Online?

    love it! thanks so much for the code - especially the product text code.

  4. #14
    Join Date
    Jul 2005
    Location
    Orlando, Fl
    Posts
    345
    Plugin Contributions
    0

    Default Re: Spiders - Filtering from Who's Online?

    Thanks, I'm glad this helps. I have since updated the products code...

    PHP Code:

                        
    } else {
                                        
                            if (
    preg_match("/products_id=([0-9999]*)/"$whos_online->fields['last_page_url'], $matches)) {
                            
                            
    $model_var $matches[1];
                            
                            
    $model_qry $db->Execute("select products_id, products_name
                                   from " 
    TABLE_PRODUCTS_DESCRIPTION "
                                   where " 
    $model_var "= products_id
                                   "
    );
                            
                            
    $model_num =  $model_qry->fields['products_name'];
                            
                            
                            } else {
                            
                            if (
    preg_match("/cPath=([0-9999_]*)/"$whos_online->fields['last_page_url'], $matches)) {
                            
                            if (
    strrchr($matches[1],'_') == true) { 
                            
                            
    $model_var substr(strrchr($matches[1],'_'),+1) ;
                            
                            } else { 
                            
                            
    $model_var $matches[1];
                            
                            }
                            
                                                                
                            
    $model_qry $db->Execute("select categories_id, categories_name
                                   from " 
    TABLE_CATEGORIES_DESCRIPTION "
                                    where " 
    $model_var "= categories_id
                                   "
    );
                            
                            
    $model_num =  'CAT - ' $model_qry->fields['categories_name'];
                            
                            
                            } else {
                            
                            if (
    preg_match("/main_page=([A-Za-z0-9999_]*)/"$whos_online->fields['last_page_url'], $matches)) {
                            
                            
    $model_num strtoupper ($matches[1]);
                            
                            } else {
                            
                            
                            if (
    preg_match("$/$"$whos_online->fields['last_page_url'])){
                            
                                        
                            
    $model_num 'HOME'
                            
                            } else {
                            
                            
    $model_num $whos_online->fields['last_page_url'];
                            
                            }
                            
                            }
                            
                            } 
                            
                            }
                                
                          echo 
    "<a href='" $whos_online->fields['last_page_url'] . "' target=new>" '<u>' $model_num  '</u>' "</a>";
                        } 

  5. #15
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: Spiders - Filtering from Who's Online?

    FANTASTIC ADDITION!

    this combined with the enhanced whos online makes life so much sweeter, i think you should certainly add this as to the zen addon directory!

    thanks!!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Enhanced Who's Online Module - how do I see spiders?
    By Bruce1952 in forum All Other Contributions/Addons
    Replies: 13
    Last Post: 30 Jul 2009, 01:08 AM
  2. Weird results from Who's online
    By 5869 in forum General Questions
    Replies: 3
    Last Post: 5 Feb 2008, 09:24 AM
  3. Removing pages from Who's Online
    By Flipside in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 26 Jan 2007, 02:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg