Hi,
It is done with custom php code and i am using phptemplate for themes.
This code is not optimized code, i hacked around a bit to get the
functionality. There may be better methods to do this. So if someone in
this list can refine this, it will be great. Put the code in the
page.tp.php file
thanks,
Paul
The code is as follows:
if ($is_front) {
$vocabularies = taxonomy_dhtml_get_vocabularies();
$i=0; $j = 0; $k =
0;
foreach ($vocabularies as $vocabulary) {
$out .= $vocabulary->name;
$result = db_query_range("SELECT tid, name FROM {term_data} WHERE
vid = '". $vocabulary->vid. "'", 0, 9);
while ($term = db_fetch_object($result))
{
$tids[] = $term->tid;
$names[] = $term->name;
$outlink .= "<b>" . $term->name .
"</b><br/>";
$outlink .= myshow_nodes($term->tid);
$j++;
if ($j > 0) {
print $outlink;
print "\n";
unset($outlink, $output, $tids, $names, $out);
$j=0;
}
}
}
}
function myshow_nodes($tid) {
static $context;
if (!isset($context)) {
$context = taxonomy_context_get_context();
}
$output = "";
$i = 0;
$sql = "select distinct(n.nid), n.title, n.teaser " .
"from {node} n " .
"left join {term_node} r on n.nid = r.nid " .
"left join {users} u on n.uid = u.uid " .
node_access_join_sql() .
" where r.tid = %d " .
"and n.status = '1' ".
"and " . node_access_where_sql() .
(variable_get("taxonomy_context_use_promote", 1) ? " and n.promote
= '1' " : "") .
" order by sticky desc, n.created desc";
$result = db_query($sql, $tid);
while ($node = db_fetch_object($result)) {
$params = array("title" => strip_tags($node->title));
if ($node->nid == $context->nid) {
$params["class"] = "active";
}
$link = l($node->title, "node/". $node->nid, $params);
$output .= " - " . $link . "<br/>";
$i++;
if ($i > 2)
break;
}
return $output;
}
Nektarios Sylligardakis wrote:
very quite site.
Somthing like this i meen
is it yours site ?
could you tell as how did that?
paul wrote:
Please take a look at www.chintha.com
Is this what you are looking for?
paul
Abalieno wrote:
I'm
actually interested in a similar feature:
I'd like to flag manually some of the nodes so that their titles (just
them) appear in a custom box on the homepage (not the sidebar).
HRose / Abalieno
I don't think this is a standard feature,
so
you may need to code some PHP unless someone else has done this and can
offer some suggestions.
There is a 'categories' block, which lists the various categories and
the number of articles in each category - maybe this could be modified
to suit your needs.
(sorry, I am a bit to busy at the moment to give this further thought -
maybe someone else will help?)