Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-04-24 03:37:54

Siguo
Member
From: Beijing, China
Registered: 2008-05-22
Posts: 44

problem of saveComment function

this is the saveComment function definiton in comment.php

function saveComment()
{
......
$isdup = safe_row("message,name", "txp_discuss", "name='$name' and message='$message2db' and ip='".doSlash($ip)."'");
......
}

the problem is how to define a DUP, the present function say:
If a discuss with same name, message, and ip is a dup
but that’s not true. say I want to comment two topic with the same message like “this topic is so great, thanks.”, then I fall into a dup.
maybe the correct one is:
If a discuss with same name, message, and parentid is a dup
if so, the function code should be:

function saveComment()
{
......
$isdup = safe_row("message,name", "txp_discuss", "name='$name' and message='$message2db' and parentid='".doSlash($parentid)."'");
......
}

btw, I think the whole comment system is not very good, maybe we should make it a little better.

Last edited by Siguo (2010-04-24 03:42:13)

Offline

#2 2010-04-25 15:06:22

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: problem of saveComment function

Siguo wrote:

say I want to comment two topic with the same message like “this topic is so great, thanks.”, then I fall into a dup.

I get what you’re saying but if all you are doing is adding that comment to two topics, then you’re not exactly adding value to the articles are you? ;-) Adding a comment like that is almost as useless — to the author — as a trackback, which is something else (thankfully) not available in native TXP.

Sure, it might make the author feel important to receive 500 comments from 500 people simply saying that every article they write is great, but if nobody says how or why it helped them, you might as well not bother commenting (similarly, the author might consider not bothering to allow comments if they have to wade through useless comments like this).

My hunch says people who write exactly the same message on exactly the same site on two different articles from exactly the same IP are either:

  1. ten years old unable to express themselves due to immaturity / not knowing any better
  2. just not very imaginative
  3. spamming (and not very well either: proper spammers would randomize their IPs/use a proxy!)

I think the whole comment system is not very good

And so do I. You might want to chime in over on that thread and post any mods there, because I’d like to help bring comments in line with other tags and/or a implement them in a better (still backwards-compatible!) manner. Your thoughts/code would be appreciated.

Last edited by Bloke (2010-04-25 18:53:52)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2010-04-25 18:22:36

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: problem of saveComment function

Bloke wrote:

ten years old

Don’t blame youth, blame immature. Some of us are really young here, please don’t make kids cry ;-) On serious note; also really old ppl might be behind those indentical comments. Old person’s decease is serious business.

Offline

#4 2010-04-25 18:54:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: problem of saveComment function

Gocom wrote:

Don’t blame youth, blame immature.

Hehe, sorry. That’s what I meant. No offence intended. Post adjusted to be more politically correct :-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB