TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 824
  • Total: 824

Events sign-up on Calendar

Started by jayemsee283, November 19, 2007, 07:33:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ken.

Just signed up and gave it a try JP... this is looking good.  :up:
On one of my sites this would be useful often... maybe more that once a month.
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

JPDeni

Well, at this point, it's a mod that's available from SMF. I'm writing some block code that will list what events the user has signed up for. I just needed data to play with.

I appreciate the help!!

omapie

I just signed up... looks cool.. very useful potentially. ;)

Keep us informed. On my high school reunion website, I'm thinking this could be very useful. TY!  :up:

Lori

JPDeni

#33
Thanks much!! There's another event (even cooler than the first ;) ) that you can sign up for. And then you can see the list of events that you've signed up for in the right panel.

This goes into a php block:


global $ID_MEMBER, $db_prefix, $scripturl;

$today = date('Y-m-d');
$request = db_query("
  SELECT ID_TOPIC, title, startDate, endDate
  FROM {$db_prefix}calendar
  WHERE FIND_IN_SET($ID_MEMBER, attendees)
  AND startDate >= $today
  ORDER BY startDate", __FILE__, __LINE__);

if (mysql_num_rows($request) == 0)
  echo "You haven't signed up for any events yet.";
else {
  while ($row = mysql_fetch_row($request)) {
    echo '<a href="' . $scripturl . '?topic=' . $row[0] . '.0">' . $row[1] . '</a> ' . date('F j',strtotime($row[2]));
    if  ($row[2] < $row[3])
      echo ' - ' . date('F j',strtotime($row[3]));
    echo '<br>';
  }
}


You might want to play around with the html for this so the display is how you want.

In order to see it in action, you'll need to register at http://www.jpdeni.com/snippets and check that you are going to attend both events listed in the General Discussion board.

Edited to add:

I've moved things around a bit. If you want to see the block, go to http://www.jpdeni.com/snippets/index.php?page=7  after you have logged in. It makes no sense to allow guests to see the block, because it only lists information for the logged-in user.

confuzed

wow!  that's really great JPDeni.  I just tried the block on my site and it works brilliantly.  Thanks for working that out and so quickly

*confused is very excited now*

I love this attendee mod but I thought it would also be handy to be able to see your own events all in one place.

This is it!   

JPDeni

I'm glad you like it. :-) It wasn't hard to do once I figured out how the info was stored in the database.

confuzed

uh oh, I don't think it's working properly though, it seems to be showing the same events for every member regardless of whether they are attending or not

JPDeni

#37
Hmmmmm. I don't get that. I only have two events defined, but when I have a user sign up for one, only that one is displayed in the block. If a user hasn't signed up for any, it's not showing anything, which I should fix.

Now, if there's nothing returned from the search, it says that the user hasn't signed up for anything yet.

confuzed

I tried the code again but it is still showing a list of all events whether the user is attending or not.

JPDeni

I'm not sure what to tell you. Did you go to my "snippets" site to test it out?

This website is proudly hosted on Crocweb Cloud Website Hosting.