Add new comment to Zákaz odkazování stránky samu na sebe
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)

Děkuji, to nevadí :)
<?php
// $Id: template.php,v 1.16.2.2 2009/08/10 11:32:54 goba Exp $
/**
* Sets the body-tag class attribute.
*
* Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
*/
function phptemplate_body_class($left, $right) {
if ($left != '' && $right != '') {
$class = 'sidebars';
}
else {
if ($left != '') {
$class = 'sidebar-left';
}
if ($right != '') {
$class = 'sidebar-right';
}
}
if (isset($class)) {
print ' class="'. $class .'"';
}
}
/**
* Return a themed breadcrumb trail.
*
* @param $breadcrumb
* An array containing the breadcrumb links.
* @return a string containing the breadcrumb output.
*/
function phptemplate_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
return ''. implode(' › ', $breadcrumb) .'';
}
}
/**
* Override or insert PHPTemplate variables into the templates.
*/
function phptemplate_preprocess_page(&$vars) {
$vars['tabs2'] = menu_secondary_local_tasks();
// Hook into color.module
if (module_exists('color')) {
_color_page_alter($vars);
}
}
/**
* Add a "Comments" heading above comments except on forum pages.
*/
function garland_preprocess_comment_wrapper(&$vars) {
if ($vars['content'] && $vars['node']->type != 'forum') {
$vars['content'] = ''. t('Comments') .''. $vars['content'];
}
}
/**
* Returns the rendered local tasks. The default implementation renders
* them as tabs. Overridden to split the secondary tasks.
*
* @ingroup themeable
*/
function phptemplate_menu_local_tasks() {
return menu_primary_local_tasks();
}
function phptemplate_comment_submitted($comment) {
return t('!datetime — !username',
array(
'!username' => theme('username', $comment),
'!datetime' => format_date($comment->timestamp)
));
}
function phptemplate_node_submitted($node) {
return t('!datetime — !username',
array(
'!username' => theme('username', $node),
'!datetime' => format_date($node->created),
));
}
/**
* Generates IE CSS links for LTR and RTL languages.
*/
function phptemplate_get_ie_styles() {
global $language;
$iecss = '';
if ($language->direction == LANGUAGE_RTL) {
$iecss .= '@import "'. base_path() . path_to_theme() .'/fix-ie-rtl.css";';
}
return $iecss;
}
function phptemplate_menu_item_link($link) {
if (empty($link['localized_options'])) {
$link['localized_options'] = array();
}
// teď zjistíme, zda je odkaz jiný, než aktuální stránka. Pokud tomu tak je, tak odkaz vypíšeme.
if( strpos($_SERVER['REQUEST_URI'], drupal_get_path_alias($link['href'])) ) {
// text bez odkazu
$output = $link['title'];
}
else{
//text s odkazem
$output = '';
$output .= $link['title'];
$output .= '';
}
return $output;
}
function phptemplate_menu_item_link($link) {
if (empty($link['localized_options'])) {
$link['localized_options'] = array();
}
// teď zjistíme, zda je odkaz jiný, než aktuální stránka. Pokud tomu tak je, tak odkaz vypíšeme.
if( strpos($_SERVER['REQUEST_URI'], drupal_get_path_alias($link['href'])) ) {
// text bez odkazu
$output = $link['title'];
}
else{
//text s odkazem
$output = '';
$output .= $link['title'];
$output .= '';
}
return $output;
}
Děkuji moc. l.h.
Nový poznatek:
váš kód funguje :), ale tím teď nefunguje nastavení v css
.menu a.active, .menu a:active { background: rgb(51,102,204); color:white; text-decoration:none;}
a když váš kód odmažu a vyčistím paměť, tak obarvení funguje. Stránky mám na lokále, tak vám to nemůžu ukázat. Ale můžu to vyzkoušet na nějakých stránkách na webu. Pokud budete chtít, tedy. Děkuji. l.h.