Skip to content
80 changes: 80 additions & 0 deletions meetup-groups-list.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?php
global $events;
global $_meetup_widget;

echo '<ul class="meetup_list">';
$count = 0;
foreach ( $events as $event ) {

if (++$count > $limit)
break;

if ( preg_match('/[a-zA-Z]/', $highlight_group ) )
$this_group = $event->group->urlname;
else
$this_group = $event->group->id;

if ($this_group == $highlight_group)
{
echo '<li class="highlight">';
}
else
{
echo '<li>';
}

if ($highlight_first && $count == 1)
{
if ( isset( $event->time ) ) {
$date = date( $date_format, intval( $event->time/1000 + $event->utc_offset/1000 ) );
} else {
$date = apply_filters( 'vsm_no_date_text', '' );
}
$event_url = $event->event_url;
$event_name = strip_tags($event->name);
$event_description = wp_trim_words( strip_tags( $event->description ), 20 );
$event_rsvp = absint( $event->yes_rsvp_count ) .' '. _n( $_meetup_widget[get_locale()]['attendee'], $_meetup_widget[get_locale()]['attendees'], $event->yes_rsvp_count );
echo '
<h3 class="event-title"><a href="' . $event_url . '">' . $event_name . '</a></h3>';
if ( ! empty( $date ) )
{
echo '<p class="event-date">' . $date , '</p>';
}
echo '
<p class="event-summary">' . $event_description . '</p>
<p class="event-rsvp"><span class="rsvp-count">' . $event_rsvp . '</span> ';
$rsvp = $_meetup_widget[get_locale()]['rsvp'];
if ( !empty($options['vs_meetup_key']) && !empty($options['vs_meetup_secret']) && class_exists('OAuth')) {
echo "<span class='rsvp-add'><a href='#' onclick='javascript:window.open(\"{$event->callback_url}&event=$id\",\"authenticate\",\"width=400,height=600\");'>$rsvp</a></span>";
} else {
echo "<span class='rsvp-add'><a href='{$event->event_url}'>$rsvp</a></span>";
}
echo '</p>';

$location = $_meetup_widget[get_locale()]['location'];
if ( isset( $event->venue ) ) {
$venue = $event->venue->name.' '.$event->venue->address_1 . ', ' . $event->venue->city . ', ' . $event->venue->state;
echo "<p class='event-location'>$location: <a href='http://maps.google.com/maps?q=$venue+%28".$event->venue->name."%29&z=17'>$venue</a></p>";
} else {
$tba = $_meetup_widget[get_locale()]['tba'];
$venue = apply_filters( 'vsm_no_location_text', "$location: $tba" );
if ( ! empty( $venue ) ){
echo "<p class='event-location'>$venue</p>";
}
}
}
else
{
printf(
'<a href="%1$s">%2$s</a>; %3$s',
esc_url($event->event_url),
strip_tags($event->name),
date($date_format, intval($event->time / 1000 + $event->utc_offset / 1000))
);
}
echo '</li>';
}

echo '<li class="desc_phpsp"><span></span> Eventos do PHPSP.</li>';
echo '<li class="desc_partner"><span></span> Eventos de parceiros.</li>';
echo '</ul>';
16 changes: 10 additions & 6 deletions meetup-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
global $events;

echo '<ul class="meetup_list">';
$count = 0;
foreach ( $events as $event ) {
printf(
'<li><a href="%1$s">%2$s</a>; %3$s</li>',
esc_url( $event->event_url ),
strip_tags( $event->name ),
date( 'M d, g:ia', intval( $event->time/1000 + $event->utc_offset/1000 ) )
);
if ($hide_first && ++$count == 1)
continue;

printf(
'<li><a href="%1$s">%2$s</a>; %3$s</li>',
esc_url($event->event_url),
strip_tags($event->name),
date($date_format, intval($event->time / 1000 + $event->utc_offset / 1000))
);
}
echo '</ul>';
18 changes: 11 additions & 7 deletions meetup-single.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?php
global $event;
global $event;
global $_meetup_widget;
if ( isset( $event->time ) ) {
$date = date( 'F d, Y @ g:i a', intval( $event->time/1000 + $event->utc_offset/1000 ) );
$date = date( $date_format, intval( $event->time/1000 + $event->utc_offset/1000 ) );
} else {
$date = apply_filters( 'vsm_no_date_text', '' );
}
Expand All @@ -12,21 +13,24 @@
<p class="event-date"><?php echo $date; ?></p>
<?php endif; ?>
<p class="event-summary"><?php echo wp_trim_words( strip_tags( $event->description ), 20 ); ?></p>
<p class="event-rsvp"><span class="rsvp-count"><?php echo absint( $event->yes_rsvp_count ) .' '. _n( 'attendee', 'attendees', $event->yes_rsvp_count ); ?></span>
<p class="event-rsvp"><span class="rsvp-count"><?php echo absint( $event->yes_rsvp_count ) .' '. _n( $_meetup_widget[get_locale()]['attendee'], $_meetup_widget[get_locale()]['attendees'], $event->yes_rsvp_count ); ?></span>

