MyBB Hacks

Full Version: Postbit Tabs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
I'm certain I can find a good use for this on at least one of my sites! Biggrin

Thanks RateU for another interesting application here! Biggrin
Not sure if anyone saw my post because I bumped this topic and another reply came right after. i'll requote:

(08-23-2012 11:57 PM)Gstone Wrote: [ -> ]Hello,

in the demo in the first post, the New Thread template has tabs. Is there a tutorial for doing that? I searched a little but haven't found one.

also, this is a great tutorial, thank you!
This is the newthread and editpost_first template. Modify it as your needs:
newthread

HTML Code
<html>
<head>
<title>{$lang->newthread_in}</title>
{$headerinclude}
<script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
	$.noConflict();
</script>
<script type="text/javascript">
	jQuery(document).ready(function($){
		$('.tab').click(function(){
			$('.at').removeClass('at');
			$(this).addClass('at');
			$('.content').slideUp();
			var catshow = $(this).attr('abbr');
			$('#'+ catshow).slideDown();
		});
	});
</script>
<style type="text/css">
#tc2, #tc3, #nt2, #nt3, #nt4 {
	display: none;
}
.at {
	background: #026CB1 url(images/thead_bg.gif) top left repeat-x;
	color: #ffffff;
}
</style>
</head>
<body>
{$header}
<div class="tc largetext"><a href="http://www.14.mynie.co.cc/forumdisplay.php?fid=33">Miscellaneous</a></div>
<br />
{$preview}
{$thread_errors}
{$attacherror}
<form action="newthread.php?fid={$fid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-bottom-width: 0;">
<tr>
<td class="thead" colspan="4"><strong>{$lang->post_new_thread}</strong></td>
</tr>
<tr>
<td class="tcat at tab" style="cursor: pointer; text-align: center; width: 25%;" abbr="nt1"><strong>Contents In Tabs 1</strong></td>
<td class="tcat tab" style="cursor: pointer; text-align: center; width: 25%;" abbr="nt2"><strong>Contents In Tabs 2</strong></td>
<td class="tcat tab" style="cursor: pointer; text-align: center; width: 25%;" abbr="nt3"><strong>Contents In Tabs 3</strong></td>
<td class="tcat tab" style="cursor: pointer; text-align: center; width: 25%;" abbr="nt4"><strong>Additional Settings</strong></td>
</tr>
</table>
<div id="nt1" class="content">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
<tr>
<td class="trow2" width="20%"><strong>{$lang->thread_subject}</strong></td>
<td class="trow2"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
</tr>
{$extra_threadfields}
<tr>
<td class="trow2" valign="top"><strong>{$lang->your_message}</strong>{$smilieinserter}</td>
<td class="trow2">
<textarea name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>
{$codebuttons}
{$multiquote_external}
</td>
</tr>
</table>
</div>
<div id="nt2" class="content">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
{$tfinputrow['tc2']}
{$tfinputrow['tc2c']}
</table>
</div>
<div id="nt3" class="content">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
{$tfinputrow['tc3']}
{$tfinputrow['tc3c']}
</table>
</div>
<div id="nt4" class="content">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
{$loginbox}
{$posticons}
{$tfinputrow['prefix']}
{$tfinputrow['xtforcepostlayout']}
<tr>
<td class="trow1" valign="top" width="20%"><strong>{$lang->post_options}</strong></td>
<td class="trow1"><span class="smalltext">
<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="7"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
{$disablesmilies}</span></td>
</tr>
{$modoptions}
{$subscriptionmethod}
{$pollbox}
</table>
</div>
<br />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="3"><strong>Image Verification</strong></td>
</tr>
{$captcha}
</table>
{$attachbox}
<br />
<div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->post_thread}" tabindex="4" accesskey="s" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="5" />{$savedraftbutton}</div>
<input type="hidden" name="action" value="do_newthread" />
<input type="hidden" name="posthash" value="{$posthash}" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
<input type="hidden" name="quoted_ids" value="{$quoted_ids}" />
<input type="hidden" name="tid" value="{$tid}" />
{$editdraftpid}
</form>
{$forumrules}
{$footer}
</body>
</html>


editpost_first

HTML Code
<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->edit_post}</title>
{$headerinclude}
<script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
	$.noConflict();
