PDA

View Full Version : Event Attendance 2.0


Pages : [1] 2

arpy
08-06-2005, 10:00 PM
This is an update version of the vB 3.0x "Event Attendance" hack found HERE (https://vborg.vbsupport.ru/showthread.php?t=63460). 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 (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=93782) if you like this plugin.

bigcurt
08-07-2005, 12:47 PM
Good job bud

~Curt

FleaBag
08-07-2005, 02:03 PM
Excellent - I was hoping this would get a conversion. Thanks a lot! :)

Edit: I'm getting an invalid event specified error if I try to edit an event and enable enrolling.

arpy
08-07-2005, 02:37 PM
I'm getting an invalid event specified error if I try to edit an event and enable enrolling.

Could you give me the exact errormessage and a way to reproduce this error - I tried it, but everything is working here...

arpy

FleaBag
08-07-2005, 02:42 PM
Hi there!
Sorry I should have been clearer before!

I can sucessfully edit the event, but afterwards when I click on the "I will be attending this event" link on the event page, I get the following error.

"Invalid Event specified. If you followed a valid link, please notify the administrator"

http://dragonninja.co.uk/world/invalidevent.jpg

arpy
08-07-2005, 02:49 PM
"Invalid Event specified. If you followed a valid link, please notify the administrator"


You had the 3.0x Version installed before? Please revert the Templates as stated in the first post. In this case, at least the calendar_rollbit *** template is not reverted.

You can see this in the "I will attend"-Link:
http://example.com/calendar.php?do=getinfo&ea=attend&e=1069
If there is no "do=getinfo" in the link, then you are using the old template. I had to change the links in order to use a hook.

arpy

***Edit: Sorry, it is the calendat_roll Template - not the calendar_rollbit

FleaBag
08-07-2005, 10:17 PM
Thanks arpy, it solved the problem. I've been working from a new style since the 3.5. upgrade, but I was viewing the site through the old one [for stylesheet purposes - the child of the new style]. All reverted and working.

I'm not able to enroll in an event that occurs on today's date. Is that intentional?

RMS-Chef
08-08-2005, 03:59 AM
No idea how tough it would be but I think a great addition to this would to be able to export an event's attending roster to a CSV or Excel file. In a perfect world the users profile info to be exported could be ACP selectable. So you could get an output something like:

RMS-Chef,whatever@hotmail.com,http://userswebpage.com
JohnDoe,jd@yahoo.com,http://yahoo.com

arpy
08-08-2005, 05:11 AM
I'm not able to enroll in an event that occurs on today's date. Is that intentional?

Yes, its a feature: You cannot enroll for an event that is already started. You can switch this feature in AdminCP (late enroll).

@RMS-Chef: Everything is possible but my time is limited. I only will add features if there is a huge request and/or I can use the feature for my board and/or sb else is doing the coding ;)

arpy

FleaBag
08-08-2005, 06:50 PM
Ah cool, glad you have late enroll in there!

Benj
08-08-2005, 06:57 PM
::request::

events im attending in profile?

would you be able to code this ?

arpy
08-08-2005, 08:09 PM
::request::

events im attending in profile?

would you be able to code this ?
Able? Yes. However I have no time for this at the moment and I don't want to promise anything. I added it to the "feature requests" in the plugin description.

arpy

Vindicare
08-09-2005, 09:52 AM
Doesn't work at all for me.

Installed it without problems on a 3.5 RC2, reverted all templates twice and re-installed the hack thrice.
Checked all the options and even the usergroup permissions if there is some hidden "unlock-option"... but still I simply don't get the checkbox to create events (being in the newthread.php).

arpy
08-09-2005, 12:47 PM
Checked all the options and even the usergroup permissions if there is some hidden "unlock-option"... but still I simply don't get the checkbox to create events (being in the newthread.php).
Maybe you tried to create a reoccuring event? Go to your AdminCP, vbulletin options, event attendance and enable "Enroll reoccuring events".

butty
08-10-2005, 02:25 AM
hi there i installed this after id installed the post event to a forum plugin here

https://vborg.vbsupport.ru/showthread.php?t=93308

now that seemed to install fine and worked but afterwards i put on this plugin and it all seemed to go ok etc. but when i add a event and check that box. when you view the event you dont get the option to add yourself as an atendee to it. any ideas guy?

thanks in advance :)

arpy
08-10-2005, 08:13 AM
hi there i installed this after id installed the post event to a forum plugin here

https://vborg.vbsupport.ru/showthread.php?t=93308
I don't know exactly how the other plugin works - but taken from the description:


"Links to event details are redirected to the thread."
If this means, that you cannot view an event with "calendar.php" because you are redirected to the according thread, then this means that my product has no chance to display anything in the event details. When the event details are copied to the thread, the event attendance information is not copied.

If I'm wrong: Please provide me a link to your forum where I can see both plugins.

arpy

ricker
08-10-2005, 06:38 PM
Looking back at this thread I realize I never posted to say the install went perfectly and the plugin works great! Thanks!

Zachariah
08-13-2005, 11:57 PM
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.

Fix:

add Plugin: Event Attendance - Cache Templates
Hook Location: cache_templates
Title: Event Attendance - Cache Templates
PHP Code:
if (THIS_SCRIPT == 'calendar'){
$globaltemplates = array_merge($globaltemplates, array('calendar_rollbit','calendar_roll',));
}

Plugin is Active: yes

arpy
08-14-2005, 03:43 PM
Fix:

add Plugin: Event Attendance - Cache Templates
[...]
Note: I do not know if this is the perfect way, but it works. Unsure of drawbacks if any.

This is a way but unfortunately one I don't want to go:
With template caching disabled (now), we have 1 additional query when viewing a calendar entry with nobody enrolled or 2 queries, when s.b. is enrolled (2 templates).

With your solution, one every pageview (not only calendar) there is an overhead (1 plugin loaded).

If s.b. really has perfomance issues with his vb, he should consider including the templates in calendar.php (which would be a hack, not a plugin).

But as written in the release text, I don't think that 1 or 2 uncached templated are a problem.

poolking
08-14-2005, 05:41 PM
/me installed

Bro_Joey_Gowdy
08-14-2005, 08:55 PM
Sweet !!

*Rowdy clicks install*

This will be great for my haunted forest this year...

So, when the event passes what happens ?

Will it go from saying "members attending" to "members attended" ?

ohgenki
08-15-2005, 08:15 AM
excellent ! keep up the good job, once it goes LIVE i'll install this

arpy
08-15-2005, 04:08 PM
So, when the event passes what happens ?

Will it go from saying "members attending" to "members attended" ?
Only the link to enroll will disappear.
But I take this as a feature request ;)

arpy

arpy
08-15-2005, 04:16 PM
No problems till now and >20 installs - I removed the beta-tag.

arpy

jesus likes pie
08-15-2005, 04:45 PM
/me clicks install

Gryphon
08-15-2005, 05:43 PM
/me installs
Nice. I would like to see an option in the usergroup Calendar Permissions for "Can enroll in calendar events".

FOZ13
08-16-2005, 09:34 PM
Er,

What did i do wrong?

Warning: main(/home/site/forum/admincp/FCKeditor/fckeditor.php): failed to open stream: No such file or directory in /admincp/vbarticles.php on line 29

Warning: main(): Failed opening '/home/site/forum/admincp/FCKeditor/fckeditor.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /admincp/vbarticles.php on line 29

arpy
08-16-2005, 10:05 PM
Nice. I would like to see an option in the usergroup Calendar Permissions for "Can enroll in calendar events".

You can do this by modifying the template with IF-Conditions.

arpy
08-16-2005, 10:08 PM
Warning: main(/home/site/forum/admincp/FCKeditor/fckeditor.php): failed to open stream: No such file or directory in /admincp/vbarticles.php on line 29


Are you sure that you are in the proper thread? This error message has nothing to do with this plugin - could you please send the url?

Gryphon
08-19-2005, 05:15 PM
You can do this by modifying the template with IF-Conditions.
How would I detect if they are a member of 'any' secondary usergroup?

<if condition="secondary usergroup != zero> allow attendance </if>

I add/remove secondary groups all the time so listing every group number can be quite tedious using

<if condition="is_member_of($bbuserinfo, X) OR is_member_of($bbuserinfo, Y) OR is_member_of($bbuserinfo, Z)"> allow attendance </if>

arpy
08-19-2005, 07:48 PM
How would I detect if they are a member of 'any' secondary usergroup?Never used secondary usergroups here, but I found this hack:
https://vborg.vbsupport.ru/showthread.php?t=90266

It is for 3.0x, but it shows the methods...

FusionHosting
08-22-2005, 04:54 PM
That would be a nice feature (an option from the plugin's config) to be able to restrict events to certain secondary usergroups. So when you make it, there's a listing of groups, with checkboxes to select.

endquote
08-24-2005, 02:12 AM
When I install the plugin, events now say:There are 0 people enrolled for this event:

Nobody yetThere is no link to say I'm attending it. I am using (and wrote) event forums (https://vborg.vbsupport.ru/showthread.php?t=93308), but disabled calendar_getday_start, which is the plugin that was redirecting the event page to the thread.

Ideally I'd like to get these plugins working well together.

endquote
08-24-2005, 02:42 AM
Note that if I disable the Event Forums plugin, I still don't get a link to say I'm attending.

endquote
08-24-2005, 02:51 AM
Ah, I see the problem. It doesn't appear because the event is an all-day event, which means it starts at midnight that day, and since it's started, you can't say you're attending.

It would be better if the plugin wouldn't let you add yourself after it's ended rather than started.

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.

endquote
08-24-2005, 04:24 AM
Typo:$time_until_event=$eventinfo['dateline_from']-(TIMENOW+$vbulletion->userinfo['timezoneoffset']*3600);Note "vbulletion".

arpy
08-24-2005, 05:22 AM
Typo:Note "vbulletion".
Congratulations: You are the first one who found a bug!
Ok, this causes an event to be closed for enroll at the wrong time...(depending of your timezone)
It would be better if the plugin wouldn't let you add yourself after it's ended rather than started.
I will add an option for this.
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.
Ok, also added to the featere requests.
Ideally I'd like to get these plugins working well together.
What is needed for this:



read the event data in the forum thread
add the event attendance template output to the posts output
ensure that users clicking on "I will be attending" will be redirected to the thread instead of the calendar.
If you need help please PM me!

kdog316
08-24-2005, 04:11 PM
awesome hack gonna install it when i get home but one question. Is there a way for it to display more then just the users name. Reason being is i run a ffxi forum and when members say there coming it would be nice if they could enter what job there coming as so we can get an idea as to what jobs are coming and if we can actually do the event with the jobs. But anyways freakin awesome plugin exactly what i need. Now if it can do what i just asked that would be sweet please get back to me thanks.

Bojangles
09-02-2005, 06:49 AM
Awesome plugin! Users love it.

dtsrules
09-11-2005, 09:54 AM
would it be possible to alter this to use a thread instead of a calendar event? if so, is it just a case of changing the hooks & queries?

Martin
09-11-2005, 09:38 PM
This only seems to work for Ranged Events. Any way to change that? If I have an All Day Event, I can still set it to allow people to sign up, but I get no link to allow them to.

Brandon Sheley
09-11-2005, 09:51 PM
this will be great for my site, i wont install it yet, because i have tons of things still to do,, but at some point, i will install it.. ty.. i already clicked isntall tho :P

Martin
09-11-2005, 10:21 PM
ooooooooooookay...

Now it suddenly started working again. Weird.

arpy
09-12-2005, 06:34 AM
This only seems to work for Ranged Events. Any way to change that? If I have an All Day Event, I can still set it to allow people to sign up, but I get no link to allow them to.Please see the "allow late enroll" option in your AdminCP - this works as designed.

arpy
09-12-2005, 06:36 AM
would it be possible to alter this to use a thread instead of a calendar event? if so, is it just a case of changing the hooks & queries?No, this would be a new hack.

DarrinM
09-15-2005, 06:41 PM
Hi there, great mod

Wanted to ask if it is possible to up the attendee count by 2 for some profiles instead of 1, so for example if a profile is for a single person (Arthur) and they add themself to the event then the attendee count goes up by 1 but if the profile is owned by a couple (Fred & Ginger) and they add themselves then the attendee count goes up by 2

Also could the attendee name be some other profile field other than the profile username, so instead of it showing Fred & Gingers registration name then instead it shows the custom field [customfield1] in which they might put Fred the Freak and Ginger the Whinger

Your help most appreciated

Tremok
09-15-2005, 07:31 PM
Awesome plugin. I have one feature request here, and I don't know how easy / hard it would be to do -

Have the event creator be able to specify event limits, and then if more users sign up than the event can hold, they are put on a "reserve" or "backup" list.

twitch
09-16-2005, 12:26 AM
Awesome plugin. I have one feature request here, and I don't know how easy / hard it would be to do -

Have the event creator be able to specify event limits, and then if more users sign up than the event can hold, they are put on a "reserve" or "backup" list.

That would be very cool

WNxWakko
09-16-2005, 01:24 AM
Nevermind

Brandon Sheley
09-16-2005, 02:08 AM
this is about event forums and this mod working together..

What is needed for this:



read the event data in the forum thread
add the event attendance template output to the posts output
ensure that users clicking on "I will be attending" will be redirected to the thread instead of the calendar.
If you need help please PM me!

can you make a text file telling how to do this ? i'm not this good at code :(
i think it will be a great hack for my BB .. thank you for the work so far
-LM

Evercraft
09-16-2005, 10:12 AM
this is about event forums and this mod working together..


can you make a text file telling how to do this ? i'm not this good at code :(
i think it will be a great hack for my BB .. thank you for the work so far
-LM

Instead of bodging one of either plugins code, to get them to both work together, I think it would be much much better to have another plugin that can be installed to link them both. This wouldnt be very hard to write.

I might take a look at this at some point. I'm going to leave it for a bit though, as I dont want to step all over endquote's toes.

Benj
09-16-2005, 12:37 PM
any ideas if anyones gonna have a go at these feature requests :P

gyankow
09-22-2005, 07:32 PM
Is an RC3 certification is the works?

GrendelKhan{TSU
09-24-2005, 09:17 AM
* GrendelKhan{TSU clicks install!! :D thanks!! :D

GrendelKhan{TSU
09-24-2005, 12:11 PM
Is an RC3 certification is the works?


and btw...

<<RC 3. ;)


and yah.. I' just wanted to throw my hat into the "would love a cooperative between this and the event forums hack." ring.

That would rule.

:D :D

Ted S
09-27-2005, 12:07 AM
Thanks for the hack!

Ncturnal
09-29-2005, 05:13 PM
Thanks for the hack!

How about adding functionality to allow users to specify the number of guests they will be bringing with them? This was hacked into the 3.0.x version and proves quite useful for in-person events where members bring friends.

Very nice, and I agree with Ted S. Great plugin though! Thanks!

troux
09-30-2005, 01:27 AM
I installed and works well.

One suggestion would be to make the whole day's cell highlighted a different color when the user has an event that day so it's easy to see what you have going on at a glance instead of looking for an asterisk.

Thanks!

-tristan

NS_007
10-02-2005, 04:49 PM
Does this work with 3.5 gold?

WNxWakko
10-02-2005, 07:49 PM
I installed the mod, the option is there when i create the event, but I get this with no link to join it??

sdsadfdfsdfsdfs
There are 0 people enrolled for this event:

Nobody yet

wacodep
10-07-2005, 02:49 AM
wacodep clicks "INSTALL". Nice job!

GamerzWorld
10-07-2005, 01:55 PM
Great modification, i was wondering how difficult it would be to

a) Make events private for just one usergroup. I run a clan orientated site and therefore for clan raids or meetings i want it private to just clans
b) A post to be made when new events are posted with a link

Thanks for help

WNxWakko
10-07-2005, 06:55 PM
This is a gread mod I must first say. However even though Im now using it, many members are requesting this mod work in new threads. Is that possible?

AndyA
10-09-2005, 04:49 PM
Is this likely to work on 3.5 Gold ?

twitch
10-09-2005, 08:45 PM
Works for me :)

Slacker
10-11-2005, 06:43 PM
I'd be very interested if there was a way to respond to recurring events individually. Any word on that?

lawahdy
10-11-2005, 10:34 PM
great work.. thanks

Ted S
10-17-2005, 01:38 AM
arpy, would it be possible to add in a field for the number of guests a person is bringing when they RSVP? This way we can tell how many people are showing up for an event, not just how many people have RSVP'd. Int he 3.0.x version of this hack an addon was made to do this by splitting the field, it was rather basic from what I can tell.

Thanks for the great hack again!

AndyA
10-25-2005, 05:09 PM
This is a very useful addition to my forum, I don't suppose there's any way of showing the attendance results in a forum thread ?

silurius
10-25-2005, 07:22 PM
I had PM'd arpy asking him to include this with the module but he seems to be AWOL.

Has some epidemic broken out with the Event coders? Endquote has been behaving in a similarly mysterious way with the Event Forum (https://vborg.vbsupport.ru/showthread.php?t=93308)s (https://vborg.vbsupport.ru/showthread.php?t=93308).

Brandon Sheley
10-26-2005, 03:24 AM
sorry, ingore my post.. i thought i was posting in a differant events mod :|

Ted S
10-26-2005, 05:09 AM
James... as always I owe ya! Works like a charm.

silurius
11-04-2005, 05:30 PM
I still keep an eye on this lovely hack. Will install the instant it becomes compatible with Event Forum (showthread.php?t=93308)s (showthread.php?t=93308).

D|ver
11-09-2005, 12:05 PM
when creating a new event:
how do i make the "users may roll" option checked as default?

tidy_boy
11-09-2005, 03:36 PM
Hi there excellent hack

got one question when someone adds an event they have to select Allow users to specify that they will be attending this event.

If there a way to have that ticked as default

Thanks in advance

Pvtiste
11-09-2005, 04:51 PM
Great Work !! Thanks to sharing ;)

ShawnV
11-11-2005, 10:24 AM
I still keep an eye on this lovely hack. Will install the instant it becomes compatible with Event Forum (showthread.php?t=93308)s (showthread.php?t=93308).

Agreed, I hope this happens soon.

FStop
11-13-2005, 02:43 AM
installed! thanks!!! :)

davew
11-13-2005, 09:26 AM
Thank you, very nice!

andreamarucci
11-13-2005, 05:08 PM
Fantastic plugin!!!!

A suggestion or feature request. Should be possible to add the number of people attending the event? I own a morobyke forum and we organize many events. Should be absolutely fantastic to let people specify if they will attend the event alone or with another person. Should suffice to have a little popup menu with 1 or 2...

Anyway thanks again ;)

KrisJacobs
11-14-2005, 06:47 PM
I am using the 3.0.8 version of this mod on my site @ www.hordelandsecurity.org

We are a group of World of Warcraft players. We'd like an attendance mod with some additional fuctionality, here's a SoW I have written up in my "Site Feedback" forum. I would be willing to talk about paying someone to program this. It would be for 3.5.1, I intend to upgrade VERY soon now.

Thanks!

-------------------------------------------

I writing "Scope of Work" for what we would like the be able to do with the Calendar Signups here. This is what I have got so far, feedback & suggestions please, thanks!

--------------------

I have added additional fields to the user profiles to indicate player race, class, tradeskills, etc.

When creating an Event with the Roll Call function enabled, I would like the Event Planner to be able to specify a couple of things:

1. Total number of players required for the event
2. Total number of each class required for the event

When a Calendar User signs up, I would like a couple things to happen:

1. Total number of players required for the event is displayed along with total number of empty spots remaining.
2. Total number of each class required is displayed along with empty spots remaining for that class.
3. "Is event full?" checking -- if a user signs up and the event is full, that user gets a "sorry, event is full" error message.
4. "Is <userclass> full?" checking -- if a user signs up and that user's class is full, that user gets a "sorry, this event has enough <userclass> already" error message.
5. If the user tries to signup but has not yet defined their <userclass> Additional Profile Field, they should get a "sorry, you have not defined your class, goto your User CP>Edit Profile to do so"


The event should also display current status: How many and who are signed up, how many total spots remaining, and break down the same numbers for each player class.

This <userclass> checking would tie into the Class Additional Profile Field that I have added to User Profiles.

Players with mutliple active characters in game that are different classes but have a single user account here on the site should change their class setting on their Profile BEFORE signing up, to properly indicate which character they are going to play. Then make a comment on the event like "Despoiler: I signed up as rogue, I will be playing Despicable on this run"
-----------------------------------------------------------

Ah, I need to add that if the event is full or it the calendar user's class is full, they should have the option of going on a standby list.

"This event is full, would you like to go on the standby list?"

or

"This event's requisite amount of warriors has been met, would you like to go on the standby list?"

andreamarucci
11-15-2005, 08:03 PM
Fantastic plugin!!!!

A suggestion or feature request. Should be possible to add the number of people attending the event? I own a morobyke forum and we organize many events. Should be absolutely fantastic to let people specify if they will attend the event alone or with another person. Should suffice to have a little popup menu with 1 or 2...

Anyway thanks again ;)

Ehm, noone is reading this thread? :surprised:

OneShot
11-15-2005, 09:58 PM
I still keep an eye on this lovely hack. Will install the instant it becomes compatible with Event Forums.
Me too ...

revlisoft
11-16-2005, 02:01 PM
Me too ...

Great mod. I have used to mod and extended it to custom tailor it to my WoW guild. ;)

Basically I had it so that when people clicked on the attendance it would display it in a table based on what their class (custom field) is and also display next their name what their Lvl and spec (also custom fields). I also had it integrated so that the color name shows what their usergroup is which is "guild member, guild class advocate, guild officer, guild admin. Those familiar w/ WoW would recognize the colors. The tally per class is shown. This particular event is for a Molten Core signup.

Guild site @ http://frostmaneguild.com

KrisJacobs
11-16-2005, 07:40 PM
Holy cow Rev, that looks great!

That is definitely a huge step toward what I'm looking for...

care to share what you've done with me? :)

quasan
11-16-2005, 07:41 PM
thx for this great plugin :)

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

ShawnV
11-18-2005, 02:13 AM
Great mod. I have used to mod and extended it to custom tailor it to my WoW guild. ;)

Basically I had it so that when people clicked on the attendance it would display it in a table based on what their class (custom field) is and also display next their name what their Lvl and spec (also custom fields). I also had it integrated so that the color name shows what their usergroup is which is "guild member, guild class advocate, guild officer, guild admin. Those familiar w/ WoW would recognize the colors. The tally per class is shown. This particular event is for a Molten Core signup.

Guild site @ http://frostmaneguild.com


Rev, I would also like a version of what your using for our WOW site.

PsiNyde
11-18-2005, 06:26 PM
<font color="Orange">*clicks install*</font>

amazing...good job! works like a charm. thanks!

cbr929rrerion
11-21-2005, 03:23 AM
Slaps the install button and says yeah... any way to make the attending event box checked by default?

2fast4ya
11-22-2005, 05:17 AM
Invalid Event specified. If you followed a valid link, please notify the administrator

thats the error i get when i click on i will attned... whats up?

ScottMcPollux
11-22-2005, 03:39 PM
good job. :banana:

*clicking install*

hm, haven't looked at the source, but did you ever think about a possibility to enroll additional people for an event (I will attend +1,2,.. n )?

Cheers,

Scotty

Kaishi
11-22-2005, 11:46 PM
i'm looking to do something like the other guy that modified it for WoW, anyone know?

MojoNixon
11-23-2005, 07:14 PM
<a href="http://www.future-music.net/forum/calendar.php?" target="_blank">http://www.future-music.net/forum/calendar.php?</a>

I guess the forum is using the same mod, how its possible to get those numbers on the right of the Event?

andreamarucci
11-25-2005, 04:06 PM
good job. :banana:

*clicking install*

hm, haven't looked at the source, but did you ever think about a possibility to enroll additional people for an event (I will attend +1,2,.. n )?

Cheers,

Scotty

That's exactly what I've asked for some time ago. Would be fantastic and very useful to have the possibility for each user to choose how many people will attend the event
:rolleyes:

andreamarucci
11-30-2005, 11:57 AM
MMmmhhhh it seems that noone is listening here or am I wrong? :surprised:

lazyseller
12-09-2005, 06:05 PM
merge....

lazyseller
12-09-2005, 06:08 PM
::request::

events im attending in profile?

would you be able to code this ?

Any plans for this ?

Does anybody know a easy way to list the number attending members right next to the event on the calendar index page

:Judge:
12-13-2005, 07:52 AM
What template(s) do I need to look at for this change.

I would like to add "Additional Options" above or below "Event Date" when adding a new event.

I believe this feature is over looked often where it is by default unless of course you know about it, any member can and has over looked it and may not think about it even after being told.

mkdevo
12-16-2005, 11:25 PM
what do i need to do to disallow unregistered folks from adding themselves to an event?

KrisJacobs
12-16-2005, 11:55 PM
Just revoke calendar permissions so that Unregistered/Not Logged On cannot even see the calendar.

mkdevo
12-17-2005, 12:31 AM
Just revoke calendar permissions so that Unregistered/Not Logged On cannot even see the calendar.

i want them to be able to see the calendar though.

Zachariah
12-19-2005, 02:35 PM
I plan to expand this a lot for my personal site.
- I host a site for gammers / guilds / clans and they play WOW, BF2, etc .

I'll post stuff later.

Zachariah
12-19-2005, 04:32 PM
This is a way but unfortunately one I don't want to go:
With template caching disabled (now), we have 1 additional query when viewing a calendar entry with nobody enrolled or 2 queries, when s.b. is enrolled (2 templates).

