Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
[archived] bit_article_hitlist (formerly bit_counting_article)
Notice: This thread is archived, the plugin is no longer available.
**********************************************************
bit_article_hitlist
The <txp:bit_article_hitlist />
tag creates a list of most viewed articles. This plugin uses an article custom field to count the number of times an article has been viewed. The <txp:bit_count_view />
is inserted into an article form to count the number of views an article receives.
Note: The custom field that this plugin uses must be named ‘hits’. This custom field can be any of the 10 custom fields.
<txp:bit_count_view />
This tag is inserted into the form that will be used to display the articles that you want to keep track of. It automatically increments the ‘hits’ field.
<txp:bit_article_hitlist />
This tag is built on the code of ort_article_psort by Lucas Gueñol. It has all of the same attributes except for the exclusion of the pageby and sortby attributes.
<txp:bit_article_hitlist />
attributes
form (optional)
Article form to be used
Default: default
limit (optional)
Maximum number of items to fetch.
Default: 10
category (optional)
Category of articles to list. Set to ‘?’ to set to the current category. Accepts a comma-separated list of categories.
section (optional)
Section of articles to list. Set to ‘?’ to set to the current section. Accepts a comma-separated list of sections.
author (optional)
Author of articles to list.
sortdir (optional)
Order of articles. DESC
(most views first) or ASC
(least views first)
Default: DESC
offset (optional)
Number of entries to skip.
Default: 0
Change log
v0.2
+ Replaced the bit_counting_article
tag with the bit_count_view
article form tag.
+ Renamed plugin to reduce confusion (hopefully)
v0.1.1
+ Now accepts comma-separated list of sections and categories for the section
and category
attributes.
v0.1
+ Initial release
Last edited by bit (2006-08-26 12:03:42)
“The neighboring marshmallow factory fared no better, having been unable to absorb the incredible pressure wave.”
Offline
Re: [archived] bit_article_hitlist (formerly bit_counting_article)
Useful – thanks :¬)
Offline
Re: [archived] bit_article_hitlist (formerly bit_counting_article)
Have tried my dzd_counter_view ? it seems similar no?
Offline
Re: [archived] bit_article_hitlist (formerly bit_counting_article)
Hi bit,
I can’t use this plugin :( If i install it, turn on, and put <txp:bit_count_view /> everything goes well, but when i put <txp:bit_article_hitlist /> i get the error “Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 7721 bytes) in /web/htdocs/[site]/home/textpattern/lib/txplib_db.php on line 247”
Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com…
Offline
#5 2006-10-05 18:31:39
- deronsizemore
- Member
- From: Kentucky
- Registered: 2005-11-02
- Posts: 324
Re: [archived] bit_article_hitlist (formerly bit_counting_article)
Was just going to start looking for something like this! THANKS
Offline
Re: [archived] bit_article_hitlist (formerly bit_counting_article)
Just to let you know, not sure this plugin is 4.04 ready – I updated my version of textpattern from 4.03 to 4.04 and found the plugin kicked out a mysql error.
Offline
Re: [archived] bit_article_hitlist (formerly bit_counting_article)
I am able to use this plug-in for 4.0.5 but found that the functions did not discriminate as to article status – in other words, the lists it produced included hidden, live and sticky articles, and the sticky article forcibly showed themselves in full.
I added a ‘sticky’ argument and defaulted to only showing Status = ‘4’, i.e. live articles.
Could someone explain why article functions that used to follow the general default rule of live articles only are now not filtering the various status out?
In the plug-in itself it calls core article functions. Perhaps there are new parameters to pass these functions in 4.0.5?
Thanks!
Offline
Re: [archived] bit_article_hitlist (formerly bit_counting_article)
2bit: Thanks for such useful plugin. This is exactly what I was looking for!
Offline
Re: [archived] bit_article_hitlist (formerly bit_counting_article)
I modified the first function of the plugin. Now it works with non-messy URLs, too. Just in the case you want to publisha 0.3 version!
function bit_count_view($atts) {
global $thisarticle;
$field = bit_find_hit_field();
$hits = safe_row($field." AS hits", "textpattern", "ID=".$thisarticle['thisid']);
$hitcount = (empty($hits['hits'])) ? 1 : intval($hits['hits']) + 1;
global $thisarticle;
assert_article();
$query = "UPDATE `".PFX."textpattern` SET `".$field."`='".$hitcount."' WHERE ID=".$thisarticle['thisid'];
$success = safe_query($query);
}
Offline
Re: [archived] bit_article_hitlist (formerly bit_counting_article)
Hi, I need this plugin but it seems the website is down… Could you send me or tell me where could I find this plugin?
Thanks in advance!
Offline