vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Can i keep attachment views out of who's online? (https://vborg.vbsupport.ru/showthread.php?t=44404)

Sean335 10-08-2002 04:09 AM

Can i keep attachment views out of who's online?
 
I don't really care about how much bandwidth the site uses up, but i do care about the stats on the board. When people link attached images on other sites, the visitors skyrocket and show hundreds of people all viewing one attachment. Is there a way i can stop attachment views from showing up in who's online, but still allow off-site linking?

Xenon 10-08-2002 11:44 AM

hmm, open online.php find
PHP Code:

      if (!$thread[title][$post[$userinfo[postid]]] || !$forum[canview][$thread[forumid][$post[$userinfo[postid]]]] || (!$forum[canviewothers][$thread[forumid][$post[$userinfo[postid]]]] && $thread[postuserid][$post[$userinfo[postid]]] != $bbuserinfo[userid])) {
        
$userinfo[where] = "Viewing Attachment";
      } else {
        
$userinfo[where] = "Viewing Attachment in Thread <a href='showthread.php?s=$session[sessionhash]&postid=$userinfo[postid]'>".$thread[title][$post[$userinfo[postid]]]."</a>";
      } 

and replace it with
PHP Code:

 $userinfo[where]=""

that means it won't show viewing announcements, but the guest remain listed on who's online, just no location

Sean335 10-08-2002 10:24 PM

That just took out the text of where they were, but they still showed up as a user. I found something that seemingly works well though.

I replaced
PHP Code:

else { // Guest
      
$guests[$count][location] = $user[location];
      
$guests[$count][invisible] = 0;
      
$guests[$count][username] = "Guest";
      if (
$WOLresolve && $usergroupdef['canwhosonlineip']) {
        
$guests[$count][ipaddress] = @gethostbyaddr($user[host]);
      } else {
        
$guests[$count][ipaddress] = $user[host];
      }
      
$guests[$count][lastactivity] = $user[lastactivity];
      
$count++;
    } 

with
PHP Code:

else { // Guest
        
if(!strstr($user[location],'attachment.php'))
        {
            
              
$guests[$count][location] = $user[location];
              
$guests[$count][invisible] = 0;
              
$guests[$count][username] = "Guest";
              if (
$WOLresolve && $usergroupdef['canwhosonlineip']) {
                
$guests[$count][ipaddress] = @gethostbyaddr($user[host]);
              } else {
               
$guests[$count][ipaddress] = $user[host];
              }
              
$guests[$count][lastactivity] = $user[lastactivity];
              
$count++;
        }
    } 

and in index.php i replaced
PHP Code:

  $loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut"); 

with
PHP Code:

  $loggedins=$DB_site->query_first("SELECT COUNT(*) AS sessions FROM session WHERE userid=0 AND lastactivity>$datecut AND location NOT LIKE '%attachment.php%'"); 

anything i may have missed or messed up?

Xenon 10-09-2002 09:55 AM

seems ok to me :)


All times are GMT. The time now is 11:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01031 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete