[[!getPage? &elementClass=`modSnippet` &element=`getResources` &parents=`2,3,4` &resources=`-1` &where=`{"createdby:=":[[!+modx.user.id]]}` &showHidden=`1` &hideContainers=`1` &toPlaceholder=`myArticles` &totalVar=`total` ]]
[[!+myArticles:notempty=`<span class="messageCount">[[+total]]</span>`]]
[[+published:is=`0`:then=`Drafts [[getResources? &parents=`2,3,4` &showUnpublished=`1` &totalVar=`totalDrafts`]] [[+totalDrafts]]`:else=``]]
[[+totalDrafts]]
This question has been answered by sottwell. See the first response.
&where=`{"createdby:=":[[!+modx.user.id]], "AND:published:=":0}`
$userId = $modx->user->get('id'); $c = $modx->newQuery('modResource'); $c->where(array( 'createdby' => $userId, 'published' => false, )); return $mod->getCount('modResource', $c);