Forum Activity for @madc

MAD
@madc
02/18/14 01:02:10AM
600 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

Thats a great idea @SteveX.
I will look into that shortly but I think thats the way we will go. Cheers for that :)

Just an update also, The module never cleared any info on my mirrored site that i can see.
Although it says 3 deleted and not sure why it's reading the year as 1969??

This is the log

18 Feb 2014 02:42:18AM xxx.xxx.xxx.xxx daily_maintenance completed
18 Feb 2014 02:42:18AM xxx.xxx.xxx.xxx [system]: deleted 2 trace items older than 7 days
18 Feb 2014 02:42:18AM xxx.xxx.xxx.xxx [system]: 3 past jrEvent items deleted
18 Feb 2014 02:42:18AM xxx.xxx.xxx.xxx [system]: Event 31 Dec 1969 - will be deleted
18 Feb 2014 02:42:18AM xxx.xxx.xxx.xxx [system]: Event 31 Dec 1969 - will be deleted
18 Feb 2014 02:42:18AM xxx.xxx.xxx.xxx [system]: Event 31 Dec 1969 - will be deleted
18 Feb 2014 02:42:18AM xxx.xxx.xxx.xxx [system]: successfully updated chart positions for 95 DataStore fields
18 Feb 2014 02:42:18AM xxx.xxx.xxx.xxx daily_maintenance started

I compared a before and after of the jrevents table in the database and they are identical so it looks like nothing got removed

All data still shows on Concert pages still as well as profile events.
And according to that it has deleted 3 yet there are 5 to delete right now dating from dec 2013 to 10th jan 2014
Compared another page I had open from yesterday and they are the same

You can see them here http://final.punkbp.com/concerts
I can't understand still why JR lists past events in the Upcoming events tab by default.
That couldn't be right is it?
MAD
@madc
02/17/14 07:33:20PM
600 posts

Aparna Module and required fields


Design and Skin Customization

It's cool. It only happened on that one account. If it happens again I will report it.
Cheers mate
MAD
@madc
02/17/14 06:32:08PM
600 posts

Aparna Module and required fields


Design and Skin Customization

Not really sure how it was done @michael
We had an artist sign up as we sent a message to all existing artists to rejoin at jr.punkbp.com
I noticed one artist that his profile page was jr.punkbp.com/----
Any menu links were like jr.punkbp.com/----/audio
Their name wasn't displaying under Newest artists but their image etc was
So I opened the form in his profile and the Name area was blank
As soon as I put the name in and saved it it was all ok
So unfortunately I can't give you any steps.
I have no idea how they saved the profile with no name.
MAD
@madc
02/17/14 05:35:51PM
600 posts

Aparna Module and required fields


Design and Skin Customization

Thanks @michael. Just curious how the artists managed to save his profile with no name.
Hence the testing I did to find that issue.
I will look into it further
MAD
@madc
02/17/14 07:39:49AM
600 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

Yep, It will redirect to ONE page saying , Hmmmm.... Gig is done . Click here for current gigs?
The amount of GB's of image uploads etc that we have or are expecting in the events makes the server bloated with stuff we really don't need unless we get an amazon account with unlimited space....that aint gonna happen.
We are a promotion site not a storage holder for old stuff.
A Redirect page is the only option in that case or we redirect to the bands page.

We aren't myspace....did I say that out loud?

Also anyone that links to it should know ( From past experience ) that if it's over it is dead.
Not up to us to worry about the people linking in.

BTW I would probably change it to a month before it deletes.
Only prob is that they come down in date order so old ones show first.
Unless I move them daily the old ones will still show first which is annoying as that is hard coded in the core.
Should be showing UPCOMING events in desc order from todays date not old events that are done.
MAD
@madc
02/17/14 07:21:23AM
600 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

paul:
Initially I'd debug it by commenting out the actual delete call and writing event info to the activity log, just to be sure that it will delete the correct events -
//                jrCore_db_delete_item('jrEvent',$rt['_item_id']);
You already did in your code lol
We have a testing domain buddy so alls good
I will run it without the comments and see how it goes
Hopefully all good!!
MAD
@madc
02/17/14 03:29:37AM
600 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

Ok I think I did it ok
I created a folder called prDeletePastEvents in the Modules folder and then added the include.php file and an empty index.php file ( no idea why ).

I pasted this in my include file

<?php

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

/** 
* meta 
*/ 
function prDeletePastEvents_meta() { 
$_tmp = array( 
'name' => 'Delete Past Events', 
'url' => 'deletepastevents', 
'version' => '1.0.0', 
'developer' => '@paul, ©' . strftime('%Y'), 
'description' => 'Listens for the "daily" event then deletes all jrEvent items that are past', 
'category' => 'PBP Custom Modules' 
); 
return $_tmp; 
} 

/** 
* init 
*/ 
function prDeletePastEvents_init() { 
jrCore_register_event_listener('jrCore','daily_maintenance','prDeletePastEvents_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 prDeletePastEvents_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; 
} 

Ran integrity check, cleared caches etc
In this code, Is it going to run once a day? ( which is why I don't see any changes )
As it has the daily_maintenance code in there?

So by tomorrow server time after 12am they should be cleared?
Or am I missing something?
MAD
@madc
02/17/14 02:39:01AM
600 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

@MAD© Wishes he knew smarty better
Be still good for other members I think to have a cutoff system that they can set to how long they want to keep them for.
I can see why some members would want to bloat there site for SEO purposes but we aren't interested in that.
MAD
@madc
02/17/14 02:29:30AM
600 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

How the hell do you do that sh#$ so fast? :D
MAD
@madc
02/17/14 01:36:12AM
600 posts

SOLVED - Hide or Delete past events


Design and Skin Customization

The latter would be perfect for us!
  32