Add new comment to Stránka registrovaného uživatele
Moje kniha o CMS Drupal
Poslední komentáře
- 5 months 3 weeks ago
- 5 months 3 weeks ago
- 8 months ago
- 8 months 4 weeks ago
- 8 months 4 weeks ago
- 9 months ago
- 1 year ago
- 1 year ago
- 1 year ago
- 1 year 1 month ago
Nové diskuze
- (3 weeks zpět)
- (3 weeks 4 days zpět)
- (7 months 2 weeks zpět)
- (9 months zpět)
- (1 year 6 months zpět)
- (1 year 6 months zpět)
- (1 year 10 months zpět)
- (1 year 10 months zpět)

Nastavení profilu - je pro to potřeba modul Profile ze standardní výbavy Drupalu. Stačí jej zapnout.
Soubor user_profile.tpl.php je tu:
<h2><?php print $user->name; ?></h2>
<?php $nlimit = 10; ?>
<?php $userid=$user->uid; ?>
<div id="userpicture"><?php if($user->picture) {print theme('user_picture', $user);} ?></div>
<?php $result1 = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.status = 1 AND n.uid = $userid AND (n.type = 'story' OR n.type = 'novinka') ORDER BY n.created DESC"), variable_get('default_nodes_main', $nlimit) ); ?>
<?php while ($node = db_fetch_object($result1)) {$output2 .= node_view(node_load(array('nid' => $node->nid)), 1);}; ?>
<?php print "Seznam článků tohoto autora:\n" ?>
<?php print $output2; ?>
<?php print theme('pager', NULL, variable_get('default_nodes_main', $nlimit), 0); ?>
V databázovém dotazu si akorát uprav podmínku určující jaký typ obsahu se má vybrat. Tedy tu část s n.type = 'story' OR n.type = 'novinka'.