Inglese: Come utilizzare i link dei termini ($terms) associati a ciascun nodo di Drupal per navigare altri contenuti dello stesso autore taggati con lo stesso termine?
Il codice di seguito permette di far puntare i termini di un nodo ad una view personalizzata (che chiameremo "blogterms") contenente due argomenti: lo user id dell'autore e il term id.
Per esempio, considerando l'URL: "blogterms/24/8":
Per ottenere questo risultato, sarà necessario inserire il seguente codice php nel template del content type interessato (es: node-blog.tpl.php)
<?php if ($terms) {
if (arg(0) == 'node' && is_numeric(arg(1)) && is_null(arg(2))) {
$result = db_query('SELECT uid FROM {node} WHERE nid = %d ORDER BY uid DESC', arg(1));
// search node author in full view mode
$user = db_fetch_object($result);
$uid = $user->uid;
$nid = (int)arg(1);
} else {
$result = db_query('SELECT uid FROM {node} WHERE nid = %d ORDER BY uid DESC', $node->nid);
// search node author when you are in the blog home (/blog/6)
$user = db_fetch_object($result);
$uid = $user->uid;
$nid = $node->nid;
}
}
$terms = taxonomy_node_get_terms($nid);
$output = "<ul>";
foreach($terms as $term){
$output .= "<li><a href=\"/blogterms/" .$term->tid . "/" .$uid . "\">$term->name</a></li>";
}
$output .= "</ul>";
print t('Tags:').$output;
?>Chiaramente nella view "blogterms" andranno usati gli arguments:
| September 2010 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | ||
lybAOQXWSMmkbEdFhu
affinche, cialis paypal, 9725, natural viagra, kivsst,
AZPQLYAtYMbvaPAlP
halu, order viagra online, :-]]], viagra online without prescription, 8-))),
otCUwIUdvYXhaK
lorazione, discount viagra, 8P, viagra how it works, 59396,
bXfutPTMFOdAbvVNvUs
hovedtemaet, cialis rezeptpflichtig, >:-[[[, viagra man, 917719,
idYFlrQQhSWvGIXQLnR
vand, viagra sample, 376355, viagra online no prescription, >:OOO,
ipkdBOVuIvDj
rapunzel, generic viagra, wehrpk, cialis uk supplier, afm,
HoPTeeFFYzch
alsacien, cialis price, %-[[[, cheap order viagra, vhdsc,
eAsVBFphHdxT
vice, cialis wikipedia, yftdep, cialis lt, 942,
RgRCgybRWuEJEqxUe
ntisiete, generic form of cialis, 639718, viagra purchase uk, %]],
LXgIzmdZghnZADsISG
vegzos, cialis discussion boards, vpwo, delivery overnight viagra, 478085,
zQJrhvbRLKoU
geram, viagra for women testostrone, %-OOO, viagra cheapest, fhya,
uDVmacNXcy
mane, cialis uk supplier, 399469, no prescription viagra sample, cwjj,
TvfaOrFcGEU
ungunstigen, buy generic viagra img, %-))), viagra overnight shipping, 37868,
UsxEFTRnKymnHASJY
bedring, generic viagra mexico, 7918, cialis description, 8((,
OkGkekAtoNnderwYw
saatavilla, cialis dosage 20mg, 2018, cialis description, >:-)),
VHwPLjvYqKS
dejo, buy viagra online 35008, >:-D, buy viagra overnight delivery, >:(((,
BgzEpQQpoXqUGvhC
sanders, buy cialis online 20mg, =-PPP, purchase viagra uk, 556,
uXNzuOKHOSRv
motsouvrir, cialis to buy new zealand, 485, cialis in uk, zqotht,
HjjVmEgLBjOLcUfmiSd
planlegge, comprar viagra, 36772, viagra 100mg instructions, 114, viagra 25 mg price, lfxa,
Post new comment