This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Adding code
#1

I have installed commentics on some custom pages in my forum. I am very happy with commentics - Thanks ShyHeart - but I am not happy that it doesn't have a login for the name of the commenter.

I would like it to join with the login of my entire site but only if someone actually wants to comment (reading is free)

I have the code that will not let you enter the page without logging in but that is not what I want.

I want the comment section to display the name of the logged in user or send them to login

Here is the code that forced login for the page (which I don't want) - I want guests to be able to see all including comments but to need to register/login to comment
Quote:// ----- Start mod - Force Login ------ //
if ($config['allow_force_login'])
{
if ($config['allow_force_login_bots'])
{
if ($config['allow_force_login_custom'] && $user->data['user_id'] == ANONYMOUS || $user->data['is_bot'])
{
login_box();
}
}
else if ($config['allow_force_login_custom'] && $user->data['user_id'] == ANONYMOUS)
{
login_box();
}
}
// ----- End mod - Force Login -------- //

I think this is all that is needed.

Here is the page that has this set up on it http://childchat.org/strollers.php (If you choose that page you are sent to login)

anything else will allow you to view without login
Reply
#2

Hi,

Unfortunately this is beyond the scope of free support.

You could hire a programmer if you can't do this yourself.

Have you completed the interview?
Reply
#3

I think I can do it since I actually have the code that does it.

I'm just not sure which program you enter your name in. I assume it's cmtx_name which I found in

\includes\app\processor.php
\includes\functions\comments.php
\includes\functions\processor.php
\includes\template\form.php
\includes\variables\set_variables.php
\includes\variables\unset_variables.php

So I need to know which script you actually enter your name in

thanks
Reply
#4

Does this help?
http://www.commentics.org/wiki/doku.php?...in_details

Have you completed the interview?
Reply
#5

Saw that and I'm looking for the value to go in here $cmtx_set_name_value = '';
but what I need more is to know what actual program inputs the comments cause then I'll say If $cmtx_set_name_value = '' go to login (however you say that in PHP) but I need to know where you usually input the name before commenting
Reply
#6

I got the $cmtx_set_name_value to display the name of the already loggedin user on the Name: line.

I would like to force guests that want to comment to go to my forum's login page before commenting. I have the code. All I need is to know in which program a user enters their name. Then I can force them to login. I do not know my way around the commentic files so I cannot find it.
Reply
#7

Why don't you just hide the form if the user is not logged in. Where the form is hidden, display a link to login. The form is displayed in /comments/includes/template/form.php.

The way you seem to want to do it is to wait until the user tries to post a comment and if they're not logged in then redirect them to the login page where they would lose their comment. If you really want to do that then the code which handles the name input is in /comments/includes/app/processor.php on line 112 onwards.

Have you completed the interview?
Reply
#8

Thanks - this will work (till my next question Blush)
Reply
#9

Quote:Why don't you just hide the form if the user is not logged in. Where the form is hidden, display a link to login.

That idea worked very well. So far I didn't touch the commentic file. I just put a big YOU MUST LOGIN TO COMMENT button right before the comments start. That only appears if the user isn't logged in.

I have the form hidden and you can press 'open the form' which will have the name of the user or Anonymous on the name line.

Is there a way that instead of choosing Hide form and then letting everyone open it, instead can it be that if $cmtx_set_name_value is "" it just stays hidden without the option of opening it. And if $cmtx_set_name_value = a name it's not hidden? I don't want to have anonymous as the name
Reply
#10

Quote:Why don't you just hide the form if the user is not logged in

is that an option on the admin panel?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Steven
06-Aug-2014, 08:43 PM
Last Post by ppiper
19-Oct-2011, 04:23 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)