With your solution, one every pageview (not only calendar) there is an overhead (1 plugin loaded).

If s.b. really has perfomance issues with his vb, he should consider including the templates in calendar.php (which would be a hack, not a plugin).

But as written in the release text, I don't think that 1 or 2 uncached templated are a problem.

Updated: kills 2 queries on event view.
https://vborg.vbsupport.ru/showpost.php?p=755760&postcount=18

if (THIS_SCRIPT == 'calendar'){
$globaltemplates = array_merge($globaltemplates, array('calendar_rollbit','calendar_roll',));
}

SimonVlc
12-21-2005, 08:22 PM
Hello,

is it possible to send an email to all the users who choose to attend to an event? It would be a great feature.

Thanks, Simon.

bada_bing
01-11-2006, 07:05 PM
Any idea when this hack will be update to include fixes to the know bugs?

If you dont have this version of the hack and running vb 3.5.3 will this plugin work by it's self or do you need the proio version first?

bada_bing
01-11-2006, 07:07 PM
Can you install this plugin without any prior versions? I am running vb3.5.3 ?
Also is there going to be an updated version that fixes the known bugs?

arpy
01-13-2006, 09:08 PM
Sorry, currently I'm busy and I have no time to update this hack. I will update the hack when I update my own board which currently is still on 3.0x. I can't give you a schedule yet.

arpy

:Judge:
01-15-2006, 04:37 AM
Anyone come up with checked by default?

MustangLisa
01-15-2006, 03:12 PM
Very cool, thanks!

dodgechargerfan
01-15-2006, 11:06 PM
Just installed on 3.5.3 and it works fine so far. Thanks very much!

andreamarucci
01-17-2006, 12:01 PM
Sorry, currently I'm busy and I have no time to update this hack. I will update the hack when I update my own board which currently is still on 3.0x. I can't give you a schedule yet.

arpy

Welcome back Arpy. What do you think about my suggestion to include a popup field to spcify how many people will attend the event?

Since I run a bikers site, we organize meeting and have the possibility to specify how many people will register each time for an event will be great :squareeyed:

magnus
01-17-2006, 12:28 PM
Anyone come up with checked by default?

Simple. I've done this on my forum.

AdminCP -> Plugin System -> Plugin Manager

Find "Event Attendance - add enroll to create form" and click [Edit]

Replace with:
if (($type!='recur') OR (($type=='recur') AND ($vbulletin->options['enroll_reoccur']))) {

$disablesmiliesoption.='<div><label for="cb_rollcall"><input type="checkbox" name="useroll" value="1" id="cb_roll" tabindex="3" '.$useroll.' checked />'.$vbphrase['roll_allowenroll'].'</label></div>';

}

This will default to checked.

andreamarucci
01-17-2006, 01:12 PM
Magnus, since I see that you're a coder, do you think that my request about having a popup menu to specify how many people will attend the event, is difficult to realize?

Jenkins
01-22-2006, 11:35 PM
Mine installed great and has been working great.. One little thing I noticed. Someone tried to create an event for that day (in other words on jan 22 the guy tried to make an event for jan 22) when you select the allow people to enroll, it seems to work but there is no link in the calendar, but it does say "no on is signed up yet" not a big deal, but was just wondering if this was an issue or just some bug??

shadowdancer36
01-23-2006, 12:50 AM
I have 2 suggestions for the next version. Allow you to add yourself + # of guest. Also showing the person's avatar next to the name. I'm thinking more along the lines of Evite. I love all the functionality of Evite.

Great plugin! Thanks alot I needed this!

Jenkins
01-23-2006, 02:57 AM
I have 2 suggestions for the next version. Allow you to add yourself + # of guest. Also showing the person's avatar next to the name. I'm thinking more along the lines of Evite. I love all the functionality of Evite.

Great plugin! Thanks alot I needed this!

I think somone already posted some code to do this :)

bada_bing
01-23-2006, 11:59 AM
Any idea when the next release of this hack will be relaesed which works out some of the known bugs?

Mackem1979
01-23-2006, 01:12 PM
I know someone has already asked this but Is it possible so only certain user groups can enroll. I also run a gaming clan and this is a useful tool for when people are signing up for matches so therfore only want squad members to be able to sign up.

ricker
01-23-2006, 07:33 PM
I'd like to get the user's real name next to their username (basically just a profile field) - I saw someone else accomplished this - which variable should I be using? I can't seem to figure it out. Thanks.

mhuckaby
01-24-2006, 09:15 PM
Hi,

I installed in into our 3.5 forum just fine, but there is no link for anyone to click to indicate they will attend. When I added an event, I did check the box so that users could indicate their attendance.

Any thoughts?

Thanks!

mhuckaby
01-24-2006, 09:23 PM
Ok, I just figured it out. You cannot create an event that occurs on the day you create it. This plug-in I guess assumes that it's too late for people to sign-up. I created a new event at a future date and it works!

Thanks

:Judge:
01-26-2006, 01:47 AM
Simple. I've done this on my forum.

AdminCP -> Plugin System -> Plugin Manager

Find "Event Attendance - add enroll to create form" and click [Edit]

Replace with:
if (($type!='recur') OR (($type=='recur') AND ($vbulletin->options['enroll_reoccur']))) {

$disablesmiliesoption.='<div><label for="cb_rollcall"><input type="checkbox" name="useroll" value="1" id="cb_roll" tabindex="3" '.$useroll.' checked />'.$vbphrase['roll_allowenroll'].'</label></div>';

}

This will default to checked.

Thank You much :)

benzz0
01-27-2006, 01:51 PM
very nice...Thanks!

Vtec44
01-28-2006, 04:36 AM
Is it possible to allow Mod/Admins to remove people out from the list? :)

