// Check that we're being called by WordPress.
if (!defined('ABSPATH')) {
- die("Please do not call this code directly!");
+ header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+ die();
}
require_once GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH.'/data/dataFeedImport.php';
// Check that we're being called by WordPress.
if (!defined('ABSPATH')) {
- die("Please do not call this code directly!");
+ header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+ die();
}
/*
* Set standard defined parameters
*/
+// Check that we're being called by WordPress.
+if (!defined('ABSPATH')) {
+ header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+ die();
+}
+
// NOTE: Plugin & Database versions are defined in "/glm-member-db.php".
define('GLM_MEMBERS_EVENTS_PLUGIN_NAME', 'Gaslight Media Members Database Events (events)');
* License: GPL2
*/
-
/**
* Gaslight Media Members Database Events Add-On
* Index
* @version 1.6.57
*/
+// Check that we're being called by WordPress.
+if (!defined('ABSPATH')) {
+ header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+ die();
+}
+
/*
* Plugin and Database Versions
*
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-// Check that we're being called by WordPress.
-if (!defined('ABSPATH')) {
- die("Please do not call this code directly!");
-}
-
/*
* Some initial setup and tests
*/
2
);
+// Add hook to return event base data and all times for an event.
add_filter( 'glm-member-db-events-get-events', function( $output ){
$events = $this->wpdb->get_results(
"SELECT E.id,E.name,T1.start_time as start
FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "events E,
" . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times T1
WHERE E.status = 10
- AND T1.event = E.id AND T1.start_time IN (SELECT MIN(start_time)
- FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times
- WHERE event = E.id)
+ AND T1.event = E.id AND T1.start_time IN (
+ SELECT MIN(start_time)
+ FROM " . GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX . "times
+ WHERE event = E.id
+ )
ORDER BY E.name",
ARRAY_A
);
return $events;
} );
+
+// Add hook to return base event data for a specific event ID
+add_filter( 'glm-member-db-events-get-event', function( $eventID ){
+
+ // Check for positive integer event ID
+ $eventId = ($eventID-0);
+ if ($eventId == 0) {
+ return $eventID;
+ }
+
+ // Call dedicated model to get event base data
+ require_once GLM_MEMBERS_EVENTS_PLUGIN_CLASS_PATH.'/data/dataEvents.php';
+ $EventData = new GlmDataEvents($this->wpdb, $this->config);
+ $eventData = $EventData->getEntry($eventId);
+
+ // If we got good event base data, return that
+ if ($eventData) {
+ return $eventData;
+ }
+
+ // Otherwise pass on the event ID
+ return $eventId;
+
+} );
+
+
add_filter(
'glm-member-db-dashboard-member-widgets',
function ( $member = null ) {
);
+
/*
* Provide basic event data by Lat/Lon search for use as map items.
*
// Check that we're being called by WordPress.
if (!defined('ABSPATH')) {
- die("Please do not call this code directly!");
+ header("Location: http://".$_SERVER['SERVER_NAME']."/error/404.html");
+ die();
}
//if uninstall not called from WordPress exit
{$e.lastDate}
</td>
<td>
- <a class="button button-secondary glm-button-small glm-right" href="{$thisUrl}?page=glm-members-admin-menu-events-list&glm_action=list&member={$memberID}&option=clone&event={$e.id}">Clone</a>
+ <a class="button button-secondary glm-button-small" href="{$thisUrl}?page=glm-members-admin-menu-events-list&glm_action=list&member={$memberID}&option=clone&event={$e.id}">Clone</a>
</td>
<td>
- <a href="{$siteBaseUrl}event-detail/{$e.name_slug}/" target="_blank">View Event</a>
+ <a class="button button-secondary glm-button-small" href="{$siteBaseUrl}event-detail/{$e.name_slug}/" target="_blank">View Event</a>
+ <!-- Filter to pick up buttons from other add-ons - $e_link expects array( 'title' => 'some title', 'url' => 'some url' ) -->
+ {$e_link = apply_filters('glm_members_add_link_to_event_list_entry', $e.id)}
+ {if $e_link}
+ <a class="button button-secondary glm-button-small" href="{$e_link.url|escape:'string'}">{$e_link.title}</a>
+ {/if}
</td>
</tr>
{/foreach}