Author Topic: Modification need in next version of 4images(concerning comment_form.html)  (Read 9656 times)

0 Members and 1 Guest are viewing this topic.

Offline Kurman

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • www.kurman.ru
Hi everyone!

I was thinking about uselessness of showing the user name while adding comments, if user is already logged in.

In comment_form.html

If users are not logged in, let's them insert wanted name as an author of a comment.
But if users are already logged in, there is no need for even show them the username input area, am I right?
There enough to show them only Subject area and textinput area.

So, I myself tried make not visible that area for logged in users using {ifnot lang_loggedin_msg} like this in comment_form.html:

Code: [Select]
{ifnot lang_loggedin_msg}
                <tr>

                  <td width="90"><b>{lang_name}</b></td>

                  <td><input type="text" name="user_name" size="30" value="{user_name}" class="commentinput" /></td>

                </tr>
{endifnot lang_loggedin_msg}

But then I recieve an error, as if I did not insert username and as a result, posting of a comment fails.  :?

As I did not know how to make it work with {ifnot lang_loggedin_msg} tags I remove them.
It was unsuccessfull trying )))

But you will agree with me - it is a good idea, and it would be very nice, if this little thing would be solved in next version of 4images.
4images running as a music portal http://music.kurman.ru/

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
use these tags: {if user_loggedin}....{endif user_loggedin}

You can do it two ways:
disabling the input field:
Code: (HTML Template) [Select]
                <tr>
                  <td width="90"><b>{lang_name}</b></td>
                  <td><input type="text" name="user_name" size="30" value="{user_name}" class="commentinput" {if user_loggedin}disabled {endif user_loggedin}/></td>
                </tr>

Or completely removing it:
Code: (HTML Template) [Select]
{if user_loggedin}
                <input type="hidden" name="user_name" value="{user_name}" />
{endif user_loggedin}
{ifno user_loggedin}
                <tr>
                  <td width="90"><b>{lang_name}</b></td>
                  <td><input type="text" name="user_name" size="30" value="{user_name}" class="commentinput" /></td>
                </tr>
{endifno user_loggedin}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Kurman

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • www.kurman.ru

Oops..  :(
I've tried, but alas.. It is not working.. (both of them does not working)
There is the same error, as if username is not entered, altrough I am logged in.

Need another solution.. These tags do not let send a comment.
« Last Edit: August 26, 2009, 07:50:22 PM by Kurman »
4images running as a music portal http://music.kurman.ru/