Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Callback event

#1 2006-06-19 02:10:27

TheEric
Plugin Author
From: Colorado & Montana.
Registered: 2004-09-17
Posts: 603
Website

Callback event

It’d be seriously nice if there were a callback_event() somewhere in comments() … preferably just before the fetch function.

Offline

#2 2006-06-19 04:20:05

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

Re: Callback event

What purpose? (That determines where the callback should be.)

Offline

#3 2006-06-19 13:57:23

TheEric
Plugin Author
From: Colorado & Montana.
Registered: 2004-09-17
Posts: 603
Website

Re: Callback event

For example, if it were right before the following:

<code>
$rs = safe_rows_start(“*, unix_timestamp(posted) as time”, “txp_discuss”, “parentid=’$id’ and visible=”.VISIBLE.” order by posted asc”);
</code>

…one could insert his own code & a return to custom tailor particulars of comment viewing. It’s there in the save function, why not under comment display?

Offline

#4 2006-06-19 18:28:02

TheEric
Plugin Author
From: Colorado & Montana.
Registered: 2004-09-17
Posts: 603
Website

Re: Callback event

Hrrm. I just realized a better explanation was necessary. Currently, I’m using a slightly modified version of Comments() to display comments specific to my particular project. It would be nice if I didn’t have to reuse all that code when all I need, is the ability to change the safe_rows_start statement above and process the output as if it were still part of Comments()

Offline

#5 2006-06-25 08:04:39

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Callback event

Mary,

I too have made mods to the comments code on my site to add a few features like delayed visibility and a time-to-live feature. You can check this out on my demo pages (try submitting a comment then refreshing the page a few times to get the idea.)

I would like to be able to pre-process each comment just before it is rendered so that I can make changes to any field in $thiscomment.
I would also like to be able to post-process the list to actually delete any that have expired.

Could this be handled with two new events? Perhaps something like comment.pre-render (issued on a per-comment basis just after the $thicomment variable is setup but before the comment form is parsed) and comments.render-complete (issued after the article’s comments have all been rendered.)

Anyway, this is not a high priority item, just a wish!

Last edited by net-carver (2006-06-25 08:05:02)


Steve

Offline

#6 2006-07-06 20:52:22

TheEric
Plugin Author
From: Colorado & Montana.
Registered: 2004-09-17
Posts: 603
Website

Re: Callback event

bump

Offline

#7 2006-07-07 00:52:22

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Callback event

1. I don’t see how having a callback solves Eric’s problem, since you still can’t change the query.

2. It sounds like many of these problems would be better solved with plugin tags placed in the comment form. <txp:abc_if_expired>, that kind of thing.

If I’m missing something, please explain further.


Alex

Offline

#8 2006-07-07 04:17:41

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: Callback event

Thanks Alex,

for my needs that is such an obvious way to proceed that I didn’t even think about it.


Steve

Offline

  1. Index
  2. » Archives
  3. » Callback event

Board footer

Powered by FluxBB