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)

Joey805 04-26-2006 03:59 PM

Quote:

Originally Posted by andreamarucci
Maybe I've missed something but anyone know if there's a way to input the number of people attending the event instead of the default one? I think this would be a nice addition since if I organize, for example, a meeting, some people will attend alone and some others will attend with another person.

Any suggestion?


Great suggestion! This would be an awesome feature to have.

andreamarucci 04-26-2006 04:08 PM

Sure, I'm asking for it from a long time but it seems that I'm the only one interested. Now we're two. Hope that someone come out with a solution...

louis_chypher 04-28-2006 10:44 AM

Quote:

Originally Posted by andreamarucci
Sure, I'm asking for it from a long time but it seems that I'm the only one interested. Now we're two. Hope that someone come out with a solution...

I to would like to see the addition of an attendence count added to this mod.

kurtbarker 05-01-2006 10:00 PM

Quote:

Originally Posted by sickboy6ths
Does anyone know... how to make these 2 Products compatible with eachother:
vb Event Forums: https://vborg.vbsupport.ru/showthread.php?t=102213
Together this mod would be perfect for my usage! Problem is... if there is an event linked to a thread, and someone opens the event... All the options for attending/unattending are not working, while in the normal calendar (view) it does.

this would be a great addition if they were compatible

Neo_obs 05-03-2006 09:08 AM

it may be closer to a solution than you think. I have both working on my test forum now.

kurtbarker 05-03-2006 11:35 AM

how'd you do that??? do tell :D

TomasDR 05-03-2006 01:19 PM

Quote:

Originally Posted by Neo_obs
it may be closer to a solution than you think. I have both working on my test forum now.

On the same calendar too? Yes please do tell if they are combined.

Neo_obs 05-03-2006 02:13 PM

right now not on the same calendar but I see improvement and I am trying to help find the solution.

TomasDR 05-05-2006 01:21 AM

Ok this post might bring on a slew of PMs and the hack is a little ugly so I don't want to post it in the open but I found a dirty solution for combining both hacks:
Event Attendance: https://vborg.vbsupport.ru/showthread.php?t=93782
vB Event Forums: https://vborg.vbsupport.ru/showthread.php?t=102213

Notes
Works: The Attendees are shown in the Showthread view in the connected forum.
Works: The Attendees are shown in the Calendar preview.
Works: You can Attend or UnAttend in either view, showthread or Calendar.
BROKEN: When Attending the Event or UnAttending you are redirected to the Calendar Preview NOT the Showthread Preview but since there are the links "View Replies to this Event" & "Post a Reply to this Event" I felt my users could live with it.

jerx 05-05-2006 05:28 AM

TomasDR,

I think you should post your solution in this thread and the other thread, because the limitation you are talking of is very little. I think everyone can live with it. Moreover other coders might be able to solve the redirection problem when attending/unattending.

TomasDR 05-05-2006 05:54 AM

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)

Mighty Mojo 05-05-2006 04:48 PM

Ok I'm begging now-

How do I get data from specific profile fields to show up next to the username?

I want to be able to take the username, put my custom profile field, say... city next to it, i.e:

Code:
$username, $field10

Appearance:
Christopher, San Diego
Violet, San Diego
Bo-Jackson, Missisipi

ricker 05-05-2006 08:46 PM

Quote:

Originally Posted by quasan
here are some feature suggestions:
user limit for an event
eventstarter has the right to remove an attendee from the event

agreed!

TomasDR 05-06-2006 12:42 PM

Quote:

Originally Posted by jerx
TomasDR,

I think you should post your solution in this thread and the other thread, because the limitation you are talking of is very little. I think everyone can live with it. Moreover other coders might be able to solve the redirection problem when attending/unattending.

Anyone try my hack?
Any issues besides the ones I reported?
Anyone figure out how to fix the two display issues? (I doubt the showthread redirect will ever work without a major rewrite.)

Neo_obs 05-07-2006 02:10 AM

i havent tried it as im not even sure what to do LOL im a lil newb here

kurtbarker 05-07-2006 04:31 AM

I tried your edit mate, I couldn't see how they were compatible

sickboy6ths 05-08-2006 06:58 AM

Quote:

Originally Posted by TomasDR
Anyone try my hack?
Any issues besides the ones I reported?
Anyone figure out how to fix the two display issues? (I doubt the showthread redirect will ever work without a major rewrite.)

Great job on it m8! It's working the way as advertised! Thanks for your time and effort.

