Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-29 17:05:49

bit
Archived Plugin Author
From: Philippines
Registered: 2005-02-14
Posts: 65
Website

[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.

Download here.

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

#2 2006-09-27 20:32:09

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: [archived] bit_article_hitlist (formerly bit_counting_article)

Useful – thanks :¬)

Offline

#3 2006-09-30 13:31:36

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,529
Website GitHub Twitter

Re: [archived] bit_article_hitlist (formerly bit_counting_article)

Have tried my dzd_counter_view ? it seems similar no?

Offline

#4 2006-10-05 18:19:46

vittorio
Member
From: Roma caput mundi
Registered: 2006-02-01
Posts: 122
Website

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

#6 2006-10-25 19:27:04

warmbeat
Member
Registered: 2005-11-03
Posts: 33
Website

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

#7 2007-10-12 01:53:41

jagorny
Member
From: Portland, OR
Registered: 2006-08-24
Posts: 39
Website

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

#8 2007-11-25 15:33:36

ekutsenko
Member
From: Ukraine
Registered: 2005-08-16
Posts: 11
Website

Re: [archived] bit_article_hitlist (formerly bit_counting_article)

2bit: Thanks for such useful plugin. This is exactly what I was looking for!

Offline

#9 2007-12-13 17:02:28

Turbo-G
Member
From: Würzburg, Germany
Registered: 2004-04-15
Posts: 27
Website

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

#10 2009-04-18 22:47:05

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

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

Board footer

Powered by FluxBB