[support] Counting the number of node created by user, Views only
Victor Kane
victorkane at gmail.com
Wed Dec 22 14:51:41 UTC 2010
Is there any solution NOT involving COUNT() ?
Otherwise the Drupal Handbook (http://drupal.org/node/161974) has the most
straightforward PHP snippet:
<?php
$mytype = 'job'; // <<---------- set your content type here.
$results = db_query("SELECT COUNT(DISTINCT(nid)) FROM {node} WHERE
type='%s' AND status=1", $mytype);
$count = db_num_rows($results);
echo "There are currently $count jobs in our database.";
?>
Victor Kane
http://awebfactory.com.ar
http://projectflowandtracker.com
On Wed, Dec 22, 2010 at 11:16 AM, Denis Lafont-Trevisan <
denis.lafont at gmail.com> wrote:
>
> Hi,
>
> Just for the archive, the answer was using Views GroupBy module.
>
> Cheers,
>
> Denis
>
> On Wed, Dec 22, 2010 at 12:36 PM, Shai Gluskin <shai at content2zero.com>
> wrote:
>
>>
>> On Dec 22, 2010, at 3:23 AM, Denis Lafont-Trevisan <
>> denis.lafont at gmail.com> wrote:
>>
>> > Hi,
>> >
>> > Sounds stupid but I can't manage to create a view that count the number
>> of node of a certain type each user created.
>> >
>> >
>> > Any clue?
>> >
>> > Cheers,
>> >
>> > Denis
>> > --
>> > [ Drupal support list | http://lists.drupal.org/ ]
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20101222/aa0ea100/attachment.html
More information about the support
mailing list