static string extract_keyphrase_from_referer(
string
$ref
)
|
|
Extract the keyphrase from a search engine referer url
Typically http://google.com?s=keyphraz returns keyphraz
Parameters:
API Tags:
static string extract_serprank_from_referer(
string
$ref
)
|
|
Extract the "serp rank" from a search engine referer url
Typically http://google.com?s=keyphraz&start=18 returns 18
Parameters:
API Tags:
Constructor
This may INSERT a basedomain and a useragent but NOT the HIT itself!
void detect_admin_page(
)
|
|
Detect admin page
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
Set $user_agent and detect the browser.
This function also handles the relations with T_useragents and sets $agent_type.
Get the User agent's name.
string get_agent_platform(
)
|
|
Get the User agent's platform.
Get the User agent's type.
Get the keyphrase from the referer
integer get_referer_domain_ID(
)
|
|
Get referer_domain_ID (ID of the referer in T_basedomains).
API Tags:
| Return: | (may be NULL, but should never). |
string get_remote_host(
[
$allow_nslookup = false]
)
|
|
Get the remote hostname.
Parameters:
Get the serprank from the referer
Get the User agent's signature.
API Tags:
| Return: | False, if not provided or empty, if it included tags. |
boolean is_browser_reload(
)
|
|
Is this a browser reload (F5)?
API Tags:
| Return: | true on reload, false if not. |
Determine if a hit is a new view (not reloaded 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())?! |
T-Tag: 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 |
| Uses: | Log::record_the_hit() |
This records the hit. You should not call this directly, but Hit::log() instead!
However, if a Plugin registers the AppendHitLog event, it could be necessary to call this as a shutdown function.
API Tags:
boolean should_be_logged(
)
|
|
Tell if a HIT should be logged: