Thursday, 28 September 2023

Past Activities

Diary of Activities

runSnippet("getchildid", array("parent"=>$parentid)); $ids = substr($ids,0,-1); $ids = explode(",",$ids); $children = $modx->getCollection('modResource', array( 'id:IN' => $ids ,'parent:=' => $parentid )); // get children ids array $ids2 = $modx->runSnippet("getchildid", array("parent"=>$parentid2)); $ids2 = substr($ids2,0,-1); $ids2 = explode(",",$ids2); $children2 = $modx->getCollection('modResource', array( 'id:IN' => $ids2 ,'parent:=' => $parentid2 )); // get children ids array $ids3 = $modx->runSnippet("getchildid", array("parent"=>$parentid3)); $ids3 = substr($ids3,0,-1); $ids3 = explode(",",$ids3); $children3 = $modx->getCollection('modResource', array( 'id:IN' => $ids3 ,'parent:=' => $parentid3 )); // get children id array if (!empty($parentid2) && !empty($parentid3)){ $parentid= $parentid.",".$parentid2.",".$parentid3; }else if (!empty($parentid2)){ $parentid= $parentid.",".$parentid2; }else if (!empty($parentid3)){ $parentid= $parentid.",".$parentid3; } $mergeChildren = array_merge((array)$children, (array)$children2,(array)$children3); //$childnum = count($children); $gettodayDate = (date("Y")."-".date("m")."-".date("d")); $gettodayYear = (date("Y")); $geteventdate =array(); $geteventid = array(); $getmonthlist = array(); $geteventlist = array(); $geteventlist1 = array(); $getyear = array(); // insert date array from each children id foreach ($mergeChildren as $value) { $published = $value->get('published'); $getid = $value->get('id'); $getmonthnum = date('Y-m-d', strtotime($value->getTVValue('startDate'))); $getenddate = date('Y-m-d', strtotime($value->getTVValue('endDate'))); $date_diff = floor(strtotime($getenddate)-strtotime($gettodayDate)) / 86400; if (empty($published)||$published=="0"||$date_diff>=0){ }else{ echo ""; array_push($geteventdate,$getenddate); array_push($geteventid,$getid); } } $max=count($geteventdate); for ($i=0; $i<$max; $i++) { $geteventlist[$geteventid[$i]] = $geteventdate[$i]; } arsort($geteventlist); $firsthitem = 0; echo "
return; 1