Posts: 655
Threads: 10
Joined: Mar 2009
Reputation:
42
2012-07-25, 11:59 AM
(This post was last modified: 2012-07-25, 12:04 PM by Tecca.)
(2012-07-25, 11:38 AM)Fábio Maia Wrote: (2012-07-24, 02:45 AM)brad-t Wrote: Nice. One problem with using the Preview button this way is if you hit "Full Editor" without entering anything, you'll get an error message. Not sure what to do about that.
That's fairly easy to fix. Open the ./inc/datahandlers/post.php file in a text editor.
Find:
<snip>
This is a decent alternative, but it allows users to post blank posts. I think I prefer the error message.
EDIT: I guess there are other ways to post blank posts as well though. But this makes it a little more obvious.
Posts: 9,348
Threads: 266
Joined: Oct 2007
Reputation:
232
Yeah, that doesn't strike me as a great solution. Ideally what would happen is that you would not get an error for blank post when previewing via quick reply ONLY. but I appreciate your willingness to help.
Posts: 10,063
Threads: 311
Joined: Oct 2008
Reputation:
457
Yeah, I didn't think of any of that. But I have a better solution. Undo the previous changes first.
Open the ./inc/datahandlers/post.php file in a text editor again.
Find:
// Do we even have a message at all?
if(my_strlen($post['message']) == 0)
{
$this->set_error("missing_message");
return false;
}
Replace with:
// Do we even have a message at all?
if(my_strlen($post['message']) == 0)
{
header("Location: ".$mybb->settings['bburl']."/newreply.php?tid=".$post['tid']);
return false;
}
Basically if the message is empty it takes you straight to a standard new reply page. Otherwise you're just taken to the preview page. That simulates the functionality you want right? You could probably get rid of the preview box if you don't want it, so that it's actually just a full editor.
Posts: 9,348
Threads: 266
Joined: Oct 2007
Reputation:
232
What will happen if you try to submit a new reply from newreply.php with no message?
Posts: 10,063
Threads: 311
Joined: Oct 2008
Reputation:
457
God dammit. Okay, I got it this time - I tried it myself. Undo everything.
Open newreply.php in a text editor.
Find:
// Coming from quick reply? Set some defaults
if($mybb->input['method'] == "quickreply")
{
if($mybb->user['subscriptionmethod'] == 1)
{
$mybb->input['postoptions']['subscriptionmethod'] = "none";
}
else if($mybb->user['subscriptionmethod'] == 2)
{
$mybb->input['postoptions']['subscriptionmethod'] = "instant";
}
}
Replace with:
// Coming from quick reply? Set some defaults
if($mybb->input['method'] == "quickreply")
{
if($mybb->user['subscriptionmethod'] == 1)
{
$mybb->input['postoptions']['subscriptionmethod'] = "none";
}
else if($mybb->user['subscriptionmethod'] == 2)
{
$mybb->input['postoptions']['subscriptionmethod'] = "instant";
}
if(my_strlen($mybb->input['message']) == 0)
{
header("Location: ".$mybb->settings['bburl']."/newreply.php?tid=".$mybb->input['tid']);
return false;
}
}
Works exactly the same. But now it only does that if we're coming from the quick reply form. And then if you try to post an empty message it throws the error.
Posts: 9,348
Threads: 266
Joined: Oct 2007
Reputation:
232
PERFECT. Thanks. Will try later.
Posts: 655
Threads: 10
Joined: Mar 2009
Reputation:
42
(2012-07-25, 03:19 PM)Fábio Maia Wrote: God dammit. Okay, I got it this time - I tried it myself. Undo everything.
Open newreply.php in a text editor.
Find:
<snip>
Works exactly the same. But now it only does that if we're coming from the quick reply form. And then if you try to post an empty message it throws the error.
Awesome, thank you. It would have taken me a while to figure this out. It works perfectly.
Posts: 825
Threads: 61
Joined: Mar 2012
Reputation:
49
(2012-07-14, 12:30 AM)brad-t Wrote: Here's the template for my registration page. I offer it with no warranty or support -- it's up to you to style it as needed.
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->registration}</title>
{$headerinclude}
<script type="text/javascript" src="jscripts/validator.js"></script>
</head>
<body onload=' location.href="#content" '>
{$header}
<a name="signup"></a>
<form action="member.php" method="post" id="registration_form" name="registration_form"><input type="text" style="visibility: hidden;" value="" name="regcheck1" /><input type="text" style="visibility: hidden;" value="true" name="regcheck2" />
{$regerrors}
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="30%" valign="top">
<div class="insetbox" style="
border: 1px solid #DEDEDE;
margin-left: 20px;
margin-top: -10px;
">
<h2>Sign Up ↓</h2><br />
<table cellspacing="0" cellpadding="4" width="95%">
<tr>
<td colspan="2">
<h4>Username</h4>
<input type="text" class="textbox" name="username" id="username" style="width: 100%; padding: 3px; font-size: 1.2em;" value="{$username}" /></td>
</tr>
{$passboxes}
<tr>
<td><h5>Email</h5>
<input type="text" class="textbox" name="email" id="email" style="width: 100%; padding: 3px;" maxlength="50" value="{$email}" /></td>
<td><h5>Confirm Email</h5>
<input type="text" class="textbox" name="email2" id="email2"style="width: 100%; padding: 3px;" maxlength="50" value="{$email2}" /></td>
</tr>
<tr>
<td colspan="2" style="display: none;" id="email_status"> </td>
</tr>
</tr>
</tbody></table>
<input type="hidden" name="step" value="registration" />
<input type="hidden" name="action" value="do_register" />
<br />
<h4 style="text-align: center;">Important Stuff</h4>
<p class="smalltext">To keep our community spam-free, we moderate every member's first post; so please be patient after introducing yourself.</p>
<p class="smalltext">By joining Harajuju, you agree to our <a href="http://harajuju.net/misc.php?action=help&hid=8" target="_blank">Community Rules</a> and <a href="http://harajuju.net/misc.php?action=help&hid=13" target="_blank">Terms of Service</a>.</p>
<input type="submit" class="button" style="font-size: 1.5em; margin-left: auto; margin-right: auto; width: 100%;" name="regsubmit" value="Let's do it" />
</div>
</td>
<td width="70%" valign="top" style="padding-left: 40px;">
<h2 style="margin-top: -66px;
text-align: center;
position: relative;
bottom: -13px;">Some reasons to love HARAJUJU</h2><br />
<div class="reason">
<img src="/images/signup_women.png"><br />
<p style="color: #cc0000; font-weight: bold; text-transform: uppercase;">For Women</p>
<p style="padding: 0px 10px;">Discuss everything from lolita to gyaru with other fashion-forward girls.</p>
</div>
<div class="reason">
<img src="/images/signup_men.png"><br />
<p style="color: #cc0000; font-weight: bold; text-transform: uppercase;">For Men</p>
<p style="padding: 0px 10px;">A Japanese fashion community with a dedicated menswear base. Finally.
</p>
</div>
<div class="reason">
<a href="/Forum-HARALOOKS" target="_blank"><img src="/images/signup_haralooks.png"><br />
<p style="color: #cc0000; font-weight: bold; text-transform: uppercase;">Haralooks <span class="icon-chevron-right"></span></a></p>
<p style="padding: 0px 10px;">Share your looks. Get feedback from other Japanese fashion lovers.
</p>
</div>
<div class="reason">
<a href="/Forum-Brand-Directory" target="_blank"><img src="/images/signup_brands.png"><br />
<p style="color: #cc0000; font-weight: bold; text-transform: uppercase;">Brand Directory <span class="icon-chevron-right"></span></a></p>
<p style="padding: 0px 10px;">In-depth info on the best brands. Your favourite isn't there? Write it. We'll help.
</p>
</div>
<div class="reason">
<img src="/images/signup_hearts.png"><br />
<p style="color: #cc0000; font-weight: bold; text-transform: uppercase;">Share the Love</p>
<p style="padding: 0px 10px;">Give Hearts to your favourite posts and looks. Collect Hearts for being awesome.
</p>
</div>
<div class="reason">
<img src="/images/signup_advice.png"><br />
<p style="color: #cc0000; font-weight: bold; text-transform: uppercase;">Get Advice</p>
<p style="padding: 0px 10px;">Should you buy that? Need fit advice? No worries -- we're here to help.
</p>
</div>
<div class="reason">
<a href="http://harajuju.net/Forum-Marketplace" target="_blank"><img src="/images/signup_marketplace.png"><br />
<p style="color: #cc0000; font-weight: bold; text-transform: uppercase;">Marketplace <span class="icon-chevron-right"></span></a></p>
<p style="padding: 0px 10px;">Buy items directly from people who love fashion as much as you.
</p>
</div>
<div class="reason">
<img src="/images/signup_culture.png"><br />
<p style="color: #cc0000; font-weight: bold; text-transform: uppercase;">A New Culture</p>
<p style="padding: 0px 10px;">A fresh take on what a fashion community can be: open, intelligent, and evolutionary.
</p>
</div>
<br class="clear">
</td>
</tr>
</table>
<br />
<div align="center">
<input type="hidden" name="step" value="registration" />
<input type="hidden" name="action" value="do_register" />
</div>
</form>
<script type="text/javascript">
<!--
regValidator = new FormValidator('registration_form');
regValidator.register('username', 'notEmpty', {failure_message:'{$lang->js_validator_no_username}'});
regValidator.register('email', 'regexp', {match_field:'email2', regexp:'^([a-zA-Z0-9_\\.\\+\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$', failure_message:'{$lang->js_validator_invalid_email}'});
regValidator.register('email2', 'matches', {match_field:'email', status_field:'email_status', failure_message:'{$lang->js_validator_email_match}'});
{$validator_extra}
regValidator.register('username', 'ajax', {url:'xmlhttp.php?action=username_availability', loading_message:'{$lang->js_validator_checking_username}'}); // needs to be last
// -->
</script>
<!-- <script type="text/javascript" language="JavaScript">
document.forms['registration_form'].elements['username'].focus();
</script>
-->
{$footer}
</body>
</html>
Does anybody know how I can skip the registration agreement and make this modal, while editing only templates?
Please don't PM me for support.
Posts: 9,348
Threads: 266
Joined: Oct 2007
Reputation:
232
Agreement skip was just discussed here. Can't imagine making it modal would be too hard ...
Posts: 825
Threads: 61
Joined: Mar 2012
Reputation:
49
(2012-07-26, 11:34 AM)brad-t Wrote: Agreement skip was just discussed here. Can't imagine making it modal would be too hard ...
I saw it in the post I've quoted below, but I'm making my first theme and would like to skip it by only editing templates. As for modal, I'll tinker round with euantor's modal login box and see what I come up with.
(2012-07-23, 08:22 PM)quecarallo Wrote: Vey nice!
A little question, wich plugin do u use for avoiding the TOS page and goind directly to the reg. page? Im re-styling my reg page and I need something like that.
Please don't PM me for support.
|