News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Post Form: Minor Adjustment

Started by Uhura!, August 22, 2014, 11:53:17 AM

Previous topic - Next topic

Uhura!

Is there a way to make a small change to where it says "Email" in mhy guest posting form? (See attached image)

I would like to add a small not that says the email address will not be published.

Thank you!

SMF 2.0.6 | SMF © 2013, Simple Machines
SimplePortal 2.3.5 © 2008-2012, SimplePortal
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Hj Ahmad Rasyid Hj Ismail

Post.template.php

if (empty($modSettings['guest_post_no_email']))
echo '
<dt>
<span', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '', ' id="caption_email">', $txt['email'], ':</span>
</dt>
<dd>
<input type="text" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" /><br / >ADD YOUR NOTICE HERE!
</dd>';


Change ADD YOUR NOTICE HERE! to your own words. :)

Arantor

Firstly you should probably upgrade to 2.0.8.

Secondly, it's controlled by this chunk of code in Post.template.php for new topics and full-reply page:
// Guests have to put in their name and email...
if (isset($context['name']) && isset($context['email']))
{
echo '
<dt>
<span', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' class="error"' : '', ' id="caption_guestname">', $txt['name'], ':</span>
</dt>
<dd>
<input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" class="input_text" />
</dd>';

if (empty($modSettings['guest_post_no_email']))
echo '
<dt>
<span', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '', ' id="caption_email">', $txt['email'], ':</span>
</dt>
<dd>
<input type="text" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" />
</dd>';
}


Two choices present with the way this code is built - either directly after the email address box or directly under it. The latter would probably look better and would be something like this:

// Guests have to put in their name and email...
if (isset($context['name']) && isset($context['email']))
{
echo '
<dt>
<span', isset($context['post_error']['long_name']) || isset($context['post_error']['no_name']) || isset($context['post_error']['bad_name']) ? ' class="error"' : '', ' id="caption_guestname">', $txt['name'], ':</span>
</dt>
<dd>
<input type="text" name="guestname" size="25" value="', $context['name'], '" tabindex="', $context['tabindex']++, '" class="input_text" />
</dd>';

if (empty($modSettings['guest_post_no_email']))
echo '
<dt>
<span', isset($context['post_error']['no_email']) || isset($context['post_error']['bad_email']) ? ' class="error"' : '', ' id="caption_email">', $txt['email'], ':</span>
</dt>
<dd>
<input type="text" name="email" size="25" value="', $context['email'], '" tabindex="', $context['tabindex']++, '" class="input_text" />
</dd>
<dt></dt>
<dd>The email address will not be published.</dd>';
}

Uhura!

#3
Arantor,

Thank you for replying. I replaced the code; however, it did not work. No change was made to the post form.

I went to this file: public_html/community/Themes/default/post.template.php

Maybe that was the wrong file?

I thought of a better solution though. I think you're right - adding text to the box near the word "email" may look sloppy. How about if I add a note to the pink box @ the top? Any idea how I can do that?
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Arantor

That would be the place to go unless your theme has its own Post.template.php file.

The way I wrote the code, it would line up underneath the box rather than being jammed in next to it, so it should fit all the normal UI guidelines. Fitting it into the red box at the top would be less effective in practice because it's not referenced next to the thing it relates to, if that makes sense.

Uhura!

Makes complete sense Arantor.

My issue is that I can't find the correct fpost.template.php

Also tried public_html/community/Themes/moms/post.template.php after recalling that "moms" is the theme which is actually being used :) Can you help?
:) Our Parenting Spot is an online parenting community for fathers, mothers, grandparents, teachers, and family service professionals. 8) We also provide low cost advertising options for authors, family service providers, and businesses with family friendly products and services. ;D Visit us @ www.OurParentingSpot.net!

Hj Ahmad Rasyid Hj Ismail

It's either default or your custom theme. But normally custom themes don't have its own Post.template.php.

Advertisement: