Running 5.7 I would like two sets of "recent blog posts" One for one user and another for a different user.

I went into the blog.module and in the function hook_block() I found the line containing:

WHERE n.type = 'blog' = 2 AND n.status = 1

and added the argument: AND n.uid = 2

Which worked perfectly to make the standard block list of 10 most recent posts work for user id 2.

How do I copy and re-implement that function to create another block for user id 3?

Thanks,
Zachary

Comments

rahim123’s picture

I would use the Views module for this.

nicksanta’s picture

Definitely use the views module.

add a filter, NODE: Author is current user

and NODE: TYPE = blog post

the cool thing about views is you can put it in a page and a block

----------------------
Nick Santamaria

fiveplusseven’s picture

Ah thank you very much. Views is pretty nice. No messing with code... even though for someone who has no clue about php, I thought adding that AND n.uid argument was pretty ingenius :p