Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-13 12:13:09

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

dzd_counter_view: article view counter

Hi everybody,

A new vesrsion is released (Thanks Jakob): dzd_counter_view 0.4

dzd_counter_view : it gives the number of view of an article, it did the same thing like ras_counter but without adding new table to the Data base it use just a custom field called!

The help is inside the plugin, for french community you can find description in the release page.

Download version 0.4: here

Archive version 0.3: here

Archive version 0.2: here
Archive pluggin 0.1: here

If you have comments or suggestions (for emprovements or advices) post here.

Special Thanks for Zem: for its plugin template and articles explaning how to write plugins! And Thanks To Jakob for the 0.4 update that make the plugin works well on 4.6 version and above.

New in version 0.4 :
tag registry
- optional reset and operator attributes
- revised help

New in version 0.3 :
add : custom_field = “custom_field” let you choose wich custom_field to use, by default it s “countxx” for compatibily

New in version 0.2 :
-category = “categry1,category2,…”
bq. set category to restrict the count only for the desired categories, if not set all categories are available.

-section = “section1,section2,…”
bq. set section to restrict the count only for the desired sections, if not set all sections are available.

-force = “1” or “0” (default 0)
bq. this argument force to put 0 in custom_field “countxx” if it is not numeric or blank, default 0 not enforce the value.

Last edited by Dragondz (2018-04-21 09:10:21)

Offline

#2 2006-10-01 09:52:42

murani
Member
Registered: 2006-09-20
Posts: 15

Re: dzd_counter_view: article view counter

Is it possible with this plugin to display a list of most accessed articles?

Thanks.

Last edited by murani (2006-10-01 11:33:12)

Offline

#3 2006-10-01 15:04:40

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

Re: dzd_counter_view: article view counter

The problem is of limitation of txp:article then you can’t do that easily but the new txp 4.0.4 can do that

There is a pluggin here

good luck

PS: txp:article can do that but the sorting is not numerical!

Last edited by Dragondz (2006-10-01 15:05:22)

Offline

#4 2006-10-02 09:10:42

murani
Member
Registered: 2006-09-20
Posts: 15

Re: dzd_counter_view: article view counter

OK. It’s working!
Thanks. Great plugin.

Another question:
Can I writte a zero automatically in the countxx custom field every time I writte a new article?

Offline

#5 2006-10-03 11:00:01

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

Re: dzd_counter_view: article view counter

no this feature is not implemented in this plugin,

but I will try to see how can i code that in the plugin!

Offline

#6 2006-10-03 13:27:02

murani
Member
Registered: 2006-09-20
Posts: 15

Re: dzd_counter_view: article view counter

OK. Thanks!
I’ll be waiting :)

Offline

#7 2006-10-26 14:41:52

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

Re: dzd_counter_view: article view counter

Ok the 0.2 had just been released, see the forst post for futher details,

I tested the plugin in the new version 4.0.4 and it works, it should works on 4.0.x series.

Offline

#8 2007-01-31 10:17:54

Alexsis
New Member
From: Russia
Registered: 2005-03-13
Posts: 5

Re: dzd_counter_view: article view counter

Hello!
Got and install your plugin on the resulted instruction, but a meter does not work unfortunately, that at stoppings on the article the field of countxx does not change the value. I use the svn version of textpattern. What can advise where to look?

Offline

#9 2007-04-04 15:56:57

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

Re: dzd_counter_view: article view counter

Give me the form you use.

Last edited by Dragondz (2007-04-04 15:57:28)

Offline

#10 2007-05-10 10:32:03

Alexsis
New Member
From: Russia
Registered: 2005-03-13
Posts: 5

Re: dzd_counter_view: article view counter

<txp:if_article_list>
<txp:if_custom_field name="best"><h2 class="best"><txp:else /><h2></txp:if_custom_field><a rel="bookmark" href="<txp:permlink />" title="<txp:title />"><txp:title /></a></h2>
  <txp:if_custom_field name="Price">
   <p class="rounded"><txp:custom_field name="Price" /> руб. </p>
  </txp:if_custom_field>
 <txp:hak_article_thumb link="1" linktype="page" />
 <txp:if_excerpt>
  <txp:excerpt />
  <p><txp:permlink>Подробнее… »</txp:permlink></p>
 <txp:else />
   <txp:body />
 </txp:if_excerpt>
</txp:if_article_list>
<txp:if_individual_article>
<txp:dzd_counter_view force="1" />
  <p class="crumb"><txp:etz_crumbs category="2" section="0" atitle="1" /></p>
 <txp:if_custom_field name="best"><h2 class="best"><txp:else /><h2></txp:if_custom_field><txp:title /></h2>
  <txp:if_custom_field name="Price">
    <p class="rounded"><txp:custom_field name="Price" /> руб.</p>
  </txp:if_custom_field> <p>Добавить в закладки <a href="http://del.icio.us/post?url=<txp:permlink />&amp;title=<txp:title />">del.icio.us</a> </p> 
 <span class="float">
 <txp:hak_article_image />
<p><a href="/article/dostavka" title="Доставка">Доставка</a> работает с 9.00 до 19.00 (пн-пт). Подробности по телефону: +7(495)771-20-40 </p>
 </span>
  <txp:body />
<txp:custom_field name="countxx" />
 <txp:related_articles label="Похожие товары:" limit="10" break="li" wraptag="ul" section=tovary />
<div style="clear:both;"></div>
</txp:if_individual_article>

Last edited by Alexsis (2007-05-10 10:34:23)

Offline

#11 2007-05-12 09:33:43

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

Re: dzd_counter_view: article view counter

The form you use seems ok

If you set a custom_field with name countxx, right?

Try something:

change like this:
<txp:if_individual_article>
<p class=“crumb”><txp:etz_crumbs category=“2” section=“0” atitle=“1” /></p>
<txp:if_custom_field name=“best”><h2 class=“best”><txp:else /><h2></txp:if_custom_field><txp:title /></h2>
<txp:if_custom_field name=“Price”>
<p class=“rounded”><txp:custom_field name=“Price” /> руб.</p>
</txp:if_custom_field> <p>Добавить в закладки <a href=“http://del.icio.us/post?url=<txp:permlink />&amp;title=<txp:title />”>del.icio.us</a>
</p>
<span class=“float”>
<txp:hak_article_image />
<p><a href=”/article/dostavka” title=“Доставка”>Доставка</a> работает с 9.00 до 19.00 (пн-пт). Подробности по телефону: +7(495)771-20-40
</p>
</span>
<txp:article form=“newform” />
<txp:related_articles label=“Похожие товары:” limit=“10” break=“li” wraptag=“ul” section=tovary />
<div style=“clear:both;”></div>
</txp:if_individual_article>

and cerate new article form call it “newform” and put in
<txp:dzd_counter_view force=“1” />
<txp:body />
<txp:custom_field name=“countxx” />

And tell me what happens.

Offline

#12 2007-07-27 11:19:41

premek.b
Member
From: Pilsen, CZ
Registered: 2006-05-17
Posts: 18
Website

Re: dzd_counter_view: article view counter

Hi, I played a bit with the plugin and added an (obvious ;-) small extension to allow any custom field to be used for counting. The link leads to an article + download link; the download is only a zipped PHP source of the plugin (no time to package into plugin proper, sorry).

Premek


“So, where is the patch?”
((former nick pbrada))

Offline

Board footer

Powered by FluxBB