Submitted by serrano on
J'ai un problème avec un theme acheté sur template monster, à chaque fois que j'enregistre une modif, que je me connecte etc, j'ai ce genre de message:
* warning: Cannot modify header information - headers already sent by (output started at /homez.344/lasalleor/www/themes/theme339/template.php:7) in /homez.344/lasalleor/www/includes/session.inc on line 99.
* warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in /homez.344/lasalleor/www/includes/session.inc on line 102.
je suis sur la version 6.16
voici le contenu du fichier template.php du thème installé:
<?php
function theme339_menu_local_task($link, $active = FALSE) {
return '<li '. ($active ? 'class="active" ' : '') .'><span><span>'. $link ."</span></span></li>\n";
}
?>
<?php
function theme339_l($text, $path, $options = array()) {
// Merge in defaults.
$options += array(
'attributes' => array(),
'html' => TRUE,
);
// Append active class.
if ($path == $_GET['q'] || ($path == '<front>' && drupal_is_front_page())) {
if (isset($options['attributes']['class'])) {
$options['attributes']['class'] .= ' active';
}
else {
$options['attributes']['class'] = 'active';
}
}
// Remove all HTML and PHP tags from a tooltip. For best performance, we act only
// if a quick strpos() pre-check gave a suspicion (because strip_tags() is expensive).
if (isset($options['attributes']['title']) && strpos($options['attributes']['title'], '<') !== FALSE) {
$options['attributes']['title'] = strip_tags($options['attributes']['title']);
}
return '<a href="'. check_url(url($path, $options)) .'"'. drupal_attributes($options['attributes']) .'>'. ($options['html'] ? $text : check_plain($text)) .'</a>';
}
/**
* Override theme_links to include <span> in list.
*/
function theme339_links($links, $attributes = array('class' => 'links')) {
$output = '';
if (count($links) > 0) {
$output = '<ul'. drupal_attributes($attributes) .'>';
$num_links = count($links);
$i = 1;
foreach ($links as $key => $link) {
$class = '';
// Automatically add a class to each link and also to each LI
if (isset($link['attributes']) && isset($link['attributes']['class'])) {
$link['attributes']['class'] .= ' ' . $key;
$class = $key;
}
else {
$link['attributes']['class'] = $key;
$class = $key;
}
// Add first and last classes to the list of links to help out themers.
$extra_class = '';
if ($i == 1) {
$extra_class .= 'first ';
}
if ($i == $num_links) {
$extra_class .= 'last ';
}
// Add class active to active li
$current = '';
if (strstr($class, 'active')) {
$current = ' active';
}
$output .= '<li class="'. $extra_class . $class . $current .'">';
// Is the title HTML?
$html = isset($link['html']) && $link['html'];
// Initialize fragment and query variables.
$link['query'] = isset($link['query']) ? $link['query'] : NULL;
$link['fragment'] = isset($link['fragment']) ? $link['fragment'] : NULL;
if (isset($link['href'])) {
$spanned_title = "<span ". drupal_attributes($link['attributes']) ."><span>".$link['title']."</span></span>";
// In the line above, you could take out the drupal_attributes var and specify your class
$output .= theme339_l($spanned_title, $link['href'], $link['attributes'], $link['query'], $link['fragment']);
} else if ($link['title']) {
//Some links are actually not links, but we wrap these in <span> for adding title and class attributes
if (!$html) {
$link['title'] = check_plain($link['title']);
}
$output .= '<span'. drupal_attributes($link['attributes']) .'>'. $link['title'] .'</span>';
}
$i++;
$output .= "</li>\n";
}
$output .= '</ul>';
}
return $output;
}
/*FOR USER LOGIN*/
function custom_login_block() {
$form = array(
'#action' => url($_GET['q'], array('query' => drupal_get_destination())),
'#id' => 'user-login-form',
'#validate' => user_login_default_validators(),
'#submit' => array('user_login_submit'),
);
$form['name'] = array('#type' => 'textfield',
'#title' => t('Username'),
'#maxlength' => USERNAME_MAX_LENGTH,
'#size' => 15,
'#required' => TRUE,
);
$form['pass'] = array('#type' => 'password',
'#title' => t('Password'),
'#maxlength' => 60,
'#size' => 15,
'#required' => TRUE,
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Login'), );
$items = array();
if (variable_get('user_register', 1)) {
$items[] = l(t('create new account'), 'user/register', array('title' => t('Create a new user account.')));
}
$items[] = l(t('request new password'), 'user/password', array('title' => t('Request new password via e-mail.')));
$form['links'] = array('#value' => theme('item_list', $items));
return $form;
}
function theme339_user_bar() {
global $user;
$output = '';
if (!$user->uid) {
$output .= drupal_get_form('custom_login_block');
}
else {
$output .= t('<p class="user-info">Hi !user, welcome back.</p>', array('!user' => theme('username', $user)));
$output .= theme('item_list', array(
l(t('Your account'), 'user/'.$user->uid, array('title' => t('Edit your account'))),
l(t('Sign out'), 'logout')));
}
$output = '<div id="user-bar">'.$output.'</div>';
return $output;
}
//<!--ZEBRA-MENU-->
function phptemplate_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
static $zebra = FALSE;
$zebra = !$zebra;
$class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
if (!empty($extra_class)) {
$class .= ' '. $extra_class;
}
if ($in_active_trail) {
$class .= ' active-trail';
}
if ($zebra) {
$class .= ' even';
}
else {
$class .= ' odd';
}
return '<li class="'. $class .'">'. $link . $menu ."</li>\n";
}
?>
merci de votre aide, j'y comprend rien....
le site: http://www.lasalleofeminin.com/
Quelle modif essaye tu d
Permalien Soumis par mbehmane le 13 Mai, 2010 - 19:59
Quelle modif essaye tu d apporter??
Supprime le premier "?>" et
Permalien Soumis par Damien Tournoud le 13 Mai, 2010 - 20:18
Supprime le premier "?>" et le "<?php" qui suit au début du fichier, y compris toutes les éventuelles lignes blanches entre les deux.
Merci, c'était bien ça, plus
Permalien Soumis par serrano le 14 Mai, 2010 - 21:05
Merci, c'était bien ça, plus de problèmes.... Merci encore...