Webmastersite.net
Register Log In

1 not working
unable to determine whether comment has been read

Comments on 1 not working

dseron


Usergroup: Customer
Joined: Jan 21, 2004

Total Topics: 7
Total Comments: 10
dseron
Posted Jan 28, 2006 - 10:53 AM:

First of all my compliments for building this great links engine. Please find below some bugs for which I ask your help.

There is a typo in prestart.php causing the Template Variable {LINKCOMMENTSREAD} to not work at all. The typo is still there in version 3.3.4.


--- prestart.php Sat Jan 28 17:35:16 2006
+++ prestart.php.orig Sun Oct 30 10:06:49 2005
-// get visitedarray data
+// get vistedarray data

-$visited = explode('[END]', $_COOKIE['commentsread']);
+$visted = explode('[END]', $_COOKIE['commentsread']);


After fixing the typo this variable still does not work the way it should. Viewing a link's comments sets a cookie called "commentsread" containing the link ID. So far so good, the template variable gets set accordingly and is useable again. But when viewing the comments a second time the cookie is deleted. Actually, the cookie "commentsread" is set again but is empty. This only happens when viewing the same link's comments for a second time.

The same resetting of cookies happens for the linksread cookie. I assume the commentsread code was copied from there, they use the same mechanism.

Thanks for your support.









Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Jan 29, 2006 - 2:06 AM:

In comments.php, the line that would set the cookie is commented out with this note:

// makecookie('commentsread', $linksread); // troublesome for opera somehow

So I'm not sure how you can find that it's being set... perhaps your version has the line uncommented.

I vaguely recall that there was an issue with opera was very hard to duplicate, occouring only after you browse around for a while. Will test what uncommenting the line does.
dseron


Usergroup: Customer
Joined: Jan 21, 2004

Total Topics: 7
Total Comments: 10
dseron
Posted Jan 29, 2006 - 5:08 AM:

In version 3.1.6 this line is not commented out yet. And since only about 0.5 percent of our visitors are using Opera I would rather leave the feature in. Thanks for investigating.
dseron


Usergroup: Customer
Joined: Jan 21, 2004

Total Topics: 7
Total Comments: 10
dseron
Posted Feb 02, 2006 - 10:24 AM:

I think I have solved this one. On top of correcting the typo's and uncommenting out the makecookie lines (in 3.20 that is) I added some code in classes/onelink.php:


// determine if this link has been read by viewer
global $visitedarray, $visitedcommentsarray;
if ($visitedarray[$this->id] != '' && $visitedarray[$this->id] > $this->lastedit)
{
$this->isread = 1;
}
else
{
$this->isread = 0;
if ($settings->trackviews == 'yes')
{
if (strstr('[END]'. $this->viewers, '[END]'. $thismember->id .'[,]')) $this->isread = 1;
}
}
if (($visitedcommentsarray[$this->id] != '' && $visitedcommentsarray[$this->id] > $this->lastcomment) || $this->numcomments == 0)
{
$this->commentsread = 1;
}
else
{
$this->commentsread = 0;
// Start bugfix
if ($settings->trackviews == 'yes')
{
if (strstr('[END]'. $this->threadviewers, '[END]'. $thismember->id .'[,]')) $this->commentsread = 1;
}
// End bugfix
}



Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Feb 03, 2006 - 5:37 PM:

Thanks, will apply for 3.3.6.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.