After testing with bbclone, i improve the bbclone analitics-code from @Felix with custom titles for my search.php- and tags.php pages.
First filter the search and tag terms from the url (i used the I18N Search-plugin)
search.php template:
tags.php template:
Put the improved bbclone-code in the footer.inc.php:
Without this code and using search- or tag results it shows only the page title: Search or Tags without the terms.
With this code it shows Search results for: SEARCH_WORD or Tag: TAG
If you wish test and see, go to my website and the statistics page , and click on a tag or using a search term.
Also thanks to @Felix for his code snippet ;-)
- USING VIEWS/HITS on a single page:
On a post-page you can also see the views per single page.
Adding this code-snippet in your_template.php-template:
Show the views/hits on your page:
Extra tip:
bbclone using the title as page-id.
If the title > 60 characters then it doesn't show the hits on your single post page correctly.
You can increase the characters in bbclone/conf/config.php, so you can see the hits on your single page correctly (for my needs a changed to 80:
Voila, thats my experience with bbclone until now :-)
Feel free using and customize all this code-snippets for your needs.
Hope can help someone improve his bbclone statistics.
First filter the search and tag terms from the url (i used the I18N Search-plugin)
search.php template:
Code:
<?php if (@$_REQUEST['words']) { // show search term(s) ?>
<h1 class="page-title">Zoekresultaten voor: <span>
<?php
// filter the SEARCH WORD from the url:
// YOUR_SITE.COM/search/?words=SEARCH_WORD&search=Zoeken
$search_word = htmlspecialchars($_REQUEST['words']); ?>
<?php echo $search_word; ?></span>
</h1>
<?php } ?>
tags.php template:
Code:
<?php if (@$_REQUEST['tags']) { // show tag ?>
<h1 class="page-title">Tag: <span>
<?php
// filter the TAG from the url:
// YOUR_SITE.COM/tags/?tags=TAG_NAME
$tag_name = htmlspecialchars($_REQUEST['tags']); ?>
<?php echo $tag_name; ?></span>
</h1>
<?php } ?>
Put the improved bbclone-code in the footer.inc.php:
Code:
<?php
// BBCLONE Analytics
$analytics_title = return_page_title(); // default title
if ($template_file == 'tags.php') {
// $tag_name = available at tags.php
$analytics_title = "Tag: ".$tag_name;
}
else if ($template_file == 'search.php') {
// $search_word = available at search.php
$analytics_title = "Zoekresultaten voor: ".$search_word;
}
if (return_page_title()=='Oops! Page not found!') {
// do nothing
} else { // activate bbclone analytics script
define("_BBC_PAGE_NAME", $analytics_title);
define("_BBCLONE_DIR", "bbclone/");
define("COUNTER", _BBCLONE_DIR."mark_page.php");
if (is_readable(COUNTER)) include_once(COUNTER);
}
?>
Without this code and using search- or tag results it shows only the page title: Search or Tags without the terms.
With this code it shows Search results for: SEARCH_WORD or Tag: TAG
If you wish test and see, go to my website and the statistics page , and click on a tag or using a search term.
Also thanks to @Felix for his code snippet ;-)
- USING VIEWS/HITS on a single page:
On a post-page you can also see the views per single page.
Adding this code-snippet in your_template.php-template:
Code:
<?php
//-------Display single page visits -----------
require("bbclone/var/access.php");
// number of hits by title
$single_page_hits = $access["page"][return_page_title()]["count"];
if (empty($single_page_hits)) {
// needed instead shows nothing
$single_page_hits = 0;
}
?>
Show the views/hits on your page:
Code:
<?php echo $single_page_hits; ?>
Extra tip:
bbclone using the title as page-id.
If the title > 60 characters then it doesn't show the hits on your single post page correctly.
You can increase the characters in bbclone/conf/config.php, so you can see the hits on your single page correctly (for my needs a changed to 80:
Code:
// The max. number of characters for the page name.
// Longer page names will be stripped-down at the front, leading with "..."
// IMPORTED NOTE: This option changes how page names are recorded,
// so you may need to reset the stats.
// Syntax:
// $BBC_MAX_PAGENAME = 60; => 60 characters (default)
$BBC_MAX_PAGENAME = 80;
Voila, thats my experience with bbclone until now :-)
Feel free using and customize all this code-snippets for your needs.
Hope can help someone improve his bbclone statistics.