Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Events Forum
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #27
RE: Events Forum
Experimental:

From this thread: http://mybbhacks.zingaburga.com/showthre...http://mybbhacks.zingaburga.com/showthread.php (thanks nier3 and Lee!), we'll try to make this goes a bit (not much) further.

This time we'll try to integrate it to MyBB calendar in one way. What I mean by the "one way" is the main control is MyBB thread, not the calendar event.

The ideas that tried to be implemented by this experimental are:
  • For creating an event, we choose MyBB thread, since it has more rich contents than the MyBB calendar (attachments, custom thread fields, discussion and etc).
  • Editing the thread will edit the event.
  • Editing the event from calendar (if forced) will redirect to edit the thread.
  • It bypass the calendar permissions, so it'll uses the forum permissions. Therefore it is better if we use a specific calendar for this.
  • There is a link on each event to view the thread.
  • It uses a single type of event.
  • There is still a possibilities to create normal events on the calendar. These normal events will use the calendar permissions.
  • Deleting thread will delete the event.
  • Soft deleting and unapproved thread will make the event as unapproved event.
  • Restoring and approving thread will make the event as approve event.
  • Some other features like displaying the upcoming events on index page.

Here is how to set it up:
Note that this is a basic set up. We still can add more custom thread fields and create new templates as usual.
  • Create a new calendar specified for the XThreads Event forum.
  • Create a new forum for the XThreads Event forum.
  • Create custom thread fields:
    • Event date
      • Title: Date
        Modify it as our needs. Use {$GLOBALS['threadfields']['e_date']} for displaying it anywhere inside the forumdisplay_thread template.
      • Key: e_date
        Modify it as our needs
      • Applicable Forums: Select our XThreads Events forum
      • Editable by / Required Field?: Everyone (required)
      • Maximum Text Length: 10
        Enough for dd-mm-YYYY
      • Text Mask Filter:

        Code:
        ^(0?[1-9]|[12]\d|3[01])\-(0?[1-9]|1[012])\-((?:19|20)\d\d)$

        We'll use dd-mm-YYYY format

      • Input Formatter:

        Code:
        <?=strtotime({VALUE})?>

      • Custom Modify Error:

        Code:
        <setvar e_date>explode('-',{VALUE})</setvar>
        <if !checkdate($tplvars['e_date'][1],$tplvars['e_date'][0],$tplvars['e_date'][2]) then>The date you supplied is not valid</if>

        Date validation

      • Use Custom Input HTML: Yes
        Input Field HTML:

        Code:
        1
        2
        3
        4
        5
        6
        <input type="text" class="textbox"{NAME_PROP}{MAXLE​​N_PROP}{WIDTH_PROP_SIZE}{TABINDE​X​_PROP}{REQUIRED_PROP} value="<if {VALUE} && !$mybb->input['my_post_key'] then><?=my_date('d-m-Y',{VALUE})?><else>{VALUE}</if>" id="datepicker" style="position: relative; z-index: 10000;" />
        <link type="text/css" rel="stylesheet" href="cache/css/jquery-ui.min.css" />
        <script src="cache/js/jquery-ui.min.js"></script>
        <script>
        	$(function(){$('#datepicker').datepicker({dateFormat:'dd-mm-yy',autoSize:true});});
        </script>

        Note that we use jQuery UI datepicker. Please modify it as our needs.

      • Display Format:

        Code:
        <?=my_date('d-m-Y',{VALUE})?>

      • Filtering Mode: Exact match
      • Underlying Data Type: Integer (unsigned, usually 32 bit)
    • Event description
      We'll use this description as the event description on the calendar event
      • Title: Event Description
        Modify it as our needs. Use {$GLOBALS['threadfields']['e_desc']} for displaying it anywhere inside the forumdisplay_thread template.
      • Key: e_desc
        Modify it as our needs
      • Applicable Forums: Select our XThreads Events forum
      • Editable by / Required Field?: Everyone (required)
      • Maximum Text Length: 200
        Modify it as our needs
  • Install the plugin (attached). Try it on our test board.

Forumdisplay:
   

Calendar:
   

Calendar events (custom events (created from the XThreads Events forum) mixed with default event (created from the calendar)):
   

Single calendar custom event (the "Read More" is link to the thread):
   

Single default event (still use the calendar permissions):
   

Index:
   

Since I'm not a coder, please don't expect much from this experimental.


Attached File(s)
.php  mnxt_events.php (Size: 11.98 KB / Downloads: 371)

(This post was last modified: 10-16-2015 09:15 AM by RateU.)
10-16-2015 06:48 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Events Forum - RateU - 10-10-2010, 06:41 AM
RE: Events Forum - ZiNgA BuRgA - 10-10-2010, 10:11 AM
RE: Events Forum - Imran - 10-10-2010, 10:36 PM
RE: Events Forum - leefish - 10-11-2010, 12:07 AM
RE: Events Forum - Glas - 12-02-2010, 02:29 PM
RE: Events Forum - ZiNgA BuRgA - 12-02-2010, 03:02 PM
RE: Events Forum - Glas - 12-02-2010, 05:06 PM
RE: Events Forum - leefish - 12-02-2010, 05:13 PM
RE: Events Forum - kaixer - 12-25-2010, 09:55 PM
RE: Events Forum - RateU - 12-26-2010, 01:59 AM
RE: Events Forum - kaixer - 12-26-2010, 09:22 AM
RE: Events Forum - RateU - 12-26-2010, 10:04 AM
RE: Events Forum - kaixer - 12-26-2010, 10:07 AM
RE: Events Forum - RateU - 12-26-2010, 10:25 AM
RE: Events Forum - kaixer - 12-26-2010, 10:34 AM
RE: Events Forum - RateU - 12-26-2010, 10:45 AM
RE: Events Forum - kaixer - 12-26-2010, 10:46 AM
RE: Events Forum - Shemo - 01-02-2011, 09:50 AM
RE: Events Forum - Tridion - 02-16-2011, 11:00 PM
RE: Events Forum - RateU - 02-17-2011, 01:56 AM
RE: Events Forum - Glas - 08-25-2011, 11:43 AM
RE: Events Forum - nier3 - 08-09-2012, 09:54 PM
RE: Events Forum - RateU - 08-10-2012, 05:38 AM
RE: Events Forum - Destro - 05-16-2013, 09:13 PM
RE: Events Forum - xensor - 04-19-2015, 07:36 AM
RE: Events Forum - adsol93 - 05-07-2015, 07:49 AM
RE: Events Forum - RateU - 10-16-2015 06:48 AM
RE: Events Forum - Wally - 04-02-2017, 10:46 PM
RE: Events Forum - ZiNgA BuRgA - 04-03-2017, 04:08 PM
RE: Events Forum - Wally - 04-03-2017, 07:42 PM
RE: Events Forum - RateU - 04-05-2017, 01:20 AM

 Standard Tools
Forum Jump: