
<?php
$where ="createdby='".$modx->documentObject['createdby']."' AND isfolder='1' AND parent!='0' AND published='1'";
$result = $modx->db->makeArray($modx->db->select("id,pagetitle",$modx->getFullTableName('site_content'),$where,''));
if( $result ){
$output ='The author of this article has written articles in the following categories: ';
for( $x=0; $x<count($result); $x++ ) {
$output .= '<a href="[~'.$result[$x]['id'].'~]">'.$result[$x]['pagetitle'].'</a>'.($x < count($result)-1 ? ', ' : '');
}
return $output;
}
?>
Just another EVO sample...
<?php $where ="createdby='".$modx->documentObject['createdby']."' AND isfolder='1' AND parent!='0' AND published='1'"; $result = $modx->db->makeArray($modx->db->select("id,pagetitle",$modx->getFullTableName('site_content'),$where,'')); if( $result ){ $output ='The author of this article has written articles in the following categories: '; for( $x=0; $x<count($result); $x++ ) { $output .= '<a href="[~'.$result[$x]['id'].'~]">'.$result[$x]['pagetitle'].'</a>'.($x < count($result)-1 ? ', ' : ''); } return $output; } ?>
$c = $modx->newQuery('modResource');
$c->where(array(
'createdby' => $modx->resource->get('createdby'),
'isfolder' => true,
'parent:!=' => 0,
'published' => true,
));
$c->select(array('id','pagetitle'));
$resources = $modx->getCollection('modResource',$c);
$o = '';
if (!empty($resources)) {
$o = array();
foreach ($resources as $resource) {
$o[] = '<a href="'.$modx->makeUrl($resource->get('id')).'">'.$resource->get('pagetitle').'</a>'."\n";
}
$o = 'The author of this article has written articles in the following categories: '.implode(',',$o);
}
return $o;
Do you need to include one more line:
$c->bindGraph('{"CreatedResources":{"Parent":{}}}');

<?php
$c = $modx->newQuery('modResource');
$c->select('modResource.*, Parent.pagetitle as category');
$c->where(array('Parent.parent != 0', 'CreatedResources.createdby ' => $modx->resource->get('createdby')));
$c->groupBy('Parent.pagetitle');
/* Check the query output */
$c->bindGraph('{"CreatedResources":{"Parent":{}}}');
$c->prepare();
echo $c->toSQL();
Quote from: TimGSBut to say that the flagship MODx product is on equal grounds (or inferior) to its older, aging sibling is a pretty ludicrous statement IMHO.
You are in a different situation from me though. I already know Evo well, and see no benefit in switching. Despite the above, I don’t think Revo’s bad (but I don’t see it as being better.)
Evo shouldn’t be regarded as a step backwards if its better for you (I’m not saying this is the case for yourself - only you can decide that one!).