MyBB Hacks

Full Version: Events Forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Requirement: XThreads

I know there is a thread about this:
http://mybbhacks.zingaburga.com/showthread.php?tid=405

But this is not an events system. This is only a very basic event forum. There is no Calendar integration at all. That's why I prefer to post this as a new thread rather than post a reply to that thread. Yeah, very very basic.

  1. Listbox field for Month:
    • Title: Month
    • Key: efmonth
    • Applicable Forums: select our events forum
    • Input Field Type : Listbox
    • Field Input Width : 7
    • Field Input Height : 1
    • Values List :

      Code:
      01
      02
      03
      04
      05
      06
      07
      08
      09
      10
      11
      12

    • Editable by / Required Field? : Everyone (required)
    • Hide Input Field : Yes
  2. Listbox field for Day:
    • Title: Day
    • Key: efday
    • Applicable Forums: select our events forum
    • Input Field Type : Listbox
    • Field Input Width : 7
    • Field Input Height : 1
    • Values List :

      Code:
      01
      02
      03
      04
      05
      06
      07
      08
      09
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31

    • Editable by / Required Field? : Everyone (required)
    • Hide Input Field : Yes
  3. Listbox field for Year:
    • Title: Year
    • Key: efyear
    • Applicable Forums: select our events forum
    • Input Field Type : Listbox
    • Field Input Width : 9
    • Field Input Height : 1
    • Values List :

      Code:
      2010
      2011

    • Editable by / Required Field? : Everyone (required)
    • Hide Input Field : Yes
  4. Textbox field for Entry Fee:
    • Title: Entry Fee
    • Key: effee
    • Applicable Forums: select our events forum
    • Input Field Type : Textbox
    • Field Input Width : 10
    • Field Input Height : 17
    • Editable by / Required Field? : Everyone
    • Blank Replacement Value :

      HTML Code
      –

    • Display Format :

      PHP Code:
      $ <?=number_format({VALUE},2)?>

    • Text Mask Filter :

      Code:
      ^\d+(\.\d{2})?$

  5. Textbox fields for Address:
    • Title: Address
    • Key: efaddress
    • Applicable Forums : select our events forum
    • Editable by / Required Field? : Everyone
    • Blank Replacement Value :

      Code:
      Not Specified



Then, set our download forum setting like this:
  • Template Prefix: ef_
  • Show first post on every showthread page: Yes
  • Enable XThreads' Inline Forum Search : Yes
  • Hide Forum: Yes
    We need to put the forum link manually in our template (example: in header template).

