b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.10) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Class: Hit

Source Location: /blogs/inc/MODEL/sessions/_hit.class.php

Class Hit

Property Summary
integer   $agent_ID   The ID of the user agent entry in T_useragents.
string   $agent_type   The user agent type.
mixed   $ID   ID in DB, gets set when http://www.php.net/log was called and the hit was logged.
boolean   $ignore   Ignore this hit?
string   $IP   Remote address (IP).
integer   $is_gecko   Detected browser.
integer   $is_lynx   Detected browser.
integer   $is_macIE   Detected browser.
integer   $is_NS4   Detected browser.
integer   $is_opera   Detected browser.
integer   $is_winIE   Detected browser.
boolean   $logged   Is the hit already logged?
string   $referer   The referer/referrer.
integer   $referer_domain_ID   The ID of the referer's base domain in T_basedomains
string   $referer_type   The type of referer.
string   $user_agent   The user agent.
boolean   $_is_new_view   Is this a reload? This gets lazy-filled by is_new_view().
string   $_remoteHost   The user's remote host.

[ Top ]
Method Summary
Hit   Hit()   Constructor
void   detect_admin_page()   Detect admin page
void   detect_referer()   Detect Referer (sic!).
void   detect_useragent()   Set $user_agent and detect the browser.
string   get_remote_host()   Get the remote hostname.
string   get_user_agent()   Get the User agent's signature.
boolean   is_browser_reload()   Is this a browser reload (F5)?
boolean   is_good_hit()   Is this a good hit? This means "no spam".
boolean   is_new_view()   Determine if a hit is a new view (not reloaded, (internally) ignored or from a robot).
boolean   log()   Log a hit on a blog page / rss feed.
void   record_the_hit()   This records the hit. You should not call this directly, but Hit::log() instead!

[ Top ]
Properties
integer   $agent_ID [line 131]

The ID of the user agent entry in T_useragents.


[ Top ]
string   $agent_type = 'unknown' [line 125]

The user agent type.

The default setting ('unknown') is taken for new entries (into T_useragents), that are not detected as 'rss', 'robot' or 'browser'. 'rss'|'robot'|'browser'|'unknown'


[ Top ]
mixed   $ID [line 50]

ID in DB, gets set when http://www.php.net/log was called and the hit was logged.


[ Top ]
boolean   $ignore = false [line 94]

Ignore this hit?


[ Top ]
string   $IP [line 100]

Remote address (IP).


[ Top ]
integer   $is_gecko [line 139]

Detected browser.


[ Top ]
integer   $is_lynx [line 138]

Detected browser.


[ Top ]
integer   $is_macIE [line 141]

Detected browser.


[ Top ]
integer   $is_NS4 [line 143]

Detected browser.


[ Top ]
integer   $is_opera [line 142]

Detected browser.


[ Top ]
integer   $is_winIE [line 140]

Detected browser.


[ Top ]
boolean   $logged = false [line 56]

Is the hit already logged?


[ Top ]
string   $referer [line 63]

The referer/referrer.


[ Top ]
integer   $referer_domain_ID [line 80]

The ID of the referer's base domain in T_basedomains


[ Top ]
string   $referer_type [line 73]

The type of referer.

Note: "spam" referers do not get logged. 'search'|'blacklist'|'referer'|'direct'|'spam'


[ Top ]
string   $user_agent [line 106]

The user agent.


[ Top ]
boolean   $_is_new_view [line 88]

Is this a reload? This gets lazy-filled by is_new_view().

API Tags:
Access:  protected


[ Top ]
string   $_remoteHost [line 114]

The user's remote host.

Use get_remote_host() to access it (lazy filled).

API Tags:
Access:  protected


[ Top ]
Methods
Constructor Hit  [line 150]

  Hit Hit( )

Constructor



[ Top ]
detect_admin_page  [line 216]

  void detect_admin_page( )

Detect admin page



[ Top ]
detect_referer  [line 237]

  void detect_referer( )

Detect Referer (sic!).

Due to potential non-thread safety with getenv() (fallback), we'd better do this early.

referer_type: enum('search', 'blacklist', 'referer', 'direct'); 'spam' gets used internally



[ Top ]
detect_useragent  [line 350]

  void detect_useragent( )

Set $user_agent and detect the browser.

This function also handles the relations with T_useragents and sets $agent_type.



[ Top ]
get_remote_host  [line 567]

  string get_remote_host( [ $allow_nslookup = false]  )

Get the remote hostname.

Parameters:
   $allow_nslookup: 


[ Top ]
get_user_agent  [line 556]

  string get_user_agent( )

Get the User agent's signature.



[ Top ]
is_browser_reload  [line 676]

  boolean is_browser_reload( )

Is this a browser reload (F5)?


API Tags:
Return:  true on reload, false if not.


[ Top ]
is_good_hit  [line 665]

  boolean is_good_hit( )

Is this a good hit? This means "no spam".



[ Top ]
is_new_view  [line 612]

  boolean is_new_view( )

Determine if a hit is a new view (not reloaded, (internally) ignored or from a robot).

'Reloaded' means: visited before from the same user (in a session) or from same IP/user_agent in the last reloadpage_timeout seconds.

This gets queried by the Item objects before incrementing its view count (if the Item gets viewed in total ($dispmore)).


Information Tags:
Todo:  fplanque>> if this is only useful to display who's online or view counts, provide option to disable all those resource consuming gadgets. (Those gadgets should be plugins actually, and they should enable this query only if needed) blueyed>> Move functionality to Plugin (with a hook in Item::content())?!

[ Top ]
log  [line 465]

  boolean log( )

Log a hit on a blog page / rss feed.

This function should be called at the end of the page, otherwise if the page is displaying previous hits, it may display the current one too.

The hit will not be logged in special occasions, see $ignore and is_good_hit().

It will call Hitlist::dbprune() to do the automatic pruning of old hits in case of auto_prune_stats_mode == "page".


API Tags:
Return:  true if the hit gets logged; false if not


[ Top ]
record_the_hit  [line 526]

  void record_the_hit( )

This records the hit. You should not call this directly, but Hit::log() instead!

However, if a Plugin registers the Plugin::AppendHitLog(), it could be necessary to call this as a shutdown function.


API Tags:
Usedby:  basic_antispam_plugin::double_check_referer()


[ Top ]

Documentation generated on Tue, 20 May 2008 01:41:19 +0200 by phpDocumentor 1.4.2