Hi,
First I would like to thank you for the update to version 1.1!
I just want to know if it is correct that guest users can push the remove comment button (although the comments are not deleted??
In any case I changed line 1731 the TPsubs.template.php into
if(allowedTo('tp_articles') || $comment['posterID'] == $context['user']['id']['is_logged'])
Best regards,
Fred
The Netherlands!
Hi wildenborch
We are glad you like the new version. 8)
Please give us a little more information so that we are better able to help, the posting guidelines would help a lot.
What comments are you asking about? If it's the Articles, you can set permissions so that a guest can see comments, but not see any controls, like the Delete button.
Hi Ken,
When I post a article comment, I see the following after the comment is posted:
See attachment.
Since the comment is not deleted if I (as guest) push the delete button and because I'm redirected to the forum change line 1731 of the TPsubs.template.php making it umpossible for a guest to delete his comments.
When logged in as admin the delete behaviouw is working as it should be.
I have created a test site:
Rodebaert.nl
smf version 2.0.10
TP version 1.1
Default Forum Language is english
Browser Firefox
No mods installed
Hi wildenborch
Thanks for choosing Tinyportal. 8)
On your test site I don't see any comments on that article. Have you got a example where were can see the problem in action.
Hi Lurkalot,
Thanks for your reply but there is one article on the frontpage of this site.
I have now renamed it to Test for Ken and Lurkalot! and added some text.
here's the link http://rodebaert.nl/index.php?page=1 (http://rodebaert.nl/index.php?page=1)
Best regards,
Fred
Quote from: wildenborch on September 14, 2015, 09:32:32 PM
Hi Lurkalot,
Thanks for your reply but there is one article on the frontpage of this site.
I have now renamed it to Test for Ken and Lurkalot! and added some text.
here's the link http://rodebaert.nl/index.php?page=1 (http://rodebaert.nl/index.php?page=1)
Best regards,
Fred
Fred, I just checked the site and tried the 'Delete' button and it appeared to let me delete the article, but it returned with a page refresh.
How are your permissions set for 'Guests'?
EDIT: when logged in the 'Delete' button is not showing.
Quote from: Ken. on September 14, 2015, 11:06:47 PM
Quote from: wildenborch on September 14, 2015, 09:32:32 PM
Hi Lurkalot,
Thanks for your reply but there is one article on the frontpage of this site.
I have now renamed it to Test for Ken and Lurkalot! and added some text.
here's the link http://rodebaert.nl/index.php?page=1 (http://rodebaert.nl/index.php?page=1)
Best regards,
Fred
Fred, I just checked the site and tried the 'Delete' button and it appeared to let me delete the article, but it returned with a page refresh.
How are your permissions set for 'Guests'?
EDIT: when logged in the 'Delete' button is not showing.
Ken, this is a guest related issue. I don't think its a permissions problem (as in a setting) I think there's a problem which was missed somewhere.
wildenborch, Sorry, we'll have to look into it a bit further to see what happened.
The code you changed is not correct wildenborch. I think the code is correct on the TP side. I'm just not sure allowing guests to delete comments is a good idea?
Hi Ichbin,
You are right. Guest should not remove comments (also not the ones they made!) In fact that's not possible because if they push the delete button they are only directed to the forum and the comment is not removed at all!
The code I changed does prevent guests from seeing the delete button.
I tested this in another side.
Only logged in memebers can now see the delete button.
But if you say that the change I made is not correct at all... than you are probably right because I have no knowledge of PHP. I simply tried something (which seems to work).
Another thing I did (on the other site) is to create in the sql_Members table a ID_member 0 with Member_name Guest. I was then able to see the guest comments in your Recent Comments block. http://www.tinyportal.net/index.php?topic=31176.msg279657#msg279657 (http://www.tinyportal.net/index.php?topic=31176.msg279657#msg279657)
The main side where Tinyportal is used is not even used as a forum. I simply use Tinyportal as Blog / article writer. In my opinion Tinyportal is simply the best CMS tool for doing that. (I tried them all!) If you wish just look at: www.vanveen-nl.com (http://www.vanveen-nl.com). It's in Dutch!
On the right side you will find the recent comments block ( Recente Reacties )
Gast = Guest (the ID_member 0 )!
wildenborch are you able to delete those guest comments as admin?
Yes I am able to delete comments when logged in as Admin.
Hi Lurkalot,
I/m not sure if the following is also caused by the new functionality that guest can post but if I click the show latest comments in the USER block in the left menu I get the message Sorry, you are not allowed to comment
When, in the addressbar I type ?action=tpmod;sa=showcomments;showall
I see all comments. Without the ;showall i get te message Sorry, you are not allowed to comment.
BTW, it would be nice if this showall listing would also include a delete comment button (if logged in as admin!)
Best regards,
PS, if I should make a new topic for this, please let me know.
Quote from: wildenborch on September 15, 2015, 08:23:16 AM
Yes I am!
Thanks, at least that bit's working. Phew was worried there forma minute. ;)
I had to ask that because the login you sent me doesn't seem to work. I did reply to you PM, but the it's not easy to see you have any replies with the theme on here.
Quote from: wildenborch on September 15, 2015, 08:52:33 AM
PS, if I should make a new topic for this, please let me know.
Might be an idea to keep separate, will make it easier to track.
Thanks.
You should now be able to login.
Best regards,
Fred
And a new topic has been made!
http://www.tinyportal.net/index.php?topic=35499.msg284476#msg284476 (http://www.tinyportal.net/index.php?topic=35499.msg284476#msg284476)
Quote from: wildenborch on September 15, 2015, 09:19:31 AM
You should now be able to login.
Best regards,
Fred
Thanks. I'm investigating your issues as I type. Might take sometime to come up with something, so please bare with me. Unless someone else on the team has the answer that is. ;)
Quote from: IchBin™ on September 15, 2015, 04:59:27 AM
The code you changed is not correct wildenborch. I think the code is correct on the TP side. I'm just not sure allowing guests to delete comments is a good idea?
IchBin™ There doesn't seem to be any other way to hide that delete button for guests, other than edit that code, like wildenborch has. Am I missing something obvious?
Quote from: wildenborch on September 14, 2015, 02:11:05 PM
Hi,
First I would like to thank you for the update to version 1.1!
I just want to know if it is correct that guest users can push the remove comment button (although the comments are not deleted??
In any case I changed line 1731 the TPsubs.template.php into
if(allowedTo('tp_articles') || $comment['posterID'] == $context['user']['id']['is_logged'])
Best regards,
Fred
The Netherlands!
if you have debug enabled or check your error log you will find this causes errors.
Warning: Illegal string offset 'is_logged' in D:\wamp\www\clean5\Themes\default\TPsubs.template.php on line 1731
seems like a better fix is...
if(allowedTo('tp_articles') || $comment['posterID'] == $context['user']['id'] && !$context['user']['is_guest'])
Illori,
This change is indeed working perfectly!
Best regards,
Fred
This part of the code is not right.
$comment['posterID'] == $context['user']['id']['is_logged'])
That is comparing the poserID to a boolean if the user is logged in or not. Illori shows the correct code. :)
Quote from: IchBin™ on September 17, 2015, 06:22:34 PM
This part of the code is not right.
$comment['posterID'] == $context['user']['id']['is_logged'])
That is comparing the poserID to a boolean if the user is logged in or not. Illori shows the correct code. :)
Thanks Brad. I asked before Illori posted the solution. Even so, it's good to see we're on the right track. O0