[drupal-devel] [feature] List of bloggers

essig drupal-devel at drupal.org
Thu Aug 25 04:15:54 UTC 2005


Issue status update for 
http://drupal.org/node/17030
Post a follow up: 
http://drupal.org/project/comments/add/17030

 Project:      Drupal
 Version:      cvs
 Component:    blog.module
 Category:     feature requests
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  Bèr Kessels
 Updated by:   essig
 Status:       patch (code needs review)

I think 'DISTINCT' can be removed from the query in
blog_bloggers_list_1.patch [1]. There is already a 'GROUP BY' clause
over the same columns.


George Essig
[1] http://drupal.org/files/issues/blog_bloggers_list_1.patch




essig



Previous comments:
------------------------------------------------------------------------

Tue, 08 Feb 2005 23:27:27 +0000 : Bèr Kessels

Attachment: http://drupal.org/files/issues/blog_bloggers_list.patch (1.66 KB)

Small patch to show a list of bloggers. We all should know that
blog.module is not meant for personal blogging, but that set aside, we
do not have a way to show all bloggers, on a site as a list. This patch
ads a few lines that will allow you to show that overview of blogging
users. It ads a menu item, disabled by default that shows such a list.




------------------------------------------------------------------------

Tue, 08 Feb 2005 23:31:49 +0000 : Bèr Kessels

Attachment: http://drupal.org/files/issues/blog_bloggers_list.png (4.02 KB)

Here is a small screeny that shows what this is about.




------------------------------------------------------------------------

Tue, 08 Feb 2005 23:34:15 +0000 : Bèr Kessels

Attachment: http://drupal.org/files/issues/list_bloggers_2.png (2.25 KB)

hmm. error in my png file. Here is a correct one.




------------------------------------------------------------------------

Sat, 19 Feb 2005 20:13:20 +0000 : Emiliano

Hi Bèr Kessels!


Thanks for the patch! It's really useful! :-)


I just noticed what I think is a little mistake in this line:


$items[] = l($row->name, 'blog/'.$row->uid)." ".theme('xml_icon',
url('blog/'.$row->uid.'/feed'), TRUE);


Which I believe should end like:


$items[] = l($row->name, 'blog/'.$row->uid)." ".theme('xml_icon',
url*('blog/feed/'.$row->uid)*, TRUE);


Ah, and BTW,  "db_rewrite_sql" didn't work for me... I just cut it
off... ;-)


Cheers,
Emiliano.




------------------------------------------------------------------------

Thu, 17 Mar 2005 22:17:39 +0000 : Bèr Kessels

Attachment: http://drupal.org/files/issues/blog_bloggers_list_2.patch (1.81 KB)

and here is the actual patch. (i think i really need some script that
tells me i did not attach a patch ;) )




------------------------------------------------------------------------

Thu, 17 Mar 2005 22:19:53 +0000 : Bèr Kessels

Attachment: http://drupal.org/files/issues/blog_bloggers_list_2_0.patch (1.71 KB)

sigh. something tells me i should stop working.... a silly "F" sneaked
into the previous patch.




------------------------------------------------------------------------

Thu, 24 Mar 2005 20:25:01 +0000 : Anonymous

I applied the patch, reuploaded the blog.module and then deactivated and
reactivated it. I cannot see a difference. How do I access the blog
users page? 


Drupal 4.6rc


thanks for the help.




------------------------------------------------------------------------

Thu, 24 Mar 2005 20:53:26 +0000 : Bèr Kessels

look in the menu admin.




------------------------------------------------------------------------

Wed, 18 May 2005 13:38:39 +0000 : Bèr Kessels

Nearly two months since the patch. If there is no need for this I will
mark it won't fix.




------------------------------------------------------------------------

Wed, 18 May 2005 13:52:56 +0000 : tostinni

I made a custom block for this, but it still need a little improvment
(add "read more" for example). So I don't know if it's usefull but if
anyone care :

<?php
$result = db_query("SELECT u.uid, u.name, COUNT(0) AS num FROM {node} n
LEFT JOIN {users} u ON u.uid = n.uid WHERE n.type = 'blog' GROUP BY
u.uid, u.name ORDER BY u.name ASC");
while ($blog = db_fetch_object($result)) {
     $output .= '<li />'.l($blog->name. ' ('.$blog->num.')',
'blog/'.$blog->uid);
}
return '<ul>'.$output.'</ul>';
?>






------------------------------------------------------------------------

Wed, 18 May 2005 16:06:36 +0000 : Chris Johnson

I think this is a useful feature.  I've coded custom blocks in the past
to provide it on my sites.




------------------------------------------------------------------------

Sat, 21 May 2005 05:23:11 +0000 : Andrzej7

I was a little afraid (poor PHP) to install the patch (March...), but I
have made a block. And it's very nice.


One question only. All the bloggers are shown, but the Admin (user No
1) is on the list and he has no blogs.


What's that?




------------------------------------------------------------------------

Sun, 22 May 2005 16:24:08 +0000 : Bèr Kessels

To avoid confusion: this patch ads no blocks, but shows the list inline:
as content!




------------------------------------------------------------------------

Sat, 18 Jun 2005 22:07:42 +0000 : igrcic

aaargh.....there is a problem when using PostgreSQL db. After I
successfully patch blog.module and enable it in menu, click on it and
following sql errors pop up:


warning: pg_query(): Query failed: ERROR:  function count(integer,
character varying) does not exist
HINT:  No function matches the given name and argument types. You may
need to add explicit type casts. in
/web/www/htdocs/iaeste3/includes/database.pgsql.inc on line 45.
user error:
query: SELECT COUNT(DISTINCT u.uid, u.name) FROM users u LEFT JOIN node
n ON n.uid = u.uid WHERE n.type = 'blog' AND n.status =1 ORDER BY
n.created DESC  in /web/www/htdocs/iaeste3/includes/database.pgsql.inc
on line 62.


warning: pg_query(): Query failed: ERROR:  for SELECT DISTINCT, ORDER
BY expressions must appear in select list in
/web/www/htdocs/iaeste3/includes/database.pgsql.inc on line 45.
user error:
query: SELECT DISTINCT u.uid, u.name FROM users u LEFT JOIN node n ON
n.uid = u.uid WHERE n.type = 'blog' AND n.status = 1 ORDER BY n.created
DESC LIMIT 10 OFFSET 0 in
/web/www/htdocs/iaeste3/includes/database.pgsql.inc on line 62


For first one its clear, there is no such fucntion in Postgresql, and
second one is typical Postgresql/Mysql error, n.created isn't in select
syntax. But if we put it in a select distinct syntax , it isn't DISTINCT
anymore, so I get lots of lines with user and all of his blogs, with
different time of course. So we must modify query a bit:
SELECT DISTINCT u.name, u.uid, MAX(n.created) as time FROM users u LEFT
JOIN node n ON n.uid = u.uid WHERE n.type = 'blog' AND n.status = 1
GROUP BY u.name,u.uid ORDER BY time DESC


It works fine like this :)


Didn't look for first one yet... will when I catch some time.
Cheers!




------------------------------------------------------------------------

Sat, 18 Jun 2005 22:15:29 +0000 : igrcic

Attachment: http://drupal.org/files/issues/blog_bloggers_list_0.patch (1.75 KB)

Sorry, here is a patch for a blog_bloggers_list_2_0.patch :)




------------------------------------------------------------------------

Tue, 05 Jul 2005 09:08:19 +0000 : Bèr Kessels

That doesz not seem a patch of a patch, but a regular patch.


Igrirc, please note that the SQL contains unbracketed tablenames. That
is unacceptible. If you don't want to fix it, please report it back
here, So I can fix it otherwise :)




------------------------------------------------------------------------

Sun, 21 Aug 2005 19:46:13 +0000 : Bèr Kessels

Attachment: http://drupal.org/files/issues/blog_bloggers_list_1.patch (1.75 KB)

Bingo! My own patch, brought to you by patchbingo!







More information about the drupal-devel mailing list