Gizmo999
02-01-2006, 02:56 PM
I've applied James hack below but I can't now edit an event, clicking the edit button submits me as attending member :(

I'm working round it by running a testing template without the calendar roll template submit form hack, is there any other way of doing it??


I had PM'd arpy asking him to include this with the module but he seems to be AWOL.

Here is how you can add guests to this hack after it is installed:

calendar_roll template:

Find

<else />
[<a href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=attend&amp;e=$eventinfo[eventid]">$vbphrase[roll_enroll]</a>]
</if>

Replace with

<else />
<form action="calendar.php" method="post">
<input type="hidden" name="do" value="getinfo" />
<input type="hidden" name="ea" value="attend" />
<input type="hidden" name="e" value="$eventinfo[eventid]" />
[I will be attending this event with <input type="text" name="guests" value="0" size=3 /> guests. <input type="submit" value="Submit" />]
</form>
</if>


Event Attendance - show/enroll plugin:

Find

$roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'];

Replace with

$info = $vbulletin->userinfo['username'];
$guests = intval( $_REQUEST['guests']);
if (1 == $guests)
$info .= ' (' . $guests . ' guest)';
else if ($guests > 0)
$info .= ' (' . $guests . ' guests)';
$roll[$vbulletin->userinfo['userid']] = $info;

:Judge:
02-03-2006, 07:34 AM
I've applied James hack below but I can't now edit an event, clicking the edit button submits me as attending member :(

I'm working round it by running a testing template without the calendar roll template submit form hack, is there any other way of doing it??

I am also in the same boat as you, I cannot delete, move or edit. When I click "Go" nothing happens.

finn snor
02-15-2006, 08:05 PM
I love this,

Is there a way to show a list of events a user has enrolled on the users profile ?

MythoLogy
02-15-2006, 08:54 PM
*click installs - perfect for creating activity and building reputation for guild prizes, etc.

htscpl
02-18-2006, 10:34 AM
Maybe I missed a fix but I keep getting an error message when I try to upload the xml file XML Error: xml processing instruction not at start of external entity at Line 1

Any idea on what I need to do to fix this?

Thanks for you help.

Henry :D

bada_bing
02-23-2006, 04:18 PM
Will there be an update for vb 3.5.3 for this great hack?

finn snor
02-23-2006, 06:32 PM
Will there be an update for vb 3.5.3 for this great hack?

I got it working on 3.5.3. It didnt work at first but after a reboot or something it started to work.

However i am on 3.5.4 now and it aint working on that.

Andreas
02-23-2006, 11:59 PM
What exactly does not work on 3.5.4?

finn snor
02-24-2006, 07:05 AM
What exactly does not work on 3.5.4?

I installed it on a fresh 3.5.4 and nothing happens.

nothing happened on the old 3.5.3 either but after i accedential hit a revert or generel reset menu it worked on 3.5.3.
Perhaps i need to find that reset thing again.

Any suggestions ?

finn snor
02-24-2006, 01:28 PM
I installed it on a fresh 3.5.4 and nothing happens.

nothing happened on the old 3.5.3 either but after i accedential hit a revert or generel reset menu it worked on 3.5.3.
Perhaps i need to find that reset thing again.

Any suggestions ?

It works now after i reverted the calendar template :nervous:

Joey805
02-28-2006, 04:20 AM
Just upgraded to 3.54 and this no longer works.

The users no longer have the link to attend or unattend themselfs when viewing an event and I have two templates that show as uncached now when I view a calendar event that I have allowed users to specify if they are attending.

Uncached templates: calendar_roll (1)
Uncached templates: calendar_rollbit (2)

When I turn the plugin off, the uncached templates notices no longer appear.

Can anyone help?

afkae
02-28-2006, 11:34 AM
I was wondering if there is a way that only certain user groups can set the event but anyone from registered user up can enroll in the event?

finn snor
02-28-2006, 11:37 AM
Just upgraded to 3.54 and this no longer works.

The users no longer have the link to attend or unattend themselfs when viewing an event and I have two templates that show as uncached now when I view a calendar event that I have allowed users to specify if they are attending.

Uncached templates: calendar_roll (1)
Uncached templates: calendar_rollbit (2)

When I turn the plugin off, the uncached templates notices no longer appear.

Can anyone help?

Try reverting the calendar template - ithat worked for me.

Joey805
02-28-2006, 08:36 PM
I tried reverting the calendar template and it did not fix the problem.

What should I try next?

Joey805
02-28-2006, 09:29 PM
I have even gone as far as installing this on a fresh unmodified template/style. This still does not work.

Apparently something needs to be changed in order to get this working with 3.54.

Can any coders jump in on this? I would really like to continue to use this.

Thanks,

Joey

Joey805
03-02-2006, 01:09 AM
Anyone???

Jayphen
03-02-2006, 04:20 AM
Is there a way to link events to forums?

I run a dance party website, and we have different forums for each upcoming event. In that forum, users make threads about the party.

It would be awesome if at the top of the forum (on the thread list page), if the user could click "add me to this event", and then be added to the list.. as well as having a popup window there for them to see other users attending.

Is this beyond the scope of this plugin, or is it do-able?

Joey805
03-02-2006, 04:26 AM
Has anyone got this successfully running on 3.54? I cant for the life of me. :(

yinyang
03-02-2006, 06:03 AM
Is there a way to link events to forums?

I run a dance party website, and we have different forums for each upcoming event. In that forum, users make threads about the party.

It would be awesome if at the top of the forum (on the thread list page), if the user could click "add me to this event", and then be added to the list.. as well as having a popup window there for them to see other users attending.

Is this beyond the scope of this plugin, or is it do-able?

https://vborg.vbsupport.ru/showthread.php?t=102213&highlight=event+forum

Neo_obs
03-03-2006, 06:38 PM
I have gotten it to work on 3.5.4 works quite nice on a modified forum

kizzmet
03-03-2006, 11:16 PM
Thank you for this, my users are very excited about it.

Jayphen
03-05-2006, 10:52 AM
https://vborg.vbsupport.ru/showthread.php?t=102213&highlight=event+forum
That creates new threads for events, not new forums.

kommuni
03-11-2006, 12:55 PM
unfortunately this doesn't seem to work together with the event-forum-plugin.

Probably anyone could make this possible?

ataraxia
03-13-2006, 09:39 AM
This is a GREAT plugin!

QUESTION: Is there some way to make the "Allow users to specify that they will be attending this event." setting to default to "Yes"?

When adding events most people (including myself) seem to overlook or forget that setting entirely. The result is that few events ever offer the option to the general members.

Thanks

Mighty Mojo
03-16-2006, 01:27 AM
How do I add VBulletin profile fields to the list of items shown?
I'm editing the rollbits with this info----but it isn't "parsing" the profile fields....

<li><a href="member.php?u=$rolluserid">$rollusername</a></li>
<td class="tcat" bgcolor="#919EBA">Character Level:</td>
<td class="panelsurround">$userinfo[field2]</td>
<td class="tcat" bgcolor="#919EBA">Character Class:</td>
<td class="panelsurround">$userinfo[field14]</td>

robert_2004
03-21-2006, 12:16 PM
ataraxia, simply go to the plugin manager, find "Event Attendance - add enroll to create form" and edit it.
Now edit the PHP code

$disablesmiliesoption.='<div><label for="cb_rollcall"><input type="checkbox" name="useroll" value="1" id="cb_roll" tabindex="3" '.$useroll.' />'.$vbphrase['roll_allowenroll'].'</label></div>';
change to:

$disablesmiliesoption.='<div><label for="cb_rollcall"><input type="checkbox" checked name="useroll" value="1" id="cb_roll" tabindex="3" '.$useroll.' />'.$vbphrase['roll_allowenroll'].'</label></div>';



Now, things i would like to see on this mod:
- add the guest functionality, so poeple can enroll and add upto 5 guests
- make the data indexable/searchable, so that when you click on the user's profile, it will show the events this user has attened.
- after the event takes place, the next day, use a popup on the main screen to ask if the user did infact attend the event. If they choose yes, leave them on the list as a 'attendee' otherwise, remove their name from the list.

robert_2004
03-21-2006, 12:21 PM
this is actually the first plugin i've installed, as i'm running a new copy of vB, trying to upgrade my forum.
I don't like these hooks - i can't change the position of where the enroll is going to be!

bada_bing
03-21-2006, 12:50 PM
I would like to install this hack but I had a couple questions. I have 2 calandars on my site Private-Public and would like to create another called Swaps. How can assign this hack to only the Swaps calandar?

GSX-Racing
03-22-2006, 01:47 AM
unfortunately this doesn't seem to work together with the event-forum-plugin.

Probably anyone could make this possible?

Yes, I agree. I wish it worked with it.

blacklancer
03-24-2006, 04:52 PM
i want to use this for another part of my forum, and in a different context. i am currently using it for events and i love it!

what i want to use it for is the following:

we have a parts review (car related website) and i want the option for users to specify whether or not they have any certain item installed on their car.

is there a way i can modify this to include it in a different section??

twitch
03-25-2006, 04:49 PM
request to add an option for members to set a status that they will not be able to attend with reason stated

napukjon
04-09-2006, 07:45 AM
This wont work for me.

It will only seem to work when i have events forum installed on my forum, and even then, when i create a new event, and select for people to be able to sign up, nothing happens. Theres nothing for my users to click or to say that they are attending. Also when i have both this and the Events Forum installed, and i go to delete a thread i get an error message!

Any help?

Cheers

Jon

Mighty Mojo
04-14-2006, 06:13 AM
How do I add VBulletin profile fields to the list of items shown?
I'm editing the rollbits with this info----but it isn't "parsing" the profile fields....

<li><a href="member.php?u=$rolluserid">$rollusername</a></li>
<td class="tcat" bgcolor="#919EBA">Character Level:</td>
<td class="panelsurround">$userinfo[field2]</td>
<td class="tcat" bgcolor="#919EBA">Character Class:</td>
<td class="panelsurround">$userinfo[field14]</td>

I'm an idiot, I CANNOT figure this out lol

I need to have some of the custom fields show next to the users name!

Do I need to have the $roll array in the event attendance show/enroll (in the plugin area) push the data of the field/s I need to show in the rollbits before I call them in rollbits?

Please help be display custom profile fields next to the usernames for individuals that have enrolled....please?

kurtbarker
04-23-2006, 09:34 AM
hey mate, i'd really like to see the event's i'm attending in user profile as well

come on guyz, the more people that way it the more likely it'll be :D

sickboy6ths
04-26-2006, 11:18 AM
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.

andreamarucci
04-26-2006, 03:57 PM
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?

Joey805
04-26-2006, 03:59 PM
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
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
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
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
// 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_usergroupPerm issionsQuery, 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
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
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
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:

<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
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.

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
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
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
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
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
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
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:

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?



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
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
// 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_usergroupPerm issionsQuery, 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
What about something like this?



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
What about something like this?



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:

//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:
//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
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
// 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_usergroupPerm issionsQuery, 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.php?p=975840&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
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.php?p=975840&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.php?p=967286&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
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.php?p=975840&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:
$vbphrase[roll_cancel]

replace:
I will no longer be attending this event

find:
$vbphrase[roll_enroll]

replace:
I will be attending this event

find:
$vbphrase[roll_nobody]

replace:
Nobody yet

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

replace:
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".

PimvanJ
05-25-2006, 01:57 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:


Not getting any field did I miss something?
I'm not a coder a simply step by step guide will be most appreciated.
Even with more than two fields.

Mithan
05-25-2006, 09:37 PM
I installed this plugin (vB 3.5.1) but nothing happened at all.

Was I just supposed to install the plugin and then this would work?

What I did:

1. Installed via Plugin Manager.
2. Install apparently worked.
3. Tried to see events but no "sign up" showed or anything.

Nevermind, missed the part where you need to check the box to make an event user selectable.

Mithan
05-25-2006, 11:57 PM
Does anybody know how we could edit this script to do Tenative additions?

Mighty Mojo
05-26-2006, 03:32 AM
Does anybody know how we could edit this script to do Tenative additions?

One of these days, a functioning calendar may not be something that has to be an addon

Godam VBULLETIN if you are reading this, step it up in respect to the calendar, it's poo


Well, anyhow, to answer your question, really they are all tentative as they can remove themselves from the list at any time before the appointment (something else that should be optional ;))

Being able to add a custom field (like the one I posted above that puts a profile field data of your choice next to the username) or a checkbox, or dropdown list of custom options next to the users name would solve your problem and many others---so basically you have to pass more than just the persons username through the rollbit. You have to CUSTOM code your own data fields to pass. This thing would be all that much more powerful if you could add CUSTOM fields to display next to a username---without coding, and have this done at the time you create the appointment.

Also, adding an optional summation of custom field would be icing on the cake. I.e. a checkbox is created as a custom field "are you bringing food". Each member checks box yes or no when they sign up and you can have the field either count yes's or no's or both and display the count at the top of column for that field. I.E. an optional count could be in place that will count all similar data fields

D|ver
05-29-2006, 01:09 PM
this is really such a great hack, but is there any way to integrate this into the vb event forums (https://vborg.vbsupport.ru/showthread.php?t=102213)?

i cant get the attendance box displayed in the event description

timk
06-06-2006, 09:13 AM
this is really such a great hack, but is there any way to integrate this into the vb event forums (https://vborg.vbsupport.ru/showthread.php?t=102213)?

i cant get the attendance box displayed in the event description

I'd like to know this too. I would love to use this plugin but am already using vbEvent.

Anyone got a solution? Enabling HTML is not a solution for me because I don't want to moderate it.

Lqd
06-07-2006, 12:38 AM
It seems everybody loves this hack and the Event forums hack...

Still no-one is able to do it. (No disrespect towards TomasDR, I just do not wish to enable html)

So maybe we need to encourage people a bit more...

I suggest we all dump a few quaters in a box and offer the box to the magician who is able to put this together like the event attendance is 100% functional on the tread and not the calendar.

So let's start...

I'll add $5 in the box too start. I'll send it over paypal once it is done.

Total in the box: $5 (please copy in next post)

Lqd
06-11-2006, 03:27 PM
*Bump* not a lot of activity here..... *bump*

Amaranth
06-18-2006, 06:16 PM
Beautiful hack, works like a charm! :) Thanks alot

Deyth
06-22-2006, 05:18 PM
I don't know if anyone else has suggested this but having used this for a bit and it would be nice if I could track explicit non-attendance. If I invite 40 people to attend something I can't be sure that the 13 not attending actually made that decision or missed the invite.

If you want to get even fancier you could add another option for "I will attend but arrive late by x minutes/hours."

Tyegurl
06-23-2006, 02:55 AM
can someone update this for 3.6.0? i have it installed the only thing i can see that it is missing are the 2 links to enroll or unenroll....

Lqd
06-26-2006, 05:44 AM
It seems everybody loves this hack and the Event forums hack...

Still no-one is able to do it. (No disrespect towards TomasDR, I just do not wish to enable html)

So maybe we need to encourage people a bit more...

I suggest we all dump a few quaters in a box and offer the box to the magician who is able to put this together like the event attendance is 100% functional on the tread and not the calendar.

So let's start...

I'll add $5 in the box too start. I'll send it over paypal once it is done.

Total in the box: $5 (please copy in next post)

anyone?

louis_chypher
06-29-2006, 02:55 PM
To allow an attendee to input an attendence count I did the following:


Template Edits

In calendar_showeventsbit

find (near top):

<form action="calendar.php" method="post" >

change to:

<form action="calendar.php" method="post" name="calendar_showeventsbit">

In calendar_roll

replace entire contents with:

<p><strong><phrase 1="$rollcount">$vbphrase[roll_text]</phrase></strong></p>
<if condition="$rollbits">
<ul>
$rollbits
</ul>
<else />
<p><i>$vbphrase[roll_nobody]</i></p>
</if>

<if condition="$bbuserinfo[userid] > 0 && $show[enroll]">
<if condition="$show[userattending]">
<a href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=unattend&amp;e=$eventinfo[eventid]">$vbphrase[roll_cancel]</a>]
<else />
<input type="text" name="partycount" onkeyup="doAttendCount();">
<input type="hidden" name="pc_surl" value="$session[sessionurl]">
<input type="hidden" name="pc_eventid" value="$eventinfo[eventid]">
<input type="hidden" name="pc_pharse" value="$vbphrase[roll_enroll]">
</br>
<div id="attendlink">
<a
href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=attend&amp;e=$eventinfo[eventid]">$vbphrase[roll_enroll]</a>
</div>
</br>


<script language="javascript">

function doAttendCount()
{
var sVar;
sVar= '<a href="calendar.php?'+document.calendar_showeventsbit.pc_ surl.value+ 'do=getinfo&amp;ea=attend&amp;e='+
document.calendar_showeventsbit.pc_eventid.value +
'&amp;pc=' +
document.calendar_showeventsbit.partycount.value+'">' +
document.calendar_showeventsbit.pc_pharse.value+'</a>';
document.getElementById("attendlink").innerHTML = sVar;
}


</script>

</if>
</if>



In Plugin System | Plugin Manager

Edit: Event Attendance - show/enroll

Find: ($vbulletin->options['lateenroll'])) ? true : false;

Add below:

$inparty = $_REQUEST['pc'];

if ($inparty == "")
{
$inparty = "1";
}
if (!(is_numeric($inparty)))
{
$inparty="1";
}



Find:


$roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username']

change to:

$roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'] . ", " . $inparty;


If you'd like to be sent an email when someone signs up for an event then under

$roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'] . ", " . $inparty;

add:


vbmail("youremailaddress@yourdomainname.com", "Attend " . $eventinfo['title'], "Alias: "
. $vbulletin->userinfo['username'] . " will be attending " . $eventinfo['event'] .
" Party count =" . $inparty,
false, $vbulletin->userinfo['email'], '', $vbulletin->userinfo['username']);


to properly display attendace count find:


$rollcount++;


replace with:


list($usrName, $pcount)=split(",",$rollusername);
$rollcount=$rollcount + $pcount;




Oh! and if you do use the send email do not forget to set the email address you want the event sent to.

Lqd
06-29-2006, 03:16 PM
To allow an attendee to input an attendence count I did the following:


Template Edits

In calendar_showeventsbit

find (near top):

<form action="calendar.php" method="post" >

change to:

<form action="calendar.php" method="post" name="calendar_showeventsbit">

In calendar_roll

replace entire contents with:

<p><strong><phrase 1="$rollcount">$vbphrase[roll_text]</phrase></strong></p>
<if condition="$rollbits">
<ul>
$rollbits
</ul>
<else />
<p><i>$vbphrase[roll_nobody]</i></p>
</if>

<if condition="$bbuserinfo[userid] > 0 && $show[enroll]">
<if condition="$show[userattending]">
<a href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=unattend&amp;e=$eventinfo[eventid]">$vbphrase[roll_cancel]</a>]
<else />
<!-- Number in Party field -->
<input type="text" name="partycount" onkeyup="doAttend();">
<input type="hidden" name="pc_surl" value="$session[sessionurl]">
<input type="hidden" name="pc_eventid" value="$eventinfo[eventid]">
<input type="hidden" name="pc_pharse" value="$vbphrase[roll_enroll]">
</br>
<div id="attendlink">
<a
href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=attend&amp;e=$eventinfo[eventid]">$vbphrase[roll_enroll]</a>
</div>
</br>


<script language="javascript">

function doAttend()
{
var sVar;
sVar= '<a href="calendar.php?'+document.calendar_showeventsbit.pc_ surl.value+ 'do=getinfo&amp;ea=attend&amp;e='+
document.calendar_showeventsbit.pc_eventid.value +
'&amp;pc=' +
document.calendar_showeventsbit.partycount.value+'">' +
document.calendar_showeventsbit.pc_pharse.value+'</a>';
document.getElementById("attendlink").innerHTML = sVar;
}


</script>

<!-- / Number in Party field -->
</if>
</if>

In Plugin System | Plugin Manager


In Plugin System | Plugin Manager

Edit: Event Attendance - show/enroll

Find: ($vbulletin->options['lateenroll'])) ? true : false;

Add below:

$inparty = $_REQUEST['pc'];

if ($inparty == "")
{
$inparty = "1";
}


Find:


$roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username']

change to:

$roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'] . ", " . $inparty;

If you did the email mod:


then replace with(goes under > $roll[$vbulletin->userinfo['userid']] = $vbulletin->userinfo['username'] . ", " . $inparty;:

vbmail("youremailaddress@yourdomainname.com", "Attend " . $eventinfo['title'], "Alias: "
. $vbulletin->userinfo['username'] . " will be attending " . $eventinfo['event'] .
" Party count =" . $inparty,
false, $vbulletin->userinfo['email'], '', $vbulletin->userinfo['username']);


I will work on getting the proper attendee count to appear on the event page .

What does this do?

louis_chypher
06-29-2006, 03:28 PM
What does this do?


It puts an input box on the screen that enables the antendee to enter a number in party.

Tyegurl
06-29-2006, 03:58 PM
:confused: can someone update this for 3.6.0? i have it installed the only thing i can see that it is missing are the 2 links to enroll or unenroll....

guess i shouldn't work on things when i am tired....disreagard the above quote from the above post lmao!

andreamarucci
07-03-2006, 12:39 PM
Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! Thank you!! I've made the modifications and everything work flawlessly :) The only thing I wasn't able to do was to find "$rollcount++;" but I'll search more deeply...

Thanks again

andreamarucci
07-03-2006, 03:00 PM
Found a bug I think. The system work but the total number of people is always 1 for one person also if this person will attend in 2 or 3. For example

Andrea, 2
Tony, 3
John, 2

Will show as "There will be 3 people attending" and not "There will be 7 people attending".

What do you think? Maybe is because I've not modified $rollcount++; ?

andreamarucci
07-03-2006, 03:06 PM
Forget about my last post. Was because I have not updated $rollcount++

Wonderful work!!!!!!

andreamarucci
07-03-2006, 06:35 PM
louis_chypher has done a wonderful work and everyhting is working very very well.

I've a suggestion for you...

Instead of putting a text field where the user input the number, will be possible to have a popup menu with only the available values?

I run a bikers club and when the people subscribe to the event, they could be just one or two people per bike so I would like to have a popup menu with the values of 1 or 2 so nobody can input numbers like 1.5 or -12 or 500...

I suppose, but maybe I'm wrong that this is the code that draw the input box

<input type="text" name="partycount" onkeyup="doAttendCount();">

So I think that if I put this code instead of the one above

<select name="partycount" size="1">
<option>Number of people</option>
<option value="1">1</option>
<option value="2">2</option>
</select>

A popup menu will appear. The problem is where to put onkeyup="doAttendCount();" ?

andreamarucci
07-04-2006, 10:53 AM
Doesn't work

I've inserted this

<select name="partycount" size="1" onkeyup="doAttendCount();">
<option>Number of people</option>
<option value="1">1</option>
<option value="2">2</option>
</select>

but it insert just 1 also if I choose 2

Any suggestion?

louis_chypher
07-04-2006, 11:28 AM
Doesn't work

I've inserted this

<select name="partycount" size="1" onkeyup="doAttendCount();">
<option>Number of people</option>
<option value="1">1</option>
<option value="2">2</option>
</select>

but it insert just 1 also if I choose 2

Any suggestion?

andreamarucci, replace your calendar_roll with:

<p><strong><phrase 1="$rollcount">$vbphrase[roll_text]</phrase></strong></p>
<if condition="$rollbits">
<ul>
$rollbits
</ul>
<else />
<p><i>$vbphrase[roll_nobody]</i></p>
</if>

<if condition="$bbuserinfo[userid] > 0 && $show[enroll]">
<if condition="$show[userattending]">
<a href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=unattend&amp;e=$eventinfo[eventid]">$vbphrase[roll_cancel]</a>]
<else />
<!-- Number in Party field -->
<input type="hidden" name="pc_surl" value="$session[sessionurl]">
<input type="hidden" name="pc_eventid" value="$eventinfo[eventid]">
<input type="hidden" name="pc_pharse" value="$vbphrase[roll_enroll]">
</br>
<div id="attendlink">
<a
href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=attend&amp;e=$eventinfo[eventid]">$vbphrase[roll_enroll]</a>
</div>
</br>
<div id="option_attendlink">
<select name="option_partycount" size="1" onchange="doAttend(this);">
<option>Number of people</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
</div>

<script language="javascript">

function doAttend(oSelect)
{
var i=oSelect.selectedIndex;
var sVar;
sVar= '<a href="calendar.php?'+document.calendar_showeventsbit.pc_ surl.value+ 'do=getinfo&amp;ea=attend&amp;e='+
document.calendar_showeventsbit.pc_eventid.value +
'&amp;pc=' +
oSelect.value+'">' +
document.calendar_showeventsbit.pc_pharse.value+'</a>';
document.getElementById("attendlink").innerHTML = sVar;

}


</script>

<!-- / Number in Party field -->
</if>
</if>

andreamarucci
07-04-2006, 11:55 AM
As before Louis I've to tank you very very much. Works like a charm and now is very very useful :banana:

Mighty Mojo
07-12-2006, 01:05 PM
Will this allow people to put ANY note next to their name?

I.e. not just a number...

If not, what modification might I make so that members can make a note next to their name?

Mighty Mojo
07-12-2006, 01:13 PM
Two other suggestions:

1-Add an option to show what time/date an event was added to the calendar.
2-Add an option to show what time/date a person signed up (despite the fact that it shows in order who signed up first, it would be useful to me for discrepancies)

Thanks for your time---hope someone else finds these ideas worthwhile and can develop them..

inkpassion
07-16-2006, 11:43 PM
Do you know if the ability to pay to join an even is an option?

louis_chypher
07-17-2006, 10:42 AM
Will this allow people to put ANY note next to their name?

I.e. not just a number...

If not, what modification might I make so that members can make a note next to their name?


No, the way I wrote the modification will not allow individuals to put any note next to their name.

Personally, the way the modification is currently written it is not very scalable from a data storage point of view. While it would be highly possible to add in code to allow people to put in ANY note next to their name coding would get fairly messy farily quickly when trying to adapt to the scalibility issue.

I wonder what it takes to take someone eleses idea and do an extensive rewrite of it?

andreamarucci
07-20-2006, 01:03 PM
A very important question. Is this compatible with the upcoming version 3.6?

louis_chypher
08-07-2006, 03:25 PM
A very important question. Is this compatible with the upcoming version 3.6?

Hi, This mod as is downloaded along with the modifications I've wrote to add a party count (https://vborg.vbsupport.ru/showthread.php?t=93782&page=15) do work with 3.6. If you have already installed this mod then, after the upgrade to 3.6, to get the event attendence party count to work you will, after doing the required template reverts, need to reapply the change to the calendar_showeventsbit template.

70age
08-08-2006, 12:43 PM
can't work in 3.6........
waitting for

noel_leon
08-11-2006, 05:42 AM
this is working with my 3.6.0 Gold.

Tyegurl
08-11-2006, 11:53 AM
it works with 3.6.0 gold but you have to uninstall it and then reinstall the product ;)

meissenation
08-11-2006, 08:36 PM
I've done the said modifications, and it's added a bunch of lines to my vBevents showthread, but alas it doesn't pop up with anything in the showthread. It's just blank. What am I doing wrong?

While viewing the event in the calendar, it does say 0 people will be attending and what not, but there's no link to click to actually say whether or not you're attending. When viewing the thread for the event that vBevents makes, there's nothing but extra lines.

meissenation
08-13-2006, 02:28 AM
Nevermind, figured it out on my own... something that I hadn't seen mentioned is that if you do the mod you have to (or atleast I did) create the roll phrases as a phrase type Show Thread and then it will work.

Sidewindr
08-16-2006, 07:03 AM
Nevermind, figured it out on my own... something that I hadn't seen mentioned is that if you do the mod you have to (or atleast I did) create the roll phrases as a phrase type Show Thread and then it will work.

Can you elaborate a little more on how you fixed this? I am having the same problem.

Adding the phrases to Show thread did not work for me. I also did the edits suggestwed in the previous page to allow multiple attendees and still no joy. No area for the user to specify attendance in the Calendar entry.

meissenation
08-16-2006, 10:01 AM
I originally had tried the mod to make it more friendly for people bringing multiple attendees, but I didn't like the way it looked so I removed it.

First I did the event attendance - vbEvent integration according to the post (I want to say by Thom, Thomas, Dr Thom? Something like that, it's 6:55am and i'm too tired to remember names) in any case, after performing that it would work when viewing the calendar but not when viewing the thread in the forum... it was just blank or would only show the list of who was attending, nothing before and nothing after for people to click.

I then went and tried the multiple attendees hack, which I didn't like, so I had to go back and revert everything to remove that.

Once removed, my calandar_roll template looked like this:
<p><strong><phrase 1="$rollcount">$vbphrase[roll_text]</phrase></strong></p>
<if condition="$rollbits">
<ul>
$rollbits
</ul>
<else />
<p><i>$vbphrase[roll_nobody]</i></p>
</if>

<if condition="$bbuserinfo[userid] > 0 && $show[enroll]">
<if condition="$show[userattending]">
[<a href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=unattend&amp;e=$eventinfo[eventid]">$vbphrase[roll_cancel]</a>]
<else />
[<a href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=attend&amp;e=$eventinfo[eventid]">$vbphrase[roll_enroll]</a>]

</if>
</if>

After reverting the roll template back, I created the phrases as Type being Show Thread:
Varname -- Text
roll_ allowenroll -- Allow users to specify tha they will be attending this event.
roll_ cancel -- I will no longer be attending this event.
roll_ enroll -- I will be attending this event.
roll_ nobody -- Nobody Yet
roll_ text -- There are {1} people enrolled for this event:

After I did that, it worked for me.


Hope that helps!

marlita
08-19-2006, 05:25 AM
I have vB 3.6. Is it ok to use this plugin?

Thanks

marlita
08-23-2006, 01:05 PM
I have to manually link my polls to my event-forum. It's not a huge deal, but it would be nice if something did this through the admin or forum instaed. Does anyone know about a program that does this or does anyone know how to make one?

If someone doesn't know what I'm talking about and would like to see what i mean, feel free to check out my polled event-forum (http://virginiareia.com/forum/showthread.php?t=4). Just type username:test & password: test. Just don't vote, please.

Thanks.

elricstorm
08-24-2006, 07:04 PM
I tried installing this for 3.6 and it installed fine. However, after installing it and going to the calendar and check marking the allow people to attend events checkbox, and posting I get the following:

Fatal error: Existing data passed is not an array
Called set_existing in /var/www/vhosts/httpdocs/forum/includes/functions_databuild.php on line 164
Called build_forum_counters in /var/www/vhosts/httpdocs/forum/includes/class_dm_event.php(569) : eval()'d code on line 141
Called eval in /var/www/vhosts/httpdocs/forum/includes/class_dm_event.php on line 569
Called pre_save in /var/www/vhosts/httpdocs/forum/includes/class_dm.php on line 789
Called save in /var/www/vhosts/httpdocs/forum/calendar.php on line 1952
in /includes/class_dm.php on line 235

Is this not usable with 3.6 or is there a work around for this issue? Not sure what to do.

elricstorm
08-24-2006, 07:14 PM
The issue was I had another conflicting calendar plugin and once I removed it - this one worked fine.

pmkb
08-25-2006, 01:18 AM
I'm building a brand new site and just installed this mod and it works great.

Thanks also to: Zachariah (post #18 (https://vborg.vbsupport.ru/showpost.php?p=755760&postcount=18)) - cached templates Mighty Mojo (post #194 (https://vborg.vbsupport.ru/showpost.php?p=981347&postcount=194)) - display profile fields Louis Chypher (post #213 (https://vborg.vbsupport.ru/showpost.php?p=1018313&postcount=213) and post #222 (https://vborg.vbsupport.ru/showpost.php?p=1021963&postcount=222)) - set number of attendies (guests)

I made a few tweaks to the listed modifications such that attendies look something like this:

* username(4)
o Wants: <string from field6>
o Has: <string from field7>
* nextname(1)
o Wants: <string from field6>

and the Wants/Has lines are only shown if the profile strings are not empty. :)

marlita
08-26-2006, 01:02 AM
Hmm... not sure if this (https://vborg.vbsupport.ru/showpost.php?p=1055604&postcount=2) actually worked or not... all i can say is that I have my events linked to my forums with poll ability... not quite sure how lol *shrug* ... it's exactly what i wanted... I'm happy... don't know if that'll work for anyone else. ... anyway, I'm removing the test login feature on my site now.

elricstorm
08-28-2006, 05:42 PM
Would it be difficult to modify the list so that it looks like:

username || secondary_usergroup
username1 || secondary_usergroup
username2 || secondary_usergroup
etc. ?

Where secondary_usergroup only displays if it is one of the following?

Here's an example.

Ted is a primary user for members but he's also in a usergroup for warriors.
Ann is a primary user for members but she's also in a usergroup for rogues.

I want both their username and secondary group to show if it's equal to warriors or rogues, so.. something like

if secondary_group = warriors or rogues then show secondary_group

The display would appear as:

Ted || Warrior
Ann || Rogue
etc.

Can it be done and would be it be difficult?

jangus74
08-28-2006, 08:08 PM
Anyone tried this on 3.5.4?

Monty NC
08-29-2006, 02:09 PM
Yes, this works on 3.5.4

Monty NC
08-29-2006, 08:50 PM
andreamarucci, replace your calendar_roll with:

<p><strong><phrase 1="$rollcount">$vbphrase[roll_text]</phrase></strong></p>
<if condition="$rollbits">
<ul>
$rollbits
</ul>
<else />
<p><i>$vbphrase[roll_nobody]</i></p>
</if>

<if condition="$bbuserinfo[userid] > 0 && $show[enroll]">
<if condition="$show[userattending]">
<a href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=unattend&amp;e=$eventinfo[eventid]">$vbphrase[roll_cancel]</a>]
<else />
<!-- Number in Party field -->
<input type="hidden" name="pc_surl" value="$session[sessionurl]">
<input type="hidden" name="pc_eventid" value="$eventinfo[eventid]">
<input type="hidden" name="pc_pharse" value="$vbphrase[roll_enroll]">
</br>
<div id="attendlink">
<a
href="calendar.php?$session[sessionurl]do=getinfo&amp;ea=attend&amp;e=$eventinfo[eventid]">$vbphrase[roll_enroll]</a>
</div>
</br>
<div id="option_attendlink">
<select name="option_partycount" size="1" onchange="doAttend(this);">
<option>Number of people</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
</div>

<script language="javascript">

function doAttend(oSelect)
{
var i=oSelect.selectedIndex;
var sVar;
sVar= '<a href="calendar.php?'+document.calendar_showeventsbit.pc_ surl.value+ 'do=getinfo&amp;ea=attend&amp;e='+
document.calendar_showeventsbit.pc_eventid.value +
'&amp;pc=' +
oSelect.value+'">' +
document.calendar_showeventsbit.pc_pharse.value+'</a>';
document.getElementById("attendlink").innerHTML = sVar;

}


</script>

<!-- / Number in Party field -->
</if>
</if>


I did this (along with the other changes you listed), and the drop down box seems to work, but the total attendance only gets updated by '1' regardless of the selected number. In other words if you select '2' it shows 'Username, 1' in the list of attendees and only increases the total count by 1.

What am I missing?



EDIT: I just noticed that there is an "Error on page" message in the status bar as soon as I select a number from the drop-down box. This is the error:

Line: 871
Char: 1
Error: 'document.calendar_showeventsbit.pc_surl' is null or not an object
Code: 0
URL: http://~~~/calendar.php?

If I just click on the link without selecting a number from the drop down box, I do not get an error. Does this help?

Monty NC
08-30-2006, 12:24 PM
I found the problem - I made a typo in this line in the showeventsbit template:

<form action="calendar.php" method="post" name="calendar_showeventsbit">

Fixed the typo, all works great now -- thanks!

andreamarucci
09-05-2006, 11:39 AM
I've just upgraded to 3.6 and everything works except for the fact that if you enroll choosing 1 people, you get yourname,1 and it's exact, but if you choose to enroll choosing 2 people, you get always yourname,1 and this is not correct since you must get yourname,2

Probably the upgrade changed something. Where do I have to look to fix this?

andreamarucci
09-05-2006, 11:45 AM
Forget my last post. I've not added <form action="calendar.php" method="post" name="calendar_showeventsbit"> in calendar_showeventsbit template.

Now everything work ok in 3.6!

GrandAmGuru
09-13-2006, 11:57 AM
anyway we can add in an attendance option of "maybe" and "no"? Also possiblity of the number of guests attending (like registered person + 2 guests)?

I also really like the idea that was posted about some sort of event attendance counting in their profile/postbit.