Then create new templates in Global Templates:
(The templates bellow based on MyBB 1.4)
  1. ef_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>
    </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">
    <tr>
    <td class="thead" colspan="2"><strong>{$lang->edit_post}</strong></td>
    </tr>
    {$loginbox}
    <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>
    <tr>
    <td class="trow2" width="20%"><strong>Event Date</strong></td>
    <td class="trow2">Month: {$tfinput['efmonth']} &ndash Day: {$tfinput['efday']} &ndash Year: {$tfinput['efyear']}</td>
    </tr>
    {$extra_threadfields}{$posticons}
    <tr>
    <td class="trow2" valign="top"><strong>{$lang->your_message}:</strong><br /><div style="text-align: center;">{$smilieinserter}</div></td>
    <td class="trow2">
    <textarea name="message" id="message" rows="20" cols="70" tabindex="3">{$message}</textarea>
    {$codebuttons}
    </td>
    </tr>
    <tr>
    <td class="trow1" valign="top"><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>
    {$attachbox}
    <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>

  2. ef_newthread

    HTML Code
    <html>
    <head>
    <title>{$lang->newthread_in}</title>
    {$headerinclude}
    <script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
    </head>
    <body>
    {$header}
    {$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">
    <tr>
    <td class="thead" colspan="2"><strong>New Event</strong></td>
    </tr>
    {$loginbox}
    <tr>
    <td class="trow2" width="20%"><strong>Event Subject</strong></td>
    <td class="trow2"><input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
    </tr>
    <tr>
    <td class="trow2" width="20%"><strong>Event Date</strong></td>
    <td class="trow2">Month: {$tfinput['efmonth']} &ndash; Day: {$tfinput['efday']} &ndash; Year: {$tfinput['efyear']}</td>
    </tr>
    {$extra_threadfields}{$posticons}
    <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>
    <tr>
    <td class="trow1" valign="top"><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}
    {$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>

  3. ef_postbit_first

    HTML Code
    {$ignore_bit}
    <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
    	<tbody>
    		<tr>
    			<td class="tcat">
    				<div class="float_left smalltext">
    					{$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
    				</div>
    				{$post['posturl']}
    			</td>
    		</tr>
    		<tr>
    			<td class="trow1 {$unapproved_shade}">
    				<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
    					<tr>
    						<td class="post_avatar" width="1" style="{$post['avatar_padding']}">
    							{$post['useravatar']}
    						</td>
    						<td class="post_author">
    							<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
    							<span class="smalltext">
    								{$post['usertitle']}<br />
    								{$post['userstars']}
    								{$post['groupimage']}
    							</span>
    						</td>
    						<td class="smalltext post_author_info" width="165">
    							{$post['user_details']}
    						</td>
    					</tr>
    				</table>
    			</td>
    		</tr>
    		<tr>
    			<td class="trow2 post_content {$unapproved_shade}">
    				<table width="100%" border="0">
    					<tr>
    						<td valign="top" width="111"><strong>Event Subject</strong></td>
    						<td valign="top" width="1"><strong>:</strong></td>
    						<td valign="top">{$post['subject']}</td>
    					</tr>
    					<tr>
    						<td valign="top"><strong>Event Date</strong></td>
    						<td valign="top"><strong>:</strong></td>
    						<td valign="top">{$GLOBALS['threadfields']['efmonth']}&ndash;{$GLOBALS['threadfields']['efday']}&ndash;{$GLOBALS['threadfields']['efyear']}</td>
    					</tr>
    					<tr>
    						<td valign="top"><strong>Entry Fee</strong></td>
    						<td valign="top"><strong>:</strong></td>
    						<td valign="top">{$GLOBALS['threadfields']['effee']}</td>
    					</tr>
    					<tr>
    						<td valign="top"><strong>Address</strong></td>
    						<td valign="top"><strong>:</strong></td>
    						<td valign="top">{$GLOBALS['threadfields']['efaddress']}</td>
    					</tr>
    				</table>
    				<br />
    				<div class="post_body"><strong>Event Info:</strong></div>
    				<div class="post_body" id="pid_{$post['pid']}">
    					{$post['message']}
    				</div>
    				{$post['attachments']}
    				{$post['signature']}
    				<div class="post_meta" id="post_meta_{$post['pid']}">
    				{$post['iplogged']}
    				</div>
    			</td>
    		</tr>
    		<tr>
    			<td class="trow1 post_buttons {$unapproved_shade}">
    				<div class="author_buttons float_left">
    					{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}
    				</div>
    				<div class="post_management_buttons float_right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
    				</div>
    			</td>
    		</tr>
    	</tbody>
    </table>

  4. ef_postbit_first_classic

    HTML Code
    {$ignore_bit}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
    	<tr>
    		<td class="{$altbg}" width="15%" valign="top" style="white-space: nowrap; text-align: center;">
    			<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
    			<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
    			<span class="smalltext">
    				{$post['usertitle']}<br />
    				{$post['userstars']}
    				{$post['groupimage']}
    				{$post['useravatar']}<br />
    				{$post['user_details']}
    			</span>
    		</td>
    		<td class="{$altbg}" valign="top">
    			<table width="100%">
    				<tr>
    					<td>
    						{$post['posturl']}
    						<table width="100%" border="0">
    							<tr>
    								<td valign="top" width="111"><strong>Event Subject</strong></td>
    								<td valign="top" width="1"><strong>:</strong></td>
    								<td valign="top">{$post['subject']}</td>
    							</tr>
    							<tr>
    								<td valign="top"><strong>Event Date</strong></td>
    								<td valign="top"><strong>:</strong></td>
    								<td valign="top">{$GLOBALS['threadfields']['efmonth']}&ndash;{$GLOBALS['threadfields']['efday']}&ndash;{$GLOBALS['threadfields']['efyear']}</td>
    							</tr>
    							<tr>
    								<td valign="top"><strong>Entry Fee</strong></td>
    								<td valign="top"><strong>:</strong></td>
    								<td valign="top">{$GLOBALS['threadfields']['effee']}</td>
    							</tr>
    							<tr>
    								<td valign="top"><strong>Address</strong></td>
    								<td valign="top"><strong>:</strong></td>
    								<td valign="top">{$GLOBALS['threadfields']['efaddress']}</td>
    							</tr>
    						</table>
    						<br />
    						<div id="pid_{$post['pid']}" style="padding: 5px 0 5px 0;">
    							{$post['message']}
    						</div>
    						{$post['attachments']}
    						{$post['signature']}
    						<div style="text-align: right; vertical-align: bottom;" id="post_meta_{$post['pid']}">
    							<div id="edited_by_{$post['pid']}">{$post['editedmsg']}</div>
    							{$post['iplogged']}
    						</div>
    					</td>
    				</tr>
    			</table>
    		</td>
    	</tr>
    	<tr>
    		<td class="{$altbg}" style="white-space: nowrap; text-align: center; vertical-align: middle;"><span class="smalltext">{$post['postdate']} {$post['posttime']}</span></td>
    		<td class="{$altbg}" style="vertical-align: middle;">
    			<table width="100%" border="0" cellpadding="0" cellspacing="0">
    				<tr valign="bottom">
    					<td align="left" ><span class="smalltext">{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}</span></td>
    					<td align="right">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}</td>
    				</tr>
    			</table>
    		</td>
    	</tr>
    </table>

  5. ef_forumdisplay_thread

    HTML Code
    <tr>
    	<td align="center" class="{$bgcolor}" width="2%"><img src="{$theme['imgdir']}/{$folder}.gif" alt="{$folder_label}" title="{$folder_label}" /></td>
    	<td align="center" class="{$bgcolor}" width="2%">{$icon}</td>
    	<td class="{$bgcolor}">
    		{$attachment_count}
    		<div>
    			<span>{$prefix} {$gotounread}<a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a>{$thread['multipage']}</span>
    			<table width="100%" border="0">
    				<tr class="smalltext">
    					<td valign="top" width="99"><strong>Author</strong></td>
    					<td valign="top" width="1"><strong>:</strong></td>
    					<td valign="top">{$thread['profilelink']}</td>
    				</tr>
    				<tr class="smalltext">
    					<td valign="top"><strong>Submitted</strong></td>
    					<td valign="top"><strong>:</strong></td>
    					<td valign="top">{$thread['threaddate']}, {$thread['threadtime']}</td>
    				</tr>
    				<tr class="smalltext">
    					<td valign="top"><strong>Event Date</strong></td>
    					<td valign="top"><strong>:</strong></td>
    					<td valign="top">{$GLOBALS['threadfields']['efmonth']}&ndash;{$GLOBALS['threadfields']['efday']}&ndash;{$GLOBALS['threadfields']['efyear']}</td>
    				</tr>
    				<tr class="smalltext">
    					<td valign="top"><strong>Entry Fee</strong></td>
    					<td valign="top"><strong>:</strong></td>
    					<td valign="top">{$GLOBALS['threadfields']['effee']}</td>
    				</tr>
    				<tr class="smalltext">
    					<td valign="top"><strong>Address</strong></td>
    					<td valign="top"><strong>:</strong></td>
    					<td valign="top">{$GLOBALS['threadfields']['efaddress']}</td>
    				</tr>
    			</table>
    		</div>
    	</td>
    	<td align="center" class="{$bgcolor}"><a href="javascript:MyBB.whoPosted({$thread['tid']});">{$thread['replies']}</a>{$unapproved_posts}</td>
    	<td align="center" class="{$bgcolor}">{$thread['views']}</td>
    	{$rating}
    	<td class="{$bgcolor}" style="white-space: nowrap; text-align: right;">
    		<span class="lastpost smalltext">{$lastpostdate} {$lastposttime}<br />
    		<a href="{$thread['lastpostlink']}">{$lang->lastpost}</a>: {$lastposterlink}</span>
    	</td>
    {$modbit}
    </tr>



Live Demo:
I have another version in the live demo. There is a filtering events there (set Allow Filtering setting for the Month, Day and Year to Yes). And there is a filter field as a settings for additional plugin to load the next 10, 20 or 30 days events. The reason why I didn't put it here is, because I'm not quite sure about it.
http://www.14.mynie.co.cc/forumdisplay.php?fid=3
Thanks for the post RateU Smile
Xthreads is just wonderful. Smile
Hmm, this is very neat indeed. maybe you could add some neat stuff like when posting a thread in a forum you get an option - add to events (first post) only. Then it redirects you to the events forum... In the other posts in the thread where you had add to events then it will give the option sign up to event.......
Probably a conflict with another plugin?
Once again, the culprit is MyAdvertisements by Pirata Nervo
i've already drop him the report
Hmm, thats a shame on MyAdvertisements - it seems like it really does not want to play nice with XThreads Frown
I have problem with Smilies Box in ADD NEW THREAD. Smilies box sunddenly floating.
Screenshot?
Could you post your ef_newthread template?
Pages: 1 2 3 4
Reference URL's