I've been looking around for some code that I can insert into a node that will show:

content_type=X
number_of_posts=X
tid=X

I can't find anything and wouldn't have a clue how to code this myself, can anyone point me in the right direction please?
I don't want a block of latest posts, it needs to be configurable on the variables above and a snippet I can place on the page content

Comments

vm’s picture

views.module or one of the snippets I've seen in the handbooks and/or the fourms if you prefer the snippet method.

Hall of fame.module may also be worth looking at.

bcc’s picture

VM. once again, you've come to my rescue.. thanks for the guidance, I'll go looking now.

do you code at all? I'm happy to pay for this snippet :)

vm’s picture

nope, nor do I have the time to go look for the snippet for you. I know there are around though google and drupal search and some leg work are your friends until such time as someone drops it in here.

nevets’s picture

I would strongly recommending learning the views module, it provides flexibility and requires no knowledge of php or mysql

Rajan M’s picture

According to above post you may want
eg

ContentType: page
nodeCount:5
tid:?

ContentType: story
nodeCount:10
tid:?

Since tid is for each node not for each content type.
Can u explain clearly? so i can help you. :)

( As far as my understanding Views does not provide node count ;snippet will help u)

vm’s picture

I could have sworn I've seen documentation on how to group views or some such so that they show the #. :looking:

Rajan M’s picture

<?php
$cur_node = node_load( arg(1));
$nodeCount= db_result(db_query("SELECT count(nid) FROM {node} WHERE type='%s' ", $cur_node->type ));
echo 'ContentType : '. $cur_node->type .'<br/>';
echo 'NodeCount : '. $nodeCount .'<br/>';
echo 'Tid : '. $cur_node->taxonomy[1]->tid .'<br/>';
?>
bcc’s picture

hall of fame doesn't do it. I realise now that I didn't explain myself clearly enough.

I want to be able to insert a snippet into a page that will output the 5 latest nodes of a particular content type from a certain tid.

eg. 5 latest forum posts from tid5
eg. 10 latest polls from the tid13
eg. 10 latest pages from tid21

timid1’s picture

Views will do exactly what you want to do. Give in, install the Extended Help like Views recommends, and then run through the simple tutorials. If I'm not mistaken, there's a tutorial there that'll do exactly what you want. Or it may require some minor modifications. But you should be able to figure it out.