Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
February 10, 2012, 06:39:03 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
149518
Posts in
21086
Topics by
7530
Members
Latest Member:
dwaynebryant
WebsiteBaker Community Forum
English
Modules
(Moderator:
Argos
)
User Comments
Pages: [
1
]
Go Down
Author
Topic: User Comments (Read 7302 times)
Panther
Offline
Posts: 168
User Comments
«
on:
June 07, 2007, 09:28:12 PM »
Someone brought up about allowing only registered users to comment on a page, similar to how the News module is...
original thread:
http://forum.websitebaker.org/index.php/topic,6445.msg40275.html#new
I started thinking, and then tinkering with the Guestbook module.
Basically, I started out by copying it, and just putting the entire view page inside an IF statement that checks to see if the user is logged in.
That part worked...
So I started trying to customize the script ... since it's for registered users only, I figured it should be easy enough to eliminate asking for a name... putting in either username or display_name instead... and same with email, or maybe just eliminating the email and weblink all together, then keep the comment, and get rid of the verification since only registered users can see it anyways.
I also went thru, renaming all the variables and references from guestbook to comments, and since the guestbook hard codes the module location I went in and had to add includes for info.php so I could use the variable for that instead.
Well, I've gone and broken the admin functions for the most part.. and I can not get it to use the username or display_name variables...
I was trying to change the name field in the form from a text field to hidden, with value of USERNAME, but no matter what I tried in there, it was putting in exactly what I put in.... not pulling any sort of variable.
can someone confirm the syntax for substituting in either USERNAME or DISPLAY_NAME?
You can check it out here...
http://baker.mnpages.com/pages/sandbox/user-comments.php
Logged
Panther
Offline
Posts: 168
Re: User Comments
«
Reply #1 on:
June 07, 2007, 10:02:29 PM »
I just realized, that.. duh! I am pulling the variable correctly, but I'm pulling the text descriptions from the language file.
And by checking the template info on adding a login box, I think I found what I needed.
And fixed the admin stuff in the process.
So.. I'm attaching it here for now, the info file has a quick list of changes I made, and some I would still like to make.
Logged
cvfriend
Offline
Posts: 17
Re: User Comments
«
Reply #2 on:
June 08, 2007, 05:48:34 AM »
I tried it and it mostly worked.
The submit button didn't work until I disabled CAPTCHA. I also had to hard code the text of the submit button.
Then, I broke the whole thing. When I logged out of my site, the comments disappeared. So, I tried to change some code so that the comments would show if you are not logged in, and a message that says to post a comment, please log in or register.
Now that it's completely messed up, I'll try again sometime this weekend.
Logged
Panther
Offline
Posts: 168
Re: User Comments
«
Reply #3 on:
June 08, 2007, 01:22:21 PM »
Quote from: cvfriend on June 08, 2007, 05:48:34 AM
I tried it and it mostly worked.
The submit button didn't work until I disabled CAPTCHA. I also had to hard code the text of the submit button.
Then, I broke the whole thing. When I logged out of my site, the comments disappeared. So, I tried to change some code so that the comments would show if you are not logged in, and a message that says to post a comment, please log in or register.
Now that it's completely messed up, I'll try again sometime this weekend.
Re: the CAPTCHA, yea... sorry, I should have noted that. Until I rip all the code out for that, you'll need to make sure it's disabled.
re: submit button - I'll have to look and see, but I didn't think I changed the variable on that one in the EN file.
re: comments disappearing, yes... right now the whole module is only visible when a user is logged in. I suppose could set it up as an admin option to make comments public. Would require shifting the logic statements in view.php around I suppose.
Logged
cvfriend
Offline
Posts: 17
Re: User Comments
«
Reply #4 on:
June 13, 2007, 04:54:47 PM »
Has anyone tried this yet?
I've been playing with it so that I can show comments to anyone, but only registered users would see the link to post a comment. I removed the following from view.php
Quote
if (FRONTEND_LOGIN == 'enabled' AND is_numeric($wb->get_session('USER_ID'))) {
But, this broke the entire script. Anyone else put some thought into solving this problem? I think this would be a great addon and am willing to work on it more if I can get some pointers.
Logged
Panther
Offline
Posts: 168
Re: User Comments
«
Reply #5 on:
June 13, 2007, 07:17:28 PM »
I've been kind of tied up this week, but will try to take another crack at this sometime.. hopefully soon.
Logged
pcwacht
Guest
Re: User Comments
«
Reply #6 on:
June 13, 2007, 09:09:47 PM »
@Panther
Did had a brief look at view.php
One option could be extra settings,
show posts public - or not
show add post link public - or not
Then in view.php change the sql extra accordingly show comments to public or not
And right before the add add post link evalute the second setting
If you need help, just ask.
John
Logged
cvfriend
Offline
Posts: 17
Re: User Comments
«
Reply #7 on:
June 16, 2007, 08:28:03 AM »
Well, it's messy, but it works great now. See the attached module. I modified the view.php file so that the user comments are shown to every and the "Leave a Comment" link is shown only if you are signed in. If you are not signed in, you see two links "Login" and "Sign Up".
In the file, view.php, the section 2.3.2, I changed to the following...
Code:
if (FRONTEND_LOGIN == 'enabled' AND is_numeric($wb->get_session('USER_ID'))) {
$add_entry_link = '<a href="'.$WB_URL. '/modules/'.$module_directory.'/comment_add.php?sid='.$section_id.'&pid='.$page_id.'">'.$sign_comment. '</a>';
} else {
$no_auth = 'To leave a comment: ';
$no_auth = $no_auth . '<a href="' . WB_URL . '/account/login.php" target="_top">login</a>';
$no_auth = $no_auth . ' or ';
$no_auth = $no_auth . '<a href="' . SIGNUP_URL . '">signup</a>';
$add_entry_link = $no_auth;
}
Logged
Panther
Offline
Posts: 168
Re: User Comments
«
Reply #8 on:
June 16, 2007, 03:40:00 PM »
I'll check that out ..
My problem with taking this further is that I don't know enough about writing to the database and such yet.
I wonder as a next step though if couldn't set up two variables either in the info or view files
Something like..
$show_comments = true/false
$show_add = true/false
Then you can add two radio button options to the admin page
Make Comments public (true) or private (false)
Add Comments butt is public (true) or private (false)
Then actually, this may be able to be made a part of the regular guestbook module, and wouldn't need a second module that is essentially the same thing.
Logged
mm1108
Offline
Posts: 1
Re: User Comments
«
Reply #9 on:
July 15, 2007, 09:56:53 AM »
Captcha code is missing from
usercomments-v0.2.zip
. I modified the comment_page.php.
See attachment... This is a great module, and i think it should be added to add-ons page, it is a must for community sites....
Logged
olivier
Offline
Posts: 13
Re: User Comments : anonymus
«
Reply #10 on:
July 25, 2007, 10:29:42 PM »
But still there is the problem that when somebody wants to post a comment, there is no field to add his name. Displaying the comment shows the time and ´Unkbown´ in case of the author.
How to insert to username, in ´public´ and in ´private´ discussions?
olivier
Logged
Panther
Offline
Posts: 168
Re: User Comments : anonymus
«
Reply #11 on:
July 26, 2007, 03:29:10 AM »
Quote from: olivier on July 25, 2007, 10:29:42 PM
But still there is the problem that when somebody wants to post a comment, there is no field to add his name. Displaying the comment shows the time and ´Unkbown´ in case of the author.
How to insert to username, in ´public´ and in ´private´ discussions?
olivier
If you want to display a name, why not just use the original guestbook? This was set up specifically so only registered users can post comments. To allow anyone to enter their name defeats the purpose.
Logged
Panther
Offline
Posts: 168
Re: User Comments
«
Reply #12 on:
July 26, 2007, 05:18:11 AM »
ok, I should have been working on something else, but I ended up working on this instead.
User Comments v0.3 - (
view test page
)
Did some overall code cleanup, and modified the option that used to be for requiring the email address to toggle if the comments are displayed publicly or not.
So.. now... if you check the Public Visibility box in the admin area, the comments show up for EVERYONE. But you will only see the "add comments" link if you are registered and logged in.
Otherwise, if it's unchecked, you don't see anything unless you are registered and logged in.
There's a download link from the preview page.
Logged
olivier
Offline
Posts: 13
Re: User Comments
«
Reply #13 on:
July 26, 2007, 10:27:59 AM »
My news-module is meant as a little forum for a public discussion in our neighbourhood, where people can talk to each other, read suggestions about by example improvement of the streets, playing-fields etc. So it is more than a guestbook; the shoutbox is to simple and the real forum (in an external module) not suitable.
Most of the people do not like to register and to login; but I do not want to exclude these people from the discussion. Neither to have discussions with anonymus.
In short, I really need the display of the names of contribuants.
Thanks for your attention
Olivier
Logged
Panther
Offline
Posts: 168
Re: User Comments
«
Reply #14 on:
July 26, 2007, 01:54:17 PM »
Quote from: olivier on July 26, 2007, 10:27:59 AM
My news-module is meant as a little forum for a public discussion in our neighbourhood, where people can talk to each other, read suggestions about by example improvement of the streets, playing-fields etc. So it is more than a guestbook; the shoutbox is to simple and the real forum (in an external module) not suitable.
Most of the people do not like to register and to login; but I do not want to exclude these people from the discussion. Neither to have discussions with anonymus.
In short, I really need the display of the names of contribuants.
Thanks for your attention
Olivier
So you're using the news module for this?
That could actually be a simple tweek...
Add a line for the input form asking for the name (additional coding could pull their username if they are logged in and pre-fill the name field for them), then add it to the front of the string of the comment before it's written to the database.
Logged
olivier
Offline
Posts: 13
Re: User Comments
«
Reply #15 on:
July 26, 2007, 06:32:53 PM »
thanks Panther, I will try
ov
Logged
barramundi
Offline
Posts: 4
Re: User Comments
«
Reply #16 on:
March 05, 2008, 07:27:03 PM »
How do you include this comment in a page?
Modify the page templates to include this comment php file?
Logged
doc
Guest
Re: User Comments
«
Reply #17 on:
March 05, 2008, 09:11:07 PM »
Hello,
try the Feedback module from the
Addons repository
instead.
Regards Christian
Logged
barramundi
Offline
Posts: 4
Re: User Comments
«
Reply #18 on:
March 06, 2008, 03:19:43 PM »
Hi doc,
thanks for your reply. I did try the feedback b4, however I can't find a way to make it part a page.
The feedback seems to be an independant page it self..
The only way I can think of is to make a feedback page for every article and then link to it inside the article for comments/feedbacks
Is there a better way?
Thanks again.
Logged
barramundi
Offline
Posts: 4
Re: User Comments
«
Reply #19 on:
March 06, 2008, 03:47:12 PM »
Ok..seems to got it right.
I enable sections and add the feedback as a section in the page.
Cheers!
Logged
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
-----------------------------
English
-----------------------------
=> Help & Support
-----------------------------
General
-----------------------------
=> WebsiteBaker Website Showcase
-----------------------------
English
-----------------------------
=> Modules
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
-----------------------------
General
-----------------------------
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
-----------------------------
General
-----------------------------
=> Security Announcements
-----------------------------
Deutsch (German)
-----------------------------
=> Hilfe/Support
-----------------------------
General
-----------------------------
=> Documentation
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
=> Module & Snippets
-----------------------------
English
-----------------------------
=> Archive (posts up to 2007)
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Deutsch (German)
-----------------------------
=> jQuery
=> Tutorials
=> Templates & Design
-----------------------------
English
-----------------------------
=> jQuery
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
===> Suggestions
-----------------------------
Deutsch (German)
-----------------------------
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
===> Vorschläge
-----------------------------
English
-----------------------------
===> Software bugs
-----------------------------
Deutsch (German)
-----------------------------
===> Softwarefehler
=====> Module / Extensions
-----------------------------
English
-----------------------------
=====> Modules / Extensions
-----------------------------
Deutsch (German)
-----------------------------
===> Erfahrungs und Testberichte
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...