Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-26 21:16:10

larry
Archived Plugin Author
From: Chihuhua, Mexico
Registered: 2004-03-04
Posts: 7
Website

[archived] jas_popular_articles: List Popular Articles

Notice: This thread is archived, this plugin is no longer available.

**********************************************************

Because the hpw_most_popular_articles plugin is not available anywere, i decided to write my own popular_articles plugin <a href=“http://textpattern.org/article/625/list-popular-articles”>get it here</a> or <a href=“http://www.larry.org.mx/files/jas_popular_articles.php.txt”>here</a>.

Questions? antonio dot solis at gmail dot com

Last edited by larry (2006-06-26 21:18:07)



A mathematician is a device for turning coffee into theorems.

Offline

#2 2006-06-27 10:09:45

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

Re: [archived] jas_popular_articles: List Popular Articles

Very good job larry,

I wrote a pluggin dzd_counter_view to do the same but by using a custom field but you idea to use a log table is great!

Offline

#3 2006-06-27 16:11:23

Catalyst
Member
From: Yorkshire UK
Registered: 2005-07-30
Posts: 23
Website

Re: [archived] jas_popular_articles: List Popular Articles

This looks like an interesting plugin but on implementation all I receive is a list of numbers in brackets as an output.

Any idea as to why that may be happening?

using | txp:jas_popular_articles wraptag=“li” limit=“10” range=“m”

Offline

#4 2006-06-27 18:19:53

larry
Archived Plugin Author
From: Chihuhua, Mexico
Registered: 2004-03-04
Posts: 7
Website

Re: [archived] jas_popular_articles: List Popular Articles

Catalyst,

Well, i dont know how to help you, but i can tell you my txp setup, i’m using the Permanent Link Mode = /title and I’m Logging the Referers Only, maybe you could send me the output via email, and I’ll try to figure it out.

As always, feedback is appreciated.



A mathematician is a device for turning coffee into theorems.

Offline

#5 2006-07-07 17:59:51

Saigo
Member
Registered: 2005-01-02
Posts: 60
Website

Re: [archived] jas_popular_articles: List Popular Articles

I have the same problem as Catalyst — I’m getting an output with brackets in numbers, such as:

  1. (57)
  2. (28)
  3. (24)
  4. (22)
  5. (22)
  6. (18)
  7. (18)
  8. (16)
  9. (13)
  10. (11)

My settings are:
Permanent link mode – /section/title
Logging all hits

Offline

#6 2006-07-17 18:00:18

pedro
New Member
From: Finland
Registered: 2005-04-08
Posts: 3
Website

Re: [archived] jas_popular_articles: List Popular Articles

I have the same problem. The result I get (as html) is :

<code>
<ul>
<li><a href=“http://www.tilkkusatu.net/”></a> (689)</li>
<li><a href=“http://www.tilkkusatu.net/”></a> (600)</li>
<li><a href=“http://www.tilkkusatu.net/”></a> (426)</li>
<li><a href=“http://www.tilkkusatu.net/”></a> (294)</li>
<li><a href=“http://www.tilkkusatu.net/”></a> (277)</li>
</ul>
</code>

setting are :
  • Logging all hits
  • permalink : year/month/day/title
  • txp version : 4.0.3 (r1188)

I hope you’ll get this plugin working since it would be nice feature to have.

Edit:

Problem must be in these lines (with safe_row function) since $rs and $rs2 arrays seems to be empty.

<pre>
// Get URLs ordered by number of visits $rs = safe_rows($what,‘txp_log’, $where . $rest); // Extract article IDs foreach ($rs as $data) {

$rs2 = safe_rows(‘Title, url_title’, ‘textpattern’, ‘url_title = “’ . substr($data[“page”],1) . ‘”’); </pre>

I managed to get this working somehow when I changed it to output the $data[‘page’] variable instead $rs2… Could someone with better skills take a look at this?

Other thing is that I would like to make it filter everything else than articles. Any suggestions how this line should be changed to do that?

<pre> $where = ‘page <> “/” AND page <> “/index.php” ‘ . $range;</pre>

Last edited by pedro (2006-07-18 09:46:42)

Offline

#7 2006-07-26 15:15:01

Smaavie
Member
Registered: 2005-02-07
Posts: 25

Re: [archived] jas_popular_articles: List Popular Articles

I have the same problem.

Has anyone found a solution?

Offline

#8 2006-07-26 19:23:15

Victor Lazarro
Member
From: Berlin
Registered: 2006-06-14
Posts: 127
Website

Re: [archived] jas_popular_articles: List Popular Articles

me too …

any ideas at this time ??


good magic is better than sex, but harder to find …
http://www.lazarro.de

Offline

#9 2006-08-05 23:35:31

Victor Lazarro
Member
From: Berlin
Registered: 2006-06-14
Posts: 127
Website

Re: [archived] jas_popular_articles: List Popular Articles

is somebody still working on this problem?
or can we delete this not working plugin?


good magic is better than sex, but harder to find …
http://www.lazarro.de

Offline

#10 2006-08-26 04:59:46

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

Re: [archived] jas_popular_articles: List Popular Articles

This plug-in does not work for clean URLs.. on ly messy…

reason is… the first query pulls the page referred and counts the number of times it is referred.

the second search looks for the page referred dropping the leading slash… trouble is, the title of your article in the textpattern table is never going to include the whole URL!

I tried a few things – using strrpos() to find the last slash in the URL and then searching for matches… the trick with that is that you end up with a handful of popular links that are actually displaying… some examples of hits that would not register (popular thought they might be):

/section
/category
/?q=search+word

if it was possible to lock these out then maybe something could work, but I think the other idea of using an article tag replacement that increments a custom field works a lot better in this case.

Sorry for the bad news!

Offline

#11 2006-08-26 05:16:37

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [archived] jas_popular_articles: List Popular Articles

jagorny: you might try the plugin Dragondz mentioned instead.

Offline

#12 2006-08-26 12:12:36

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

Re: [archived] jas_popular_articles: List Popular Articles

I actually have my own plugin, bit_article_hitlist, that combines the functionality of ort_article_psort and (coincidentally) of dzd_counter_view.

I’d actually be willing to “give” my plugin to Dragondz if he likes and if anyone else would find this useful.


“The neighboring marshmallow factory fared no better, having been unable to absorb the incredible pressure wave.”

Offline

Board footer

Powered by FluxBB