PortalParts.com Site

 Forum Index > Geeklog > Misc Projects New Topic Post Reply
 glEventMgr - number of attendees?
 |  Printable Version
macwunder
 August 13 2007 13:01 PM (Read 8242 times)  
Forum Junior
Junior

Status: offline

Registered: 08/12/07
Posts: 8

Hi Blaine;

I purchased the event manager plugin last night and think the core functionality is exactly what I need. :banana: I do need a slight extension of functionality though...

How difficult would it be to add a number of attendees field per registered person, defaulting to one (1)? I plan to use this on my daughter's wedding site to collect RSVP info for their reception and really need to see a number of attendees for each family represented.

I also noticed that the maximum number of registrations allowed is 127. How can I increase that?

Thanks in advance!
Jeff


 
Profile Email PM
Quote
macwunder
 August 13 2007 17:14 PM  
Forum Junior
Junior

Status: offline

Registered: 08/12/07
Posts: 8

Quote by: macwunder

I also noticed that the maximum number of registrations allowed is 127. How can I increase that?


Well, made the data field a unsigned tinyint for a maximum of 255, That may be enough without going to a smallint. Still would like to know what would be involved in adding the additional field functionality.

Thanks;
Jeff


 
Profile Email PM
Quote
macwunder
 August 14 2007 22:03 PM  
Forum Junior
Junior

Status: offline

Registered: 08/12/07
Posts: 8

Well, silence forces me to learn... :D

Made pretty good progress. I added a tinyint (unsigned) field to the attendees table and added display and insert functionality to the admin section (100% complete, # attending defaults to 1):


Clicking 'Register' gives us this (with the nifty total footer!):



Attendees from the user's perspective is working, too (except the register me link):



I've also modified the registration link to display this form in event detail:



Problem is, registration/index.php won't take it. Here' the register link form:

PHP Formatted Code
$registrationlink = '<form name="form1" action="' .$_CONF['site_url']. '/registration/index.php" method="post">';
$registrationlink .= '<input type="hidden" name="op" value="register">';
$registrationlink .= '<input type="hidden" name="eventid" value="' .$eid. '">';
$registrationlink .= '<input type="hidden" name="uid" value="' .$_USER['uid']. '">';
$registrationlink .= '# attending <input type="text" size="2" name="quantity" value="1"><input type="submit" value="Register"></form>';

And the modified register case in registration/index.php:
PHP Formatted Code
case "register" :
        $uid = COM_ApplyFilter($_POST['uid'], true);
        $eid = COM_ApplyFilter($_POST['eventid'], true);
        $qty = COM_ApplyFilter($_POST['quantity'], true);
        $regcount = DB_count($_TABLES['reg_attendees'],"eid='$eid'");
        $now = time();
        $maxusers = DB_getItem($_TABLES['reg_events'],"maxusers","eid='{$eid}'");
        if (($eid > 0 and $uid > 1) AND DB_count($_TABLES['reg_attendees'],array('uid','eid'), array($uid,$eid)) == 0 ) {
            if ($maxusers == 0 OR DB_count($_TABLES['reg_attendees'],"eid", $eid) < DB_getItem($_TABLES['reg_events'],"maxusers","eid='{$eid}'")) {
                DB_query("INSERT INTO {$_TABLES['reg_attendees']} (eid,uid,registered,quantity) VALUES ('{$eid}', '{$uid}', '{$now}', '{$qty}' )");
            }
        }
        echo COM_refresh("{$eventdetailsURL}?eid=$eid");
        exit;

Any ideas? :doh: I promise I'll share with you! :lol:

Jeff


 
Profile Email PM
Quote
macwunder
 August 15 2007 22:51 PM  
Forum Junior
Junior

Status: offline

Registered: 08/12/07
Posts: 8

Okay, so COM_ApplyFilter was blowing away the parameters going from one script to the other... besides the fact that eventid isn't numeric.

My functionality is complete with the exception of displaying and comparing max attendees to the actual sum of the values in the new quantity field. Maybe you can help me with that.

I also decided to make the quantity inputs to be a drop down menu (simple 1-10) instead to avoid having to validate.

And, by the way... Thanks for making this available! It's really nice. :shakehands:

Jeff


 
Profile Email PM
Quote
Dazzy
 August 16 2007 04:46 AM  
Forum Big Cheese
Big Cheese

Status: offline

Registered: 08/17/03
Posts: 191

Just so you know Blaine is on Holidays and thats why he hasnt replied to this.


Dazzy test
 
Profile Email Website PM
Quote
Content generated in: 0.31 seconds
New Topic Post Reply



 All times are CDT. The time is now 11:23 PM.
Normal Topic Normal Topic
Locked Topic Locked Topic
Sticky Topic Sticky Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content