Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 06:59:03 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155534 Posts in 21713 Topics by 7737 Members
Latest Member: chris85
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: News comments with name and email  (Read 1131 times)
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« on: June 22, 2010, 04:46:36 PM »

Is it possible to add name and email fields to the News comment function, just like the Feedback module has?
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
pcwacht
AddOn Development
*
Offline Offline

Posts: 2859



WWW
« Reply #1 on: June 22, 2010, 05:49:49 PM »

yups it is.

can be coded into the core, wouldn't be to hard.

John

edit -> core is newsodule
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #2 on: June 22, 2010, 06:11:28 PM »

Even better: visitors should register before being able to add a comment, but all comments are visiible to everyone. Like descibed in http://www.websitebaker2.org/forum/index.php/topic,10764.0.html. I don't know how to apply the fix that is described there upon the current News module. It's different code.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
pcwacht
AddOn Development
*
Offline Offline

Posts: 2859



WWW
« Reply #3 on: June 22, 2010, 06:15:49 PM »

Hmm code seems incomplete

starts with an if, the ending } seems missing

But now I know what you mean.

Hold on Wink

John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
pcwacht
AddOn Development
*
Offline Offline

Posts: 2859



WWW
« Reply #4 on: June 22, 2010, 07:26:54 PM »

replace modules/news/view.php with attached one

What I did around line 426
Code:
// Show comments section if we have to
// Original line:
// if(($post['commenting'] == 'private' AND isset($wb) AND $wb->is_authenticated() == true) OR $post['commenting'] == 'public')
// New line
if($post['commenting'] != 'disabled')
{
// New Lines!!! added by PCWacht - see forum -> http://www.websitebaker2.org/forum/index.php/topic,10764.0.html
        // Print comments header
        if ((($post['commenting'] == 'private') AND (isset($wb) AND $wb->is_authenticated() == true)) OR ($post['commenting'] == 'public'))
        {
$values = array(WB_URL.'/modules/news/comment.php?post_id='.POST_ID.'&section_id='.$section_id.'hier', $MOD_NEWS['TEXT_COMMENTS']);
        } else {
$values = array(WB_URL.'/account/signup.php',  $MOD_NEWS['TEXT_COMMENTS']);
        }
// End News Lines!!!       
// Print comments header
$vars = array('[ADD_COMMENT_URL]','[TEXT_COMMENTS]');
// Original line!!!
// $values = array(WB_URL.'/modules/news/comment.php?post_id='.POST_ID.'&section_id='.$section_id, $MOD_NEWS['TEXT_COMMENTS']);
// End Original Line!!!

Have fun,
John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #5 on: June 22, 2010, 11:16:07 PM »

Great John, thanks very much!! I appreciate it!
I'll try it out tomorrow  grin
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #6 on: June 23, 2010, 04:23:10 PM »

Hi John, it doesn work. I don't see any difference with the regular situation, except that the link for posting comment is wrong. In the code I see the word "hier", maybe that's causing trouble?
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
pcwacht
AddOn Development
*
Offline Offline

Posts: 2859



WWW
« Reply #7 on: June 23, 2010, 07:34:21 PM »

Hmmm the 'hier' is a debug issue wich I forgot to remove, sorry.

Code:
$values = array(WB_URL.'/modules/news/comment.php?post_id='.POST_ID.'&section_id='.$section_id.'hier', $MOD_NEWS['TEXT_COMMENTS']);
must be changed to:
Code:
$values = array(WB_URL.'/modules/news/comment.php?post_id='.POST_ID.'&section_id='.$section_id, $MOD_NEWS['TEXT_COMMENTS']);

What it should do (and it does so on my test xampp) is done in this litle bit, the rest of the changes is merely to let this bit do it's work:
Code:
        if ((($post['commenting'] == 'private') AND (isset($wb) AND $wb->is_authenticated() == true)) OR ($post['commenting'] == 'public'))
        {
$values = array(WB_URL.'/modules/news/comment.php?post_id='.POST_ID.'&section_id='.$section_id.'hier', $MOD_NEWS['TEXT_COMMENTS']);
        } else {
$values = array(WB_URL.'/account/signup.php',  $MOD_NEWS['TEXT_COMMENTS']);
        }
if comments is set to private AND user is logged in OR comments is set to public, show the add comments link, else it should set the link to login.
It shouldn't do more then this, cause showing other texts etc , then those texts should be baked into the view.php, wich I am not fond of, but can be done ofcourse.

change for example
Code:
$values = array(WB_URL.'/account/signup.php',  $MOD_NEWS['TEXT_COMMENTS']);
to
Code:
$values = array(WB_URL.'/account/signup.php', 'You need to be logged in to post comments');

John



Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #8 on: June 23, 2010, 11:07:04 PM »

Sorry John, doesn't work on my install. The comment link is shown regardless of the settings in the backend (what is the difference between the comments switch in the news settings, and in the news item settings, by the way?). Besides that, the comment link that is shown within a comment allready given is incorrect.

But don't feel obliged to spend more time on this, my client just emailed me that work on the comments function is not needed anyway. We will leave is as it is.

Thanks for your effort.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
pcwacht
AddOn Development
*
Offline Offline

Posts: 2859



WWW
« Reply #9 on: June 24, 2010, 07:24:51 AM »

should work when commenting is PRIVATE, hmmm, news module 3.5?


difference between comments switch settings and post
the switch from settings is used to set deafult for post I think

In view the switch from the post is used.

John
Logged

http://www.ictwacht.nl = Dutch ICT info
http://www.pcwacht.nl = My first
both still work in progress, since years.....
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #10 on: June 24, 2010, 10:07:29 AM »

should work when commenting is PRIVATE, hmmm, news module 3.5?

Yes.

Quote
difference between comments switch settings and post
the switch from settings is used to set deafult for post I think

In view the switch from the post is used.


Ah, sounds logical indeed. Thanks.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
tkche

Offline Offline

Posts: 12


« Reply #11 on: April 14, 2011, 06:13:55 AM »

it didnt worked for me so i double checked it, just a small fix needed...

the following line:
Code:
if($post['commenting'] != 'disabled')
should be
Code:
if($post['commenting'] != 'none')
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!