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

Few changes i need help with
#1

Hi, I love the script but need to make some important changes, any help would be much appreciated.
  • I need to disable the form but still show the comments in the user isn't logged in (i use (isset($SESSION['user_id'])) to check if the user is logged in)
  • I need to remove the name input and replace it to automatically be filled in with the users username ( $SESSION['user_name'])
  • if the comment poster is the author of the page i want to have an icon of different color background to show this, a little like how the admin logo works but i would have to use something like if the comment posters id matches a variable i set earlier (which will be the authors id) then display the icon or bgcolor. I hope you understand what im trying to achieve here

Any help is much appreciated, i need to try to complete this site as soon as possible. Thanks very much.
Reply
#2

ok i got the name input to change to the persons username, however im struggling on disabling the form if not logged in, and changing the box style depending on a users id.
Reply
#3

Hi,

For your first question, open /comments/includes/template/form.php and find this part:
PHP Code:
<?php
if (!cmtx_is_form_enabled(true)) { //if form is disabled
return; //exit file
}
?>

Below it, add this:

PHP Code:
<?php
if (!isset($_SESSION['user_id'])) { //if user is not logged in
echo "You must log in to post a comment.";
return;
//exit file
}
?>

Have you completed the interview?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)