Forum Activity for @paul

paul
@paul
02/17/14 06:51:39AM
4,335 posts

Marketplace Error on System


Installation and Configuration

Obvious first question - Is the Marketplace URL set correctly in Tools -> Marketplace Systems?
paul
@paul
02/17/14 06:50:02AM
4,335 posts

Jr Solo Skin Issue


Installation and Configuration

Have you configured the skin with the 'solo' profile etc?
paul
@paul
02/17/14 02:33:53AM
4,335 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

MAD©:How the hell do you do that sh#$ so fast? :D

Copy/Paste/Edit from other scraps of JR code ;-)
paul
@paul
02/17/14 02:10:04AM
4,335 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

OK - A module with just an include.php file something like this -

<?php
// make sure we are not being called directly
defined('APP_DIR') or exit();

/**
 * meta
 */
function xxDeletePastEvents_meta()
{
    $_tmp = array(
        'name'        => 'Delete Past Events',
        'url'         => 'deletepastevents',
        'version'     => '1.0.0',
        'developer'   => 'Whoever, &copy;' . strftime('%Y'),
        'description' => 'Listens for the "daily" event then deletes all jrEvent items that are past',
        'category'    => 'site'
    );
    return $_tmp;
}

/**
 * init
 */
function xxDeletePastEvents_init()
{
    jrCore_register_event_listener('jrCore','daily_maintenance','xxDeletePastEvents_listener');

    return true;
}

//---------------------------------------------------------
// EVENT LISTENERS
//---------------------------------------------------------

/**
 * @param $_data array incoming data array
 * @param $_user array current user info
 * @param $_conf array Global config
 * @param $_args array additional info about the module
 * @param $event string Event Trigger name
 * @return array
 */
function xxDeletePastEvents_listener($_data,$_user,$_conf,$_args,$event)
{
    // Is there a jrEvent module?
    if (jrCore_module_is_active('jrEvent')) {
        // Get all past events
        $time = time();
        $_s = array(
            "search" => array (
                "event_date < {$time}"
            ),
            "limit" => 1000,
            'exclude_jrProfile_keys' => true,
            'exclude_jrProfile_quota_keys' => true
        );
        $_rt = jrCore_db_search_items('jrEvent',$_s);
        if (isset($_rt) && is_array($_rt)) {
            // Delete them
            $ctr = 0;
            foreach ($_rt as $rt) {
                jrCore_db_delete_item('jrEvent',$rt['_item_id']);
                $ctr++;
            }
            jrCore_logger('INF',"{$ctr} past jrEvent items deleted");
        }
    }
    return $_data;
}

updated by @paul: 02/17/14 09:50:26AM
paul
@paul
02/17/14 01:03:54AM
4,335 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

Alternatively it would be a simple custom module to automatically delete past events.
paul
@paul
02/17/14 01:03:00AM
4,335 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

It probably won't be a module option, but I do think that all skin templates ought to only show future events by default, then maybe an option on the profile sites to show past events, so that artists can optionally keep their events as an archive.
I'll raise it with the team.
Thanks
paul
@paul
02/17/14 12:31:25AM
4,335 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

In every template that lists events, yes.
If there's already a search in the call, use search2 or search3.
Hth
Pa
paul
@paul
02/17/14 12:22:13AM
4,335 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

To stop them from being listed put the following search in the jrCore_list -
search="$smarty.now < $event_date"
  413