vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Event attendance (https://vborg.vbsupport.ru/showthread.php?t=63460)

SamirDarji 09-24-2004 07:15 AM

Once you've chosen the correct database, I believe it is the SQL tab.

Benj 09-28-2004 12:28 PM

would it be possible to have a section on the users profile page saying what events they will be attending ??

SamirDarji 09-28-2004 01:55 PM

Quote:

Originally Posted by benj
would it be possible to have a section on the users profile page saying what events they will be attending ??

Anything is possible. ;) I'm just not sure how it would really be done since all this hack essentially does is insert another bit of information with the information for an event and then read it back when displaying an event.

To display this information with a user's profile, you'd have to scan through every event and look at that additional bit of information to see if it matches the chosen user profile. I think the code to do this will be even more than the original hack, lol.

Essentially, you'd be scanning the entire events table (or just the newer events) every time a user looks at another's profile. I suspecting it would be kinda heavy on the server if this was implemented on a forum with a lot of users and events.

Benj 09-28-2004 02:13 PM

thanks for the reply but doesnt the attendance table hold the users ID (when they click to say there attending) in which case calling the record from the database would be easier on the server (WHERE userID = "?")

SamirDarji 09-28-2004 02:25 PM

I looked at the structure of the events table and the "roll" field and it seems quite easy on the server. All it has to do is go through the events table just like you said. Now, who wants to code this cool idea? :D

Ted S 09-28-2004 11:20 PM

Suggestion:

In the Public Calendar when you click on the link at the bottom of the page to add or remove yourself as an attendee, it would be very helpful (for planning purposes) to have a drop down menu or text box available to fill in a number for how many will be in that "party".

For instance, we are planning a BBQ on Oct. 30. This is going to be open to both members and non-members (i.e. families). If a person is going to bring a spouse, 2 kids and a friend who may be interested in diving in the future, it would be very helpful to be able to look at the list and see that this will be a "Party of 5", it would also be an added bonus if the total number of attendees could be shown.

Adding this feature would make the Calendar more "useful" and relevant. If you still have to comb through a thread to find the number of attendees for each name, the Calendar function becomes less valuable.

SamirDarji 09-28-2004 11:59 PM

This doesn't seem too hard to do, but for my site I would have no need for it. But I see how your suggestion can take the calendar to the beginning stages of becoming a planner--which I fully believe it will be in the future once people realize what you can do with it.

Ted S 09-29-2004 03:28 AM

Right now a lot of our users are planning group events which means a lot more than just 1 person attending per username... this makes the "attending" feature almost useless as it misrepresents actual attendance. I would love to see (and am willing to pay for) a feature to simply include the # of attendees... it doesn't seem hard to add but time is not something I have lots of.

SamirDarji 09-29-2004 06:56 AM

If someone writes out the pseudocode, I'd be willing to hack at it in my spare time.

Benj 09-29-2004 07:08 AM

that would be so sweet if you could !! dunno about the code tho

SamirDarji 09-29-2004 01:26 PM

That's the hard part--the pseudocode. It's the logic behind the code. That's where ideas on how to do something get tested, shot down, optimized and the like. The coding is the easy part once you have the logic. Then it's just a matter of making the chosen language do what the pseudocode dictates.

Benj 09-30-2004 09:41 AM

dont have a clue how to do pseudocode sorry :(

Benj 10-04-2004 07:55 AM

so................................

buro9 10-04-2004 08:17 AM

Quote:

Originally Posted by SamirDarji
If someone writes out the pseudocode, I'd be willing to hack at it in my spare time.

Here's the psuedo SQL:

PHP Code:

$query "SELECT `eventid` , `userid` , `event` , `title` , `allowsmilies` , `recurring` , `recuroption` , `calendarid` , `customfields` , `visible` , `dateline` , `utc` , `dateline_from` , `dateline_to` , `useroll` , `roll`
FROM `" 
TABLE_PREFIX "event`
WHERE `roll` LIKE '%i:" 
$bbuserinfo['userid'] . ";s:" strlen($bbuserinfo['userid']) . ":\"" $bbuserinfo['username'] . "\"%' LIMIT 0, 30"

That would return all events that a user was attending.

Note that the SQL matches the entire user information, as performing wildcard LIKE's are never good because if we just did the userid we might match events that had the same number of attendees as the user id... or worse, if we compared on username, there may be a user named Rob and one named RobSmith and we'd match that.

So that's the SQL... and it works... so it shouldn't be too hard to write the rest :)

Please, when writing the rest, bear in mind whether the event is publicly viewable, i.e. that the calendar that it appears on is viewable. ;)

Benj 10-04-2004 10:03 AM

legend

MWetherspoon 10-04-2004 02:10 PM

Question - does anyone know of any easy way to update the mod so that when a user signs up for an event, as opposed to just listing their post name, it actually uses their name as a link to their public profile?

For me that would be a handy feature as even organizers could easily pull the user info from the custom fields in the user profile that I have enabled on the site.

I'm going to play with it and see what I can come up with.

Thanks in advance!

- Mark

SamirDarji 10-04-2004 02:33 PM

Quote:

Originally Posted by buro9
Several people have asked, and I had already sent them to one person, so I'll put them here, and if the hack author objects I'll remove them.

This is what I sent to the first person that asked:

In calendar.php the block of code you would have adjusted following:
PHP Code:

if (($show['candeleteevent'] OR $show['canmoveevent'] OR $show['caneditevent']) AND !$show['holiday']) 

I have this:
PHP Code:

    // HACK : START : ATTEND
    //if (($show['candeleteevent'] OR $show['canmoveevent'] OR $show['caneditevent']) AND !$show['holiday'])
    //{
    //  $show['eventoptions'] = true;
    //}
    //
    //eval ('$caldaybits .= "' . fetch_template('calendar_showeventsbit') . '";');

    
if (($show['candeleteevent'] OR $show['canmoveevent'] OR $show['caneditevent']) AND !$show['holiday']) {
      
$show['eventoptions'] = true;
    }

    if (
$eventinfo['useroll']) {
      
// Roll for this event
      
$show['userattending'] = false;
      if ((
$roll = @unserialize($eventinfo['roll'])) && is_array($roll)) {
        
uasort($roll"strnatcasecmp");
        if (
array_key_exists($bbuserinfo['userid'], $roll)) {
          
$show['userattending'] = true;
        }
        while (
$rollusername current($roll)) {
           
$rolluserid key($roll);
           eval(
'$rollbits .= "' fetch_template('calendar_rollbit') . '";');
           
next($roll);
        }
      } else {
        
$eventinfo['roll'] = "";
      }

      eval (
'$eventinfo[roll] = "' fetch_template('calendar_roll') . '";');
      
// End Roll
    
} else {
      
$eventinfo['roll'] = "";
    }

    eval (
'$caldaybits .= "' fetch_template('calendar_showeventsbit') . '";');
    
// HACK : END : ATTEND 

And then the calendar_rollbit becomes:
Code:

<li><a href="member.php?u=$rolluserid">$rollusername</a></li>
And the calendar_roll becomes:

Code:

<p><strong>People attending this event</strong>:</p>
<if condition="$rollbits">
<ul>
$rollbits
</ul>
<else />
<p><i>Nobody yet!</i></p>
</if>

<if condition="$bbuserinfo[userid] > 0">
<if condition="$show[userattending]">
        [<a href="calendar.php?$session[sessionurl]do=unattend&e=$eventinfo[eventid]">I will no longer be attending this event</a>]
<else />
        [<a href="calendar.php?$session[sessionurl]do=attend&e=$eventinfo[eventid]">I will be attending this event</a>]
</if>

</if>

Finally... find and correct the label title for the checkbox in the calendar_edit template... it should be:
Code:

<div><label for="cb_roll"><input type="checkbox" name="useroll" value="1" id="cb_roll" tabindex="3" $useroll />Allow users to specify that they will be attending this event.</label></div>
Some of that may not work in old versions of PHP, you'll have to try it and see :)

Here it is. This code doesn't include the duplicate member listing fix, so you'll have to implement that, but it's got everything else.

MWetherspoon 10-04-2004 02:57 PM

Thanks a ton SamirDarji - I had missed that note in the post by buro9 that he had added the link to the profile in the Roll Call hack!

Installed and working great!

Now to go back and fix the duplicate member fix!

SamirDarji 10-04-2004 03:23 PM

Yeah, I missed the fix to the unregistered user problem and spent a few good hours making the same fix. I would've hated to see you do the same.

buro9 10-04-2004 08:07 PM

Quote:

Originally Posted by SamirDarji
Yeah, I missed the fix to the unregistered user problem and spent a few good hours making the same fix. I would've hated to see you do the same.

vBulletin.org needs CVS so that all such fixes can be rolled in by anyone rather than this hunting around hack threads thing!

SamirDarji 10-04-2004 09:45 PM

What's CVS?

buro9 10-04-2004 10:10 PM

Quote:

Originally Posted by SamirDarji
What's CVS?

CVS = Concurrent Versioning System

It's used widely by software developers around the world to track and marge changes in code bases. It allows multiple developers to work on the same code, each one can see what the other has done, merge changes, view differences, etc.

SourceForge, Apache, Mozille... they all use CVS systems of some sort or other.

Microsoft use CVS systems, as does Sun, as does IBM... as does everyone.

They come in many shapes and sizes, the worst is probably Visual SourceSafe from MS, the good ones are Subversion, Perforce, Merant, WinCVS, etc.

Even Jelsoft use CVS, which is how you get those headers in the files saying the CVS file version ;)

I am just increasingly of the opinion that as a lot of the hacks evolve thanks to the contributions of many hackers, that if the author consented, that they could be made open to all to improve, and placed within a CVS system whereby all changes can get rolled into one package for end users.

Having a CVS system for hacks would prevent the need for you to search through this thread for improvements, bug-fixes, differences, etc... as you would just fetch the latest version from CVS and that would simply be the version that featured all contributions.

Benj 10-06-2004 09:58 AM

Quote:

Originally Posted by buro9
Here's the psuedo SQL:

PHP Code:

$query "SELECT `eventid` , `userid` , `event` , `title` , `allowsmilies` , `recurring` , `recuroption` , `calendarid` , `customfields` , `visible` , `dateline` , `utc` , `dateline_from` , `dateline_to` , `useroll` , `roll`
FROM `" 
TABLE_PREFIX "event`
WHERE `roll` LIKE '%i:" 
$bbuserinfo['userid'] . ";s:" strlen($bbuserinfo['userid']) . ":\"" $bbuserinfo['username'] . "\"%' LIMIT 0, 30"

That would return all events that a user was attending.

Note that the SQL matches the entire user information, as performing wildcard LIKE's are never good because if we just did the userid we might match events that had the same number of attendees as the user id... or worse, if we compared on username, there may be a user named Rob and one named RobSmith and we'd match that.

So that's the SQL... and it works... so it shouldn't be too hard to write the rest :)

Please, when writing the rest, bear in mind whether the event is publicly viewable, i.e. that the calendar that it appears on is viewable. ;)


sorry im lost is any1 looking at coding this

SamirDarji 10-06-2004 02:42 PM

I haven't had a chanced to do more than glance at it. We have the psuedocode for the sql, now we just need the supporting code that will end up in the php files as well as the html templates.

y2krazy 10-06-2004 03:42 PM

Quote:

Originally Posted by Pseudomizer
Sounds like a PHP problem of the post and get parameters of a HTML form. Do you have global variables on or off? This could cause this problem.

If you do not have them enabled and for security reasons, you should let them disabled, you can replace the variables with $_POST[variablenames] or $_GET[variablenames] and it should work.

Cheers,

Would be great if someone could clarify what Pseudo meant for me to do. I really would like to get this working, preferrably within the next 2 weeks! Thanks! :cry:

Original post:
Quote:

Originally Posted by y2krazy
For every event in my calendar, when I click on [I will be attending this event.], it send me to a forum error message that states the following:

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

This is for every event, they do not show up twice, and this is on vB 3.0.3. I've check the db via phpMyAdmin and the events exist in the correct table and rows, but they just don't seem to be called correctly with the [I will be attending this event.] link. Any help would be greatly appreciated!

It's been over a month and I still have no help from anyone. Would someone please help me figure out what is going wrong?! Thanks.

D|ver 10-13-2004 04:28 PM

is it possible to show the number of attendees of an event next to the event titel on forumhome where the next events are shown?

can somebody help me with this?

that would be really great :)

SamirDarji 10-13-2004 04:57 PM

I don't have time to code it, but the logic would be to count the attendees as it lists them, put that count into a variable that gets passed to the template and then modify the template to use the variable. Should be fairly easy. Someone code this. :D

attroll 10-16-2004 03:49 AM

buro9

Is there any chance we can get you to post a zipped file or start a new thread with all that updates and instuctions that have taken place since the owner of this mod has posted it? Since he does not seem to participate in this thread anymore.

buro9 10-16-2004 08:02 AM

Quote:

Originally Posted by attroll
buro9

Is there any chance we can get you to post a zipped file or start a new thread with all that updates and instuctions that have taken place since the owner of this mod has posted it? Since he does not seem to participate in this thread anymore.

I don't know if I'm allowed to do that.

Can a mod advise whether this would be alright?

In the case where a hack is abandoned and unsupported by it's creator, is it ok for the wider community to take ownership of it and fix outstanding bugs and issues with it and re-package it in a new thread for new users to benefit from?

