Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Event Attendance 2.0 Details »»
Event Attendance 2.0
Version: 2.00, by arpy arpy is offline
Developer Last Online: Mar 2014 Show Printable Version Email this Page

Version: 3.5.0 RC2 Rating:
Released: 08-06-2005 Last Update: Never Installs: 427
DB Changes Uses Plugins
 
No support by the author.

This is an update version of the vB 3.0x "Event Attendance" hack found HERE. Thanks to Kentaurus for allowing redistribution.

I have rebuild/rewritten the hack for vB 3.5 - now it is no longer a hack but a plugin. No template modifications and no code modifications required.

This plugin allows users to enroll for events. When a new event is created, the user can decide if this feature is available for this event.

This plugin includes (from the 3.0x Version and Thread):



  • Links to userprofile (by buro9)
  • Counter for enrolled users (by Sanni)
  • and most (all?) fixes from old version
  • no additional queries! (for reading, if you enroll/cancel there is one additional query)

It does not include (from the old thread):
  • Fix for reoccuring events (complete redesign needed)
  • Addon for guest-count (I don't need this, feel free to re-add)

Additional Features:
  • Event Attendance can be deactivated for reoccuring events (see Options in AdminCP)
  • Enroll/Cancel can be deactivated for events that are already started (AdminCP)
  • Sorting of enrolled people can be switched via AdminCP
  • All text is now in phrases

Installation:
  • Go to ACP/ Plugin System/ Manage Products.
  • Click Add/Import Product, select the product XML File you downloaded here and click Import.
  • Thats all - Have fun!

Known Problems:
  • calendar_roll and calendar_rollbit templates are not cached. I've not found a way to do this by using a plugin. But this is not really an issue.
  • Aug. 24th: Bug found by endquote in post#36: Typo in var name, this will cause Event enrollment to be disable at the wrong time (depending on time zome). Will be fixed in next release.

If you upgrade from 3.0x:
  • This plugin is fully database compatible to the old hack, if you upgrade no data will be lost.
  • You need to revert your calendar templates: calendar_showeventsbit, calendar_roll and calendar_rollbit.
  • If you do not want to revert your calendar_weekly_event and calendar_monthly_event please use "Mark enrolled in month/weekly view"=NO in Event Attendance Options to avoid event to be marked twice ("*").
Feature Requests:
I list the feature requests here - this does not mean that I will code it. If you are a coder feel free to code it and release it as addon or allow me to include it here.

  • Change text after event is over. (Post #21) (very likely)
  • "It would be better if the plugin wouldn't let you add yourself after it's ended rather than started." (Post #35) (very likely)
  • "Another suggestion would be to have an admin option to just set all events to have the attendance functionality, rather than providing an option when posting." (Post #35) (very likely)
  • List of attended events in User Profile (Post #11) (maybe later)
  • CVS-Export of attending users (Post #8) (unlikely)
Aug. 15th: Beta-Tag removed, no code changes.

Please click INSTALL if you like this plugin.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #192  
Old 05-19-2006, 02:04 PM
jerx jerx is offline
 
Join Date: Feb 2006
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #193  
Old 05-19-2006, 02:34 PM
Mighty Mojo Mighty Mojo is offline
 
Join Date: Jun 2005
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #194  
Old 05-19-2006, 02:45 PM
Mighty Mojo Mighty Mojo is offline
 
Join Date: Jun 2005
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #195  
Old 05-19-2006, 07:46 PM
Mighty Mojo Mighty Mojo is offline
 
Join Date: Jun 2005
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'] = "";
                }
Reply With Quote
  #196  
Old 05-20-2006, 09:27 AM
jerx jerx is offline
 
Join Date: Feb 2006
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #197  
Old 05-21-2006, 11:40 PM
TomasDR TomasDR is offline
 
Join Date: Feb 2006
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #198  
Old 05-22-2006, 11:53 AM
jerx jerx is offline
 
Join Date: Feb 2006
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #199  
Old 05-22-2006, 05:50 PM
dodgechargerfan dodgechargerfan is offline
 
Join Date: Aug 2005
Posts: 94
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #200  
Old 05-24-2006, 09:42 AM
soulface's Avatar
soulface soulface is offline
 
Join Date: Sep 2005
Location: Dhaka, BD
Posts: 183
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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

for 2 & 3. Just did this tweak..

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..
Reply With Quote
  #201  
Old 05-24-2006, 10:35 AM
jerx jerx is offline
 
Join Date: Feb 2006
Posts: 188
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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".
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:43 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08945 seconds
  • Memory Usage 2,417KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (14)bbcode_code
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete