News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Guest posting

Started by njtweb, April 29, 2018, 11:03:57 AM

Previous topic - Next topic

njtweb

Is there any way to remove the name and email requirement for guests who don't want to register? I'd like it so they can just create a topic or post automatically as a guest. I only want them to have to clear the security verification.

Thank you

Pipke

"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

njtweb

I did install that but I want the name field removed too so that guests automatically post as "guest"

Kindred

No way to do that without a mod.... and there is no mod currently
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

njtweb

Ok, thank you. Somebody did make one but it was for the original 1.x SMF. Doesn't work on 2.0.14

Pipke

in Post.template.php

Code (find) Select

// Guests have to put in their name and email...


Code (replace by) Select

// Guests have to put in their name and email...NOT anymore, costum changed!!!
if ($context['user']['is_guest'])
unset($context['name'], $context['email']);


in Sources/Post.php

Code (find) Select

// If the poster is a guest evaluate the legality of name and email.
if ($posterIsGuest)


Code (replace by) Select

// If the poster is a guest evaluate the legality of name and email. NOT anymore, costum changed!!!
if (!$posterIsGuest)
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

njtweb

Great! That worked. Can that be done for the quick reply too?

Aleksi "Lex" Kilpinen

Yup, similar edits can be done to the quick reply section as well. It's in the same file if I remember correctly ( post.template ).
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

njtweb

Thank you but I don't know what to look for and is it the same code that would replace?

Pipke

in Display.template.php remove this code

Code (find) Select

// Guests just need more.
if ($context['user']['is_guest'])
echo '
<strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
<strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';


or add comments like this to the code:

// Guests just need more.
//if ($context['user']['is_guest'])
// echo '
// <strong>', $txt['name'], ':</strong> <input type="text" name="guestname" value="', $context['name'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" />
// <strong>', $txt['email'], ':</strong> <input type="text" name="email" value="', $context['email'], '" size="25" class="input_text" tabindex="', $context['tabindex']++, '" /><br />';
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

Aleksi "Lex" Kilpinen

Oh, right - I forgot that wasn't in post.template at all. Cheers Pipke :)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: