Add new comment to Můj účet >> Osobní informace >> Jméno a AdSense
Moje kniha o CMS Drupal
Poslední komentáře
- 4 months 2 weeks ago
- 4 months 2 weeks ago
- 6 months 3 weeks ago
- 7 months 3 weeks ago
- 7 months 3 weeks ago
- 7 months 3 weeks ago
- 10 months 4 weeks ago
- 11 months 2 weeks ago
- 11 months 2 weeks ago
- 1 year ago
Nové diskuze
- (6 months 1 week zpět)
- (7 months 3 weeks zpět)
- (1 year 5 months zpět)
- (1 year 5 months zpět)
- (1 year 9 months zpět)
- (1 year 9 months zpět)
- (1 year 10 months zpět)
- (2 years 2 months zpět)

Zdravím, jméno - použil jsem modul Profiles, který umožňuje definovat další políčka v profilu každého z uživatelů. Aby se pak místo jména uživatele použil text z příslušného pole v profilu, je třeba editovat soubor template.php v šabloně a dát tam následující (kód je pro Drupal 6, v praxi k vidění na Backup HowTo):
function phptemplate_username($object, $link = TRUE) {
if ( !$object->profile_fullname ) {
if ( $object->uid && function_exists('profile_load_profile') ) {
profile_load_profile($object);
}
}
if ( $object->profile_fullname ) {
$name = $object->profile_fullname;
if ( $link && user_access('access user profiles')) {
return l($name, 'user/'. $object->uid, array('title' => t('View user profile.')));
}
else {
return check_plain($name);
}
}
// Profile field not set, default to standard behaviour
if ($object->uid && $object->name) {
// Shorten the name when it is too long or it will break many tables.
if (drupal_strlen($object->name) > 20) {
$name = drupal_substr($object->name, 0, 15) .'...';
}
else {
$name = $object->name;
}
if ( $link && user_access('access user profiles')) {
$output = l($name, 'user/'. $object->uid, array('title' => t('View user profile.')));
}
else {
$output = check_plain($name);
}
}
else if ($object->name) {
// Sometimes modules display content composed by people who are
// not registered members of the site (e.g. mailing list or news
// aggregator modules). This clause enables modules to display
// the true author of the content.
if ($object->homepage) {
$output = l($object->name, $object->homepage);
}
else {
$output = check_plain($object->name);
}
$output .= ' ('. t('not verified') .')';
}
else {
$output = variable_get('anonymous', 'Anonymous');
}
return $output;
}
Co se týče AdSense ID, je na to na Drupal.org přímo modul Google AdSense. V profilech vytvoříte políčko pro zadání kódu AdSense, pomocí tohoto modulu jej pak napojíte a zapnete zobrazování v určitých typech obsahu na základě procent v prospěch majitele webu a pisatele článku/příspěvku. Na Maxiorlovi je to jen připraveno, ale není to zapnuto úplně.