By Carly on Friday, 25 September 2015
Posted in General Issues
Replies 13
Likes 0
Views 0.9K
Votes 0
Hi,

In a previous version of easydiscuss we had done a hack to display the word "NEW" next to the avatar on any new posts.
We put the hack in post.repy.item.php at line 35 as follows
<?php echo DiscussHelper::GetUnReadNotifications($post); ?>

When we have put this in the new version it errors and further investigation seems to say that
GetUnReadNotifications is not in the DiscussHelper file.

Can you tell us where we can find it now?

Thanks
Carly
Hello Carly,

Please replace the attached file in: ../components/com_easydiscuss/models/unread.php and use this code in your post.repy.item.php.


<?php
$model = DiscussHelper::getModel( 'Unread' );
$posts = $model->getUnreadPosts($post);
echo $model->getUnreadPosts($post);
?>


Hope this helps.
·
Friday, 25 September 2015 11:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Nik,

Thanks for the reply.
We have replaced the file in the simplistic folder and updated the code but when we run the page we are getting a 1146 error when it executes
$posts = $model->getUnreadPosts($post);

Can you help with this.

Thanks
Carly
·
Friday, 25 September 2015 18:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Nik

I have checked the database and we do not have a table called unread!

Thanks
Carly
·
Friday, 25 September 2015 18:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Carly,

I'm sorry, can you use this code instead?

<?php
echo $post->user->isRead($post->id);
?>
·
Friday, 25 September 2015 18:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Nik,

We added the code below

<?php
echo $post->user->isRead($post->id);
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>" . $post->user->isRead($post->id);
?>

We see the >>>>>> but the value returned appears to be blank.

Also, do we still need the updated unread.php file or should we revert back to the original?

Thanks Carly
·
Friday, 25 September 2015 20:10
·
0 Likes
·
0 Votes
·
0 Comments
·
The return of the result is either true or false (boolean). You should run the var_dump on the output.
·
Monday, 28 September 2015 00:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Shouldn't it still display "true" or "false" as at the moment it displays nothing?

Cheers
Carly
·
Monday, 28 September 2015 20:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Carly,

Have you tried use the var_dump($post->user->isRead($post->id)) to see the result? Or you can provide us your backend and FTP so we can help you on this. By the way, you can leave the unread.php as it is.
·
Tuesday, 29 September 2015 11:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Nik,

If you could look into this for us that would be great.

Thanks
Carly
·
Tuesday, 29 September 2015 17:31
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Nik,

Feel free to add discussion posts as this is a development site.

We ran the dump and it always seems to be returning false

Carly
·
Tuesday, 29 September 2015 19:30
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Carly,

I am really sorry but we have already furnished you with the necessary codes and this is actually taking too much of our time to assist you with this. I am afraid we might have to pass this and you should really consider hiring a freelancer to assist you with the customizations.
·
Wednesday, 30 September 2015 03:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Right OK,

Thanks
Carly
·
Wednesday, 30 September 2015 04:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Carly,

Thanks for understanding.
·
Wednesday, 30 September 2015 12:29
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post