Author Topic: field headline optional in comments  (Read 22597 times)

0 Members and 1 Guest are viewing this topic.

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
field headline optional in comments
« on: April 18, 2005, 03:04:34 PM »
How to make field headline optional in comments?
In old forum code was somewhere....
Again this addres?!
http://www.funny.lt

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
Re: field headline optional in comments
« Reply #1 on: April 19, 2005, 02:21:22 AM »
remove/comment out from details.php
Code: [Select]
    if ($comment_headline == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
      $error = 1;
    }
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 universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: field headline optional in comments
« Reply #2 on: April 19, 2005, 04:46:29 AM »
And the same with field "name". I want remove it, if comment posted by guest, name will be Guest, else name will be by registered username
Again this addres?!
http://www.funny.lt

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
Re: field headline optional in comments
« Reply #3 on: April 19, 2005, 04:54:28 AM »
if its a statement - then yes.
if its a question, I dont see any question marks...;)
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 universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: field headline optional in comments
« Reply #4 on: April 19, 2005, 05:01:28 AM »
Jeah jeah shame on me  :lol:  :oops:
That was a question, without question marks  :wink:

I`ll try one more time:
And the same with field "name". I want remove it, if comment posted by guest, name will be Guest, else name will be by registered username :?:

 :)
Again this addres?!
http://www.funny.lt

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
Re: field headline optional in comments
« Reply #5 on: April 19, 2005, 05:11:53 AM »
it still looks like a statement even with question mark! :lol:

try replace:
Code: [Select]
    if ($user_name == "")  {
      $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
      $error = 1;
    }
with:
Code: [Select]
    if ($user_name == "")  {
      if ($user_info['user_level'] == GUEST)
      {
        $user_name = $lang['userlevel_guest'];
      }
      else
      {
        $msg .= (($msg != "") ? "<br />" : "").$lang['name_required'];
        $error = 1;
      }
    }
it will show error message only if a member leaves username field blank, but will use "Guest" if guest leaves it blank.
if u dont like it that way, and want use "Guest" if anyone leaves username field blank, then use this code instead:
Code: [Select]
    if ($user_name == "")  {
      $user_name = $lang['userlevel_guest'];
    }
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 universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: field headline optional in comments
« Reply #6 on: April 19, 2005, 05:20:08 AM »
Question marks in 6am, I`m still sleeping!  :lol:


Is this correct?  :?

Code: [Select]
    if ($user_name == "")  {
      if ($user_info['user_level'] == GUEST)
      {
        $user_name = $lang['userlevel_guest'];
      }
      else
      {
        $user_name = $lang['userlevel_registered']; // is there something like that? ;]
      }
    }
Again this addres?!
http://www.funny.lt

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: field headline optional in comments
« Reply #7 on: April 19, 2005, 05:23:17 AM »
Now I will be able to remove name field from template :?: (question)  :D
Again this addres?!
http://www.funny.lt

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
Re: field headline optional in comments
« Reply #8 on: April 19, 2005, 05:31:01 AM »
Is this correct? :?
yes, but make sure that $lang['userlevel_registered'] is present in your main.php language file (if not, then add it ;))

Now I will be able to remove name field from template :?: (question) :D
yes, it should work now.
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 universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: field headline optional in comments
« Reply #9 on: April 19, 2005, 05:36:09 AM »
Oh I had another code in my head, but still not thinking, morning without cofee  :?

If I want to use the registered user name name? What will be definition for this?
Code: [Select]
      else
      {
        $user_name = ???
      }
Again this addres?!
http://www.funny.lt

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
Re: field headline optional in comments
« Reply #10 on: April 19, 2005, 05:38:28 AM »
$user_info['user_name']

but I thought name being ignored if registered user post a comment...their real name is showed instead...
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 universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: field headline optional in comments
« Reply #11 on: April 19, 2005, 05:46:15 AM »
Now it works like I wanted, Thanks for patience V@no  :wink:
Again this addres?!
http://www.funny.lt

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: field headline optional in comments
« Reply #12 on: April 22, 2005, 08:30:19 AM »
now, when I want to edit comment without a headline, I get this error:
Please recheck the marked fields.
Headline *


How to fix it? :)
Again this addres?!
http://www.funny.lt

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
Re: field headline optional in comments
« Reply #13 on: April 22, 2005, 08:48:40 AM »
are your trying start over again???
what about your original question? and the follow up answer? its not good? :?
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 universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: field headline optional in comments
« Reply #14 on: April 22, 2005, 08:52:39 AM »
I just wanted to know where to fix it, where can I afect admin panel headline field...  :?
Again this addres?!
http://www.funny.lt