</script>
<script type="text/javascript">
	jQuery(document).ready(function($){
		$('.tab').click(function(){
			$('.at').removeClass('at');
			$(this).addClass('at');
			$('.content').slideUp();
			var catshow = $(this).attr('abbr');
			$('#'+ catshow).slideDown();
		});
	});
</script>
<style type="text/css">
#tc2, #tc3, #nt2, #nt3, #nt4 {
	display: none;
}
.at {
	background: #026CB1 url(images/thead_bg.gif) top left repeat-x;
	color: #ffffff;
}
</style>
</head>
<body>
{$header}
{$preview}
{$post_errors}
{$attacherror}
<form action="editpost.php" method="post" name="editpost">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="3"><strong>{$lang->delete_post}</strong></td>
</tr>
<tr>
<td class="trow1" style="white-space: nowrap"><input type="checkbox" class="checkbox" name="delete" value="1" tabindex="9" /> <strong>{$lang->delete_q}</strong></td>
<td class="trow1" width="100%">{$lang->delete_1}<br /><span class="smalltext">{$lang->delete_2}</span></td>
<td class="trow1"><input type="submit" class="button" name="submit" value="{$lang->delete_now}" tabindex="10" /></td>
</tr>
</table>
<input type="hidden" name="action" value="deletepost" />
<input type="hidden" name="pid" value="{$pid}" />
</form>
<br />
<form action="editpost.php?pid={$pid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-bottom-width: 0;">
<tr>
<td class="thead" colspan="4"><strong>{$lang->edit_post}</strong></td>
</tr>
<tr>
<td class="tcat at tab" style="cursor: pointer; text-align: center; width: 25%;" abbr="nt1"><strong>Contents In Tabs 1</strong></td>
<td class="tcat tab" style="cursor: pointer; text-align: center; width: 25%;" abbr="nt2"><strong>Contents In Tabs 2</strong></td>
<td class="tcat tab" style="cursor: pointer; text-align: center; width: 25%;" abbr="nt3"><strong>Contents In Tabs 3</strong></td>
<td class="tcat tab" style="cursor: pointer; text-align: center; width: 25%;" abbr="nt4"><strong>Additional Settings</strong></td>
</tr>
</table>

<div id="nt1" class="content">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
<tr>
<td class="trow2"><strong>{$lang->subject}</strong></td>
<td class="trow2"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
</tr>
{$extra_threadfields}
<tr>
<td class="trow2" valign="top"><strong>{$lang->your_message}</strong>{$smilieinserter}</td>
<td class="trow2">
<textarea name="message" id="message" rows="20" cols="70" tabindex="3">{$message}</textarea>
{$codebuttons}
</td>
</tr>
</table>
</div>

<div id="nt2" class="content">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
{$tfinputrow['tc2']}
{$tfinputrow['tc2c']}
</table>
</div>
<div id="nt3" class="content">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
{$tfinputrow['tc3']}
{$tfinputrow['tc3c']}
</table>
</div>

<div id="nt4" class="content">
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">
{$loginbox}
{$posticons}
{$tfinputrow['prefix']}
{$tfinputrow['xtforcepostlayout']}
<tr>
<td class="trow1" valign="top" width="20%"><strong>{$lang->post_options}</strong></td>
<td class="trow1"><span class="smalltext">
<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="6"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
{$disablesmilies}</span></td>
</tr>
{$subscriptionmethod}
{$pollbox}
</table>
</div>
<br />
<div align="center"><input type="submit" class="button" name="submit" value="{$lang->update_post}" tabindex="3" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="4" /></div>
<input type="hidden" name="action" value="do_editpost" />
<input type="hidden" name="posthash" value="{$posthash}" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
</form>
{$footer}
</body>
</html>

awesome RateU, thanks!
is there any way to add {$codebuttons} to the new textareas in the tabs?
Unfortunately not. MyBB's default editor can't be used more than once on the same page.
Quote:postbit_first or template_prefix_postbit_first template.
An example how to apply the tabs title and tabs contents in this template.

i canot see it where the location???

please guide me ????

ErfErf
Create them if they don't exist.
how can i get this to work on 1.8?

using the jquery that mybb 1.8.6 uses.
Hi,

RateU I love to use this on my forum I posted a Private message to you. Is there anyway you can work with me on this, to make it easier to understand? I'm slightly confused at the top part of where those codes go and such.  Frown
Pages: 1 2 3 4 5 6
Reference URL's