Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-02 06:00:35

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

[plugin] [ORPHAN] ako_random_comment

ako_random_comment
Display a random comment

This plugin is designed to allow you to display a random comment based on article ID number. This plugin was created at the request of Maniqui.

Right now it’s really limited in it’s ability (I just wanted to get it out there), so it only takes these three attributes:
  • id – the article ID from which to pull comments. (Note: it’s only taking one right now…)
  • wraptag – tag to wrap the output with
  • class – class attribute to add onto the wraptag.

I do plan on implementing some of the other features Maniqui requested (such as limits, allowing more than one article ID, output comments from a given section, and the use of article forms), but that might take a bit of time. I’m currently a bit more focused on the WP Visual.Syntax plugin port.

Also, I haven’t really tested this (just a tiny bit), so it should work, but if something goes wrong, please (a) don’t kill me, and (b) let me know so that I can fix it.

Download v0.1
More info (Not yet. Just check the sparse help file / ask here..)


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

#2 2006-07-02 06:31:29

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] ako_random_comment

Brilliant plug-in! What a wonderful idea! ;)

Ako, many thanks for taking my request!

I have tested it, and it works as expected. Very nice.
As you said, it’s quite simple right now, but thanks again for the starting kick.

Thinking in the future of the article and to have the ideas here (for reference), I quote my initial request:

Some ideas and desired attributes for the plug-in:

  • to output a random comment from a given section (“section” attribute)
  • to output a random comment from some specified articles ids. Example: <txp:random_comment id="7,15,24" />
  • would be nice if it could accept the use of article forms. This way, the output can be customized to include permanent links to the article, the title of the article, etc.
  • also, a limit attribute, so you can have a list of random comments, for example, 3 random comments…

One possible use: random product reviews.

I think a useful implementation for this requested new plug-in could be in a site that sells products and where comments are more like “product reviews”.
So, you could have at the home page or at the section front-page a random comment (review) from one of the products.

would be nice if it could accept the use of article forms. This way, the output can be customized to include permanent links to the article, the title of the article, etc.

I add: also, it would be nice if it could accept the use of comments forms (i think that comments form are, in fact, article forms) to output data about the comment (author, website, comment date).

thanks again and again and again, Ako


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2006-07-12 20:34:23

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: [plugin] [ORPHAN] ako_random_comment

I’m writing an updated version of this plugin that includes all of your enchancements.

Offline

#4 2006-07-13 05:25:52

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] ako_random_comment

Wow!
many thanks also to you, Manfre-kun.
Hope you have fun coding it!
And also hope to see you more often at forum!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2006-07-13 19:01:29

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: [plugin] [ORPHAN] ako_random_comment

maniqui wrote:

Wow!
many thanks also to you, Manfre-kun.
Hope you have fun coding it!
And also hope to see you more often at forum!

Random Comment Plugin Post

I read the forum in cycles that equate to how bored and unmotivated I am with my day job. The higher up on that scale, the more likely I am to code for fun.

Offline

#6 2006-07-13 20:15:14

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] ako_random_comment

Thanks, Manfre-kun!

Testing it right now… and works like a charm!
The only “problem” is that I have to disable the asy_jpcache plug-in because if not, the random comment stays there until the cache is cleaned, and so, it doesnt look like it’s randomly chosen.

The new request: any chance that section attribute accepts multiple comma separated values? I would like the comments from two sections to be picked up randomly.

Thanks in advance. Have fun!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#7 2006-07-13 20:26:33

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: [plugin] [ORPHAN] ako_random_comment

I can’t do anything about the caching plugin, unless I modify that. I uploaded a new version with the comma separated list of sections. (I knew you were going to ask for that as I was uploading the first version)

Offline

#8 2006-07-13 20:40:11

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] ako_random_comment

Hey! please, don’t care about the “problem” with the cache plug-in.

You are the man, Manfre!

I will try this new version… this is my way of the ninja.
thanks!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#9 2006-07-13 20:51:59

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] ako_random_comment

Mmmm, I think I’m getting a cached version of the plug-in… because it still shows 0.1 when installed and the multiple values for section attribute isn’t no working.

I have cleaned the cache, but the version it’s the same.
This happened to me once… I can’t remember how I downloaded the new version…
And maybe it’s cached not in my computer but in a server (well, my imagination thinks that is possible).

thanks!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#10 2006-07-13 21:21:13

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] ako_random_comment

Me again!

Manfre: could be any any chance to grab the title of the article to which the comment belongs?
I have tried using <txp:title /> inside the comment form but it didn’t worked.
Just the title (and not any other article field) because I’m afraid this request could overbloat the plug-in with many queries to the database

thanks!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#11 2006-07-20 21:41:55

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: [plugin] [ORPHAN] ako_random_comment

Hi Manfre,
maybe you should open a new thread for your plug-in or ako will get angry with all my posts :D

There is a little bug: when calling a comment form with your plug-in, if the comment form has a <txp:comment_time />, it won’t output the comment date. It will output today’s date for every comment.

That’s all!

Thanks!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#12 2006-07-21 02:05:27

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

Re: [plugin] [ORPHAN] ako_random_comment

Naw, I don’t mind. ;)


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

Board footer

Powered by FluxBB