<?php
$rsvp = $_meetup_widget[get_locale()]['rsvp'];
if ( !empty($options['vs_meetup_key']) && !empty($options['vs_meetup_secret']) && class_exists('OAuth')) {
echo "<span class='rsvp-add'><a href='#' onclick='javascript:window.open(\"{$event->callback_url}&event=$id\",\"authenticate\",\"width=400,height=600\");'>RSVP?</a></span>";
echo "<span class='rsvp-add'><a href='#' onclick='javascript:window.open(\"{$event->callback_url}&event=$id\",\"authenticate\",\"width=400,height=600\");'>$rsvp</a></span>";
} else {
echo '<span class="rsvp-add"><a href="'.$event->event_url.'">RSVP?</a></span>';
echo "<span class='rsvp-add'><a href='{$event->event_url}'>$rsvp</a></span>";
} ?></p>

<?php
$location = $_meetup_widget[get_locale()]['location'];
if ( isset( $event->venue ) ) {
$venue = $event->venue->name.' '.$event->venue->address_1 . ', ' . $event->venue->city . ', ' . $event->venue->state;
echo "<p class='event-location'>Location: <a href='http://maps.google.com/maps?q=$venue+%28".$event->venue->name."%29&z=17'>$venue</a></p>";
echo "<p class='event-location'>$location: <a href='http://maps.google.com/maps?q=$venue+%28".$event->venue->name."%29&z=17'>$venue</a></p>";
} else {
$venue = apply_filters( 'vsm_no_location_text', "Location: TBA" );
$tba = $_meetup_widget[get_locale()]['tba'];
$venue = apply_filters( 'vsm_no_location_text', "$location: $tba" );
if ( ! empty( $venue ) ){
echo "<p class='event-location'>$venue</p>";
}
Expand Down
17 changes: 14 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== Meetup Widgets ===
Contributors: ryelle
Contributors: ryelle, jpjoao
Donate link: https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=7OzM1TYh271yVnb30fI26d7BkYaEcnM9pmQnT42lWbEm7BsLORp4G_2UTRW&dispatch=5885d80a13c0db1f8e263663d3faee8d4026841ac68a446f69dad17fb2afeca3
Tags: meetup, meetups, meetup.com, widget
Requires at least: 3.3
Tested up to: 3.8
Stable tag: 2.2.0
Tested up to: 4.2.2
Stable tag: 2.3.2

Adds widgets displaying information from a meetup.com group.

Expand Down Expand Up @@ -46,6 +46,17 @@ If your meetup group is set up at meetup.com/`[group URL name]`, the part after

== Upgrade Notice ==

= 2.3.2 =
* Fix plugin version and notify fork.

= 2.3.1 =
* Added option to use multiple mettups IDs as source (comma separated)

= 2.3 =
* Added option to choose date format when outputing events
* Added option to hide first item in the list
* Added widget for next single event

= 2.2 =
* Fix bug where widgets could only be used once per page, due to `load_template` calling `require_once` by default.
* Add clases to `<p>`s in meetup-single template, so you can style the title/date/summary/location without jumping through CSS hoops.
Expand Down
39 changes: 31 additions & 8 deletions vs_meetup.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<?php
/*
* Plugin Name: Meetup Widgets
* Plugin Name: Meetup Widgets (forked for PHPSP)
* Description: Add widgets displaying information from Meetup.com
* Version: 2.2.0
* Author: Kelly Dwan
* Author URI: http://redradar.net
* Plugin URI: http://redradar.net/category/plugins/meetup-widgets/
* Version: 2.3.2
* Original Author: Kelly Dwan
* Original Author URI: http://redradar.net
* Original Plugin URI: http://redradar.net/category/plugins/meetup-widgets/
* Author: Joao Paulo
* Author URI: https://github.com/jpjoao/
* Plugin URI: https://github.com/jpjoao/Meetup-Widgets/
* License: GPL2
* Date: 5.30.2013
* Date: 2015-07-02
*/

/**
Expand All @@ -32,7 +35,7 @@ public function __construct($var = '') {
$this->key = $options['vs_meetup_key'];
$this->secret = $options['vs_meetup_secret'];
$this->api_key = $options['vs_meetup_api_key'];

register_activation_hook( __FILE__, array ($this, 'install' ) );

// TODO deal with translations.
Expand Down Expand Up @@ -111,7 +114,27 @@ function meetup_widgets_start() {
add_action('widgets_init', create_function('', 'return register_widget("VsMeetSingleWidget");'));
add_action('widgets_init', create_function('', 'return register_widget("VsMeetListWidget");'));
add_action('widgets_init', create_function('', 'return register_widget("VsMeetUserListWidget");'));
add_action('widgets_init', create_function('', 'return register_widget("VsMeetNextSingleWidget");'));
add_action('widgets_init', create_function('', 'return register_widget("VsMeetGroupsListWidget");'));


function vsmw_need_oauth() {
echo '<div id="message" class="updated"><p>Some functionality of <strong>Meetup Login</strong> requires <strong><a href="http://php.net/manual/en/book.oauth.php">OAuth</a></strong>, which is not detected on this server. RSVPing from this site is disabled - RSVP links will instead bring you to the event on Meetup.com.</p></div>';
}
}

//Translations
global $_meetup_widget;
$_meetup_widget['en_US'] = array(
'attendee' => 'attendee',
'attendees' => 'attendees',
'rsvp' => 'RSVP?',
'location' => 'Location',
'tba' => 'TBA',
);
$_meetup_widget['pt_BR'] = array(
'attendee' => 'confirmado',
'attendees' => 'confirmados',
'rsvp' => 'RSVP?',
'location' => 'Local',
'tba' => 'a definir',
);
Loading