I wouldn't want to help you all in this way if all it results in is my getting a kick from the moderators... afterall, it works fine on my board ;)

I can't report my own post of course, but I'll report yours so that someone reads this and can advise on whether we would be allowed to do this.

SamirDarji 10-16-2004 08:10 AM

I think this would be a good idea if the project is abandoned. I'd definitely like to be one of the coders for the revised version since my site so heavily relies on this hack. Any improvements and additions benefit me greatly and I'm willing to do my part to give back to the community.

bendigo-tech 10-16-2004 12:06 PM

Excellent hack. I have just installed it.

Thanks a lot. :)

Benj 10-20-2004 10:38 AM

Quote:

Originally Posted by SamirDarji
I think this would be a good idea if the project is abandoned. I'd definitely like to be one of the coders for the revised version since my site so heavily relies on this hack. Any improvements and additions benefit me greatly and I'm willing to do my part to give back to the community.

what revised! yeah i kinda agree and like you my site relies on this hack and the feature i wanted developed (events in profile) so i take it this isnt going to be done soon then :(

SamirDarji 10-20-2004 04:45 PM

I would work on it, but I've got work on my site I have to do first. I like the feature too, but it's not a priority at the moment. The SQL query is a good chunk of the work. Now the appropriate php files and templates that generate the profile need to be changed and tested.

Benj 10-25-2004 09:10 AM

what site do you use these on if you dont mind me asking

SamirDarji 10-25-2004 04:22 PM

My new site url is www.huntsvillecarscene.com, but I haven't start putting it out there as a replacement to hsv.streetracing.org since the old site still has more content.

Sanni 10-26-2004 04:30 AM

Quote:

Originally Posted by D|ver
is it possible to show the number of attendees of an event next to the event titel on forumhome where the next events are shown?

can somebody help me with this?

that would be really great :)

I got this working by modifying calendar.php

find
Code:

if ($eventinfo['useroll']) {
  unset($rollbits);
               
                        // Roll for this event
                        $show['userattending'] = false;
                        if (($roll = @unserialize($eventinfo['roll'])) && is_array($roll))
                        {
                                if (array_key_exists($bbuserinfo['userid'], $roll))
                                {
                                        $show['userattending'] = true;
                                }

                                foreach ($roll as $rollusername)
                                {
                                        eval ('$rollbits .= "' . fetch_template('calendar_rollbit') . '";');
                                }
                        }

and replace with:

Code:

        $rollcount=0;
if ($eventinfo['useroll']) {
  unset($rollbits);
               
                        // Roll for this event
                        $show['userattending'] = false;
                        if (($roll = @unserialize($eventinfo['roll'])) && is_array($roll))
                        {
                                if (array_key_exists($bbuserinfo['userid'], $roll))
                                {
                                        $show['userattending'] = true;
                                }

                                foreach ($roll as $rollusername)
                                {
                                        eval ('$rollbits .= "' . fetch_template('calendar_rollbit') . '";');
                                        $rollcount++;
                                }
                        }

then edit calendar_roll template and add

Code:

There are currently $rollcount Participants enrolled in this event.
to whereever you want it to be displayed.

D|ver 10-26-2004 01:25 PM

wow thanks so much it is working without any problems :)

but how can i now insert the $rollcount number in the forumhome, where the upcoming events are listed.
i want to have this number right after each event, if possible

i tried it by adding the variable into the forumhome_event template, but without success...
can somebody help?

SamirDarji 10-26-2004 09:01 PM

To be able to use that variable outside the calendar templates, you'll have to find a way to execute the php code that generates the information behind $rollcount. If not, the variable will be empty. I'd look into the forum.php file and see how the upcoming events are generated. You'll probably have to add a lot since it doesn't even do the roll count there at all.

SamirDarji 10-27-2004 07:05 PM

I've run across something I'd find useful. After an event has passed, wouldn't it be nice if the "I will be attending/not be attending" option goes away. So people can't change the list after an event and you can see who planned on coming.

buro9 10-29-2004 09:46 AM

Quote:

Originally Posted by SamirDarji
I've run across something I'd find useful. After an event has passed, wouldn't it be nice if the "I will be attending/not be attending" option goes away. So people can't change the list after an event and you can see who planned on coming.

Or change the text to "I attended" rather than "I will be attending"?

As that will then keep a list of who was where, etc... and I think should still be editable as if someone cancelled last minute they could remove themselves... just as those who might attend last minute could add themselves :)


All times are GMT. The time now is 04:17 AM.

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

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

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

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