I only hope we can soon bring the features back together so that both products fully function :) Im missing a bit that you dont get the threadview when clicking on the event :( I'll see if I can help anywhere, but my PHP isn't good at all

EDIT It looked as if it was working perfect, but now I get the following inside my showthread event (so if I check the replies, I see this on the below end of the event-post:
Code:

<p><strong></strong></p>

<p><i></i></p>




[<a href="calendar.php?do=getinfo&amp;ea=attend&amp;e=31"></a>]


TomasDR 05-08-2006 03:26 PM

Quote:

Originally Posted by sickboy6ths
Im missing a bit that you dont get the threadview when clicking on the event :( I'll see if I can help anywhere, but my PHP isn't good at all

That part has to be disabled, I couldn't see a work around at all.

Quote:

Originally Posted by TomasDR
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

As for the link and html being attached to the bottom of the showthread, I didn't change any templates what so ever, exisiting or new ones added by the two products. Could you have another hack that changed any related templates?

sickboy6ths 05-09-2006 07:01 AM

Quote:

Originally Posted by TomasDR
That part has to be disabled, I couldn't see a work around at all. As for the link and html being attached to the bottom of the showthread, I didn't change any templates what so ever, exisiting or new ones added by the two products. Could you have another hack that changed any related templates?

Phoe... not by head, but I will look into it!

sickboy6ths 05-11-2006 09:05 AM

Quote:

Originally Posted by TomasDR
As for the link and html being attached to the bottom of the showthread, I didn't change any templates what so ever, exisiting or new ones added by the two products. Could you have another hack that changed any related templates?

OK I tried disabling all plugins related to showthread (except the event ones) and still the same problem, tried it with a default style (everything reverted) still no luck... WEIRD :) Maybe you can export your combined products as vbEventForums Attendance or sth like that and attach it? Maybe if I then uninstall mine and reinstall that one it could work?

Webmist 05-12-2006 03:55 AM

Quote:

Originally Posted by Mighty Mojo
Ok I'm begging now-

How do I get data from specific profile fields to show up next to the username?

I want to be able to take the username, put my custom profile field, say... city next to it, i.e:

Code:
$username, $field10

Try:
$bbuserinfo[username], $bbuserinfo[fieldxx]

|oR|Greg 05-14-2006 02:35 PM

So the 2 are now working together with DR's fix?

I'm desperately hoping someone codes a piece where an admin can remove people that have signed up to an event and you don't want them to have attenedance for whatever reason. Anyone?

sickboy6ths 05-15-2006 10:30 AM

Quote:

Originally Posted by |oR|Greg
So the 2 are now working together with DR's fix?

For me it works, except the html formatting error that I get, (read few posts back).

dodgechargerfan 05-15-2006 03:32 PM

Getting a similar html problem here - but otherwise things seem to be working so far on my test board..

Right after the text of the event, I get this:

*Event text here*<p><strong></strong></p>

<ul>
<li><a href="member.php?u=331">dodgechargerfan</a></li>
</ul>

Edit: If I click the "unattend" link in the calendar event, this gets left in the thread:

<p><strong></strong></p>

<p><i></i></p>


Hopefully, this helps steer someone towards a resolution. I'll keep digging to see what I can figure out, but I'm no expert.

BTW, Thanks for everyone's work on these plug-ins and the plug-in for the plug-ins. :)

dodgechargerfan 05-15-2006 04:21 PM

Also, this:
"Works: You can Attend or UnAttend in either view, showthread or Calendar.
"

Does not work for me. I don't see a link for the attend/unattend in the showthread.

While viewing the thread, I don't see any link to the calendar entry at all..

dodgechargerfan 05-15-2006 04:38 PM

Well, the code that's doing that is in the "calendar_roll" template.
Not sure why it's not working though..

Dewain27 05-16-2006 10:56 PM

Quote:

Originally Posted by sickboy6ths
OK I tried disabling all plugins related to showthread (except the event ones) and still the same problem, tried it with a default style (everything reverted) still no luck... WEIRD :) Maybe you can export your combined products as vbEventForums Attendance or sth like that and attach it? Maybe if I then uninstall mine and reinstall that one it could work?

I agree... I desperatly want these to work together.... :D

Gooses 05-17-2006 04:27 AM

This is a great hack. I am looking forard to implementing it on my site. Thanks!:)

Mighty Mojo 05-19-2006 06:13 AM

Quote:

Originally Posted by Webmist
Try:
$bbuserinfo[username], $bbuserinfo[fieldxx]

Naw that just returns the field of the user that is logged in....

But I've made some progress! If I replace username with say field14 in this part of the plugin:

Code:

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

Then it returns the field14 info (but not the username of course)...trouble is, I can't get it to pass both the field14 info AND the username info ;(

How do I get both variables to show up!?!?!

|oR|Greg 05-19-2006 11:23 AM

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


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 05:48 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.02247 seconds
  • Memory Usage 2,232KB
  • 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
  • (18)bbcode_code_printable
  • (21)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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