Projet

Général

Profil

Révision 63357b6b

ID63357b6bbff85b80b12c5c8eedc8755b022d43cc
Parent 7f8ae73b
Enfant c171e5aa

Ajouté par Rowdy.nl il y a presque 14 ans

Filter, line colours match Spotweb categories

Voir les différences:

plugins/other/spotweb_cat_average
29 29
#
30 30
# [spotweb_cat_average]
31 31
# env.period 1800                                        # The period over wich to check in seconds, default to 30 minutes (1800 seconds)
32
# env.countporn = 'no'									 # Also count porn? Default is 'yes'
32
# env.countporn 'no'                                     # Also count porn? Default is 'yes'
33 33
#
34 34

  
35 35
use strict;
36 36

  
37 37

  
38 38
# Environment variables
39
my $MYSQL      = $ENV{mysql}     || "/usr/bin/mysql";
40
my $MYSQLOPTS  = $ENV{mysqlopts} || "";
41
my $DATABASE   = $ENV{database}  || "spotweb";
42
my $PERIOD     = $ENV{period}    || 1800;
39
my $MYSQL      = $ENV{mysql}      || "/usr/bin/mysql";
40
my $MYSQLOPTS  = $ENV{mysqlopts}  || "";
41
my $DATABASE   = $ENV{database}   || "spotweb";
42
my $PERIOD     = $ENV{period}     || 1800;
43 43
my $COUNTPORN 	= $ENV{countporn} || "yes";
44 44

  
45 45

  
......
49 49

  
50 50

  
51 51
# Output for config
52
    if(defined $ARGV[0] && $ARGV[0] eq 'config') {
53
print <<EOC
52
if(defined $ARGV[0] && $ARGV[0] eq 'config') {
53
    print <<EOC
54 54
graph_title $TITLE
55 55
graph_vlabel Spots
56 56
graph_category spotweb
57 57
cat0.label Videos/images
58
cat0.colour 008edf
58 59
cat1.label Music
60
cat1.colour e9a213
59 61
cat2.label Games
62
cat2.colour 00de00
60 63
cat3.label Applications
64
cat3.colour de2500
61 65
EOC
62 66
;
63 67
    exit 0;
......
69 73
    &print_value(0);
70 74
}
71 75
else { 
72
    &print_value(0, " AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%'"); 
76
# 11-04-2011 - New pr0n filters
77
#   &print_value(0, " AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%'");
78
    &print_value(0, " AND subcatz NOT LIKE '%4%' AND subcatd NOT LIKE '%23%' AND subcatd NOT LIKE '%24%' AND subcatd NOT LIKE '%25%' AND subcatd NOT LIKE '%26%' AND subcatd NOT LIKE '%72%' AND subcatd NOT LIKE '%73%' AND subcatd NOT LIKE '%74%' AND subcatd NOT LIKE '%75%' AND subcatd NOT LIKE '%76%' AND subcatd NOT LIKE '%77%' AND subcatd NOT LIKE '%78%' AND subcatd NOT LIKE '%79%' AND subcatd NOT LIKE '%80%' AND subcatd NOT LIKE '%81%' AND subcatd NOT LIKE '%82%' AND subcatd NOT LIKE '%83%' AND subcatd NOT LIKE '%84%' AND subcatd NOT LIKE '%85%' AND subcatd NOT LIKE '%86%' AND subcatd NOT LIKE '%87%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%88%' AND subcatd NOT LIKE '%89%'"); 
73 79
}
74 80
&print_value(1);
75 81
&print_value(2);
......
81 87
    my $spots = `$MYSQL $MYSQLOPTS -e "SELECT count(*) as spots FROM $DATABASE.spots WHERE stamp > $FROMSTAMP AND category = $_[0]$_[1];"`;
82 88
    $spots =~ /(\d+)/; 
83 89
    print "cat".$_[0].".value ".$1."\n"; 
84
}
90
}

Formats disponibles : Unified diff