vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Event Attendance 2.0 (https://vborg.vbsupport.ru/showthread.php?t=93782)

jerx 05-19-2006 02:04 PM

Quote:

Originally Posted by TomasDR
Ok here goes. This is what I did, it works for me in 3.5.4

I had to disable the Plugin: (hence the broken part)
"redirect links to individual events to their threads instead"
Hook Location : calendar_getday_start
Installed by: vB Event Forums

I decided to disable the Plugin: (and make a new one)
"Display Event Details on Thread Page"
Hook Location : showthread_complete
Installed by: vB Event Forums

I made a new Plugin:
"Event Attendance - Forum Combined"
Hook Location : showthread_complete
I tied it to vB Event Forums for the Product, not sure if that really does anything.

In the code I combined these 2 plugins.
"Display Event Details on Thread Page" (Hook Location : showthread_complete - vB Event Forums)
"Event Attendance - show/enroll" (Hook Location : calendar_getday_event - Event Attendance) (note: I had to leave this Plugin active!)

The Code: show/enroll remarked in caps and bolded
Code:

// we need to initialise this variable here, otherwise on non Event Threads, the var will show as text
$lv_vb_eventforums_eventdetails = "";
//ATTENDANCE VARIABLES FROM SHOW/ENROLL start
$time_until_event=$eventinfo['dateline_from']-(TIMENOW+$vbulletion->userinfo['timezoneoffset']*3600);

//Check time till event
if ($vbulletin->userinfo['dstonoff'])
{
    $time_until_event=$time_until_event-3600;
}

//echo $time_until_event."  ";
$show['enroll']=(($time_until_event>0) || ($vbulletin->options['lateenroll'])) ? true : false;
//ATTENDANCE VARIABLES FROM SHOW/ENROLL end


// is this a VB event forum?
$lv_vb_eventforums_eventForum = false;
$lv_vb_eventforums_map = preg_split('/[\n:]/', trim($vbulletin->options['lv_vb_eventforums_map']));
for($lv_vb_eventforums_i = 0; $lv_vb_eventforums_i<count($lv_vb_eventforums_map); $lv_vb_eventforums_i+=2)
{
    if(intval($lv_vb_eventforums_map[$lv_vb_eventforums_i+1]) == $foruminfo['forumid'])
    {
        $lv_vb_eventforums_eventForum = true;
        break;
    }
}
$lv_vb_eventforums_eventid = $threadinfo['lv_vb_eventforums_eventid'];
if($lv_vb_eventforums_eventForum && ($lv_vb_eventforums_eventid > 0) && (!empty($lv_vb_eventforums_eventid)))
{
  require_once(DIR . '/includes/functions_calendar.php');
  require_once(DIR . '/includes/functions_misc.php');
  require_once(DIR . '/includes/functions_newpost.php');
  require_once(DIR . '/includes/functions.php');
  require_once(DIR . '/includes/functions_user.php');
 
  require_once(DIR . '/includes/class_bbcode.php');
  $bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list(), true);
 
  // get the event
  $lv_vb_eventforums_event = $vbulletin->db->query_read("
            SELECT *
            FROM " . TABLE_PREFIX . "event
            WHERE eventid = " . intval($lv_vb_eventforums_eventid) . "
        ");
  $lv_vb_eventforums_event = $vbulletin->db->fetch_array($lv_vb_eventforums_event);
 
  $eventinfo = $lv_vb_eventforums_event;
 
  // reset the thread title, so the page title is correct.
  // we need todo this, otherwise all the html we added will show up in the browser title bar
  $threadinfo['title'] = $eventinfo['title'];
 
  // get the user info
  $lv_vb_eventforums_user = $vbulletin->db->query_read("
            SELECT *
            FROM " . TABLE_PREFIX . "user
            WHERE userid = " . intval($eventinfo['userid']) . "
        ");
  $lv_vb_eventforums_user = $vbulletin->db->fetch_array($lv_vb_eventforums_user);
 
  // get the calendar info
  $lv_vb_eventforums_calendar = $vbulletin->db->query_read("
            SELECT *
            FROM " . TABLE_PREFIX . "calendar
            WHERE calendarid = " . intval($eventinfo['calendarid']) . "
        ");
  $lv_vb_eventforums_calendar = $vbulletin->db->fetch_array($lv_vb_eventforums_calendar);
 
  $calendarinfo = $lv_vb_eventforums_calendar;
  $calendarinfo['title'] = '<a href="calendar.php?c=' . $eventinfo['calendarid'] . '">' . $calendarinfo['title'] . '</a>';
 
  // query the event reminder table
  $lv_vb_eventforums_eventReminder = $vbulletin->db->query_read("
            SELECT subscribeeventid
            FROM " . TABLE_PREFIX . "subscribeevent
            WHERE eventid = " . intval($lv_vb_eventforums_eventid) . " AND userid = " . intval($vbulletin->userinfo['userid']) . "
        ");
  $lv_vb_eventforums_eventReminderRows = $vbulletin->db->num_rows($lv_vb_eventforums_eventReminder);
 
  // parse membergroupids and make sql code to insert into where clause
  if(trim($vbulletin->userinfo['membergroupids']) != '')
  {
    $membergroupids = preg_split('/[,]/', trim($vbulletin->userinfo['membergroupids']));
  }
 
  // get permissions
  $lv_vb_eventforums_permissions = array();
 
  $membergroupsql = '';
  if(isset($membergroupids) && (count($membergroupids) > 0))
  {
    foreach($membergroupids as $key => $value)
    {
  if($value != '')
  {
    $membergroupsql .= ' OR usergroupid = ' . $value;
  }
    }
  }
 
  // get permissions for the user's usergroups
  $lv_vb_eventforums_permissionsQuery = $vbulletin->db->query_read("
  SELECT usergroupid, calendarpermissions
  FROM " . TABLE_PREFIX . "usergroup
  WHERE usergroupid = " . intval($vbulletin->userinfo['usergroupid']) . "
  " . $membergroupsql . "
  ");
 
  //$lv_vb_eventforums_usergroupPermissionsQuery = mysql_fetch_array($lv_vb_eventforums_usergroupPermissionsQuery, MYSQL_ASSOC);
 
  while($row = $vbulletin->db->fetch_array($lv_vb_eventforums_permissionsQuery, MYSQL_ASSOC))
  {
    $lv_vb_eventforums_permissions[$row['usergroupid']] = $row['calendarpermissions'];
  }
 
  // format the sql for the next query
  if(count($membergroupids) > 0)
  {
    $membergroupsql = ' AND (usergroupid = ' . $vbulletin->userinfo['usergroupid'] . $membergroupsql . ')';
  }
 
  // get any permissions overwritten in the AdminCP for the calendar
  $lv_vb_eventforums_permissionsQuery = $vbulletin->db->query_read("
  SELECT usergroupid, calendarpermissions
  FROM " . TABLE_PREFIX . "calendarpermission
  WHERE calendarid = " . intval($eventinfo['calendarid']) . "
  " . $membergroupsql . "
  ");
 
  while($row = $vbulletin->db->fetch_array($lv_vb_eventforums_permissionsQuery, MYSQL_ASSOC))
  {
    $lv_vb_eventforums_permissions[$row['usergroupid']] = $row['calendarpermissions'];
  }
 
  // work out offsets etc
  $offset = $lv_vb_eventforums_event['utc'] ? $vbulletin->userinfo['timezoneoffset'] : ($vbulletin->userinfo['timezoneoffset'] ? $vbulletin->userinfo['tzoffset'] : $vbulletin->userinfo['timezoneoffset']);
  $from = $eventinfo['dateline_from'] + $offset * 3600;
  $to = $eventinfo['dateline_to'] + $offset * 3600;
 
  if($lv_vb_eventforums_event['dateline_to'] == 0)
  {
    $from = $lv_vb_eventforums_event['dateline_from'];
  }
 
  $date1 = trim(vbdate($vbulletin->options['dateformat'],  $from, false, true, false, true));
  $date2 = trim(vbdate($vbulletin->options['dateformat'],  $to, false, true, false, true));
  $time1 = trim(vbdate($vbulletin->options['timeformat'],  $from, false, true, false, true));
  $time2 = trim(vbdate($vbulletin->options['timeformat'],  $to, false, true, false, true));
 
  // phrases
  $vbphrase['date_x_to_y'] = fetch_phrase("date_x_to_y", 5);
  $vbphrase['time_x_to_y'] = fetch_phrase("time_x_to_y", 5);
  $vbphrase['delete_reminder_for_this_event'] = fetch_phrase("delete_reminder_for_this_event", 5);
  $vbphrase['request_reminder_for_this_event'] = fetch_phrase("request_reminder_for_this_event", 5);
  $vbphrase['event_options'] = fetch_phrase("event_options", 5);
  $vbphrase['edit_event'] = fetch_phrase("edit_event", 5);
  $vbphrase['delete_event'] = fetch_phrase("delete_event", 5);
  $vbphrase['move_event'] = fetch_phrase("move_event", 5);
  $vbphrase['lv_vb_eventforums_phrase_noReplies'] = fetch_phrase("lv_vb_eventforums_phrase_noReplies", 5);
 
  // Initialise all the variables we need to set for the template
  $show['canmoveevent'] = false;
  $show['caneditevent'] = false;
  $show['candeleteevent'] = false;
 
  $show['postedby'] = true;
  $show['subscribed'] = false;
  $show['subscribelink'] = true;
  $show['recuroption'] = false;
  $show['adjustedday'] = false;
  $show['holiday'] = false;
 
  $show['singleday'] = false;
  $show['daterange'] = false;
 
  $show['customfields'] = false;
  $show['customoption'] = false;
 
  $show['eventoptions'] = false;
 
  // can the user move or delete this event?
  $show['canmoveevent'] = can_moderate_calendar($calendarinfo['calendarid'], 'canmoveevents');
  $show['candeleteevent'] = can_moderate_calendar($calendarinfo['calendarid'], 'candeleteevents');
  $show['caneditevent'] = can_moderate_calendar($calendarinfo['calendarid'], 'caneditevents');
 
  if(isset($lv_vb_eventforums_permissions))
  {
    // check each usergroup
    foreach($lv_vb_eventforums_permissions as $key => $value)
    {
      // can this user edit the event?
      if(!$show['caneditevent'])
      {
        if($eventinfo['userid'] == $vbulletin->userinfo['userid'])
        {
          if(($value & $vbulletin->bf_ugp_calendarpermissions['caneditevent']))
          {
        $show['caneditevent'] = true;
          }
        }
      }
 }
 //-- for some reason the vb guys decided that user deleting their own posts
 //-- can only do it from the edit menu. its a bug i think.
    // can this user delete the event?
    /*if(!$show['candeleteevent'])
    {
      if($eventinfo['userid'] == $vbulletin->userinfo['userid'])
      {
        if(($value & $vbulletin->bf_ugp_calendarpermissions['candeleteevent']))
        {
      $show['candeleteevent'] = true;
        }
      }
    }*/
  }
 
//ATTENDANCE CODE FROM SHOW/ENROLL start
//Enroll/Cancel
if ($_REQUEST['ea'] == "attend" || $_REQUEST['ea'] == "unattend" AND ($time_until_event>0 OR $vbulletin->options['lateenroll']) )
        {
            if (!$eventinfo['roll'])
                {
                    $roll = array();
                }
                else
                {
                    $roll = @unserialize($eventinfo['roll']);
                }

        if ($_REQUEST['ea'] == "attend")
            {
            if ($vbulletin->userinfo[userid])
            {
                $roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'];       
            }
            else
            {
            print_no_permission();
            }
            }
            else
            {
            if ($vbulletin->userinfo[userid])
            {
                unset($roll[$vbulletin->userinfo['userid']]);       
            }
            else
            {
            print_no_permission();
            }
            }
   
            $eventinfo['roll'] = serialize($roll);
        $db->query_write("UPDATE ".TABLE_PREFIX."event SET roll='".addslashes($eventinfo['roll'])."' WHERE eventid='".$eventinfo['eventid']."'");
        $_REQUEST['do'] = "getinfo";
}

//show enrolled people
        $rollcount=0;
                if ($eventinfo['useroll'])
                {
                    // Roll for this event
            unset($rollbits);
                    $show['userattending'] = false;
                    if (($roll = @unserialize($eventinfo['roll'])) && is_array($roll))
                    {
                if ($vbulletin->options['roll_sort'])
                {
                    uasort($roll, "strnatcasecmp");
                }

                            if (array_key_exists($vbulletin->userinfo['userid'], $roll))
                            {
                    $show['userattending']=true;
                            }
                   
                    while ($rollusername = current($roll))
                {
                $rolluserid = key($roll);
                eval('$rollbits .= "' . fetch_template('calendar_rollbit') . '";');
                $rollcount++;
                next($roll);
                }
                    }
                        else
                        {
                            $eventinfo['roll'] = "";
                        }
                       
                        eval ('$eventinfo[roll] = "' . fetch_template('calendar_roll') . '";');
            $eventinfo['event'].=$eventinfo['roll'];
                    // End Roll
                }
                else
                {
                    $eventinfo['roll'] = "";
                }
//ATTENDANCE CODE FROM SHOW/ENROLL end

 
  // show the options box?
  if(($show['candeleteevent'] OR $show['canmoveevent'] OR $show['caneditevent']) AND !$show['holiday'])
  {
    $show['eventoptions'] = true;
  }
 
  // construct the user info for the event poster
  $eventinfo['musername'] = $lv_vb_eventforums_user['username'] . '</a>';
 
  // user title
  $usertitle = $lv_vb_eventforums_user['usertitle'];
  if($usertitle != '')
  {
    $eventinfo['musername'] .= '<div class="smallfont" style="margin-bottom:3px;">' . $usertitle . '</div>';
  }
 
  // user avatar
  //$avatarurl = fetch_avatar_url($lv_vb_eventforums_user['userid']);
  //if($avatarurl[0] != '')
  //{
  //  $eventinfo['musername'] .= '<div class="smallfont" style="margin-bottom:3px;">&nbsp;<br><a href="member.php?u=' . $lv_vb_eventforums_user['userid'] . '"><img title="" src="' . $avatarurl[0] .'" alt="" border="0"></a></div>';
  //}
 
  $eventinfo['musername'] .= '<a>'; // this is required to validate the tag we skipped
 
  // does the current user have a reminder for this event?
  if($lv_vb_eventforums_eventReminderRows != 0)
  {
    $show['subscribed'] = true;
  }
 
  if($eventinfo['dateline_to'] == 0)
  {
    $show['singleday'] = true;
  }
 
  if(strcmp($date1, $date2) != 0)
  {
    $show['daterange'] = true;
  }
 
  if(!$show['daterange'] || $show['singleday'])
  {
    $eventdate = $date1;
  }
 
  // get the title of the custom fields
  $lv_vb_eventforums_calendarFields = $vbulletin->db->query_read("
            SELECT *
            FROM " . TABLE_PREFIX . "calendarcustomfield
            WHERE calendarid = " . intval($lv_vb_eventforums_event['calendarid']) . "
  ORDER BY calendarcustomfieldid
        ");
 
  // Custom Fields
  $lv_vb_eventforums_customfieldvals = unserialize($lv_vb_eventforums_event['customfields']);
  $lv_vb_eventforums_customfieldarray = array();
 
  if($lv_vb_eventforums_calendarFields)
  {
    while($row = $vbulletin->db->fetch_array($lv_vb_eventforums_calendarFields, MYSQL_ASSOC))
    {
  $lv_vb_eventforums_customfieldarray[$row['title']] = $lv_vb_eventforums_customfieldvals[$row['calendarcustomfieldid']];
    }
  }
 
  // custom fields
  if(count($lv_vb_eventforums_customfieldarray) > 0)
  {
    $show['customfields'] = true;
 $show['customoption'] = true;
 
    $lv_vb_eventforums_customfields = '';
    foreach($lv_vb_eventforums_customfieldarray as $key => $value)
    {
  $value = trim($value);
  if(!empty($value))
  {
    $customtitle = $key;
    $customoption = convert_url_to_bbcode(unhtmlspecialchars($value));
    $customoption = $bbcode_parser->parse($customoption, 0, true);
    eval('$lv_vb_eventforums_customfields .= "' . fetch_template('calendar_showeventsbit_customfield') . '";');
  }
    }
 
 $customfields = $lv_vb_eventforums_customfields;
  }
 
  //$eventinfo['event'] = /*convert_url_to_bbcode(*/unhtmlspecialchars($eventinfo['event'])/*)*/;
  $eventinfo['event'] = $bbcode_parser->parse($eventinfo['event'], $foruminfo['forumid'], true);
 
  eval('$spacertable1 = "' . fetch_template('spacer_close') . '";');
  eval('$spacertable2 = "' . fetch_template('spacer_open') . '";');
  //eval('$spacertable1 = "' . fetch_template('spacer_open') . '";');
  //eval('$spacertable2 = "' . fetch_template('spacer_close') . '";');
  //eval('$lv_vb_eventforums_eventblock = $spacertable1;');
  eval('$lv_vb_eventforums_eventblock = "' . fetch_template('calendar_showeventsbit') . '";');
  //eval('$lv_vb_eventforums_eventblock .= $spacertable2;');
 
  if($vbulletin->options['lv_vb_eventforums_varForEventDetails'])
  {
    $lv_vb_eventforums_eventdetails = $lv_vb_eventforums_eventblock;
  }
  else
  {
    $navbar .= $spacertable1 . $lv_vb_eventforums_eventblock . $spacertable2;
    //eval('$navbar =  . $navbar . $lv_vb_eventforums_eventblock;');
  } 
 
  // if thread is only showing first post, and is an event thread
  // discount the options and make sure quick reply is available without forcing an initial
  // click on a post.
  // This is because there is no quick reply button on the event, and the first post is hidden
  if($totalposts == 1) // only first post
  {
 require_once(DIR . '/includes/functions_editor.php');
    $istyles_js = construct_editor_styles_js();
    $qrpostid = $threadinfo['firstpostid'];
    $show['qr_require_click'] = 0;
 
 unset($messagearea);
 $editorid = construct_edit_toolbar('', 0, $foruminfo['forumid'], ($foruminfo['allowsmilies'] ? 1 : 0), 1, false, 'qr');
 $messagearea = "
  <script type=\"text/javascript\">
  <!--
  var threaded_mode = $threadedmode;
  var require_click = " . '0' . ";
  var is_last_page = " . '0' . ";
  var ajax_last_post = " . intval($effective_lastpost) . ";
  // -->
  </script>
  $messagearea
 ";
 // this isn't a great way todo this, but the lack of hooks makes this the only way I can see
 // its a bodge, but it works for now...
 $messagearea = preg_replace('/disabled="disabled"/', '', $messagearea);
 $messagearea = preg_replace('/' . fetch_phrase("click_quick_reply_icon", 41) . '/', '', $messagearea);
 
 //$noposts = '<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">';
 //$noposts .= '<tbody><tr>';
 //$noposts .= '<td class="alt1">There are no replies to show</td>';
    //$noposts .= '</tr></tbody>';
 //$noposts .= '</table>';
 //$noposts .= '<br/>';
 eval('$noposts = "' . fetch_template('lv_vb_eventforums_noPostSpacer') . '";');
 //eval('$postbits = $noposts . $postbits . ;');
 $postbits = $noposts . $postbits;
  } // is first post
}

The only other issues I found was a slight display issue with a couple extra lines thrown in with the showthread view & my username is not color coded. Again minor issues imho. (see attachments, accurately named)


I am unable to find the ""Display Event Details on Thread Page" Plugin. Does anybody have the same problem?

Edit: Somehow I downloaded version 1.2 of this hack. Now I have the correct version and modification is very easy.

Mighty Mojo 05-19-2006 02:34 PM

Quote:

Originally Posted by |oR|Greg
What about something like this?

Code:


if ($_REQUEST['ea'] == "attend")
                {
                        if ($vbulletin->userinfo[userid])
                        {
                        $roll[$vbulletin->userinfo['field14']] = $vbulletin->userinfo['field14'];
$roll[$vbulletin->userinfo['field15']] = $vbulletin->userinfo['field15'];
$roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'];       
                        }
                        else


Hmmmm, this lists the custom profile fields as if they were usernames (stacked in the same column as the username), how can I get the fields to display next to the username?

Also, when you enroll, it adds the profile fields, but when you say you will no longer be attending the event, it removes only the username, the profile fields are left behind...

Thanks for your efforts!

Mighty Mojo 05-19-2006 02:45 PM

Quote:

Originally Posted by |oR|Greg
What about something like this?

Code:


if ($_REQUEST['ea'] == "attend")
                {
                        if ($vbulletin->userinfo[userid])
                        {
                        $roll[$vbulletin->userinfo['field14']] = $vbulletin->userinfo['field14'];
$roll[$vbulletin->userinfo['field15']] = $vbulletin->userinfo['field15'];
$roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'];       
                        }
                        else



Alrighty, now we are gettin somewhere!
This works, excepting I'd like to have the profile fields next to the username, the way this is setup, it put's the fields in the same column as the username...

FYI, I've also added the variables to the unset area so that when the user removes him/herself from the event, the custom fields also remove, here is the code so far:

Code:

//Check time till event
$time_until_event=$eventinfo['dateline_from']-(TIMENOW+$vbulletion->userinfo['timezoneoffset']*3600);
if ($vbulletin->userinfo['dstonoff'])
{
        $time_until_event=$time_until_event-3600;
}
//echo $time_until_event."  ";
$show['enroll']=(($time_until_event>0) || ($vbulletin->options['lateenroll'])) ? true : false;


//Enroll/Cancel
if ($_REQUEST['ea'] == "attend" || $_REQUEST['ea'] == "unattend" AND ($time_until_event>0 OR $vbulletin->options['lateenroll']) )
                {
                        if (!$eventinfo['roll'])
                        {
                                $roll = array();
                        }
                        else
                        {
                                $roll = @unserialize($eventinfo['roll']);
                        }

                if ($_REQUEST['ea'] == "attend")
                {
                        if ($vbulletin->userinfo[userid])
                        {
                        $roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'];
$roll[$vbulletin->userinfo['field14']] = $vbulletin->userinfo['field14'];       
                        }
                        else
                        {
                        print_no_permission();
                        }
                }
                else
                {
                        if ($vbulletin->userinfo[userid])
                        {
                        unset($roll[$vbulletin->userinfo['userid']]);unset($roll[$vbulletin->userinfo['field14']]);  unset($roll[$vbulletin->userinfo['field15']]);             
                        }
                        else
                        {
                        print_no_permission();
                        }
                }
       
                $eventinfo['roll'] = serialize($roll);
                $db->query_write("UPDATE ".TABLE_PREFIX."event SET roll='".addslashes($eventinfo['roll'])."' WHERE eventid='".$eventinfo['eventid']."'");
                $_REQUEST['do'] = "getinfo";
}


//show enrolled people
                $rollcount=0;
                if ($eventinfo['useroll'])
                {
                        // Roll for this event
                        unset($rollbits);
                        $show['userattending'] = false;
                        if (($roll = @unserialize($eventinfo['roll'])) && is_array($roll))
                        {
                                if ($vbulletin->options['roll_sort'])
                                {
                                        uasort($roll, "strnatcasecmp");
                                }

                                if (array_key_exists($vbulletin->userinfo['userid'], $roll))
                                {
                                        $show['userattending']=true;
                                }
                       
                                while ($rollusername = current($roll))
                                {
                                $rolluserid = key($roll);
                                eval('$rollbits .= "' . fetch_template('calendar_rollbit') . '";');
                                $rollcount++;
                                next($roll);
                                }
                        }
                        else
                        {
                                $eventinfo['roll'] = "";
                        }
                       
                        eval ('$eventinfo[roll] = "' . fetch_template('calendar_roll') . '";');
                        $eventinfo['event'].=$eventinfo['roll'];
                        // End Roll
                }
                else
                {
                        $eventinfo['roll'] = "";}

Thanks for your efforts! Hoping we can get those custom fields to show up in the proper place...

Mighty Mojo 05-19-2006 07:46 PM

Oh I love talking to myself!

Thanks for all your help btw! appreciated!

Here I finally got what I was after---This allows you to add chosen profile fields next to the username----simply replace field14 with whatever field you are after:
Code:

//Check time till event
$time_until_event=$eventinfo['dateline_from']-(TIMENOW+$vbulletion->userinfo['timezoneoffset']*3600);
if ($vbulletin->userinfo['dstonoff'])
{
        $time_until_event=$time_until_event-3600;
}
//echo $time_until_event."  ";
$show['enroll']=(($time_until_event>0) || ($vbulletin->options['lateenroll'])) ? true : false;


//Enroll/Cancel
if ($_REQUEST['ea'] == "attend" || $_REQUEST['ea'] == "unattend" AND ($time_until_event>0 OR $vbulletin->options['lateenroll']) )
                {
                        if (!$eventinfo['roll'])
                        {
                                $roll = array();
                        }
                        else
                        {
                                $roll = @unserialize($eventinfo['roll']);
                        }

                if ($_REQUEST['ea'] == "attend")
                {
                        if ($vbulletin->userinfo[userid])
                        {
                        $roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username']."    __    ".$vbulletin->userinfo['field14'];

       
                        }
                        else
                        {
                        print_no_permission();
                        }
                }
                else
                {
                        if ($vbulletin->userinfo[userid])
                        {
                        unset($roll[$vbulletin->userinfo['userid']]);unset($roll[$vbulletin->userinfo['field14']]);               
                        }
                        else
                        {
                        print_no_permission();
                        }
                }
       
                $eventinfo['roll'] = serialize($roll);
                $db->query_write("UPDATE ".TABLE_PREFIX."event SET roll='".addslashes($eventinfo['roll'])."' WHERE eventid='".$eventinfo['eventid']."'");
                $_REQUEST['do'] = "getinfo";
}


//show enrolled people
                $rollcount=0;
                if ($eventinfo['useroll'])
                {
                        // Roll for this event
                        unset($rollbits);
                        $show['userattending'] = false;
                        if (($roll = @unserialize($eventinfo['roll'])) && is_array($roll))
                        {
                                if ($vbulletin->options['roll_sort'])
                                {
                                        uasort($roll, "strnatcasecmp");
                                }

                                if (array_key_exists($vbulletin->userinfo['userid'], $roll))
                                {
                                        $show['userattending']=true;
                                }
                       
                                while ($rollusername = current($roll))
                                {
                                $rolluserid = key($roll);
                                eval('$rollbits .= "' . fetch_template('calendar_rollbit') . '";');
                                $rollcount++;
                                next($roll);
                                }
                        }
                        else
                        {
                                $eventinfo['roll'] = "";
                        }
                       
                        eval ('$eventinfo[roll] = "' . fetch_template('calendar_roll') . '";');
                        $eventinfo['event'].=$eventinfo['roll'];
                        // End Roll
                }
                else
                {
                        $eventinfo['roll'] = "";
                }


jerx 05-20-2006 09:27 AM

Quote:

Originally Posted by TomasDR
Ok here goes. This is what I did, it works for me in 3.5.4

I had to disable the Plugin: (hence the broken part)
"redirect links to individual events to their threads instead"
Hook Location : calendar_getday_start
Installed by: vB Event Forums

I decided to disable the Plugin: (and make a new one)
"Display Event Details on Thread Page"
Hook Location : showthread_complete
Installed by: vB Event Forums

I made a new Plugin:
"Event Attendance - Forum Combined"
Hook Location : showthread_complete
I tied it to vB Event Forums for the Product, not sure if that really does anything.

In the code I combined these 2 plugins.
"Display Event Details on Thread Page" (Hook Location : showthread_complete - vB Event Forums)
"Event Attendance - show/enroll" (Hook Location : calendar_getday_event - Event Attendance) (note: I had to leave this Plugin active!)

The Code: show/enroll remarked in caps and bolded
Code:

// we need to initialise this variable here, otherwise on non Event Threads, the var will show as text
$lv_vb_eventforums_eventdetails = "";
//ATTENDANCE VARIABLES FROM SHOW/ENROLL start
$time_until_event=$eventinfo['dateline_from']-(TIMENOW+$vbulletion->userinfo['timezoneoffset']*3600);

//Check time till event
if ($vbulletin->userinfo['dstonoff'])
{
    $time_until_event=$time_until_event-3600;
}

//echo $time_until_event."  ";
$show['enroll']=(($time_until_event>0) || ($vbulletin->options['lateenroll'])) ? true : false;
//ATTENDANCE VARIABLES FROM SHOW/ENROLL end


// is this a VB event forum?
$lv_vb_eventforums_eventForum = false;
$lv_vb_eventforums_map = preg_split('/[\n:]/', trim($vbulletin->options['lv_vb_eventforums_map']));
for($lv_vb_eventforums_i = 0; $lv_vb_eventforums_i<count($lv_vb_eventforums_map); $lv_vb_eventforums_i+=2)
{
    if(intval($lv_vb_eventforums_map[$lv_vb_eventforums_i+1]) == $foruminfo['forumid'])
    {
        $lv_vb_eventforums_eventForum = true;
        break;
    }
}
$lv_vb_eventforums_eventid = $threadinfo['lv_vb_eventforums_eventid'];
if($lv_vb_eventforums_eventForum && ($lv_vb_eventforums_eventid > 0) && (!empty($lv_vb_eventforums_eventid)))
{
  require_once(DIR . '/includes/functions_calendar.php');
  require_once(DIR . '/includes/functions_misc.php');
  require_once(DIR . '/includes/functions_newpost.php');
  require_once(DIR . '/includes/functions.php');
  require_once(DIR . '/includes/functions_user.php');
 
  require_once(DIR . '/includes/class_bbcode.php');
  $bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list(), true);
 
  // get the event
  $lv_vb_eventforums_event = $vbulletin->db->query_read("
            SELECT *
            FROM " . TABLE_PREFIX . "event
            WHERE eventid = " . intval($lv_vb_eventforums_eventid) . "
        ");
  $lv_vb_eventforums_event = $vbulletin->db->fetch_array($lv_vb_eventforums_event);
 
  $eventinfo = $lv_vb_eventforums_event;
 
  // reset the thread title, so the page title is correct.
  // we need todo this, otherwise all the html we added will show up in the browser title bar
  $threadinfo['title'] = $eventinfo['title'];
 
  // get the user info
  $lv_vb_eventforums_user = $vbulletin->db->query_read("
            SELECT *
            FROM " . TABLE_PREFIX . "user
            WHERE userid = " . intval($eventinfo['userid']) . "
        ");
  $lv_vb_eventforums_user = $vbulletin->db->fetch_array($lv_vb_eventforums_user);
 
  // get the calendar info
  $lv_vb_eventforums_calendar = $vbulletin->db->query_read("
            SELECT *
            FROM " . TABLE_PREFIX . "calendar
            WHERE calendarid = " . intval($eventinfo['calendarid']) . "
        ");
  $lv_vb_eventforums_calendar = $vbulletin->db->fetch_array($lv_vb_eventforums_calendar);
 
  $calendarinfo = $lv_vb_eventforums_calendar;
  $calendarinfo['title'] = '<a href="calendar.php?c=' . $eventinfo['calendarid'] . '">' . $calendarinfo['title'] . '</a>';
 
  // query the event reminder table
  $lv_vb_eventforums_eventReminder = $vbulletin->db->query_read("
            SELECT subscribeeventid
            FROM " . TABLE_PREFIX . "subscribeevent
            WHERE eventid = " . intval($lv_vb_eventforums_eventid) . " AND userid = " . intval($vbulletin->userinfo['userid']) . "
        ");
  $lv_vb_eventforums_eventReminderRows = $vbulletin->db->num_rows($lv_vb_eventforums_eventReminder);
 
  // parse membergroupids and make sql code to insert into where clause
  if(trim($vbulletin->userinfo['membergroupids']) != '')
  {
    $membergroupids = preg_split('/[,]/', trim($vbulletin->userinfo['membergroupids']));
  }
 
  // get permissions
  $lv_vb_eventforums_permissions = array();
 
  $membergroupsql = '';
  if(isset($membergroupids) && (count($membergroupids) > 0))
  {
    foreach($membergroupids as $key => $value)
    {
  if($value != '')
  {
    $membergroupsql .= ' OR usergroupid = ' . $value;
  }
    }
  }
 
  // get permissions for the user's usergroups
  $lv_vb_eventforums_permissionsQuery = $vbulletin->db->query_read("
  SELECT usergroupid, calendarpermissions
  FROM " . TABLE_PREFIX . "usergroup
  WHERE usergroupid = " . intval($vbulletin->userinfo['usergroupid']) . "
  " . $membergroupsql . "
  ");
 
  //$lv_vb_eventforums_usergroupPermissionsQuery = mysql_fetch_array($lv_vb_eventforums_usergroupPermissionsQuery, MYSQL_ASSOC);
 
  while($row = $vbulletin->db->fetch_array($lv_vb_eventforums_permissionsQuery, MYSQL_ASSOC))
  {
    $lv_vb_eventforums_permissions[$row['usergroupid']] = $row['calendarpermissions'];
  }
 
  // format the sql for the next query
  if(count($membergroupids) > 0)
  {
    $membergroupsql = ' AND (usergroupid = ' . $vbulletin->userinfo['usergroupid'] . $membergroupsql . ')';
  }
 
  // get any permissions overwritten in the AdminCP for the calendar
  $lv_vb_eventforums_permissionsQuery = $vbulletin->db->query_read("
  SELECT usergroupid, calendarpermissions
  FROM " . TABLE_PREFIX . "calendarpermission
  WHERE calendarid = " . intval($eventinfo['calendarid']) . "
  " . $membergroupsql . "
  ");
 
  while($row = $vbulletin->db->fetch_array($lv_vb_eventforums_permissionsQuery, MYSQL_ASSOC))
  {
    $lv_vb_eventforums_permissions[$row['usergroupid']] = $row['calendarpermissions'];
  }
 
  // work out offsets etc
  $offset = $lv_vb_eventforums_event['utc'] ? $vbulletin->userinfo['timezoneoffset'] : ($vbulletin->userinfo['timezoneoffset'] ? $vbulletin->userinfo['tzoffset'] : $vbulletin->userinfo['timezoneoffset']);
  $from = $eventinfo['dateline_from'] + $offset * 3600;
  $to = $eventinfo['dateline_to'] + $offset * 3600;
 
  if($lv_vb_eventforums_event['dateline_to'] == 0)
  {
    $from = $lv_vb_eventforums_event['dateline_from'];
  }
 
  $date1 = trim(vbdate($vbulletin->options['dateformat'],  $from, false, true, false, true));
  $date2 = trim(vbdate($vbulletin->options['dateformat'],  $to, false, true, false, true));
  $time1 = trim(vbdate($vbulletin->options['timeformat'],  $from, false, true, false, true));
  $time2 = trim(vbdate($vbulletin->options['timeformat'],  $to, false, true, false, true));
 
  // phrases
  $vbphrase['date_x_to_y'] = fetch_phrase("date_x_to_y", 5);
  $vbphrase['time_x_to_y'] = fetch_phrase("time_x_to_y", 5);
  $vbphrase['delete_reminder_for_this_event'] = fetch_phrase("delete_reminder_for_this_event", 5);
  $vbphrase['request_reminder_for_this_event'] = fetch_phrase("request_reminder_for_this_event", 5);
  $vbphrase['event_options'] = fetch_phrase("event_options", 5);
  $vbphrase['edit_event'] = fetch_phrase("edit_event", 5);
  $vbphrase['delete_event'] = fetch_phrase("delete_event", 5);
  $vbphrase['move_event'] = fetch_phrase("move_event", 5);
  $vbphrase['lv_vb_eventforums_phrase_noReplies'] = fetch_phrase("lv_vb_eventforums_phrase_noReplies", 5);
 
  // Initialise all the variables we need to set for the template
  $show['canmoveevent'] = false;
  $show['caneditevent'] = false;
  $show['candeleteevent'] = false;
 
  $show['postedby'] = true;
  $show['subscribed'] = false;
  $show['subscribelink'] = true;
  $show['recuroption'] = false;
  $show['adjustedday'] = false;
  $show['holiday'] = false;
 
  $show['singleday'] = false;
  $show['daterange'] = false;
 
  $show['customfields'] = false;
  $show['customoption'] = false;
 
  $show['eventoptions'] = false;
 
  // can the user move or delete this event?
  $show['canmoveevent'] = can_moderate_calendar($calendarinfo['calendarid'], 'canmoveevents');
  $show['candeleteevent'] = can_moderate_calendar($calendarinfo['calendarid'], 'candeleteevents');
  $show['caneditevent'] = can_moderate_calendar($calendarinfo['calendarid'], 'caneditevents');
 
  if(isset($lv_vb_eventforums_permissions))
  {
    // check each usergroup
    foreach($lv_vb_eventforums_permissions as $key => $value)
    {
      // can this user edit the event?
      if(!$show['caneditevent'])
      {
        if($eventinfo['userid'] == $vbulletin->userinfo['userid'])
        {
          if(($value & $vbulletin->bf_ugp_calendarpermissions['caneditevent']))
          {
        $show['caneditevent'] = true;
          }
        }
      }
 }
 //-- for some reason the vb guys decided that user deleting their own posts
 //-- can only do it from the edit menu. its a bug i think.
    // can this user delete the event?
    /*if(!$show['candeleteevent'])
    {
      if($eventinfo['userid'] == $vbulletin->userinfo['userid'])
      {
        if(($value & $vbulletin->bf_ugp_calendarpermissions['candeleteevent']))
        {
      $show['candeleteevent'] = true;
        }
      }
    }*/
  }
 
//ATTENDANCE CODE FROM SHOW/ENROLL start
//Enroll/Cancel
if ($_REQUEST['ea'] == "attend" || $_REQUEST['ea'] == "unattend" AND ($time_until_event>0 OR $vbulletin->options['lateenroll']) )
        {
            if (!$eventinfo['roll'])
                {
                    $roll = array();
                }
                else
                {
                    $roll = @unserialize($eventinfo['roll']);
                }

        if ($_REQUEST['ea'] == "attend")
            {
            if ($vbulletin->userinfo[userid])
            {
                $roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'];       
            }
            else
            {
            print_no_permission();
            }
            }
            else
            {
            if ($vbulletin->userinfo[userid])
            {
                unset($roll[$vbulletin->userinfo['userid']]);       
            }
            else
            {
            print_no_permission();
            }
            }
   
            $eventinfo['roll'] = serialize($roll);
        $db->query_write("UPDATE ".TABLE_PREFIX."event SET roll='".addslashes($eventinfo['roll'])."' WHERE eventid='".$eventinfo['eventid']."'");
        $_REQUEST['do'] = "getinfo";
}

//show enrolled people
        $rollcount=0;
                if ($eventinfo['useroll'])
                {
                    // Roll for this event
            unset($rollbits);
                    $show['userattending'] = false;
                    if (($roll = @unserialize($eventinfo['roll'])) && is_array($roll))
                    {
                if ($vbulletin->options['roll_sort'])
                {
                    uasort($roll, "strnatcasecmp");
                }

                            if (array_key_exists($vbulletin->userinfo['userid'], $roll))
                            {
                    $show['userattending']=true;
                            }
                   
                    while ($rollusername = current($roll))
                {
                $rolluserid = key($roll);
                eval('$rollbits .= "' . fetch_template('calendar_rollbit') . '";');
                $rollcount++;
                next($roll);
                }
                    }
                        else
                        {
                            $eventinfo['roll'] = "";
                        }
                       
                        eval ('$eventinfo[roll] = "' . fetch_template('calendar_roll') . '";');
            $eventinfo['event'].=$eventinfo['roll'];
                    // End Roll
                }
                else
                {
                    $eventinfo['roll'] = "";
                }
//ATTENDANCE CODE FROM SHOW/ENROLL end

 
  // show the options box?
  if(($show['candeleteevent'] OR $show['canmoveevent'] OR $show['caneditevent']) AND !$show['holiday'])
  {
    $show['eventoptions'] = true;
  }
 
  // construct the user info for the event poster
  $eventinfo['musername'] = $lv_vb_eventforums_user['username'] . '</a>';
 
  // user title
  $usertitle = $lv_vb_eventforums_user['usertitle'];
  if($usertitle != '')
  {
    $eventinfo['musername'] .= '<div class="smallfont" style="margin-bottom:3px;">' . $usertitle . '</div>';
  }
 
  // user avatar
  //$avatarurl = fetch_avatar_url($lv_vb_eventforums_user['userid']);
  //if($avatarurl[0] != '')
  //{
  //  $eventinfo['musername'] .= '<div class="smallfont" style="margin-bottom:3px;">&nbsp;<br><a href="member.php?u=' . $lv_vb_eventforums_user['userid'] . '"><img title="" src="' . $avatarurl[0] .'" alt="" border="0"></a></div>';
  //}
 
  $eventinfo['musername'] .= '<a>'; // this is required to validate the tag we skipped
 
  // does the current user have a reminder for this event?
  if($lv_vb_eventforums_eventReminderRows != 0)
  {
    $show['subscribed'] = true;
  }
 
  if($eventinfo['dateline_to'] == 0)
  {
    $show['singleday'] = true;
  }
 
  if(strcmp($date1, $date2) != 0)
  {
    $show['daterange'] = true;
  }
 
  if(!$show['daterange'] || $show['singleday'])
  {
    $eventdate = $date1;
  }
 
  // get the title of the custom fields
  $lv_vb_eventforums_calendarFields = $vbulletin->db->query_read("
            SELECT *
            FROM " . TABLE_PREFIX . "calendarcustomfield
            WHERE calendarid = " . intval($lv_vb_eventforums_event['calendarid']) . "
  ORDER BY calendarcustomfieldid
        ");
 
  // Custom Fields
  $lv_vb_eventforums_customfieldvals = unserialize($lv_vb_eventforums_event['customfields']);
  $lv_vb_eventforums_customfieldarray = array();
 
  if($lv_vb_eventforums_calendarFields)
  {
    while($row = $vbulletin->db->fetch_array($lv_vb_eventforums_calendarFields, MYSQL_ASSOC))
    {
  $lv_vb_eventforums_customfieldarray[$row['title']] = $lv_vb_eventforums_customfieldvals[$row['calendarcustomfieldid']];
    }
  }
 
  // custom fields
  if(count($lv_vb_eventforums_customfieldarray) > 0)
  {
    $show['customfields'] = true;
 $show['customoption'] = true;
 
    $lv_vb_eventforums_customfields = '';
    foreach($lv_vb_eventforums_customfieldarray as $key => $value)
    {
  $value = trim($value);
  if(!empty($value))
  {
    $customtitle = $key;
    $customoption = convert_url_to_bbcode(unhtmlspecialchars($value));
    $customoption = $bbcode_parser->parse($customoption, 0, true);
    eval('$lv_vb_eventforums_customfields .= "' . fetch_template('calendar_showeventsbit_customfield') . '";');
  }
    }
 
 $customfields = $lv_vb_eventforums_customfields;
  }
 
  //$eventinfo['event'] = /*convert_url_to_bbcode(*/unhtmlspecialchars($eventinfo['event'])/*)*/;
  $eventinfo['event'] = $bbcode_parser->parse($eventinfo['event'], $foruminfo['forumid'], true);
 
  eval('$spacertable1 = "' . fetch_template('spacer_close') . '";');
  eval('$spacertable2 = "' . fetch_template('spacer_open') . '";');
  //eval('$spacertable1 = "' . fetch_template('spacer_open') . '";');
  //eval('$spacertable2 = "' . fetch_template('spacer_close') . '";');
  //eval('$lv_vb_eventforums_eventblock = $spacertable1;');
  eval('$lv_vb_eventforums_eventblock = "' . fetch_template('calendar_showeventsbit') . '";');
  //eval('$lv_vb_eventforums_eventblock .= $spacertable2;');
 
  if($vbulletin->options['lv_vb_eventforums_varForEventDetails'])
  {
    $lv_vb_eventforums_eventdetails = $lv_vb_eventforums_eventblock;
  }
  else
  {
    $navbar .= $spacertable1 . $lv_vb_eventforums_eventblock . $spacertable2;
    //eval('$navbar =  . $navbar . $lv_vb_eventforums_eventblock;');
  } 
 
  // if thread is only showing first post, and is an event thread
  // discount the options and make sure quick reply is available without forcing an initial
  // click on a post.
  // This is because there is no quick reply button on the event, and the first post is hidden
  if($totalposts == 1) // only first post
  {
 require_once(DIR . '/includes/functions_editor.php');
    $istyles_js = construct_editor_styles_js();
    $qrpostid = $threadinfo['firstpostid'];
    $show['qr_require_click'] = 0;
 
 unset($messagearea);
 $editorid = construct_edit_toolbar('', 0, $foruminfo['forumid'], ($foruminfo['allowsmilies'] ? 1 : 0), 1, false, 'qr');
 $messagearea = "
  <script type=\"text/javascript\">
  <!--
  var threaded_mode = $threadedmode;
  var require_click = " . '0' . ";
  var is_last_page = " . '0' . ";
  var ajax_last_post = " . intval($effective_lastpost) . ";
  // -->
  </script>
  $messagearea
 ";
 // this isn't a great way todo this, but the lack of hooks makes this the only way I can see
 // its a bodge, but it works for now...
 $messagearea = preg_replace('/disabled="disabled"/', '', $messagearea);
 $messagearea = preg_replace('/' . fetch_phrase("click_quick_reply_icon", 41) . '/', '', $messagearea);
 
 //$noposts = '<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">';
 //$noposts .= '<tbody><tr>';
 //$noposts .= '<td class="alt1">There are no replies to show</td>';
    //$noposts .= '</tr></tbody>';
 //$noposts .= '</table>';
 //$noposts .= '<br/>';
 eval('$noposts = "' . fetch_template('lv_vb_eventforums_noPostSpacer') . '";');
 //eval('$postbits = $noposts . $postbits . ;');
 $postbits = $noposts . $postbits;
  } // is first post
}

The only other issues I found was a slight display issue with a couple extra lines thrown in with the showthread view & my username is not color coded. Again minor issues imho. (see attachments, accurately named)

ThomasDR,

Your modification is a big step forward, but there are these problems:
1. You have to enable html in the event forum to be able to see the enrolled member list correctly. Otherwise you get this error: https://vborg.vbsupport.ru/showpost....&postcount=185
2. There are no links to attend or unattend the event in showthread.
3. Showthread does not explain "There are 5 people enrolled for this event:", so some users might wonder why those members are listed.
4. There is a javascript error: left corner of the status bar says "error on page".

Anyone able to improve this?

TomasDR 05-21-2006 11:40 PM

Quote:

Originally Posted by jerx
ThomasDR,

Your modification is a big step forward, but there are these problems:
1. You have to enable html in the event forum to be able to see the enrolled member list correctly. Otherwise you get this error: https://vborg.vbsupport.ru/showpost....&postcount=185
2. There are no links to attend or unattend the event in showthread.
3. Showthread does not explain "There are 5 people enrolled for this event:", so some users might wonder why those members are listed.
4. There is a javascript error: left corner of the status bar says "error on page".

Anyone able to improve this?

1. Yes I forgot to mention the need to enable html, I know people are dead set against enabling it. Again if anyone has any ideas.
2/3. Very odd, if you refer to my screenshots (which aren't doctored) I definitely have links and text showing the ability to attend/unattend and the phrase "There are # people enrolled for this event:" in Showthread.
4. I don't get a javascript error, I do have other hacks installed. Not sure if something else is conflicting.

jerx 05-22-2006 11:53 AM

Which screen shots do you mean? Those of post 172?(https://vborg.vbsupport.ru/showpost....&postcount=172)
Don' t they show the calendar view only? That is working without problem for me, too, but the showthread view in the forum does not show those links and the explanation. I think that is the reason for the javascript error on my installation, because when I disable both hacks (attendance and event forums) the error is not present any more.

dodgechargerfan 05-22-2006 05:50 PM

Cool! Allowing html fixed the one problem.

I do see the same 2, 3 and 4 issues, though.

javascript error text is:
Line: 66
Char: 3
Error: 'vB_Editor[...]' is null or not an object.
Code: 0
URL: http://www.sitename.com/forums/showthread.php?t=8814

soulface 05-24-2006 09:42 AM

Quote:

Originally Posted by jerx
ThomasDR,

Your modification is a big step forward, but there are these problems:
1. You have to enable html in the event forum to be able to see the enrolled member list correctly. Otherwise you get this error: https://vborg.vbsupport.ru/showpost....&postcount=185
2. There are no links to attend or unattend the event in showthread.
3. Showthread does not explain "There are 5 people enrolled for this event:", so some users might wonder why those members are listed.
4. There is a javascript error: left corner of the status bar says "error on page".

Anyone able to improve this?

Its working fine in my test board. but for this problem i had to do this :p

1. had to enable HTML & Moderate Threads options in event forum. so that i can view if any member included any bad html code :p

for 2 & 3. Just did this tweak..:p

in templates 'calendar_roll'

find:
Code:

$vbphrase[roll_cancel]
replace:
Code:

I will no longer be attending this event
find:
Code:

$vbphrase[roll_enroll]
replace:
Code:

I will be attending this event
find:
Code:

$vbphrase[roll_nobody]
replace:
Code:

Nobody yet
find:
Code:

<phrase 1="$rollcount">$vbphrase[roll_text]</phrase>
replace:
Code:

There are $rollcount people enrolled for this event:
done..

jerx 05-24-2006 10:35 AM

The replacement of the phrases is a workaround for single language forums, but I have two languages installed... It is not a big problem, since most users are using the default language anyway. But somehow I am not satisfied with this solution.

And it does not help solving to show the number of enrolled people. If anybody does not need the amount of enrolled users, you should just replace the phrase with "these people are enrolled for this event".


All times are GMT. The time now is 11:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01713 seconds
  • Memory Usage 2,032KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (14)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete