By jorre on
for some reason, I want to create a "recent comments" block on my site
I need to do it by creating a new block, and paste some php code in there. Does anyone have a code snippet to do this?
I don't want to use the block that is available by standard...
thanks already!
Comments
Recent comments
The Views Module now has some list views for comments, so you could try that. That means you wouldn't have to maintain PHP snippets as Drupal.
That said, here's the recent comments block that I whipped up a few days ago:
(Username formerly my full name, Richard Eriksson.)
Nice, thanks Richard. I've
Nice, thanks Richard.
I've tried the views module last week and this sure gives me some possibilities,
but: is there a way to use views in my page.tpl.php file without having to use blocks..............
some php code like "return view('viewname')"
?
Pakfriet.be
Uzegt.be
theme_view()
I don't know if it's "the right way", but
print theme_view('view name')seems to work.(Username formerly my full name, Richard Eriksson.)
I tried your recent comments
I tried your recent comments code and it's just great!
I would love to tune it a little, to have a small image displayed in front of every recent comment instead of a list item bullet in front of it. Do you know how I could achieve this when still using your code?
let's say if we use
Pakfriet.be
Uzegt.be
link problems in version 4.7.4
The link is not correct composite in version 4.7.4:
Comment links looks like: "node/281/175#comment-175"
So i changed the code to:
but it will not work.
Think there is an syntax problem.
Can anyone help?
more granularity
This might come in useful for someone. This is basically the same as above except you can select which content types you want to show comments for. Useful if you don't want comments on profiles to show up. I also added a little bit of formatting to the comments so the look like: "this is my comment...".
Enjoy,
Neil
- Connecting Language Learners
www.huitalk.com
--
Neil Cameron