flatforum unter yaml
Eingetragen von popkopff (14)
am 26.07.2007 - 15:58 Uhr in
am 26.07.2007 - 15:58 Uhr in
Hallo Folks,
hat jemand schon mal das Flatforum unter dem yaml Template
installiert. Ich habe Drupal 5.1 laufen merge die 2 Templatedateien.
Keine Fehlermeldung aber auch keine Auswirkung auf das Forum hat jemand einen Rat.
Hier mal meine template.php :
<?php
/*
* ######################################################################################################
* # "YAML für Drupal" (c) von Alexander Hass (http://www.yaml-fuer-drupal.de) ##########################
* ######################################################################################################
*
* YAML for Drupal : 5.x-2.5.2.4
* Dateiversion : 06.04.07
* Datei : template.php
* Funktion : Zentrales Template
*/
/*
* This snippet tells Drupal to load up a different page-front.tpl.php layout
* file automatically. For use in a page.tpl.php file.
*
* This works with Drupal 4.5, Drupal 4.6, Drupal 4.7 and Drupal 5
*/
function _phptemplate_variables($hook, $vars = array()) {
switch ($hook) {
case 'page':
global $user;
// Load the XML prolog for standard compliant browsers if caching is inactive.
// The function page_set_cache() does not cache pages if $user->uid has a value.
// Additional the XML prolog can only added to YAML for Drupal if a user is
// logged into Drupal (caching inactive) or caching is globaly disabled on the site.
if ((_browser_xml_prolog_compliant() && $user->uid) || (_browser_xml_prolog_compliant() && !(variable_get('cache', 0)))) {
$vars['xml_prolog'] = '<?xml version="1.0" encoding="utf-8"?>'."\n" ;
}
// Load region content assigned via drupal_set_content().
foreach (array('fontsize_init','fontsize_links') as $region) {
$vars[$region] = drupal_get_content($region);
}
break;
}
// node_style module is installed and active
if (module_exists('node_style')) {
return module_invoke('node_style', 'return_vars', $hook, $vars);
}
else {
return $vars;
}
static $is_forum;
$variables = array();
if (!isset($is_forum)) {
if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == '') {
$nid = arg(1);
}
if (arg(0) == 'comment' && arg(1) == 'reply' && is_numeric(arg(2))) {
$nid = arg(2);
}
if ($nid) {
$node = node_load(array('nid' => $nid));
}
$is_forum = ($node && $node->type == 'forum');
_is_forum($is_forum);
}
if ($is_forum) {
switch ($hook) {
case 'comment' :
$variables['template_file'] = 'node-forum';
$variables['row_class'] = _row_class();
$variables['name'] = $vars['author'];
$variables['userid'] = $vars['comment']->uid;
$joined = module_invoke('flatforum', 'get_created', $vars['comment']->uid);
$variables['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
$posts = module_invoke('flatforum', 'get', $vars['comment']->uid);
$variables['posts'] = $posts ? $posts : 0;
$variables['submitted'] = format_date($vars['comment']->timestamp);
$subject = $vars['comment']->subject;
$variables['title'] = empty($subject) ? ' ' : $subject;
$variables['content'] = $vars['comment']->comment;
$variables['links'] = empty($vars['links']) ? ' ' : $vars['links'];
break;
case 'node' :
$variables['row_class'] = _row_class();
$variables['userid']=$vars['node']->uid;
$joined = module_invoke('flatforum', 'get_created', $vars['node']->uid);
$variables['joined'] = $joined ? format_date($joined, 'custom', 'Y-m-d') : '';
$posts = module_invoke('flatforum', 'get', $vars['node']->uid);
$variables['posts'] = $posts ? $posts : 0;
$variables['title'] = empty($vars['title']) ? ' ' : $vars['title'];
$variables['content'] = $vars['node']->body;
$variables['links'] = empty($vars['links']) ? ' ' : $vars['links'];
break;
}
}
return $variables;
}
function _row_class() {
static $forum_row = TRUE;
$forum_row = !$forum_row;
return $forum_row ? 'odd' : 'even';
}
function _is_forum($arg = NULL) {
static $is_forum = FALSE;
if ($arg) {
$is_forum = $arg;
}
return $is_forum;
}
/* This snippet changes primary links layout */
function phptemplate_links_primary($links) {
$output = '';
if (count($links)) {
$output .= '<ul>';
foreach ($links as $link) {
$output .= '<li';
if ($link['href'] == $_GET['q']) {
$output .= ' id="current"';
}
$output .= '>'. l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment']) .'</li>';
}
$output .= '</ul>';
}
return $output;
}
/* This snippet changes seconday links layout */
function phptemplate_links_secondary($links, $delimiter = ' | ', $leftcab = '', $rightcab = '') {
// Display the left cap of the 'button bar'
$output = '';
$output .= $leftcab;
$link_count = count($links);
$current = 1;
foreach ( $links as $link ) {
// Print the link
$output .= l($link['title'], $link['href'], $link['attributes'], $link['query'], $link['fragment']);
// Only print the delimiter if not the last link
if ( $current < $link_count ) {
$output .= $delimiter;
}
$current++;
}
// Display the right cap of the 'button bar'
$output .= $rightcab;
return $output;
}
/* This snippet changes default menu layout */
function phptemplate_menu_tree($pid = 1) {
if ($tree = menu_tree($pid)) {
$output .= "<ul class=\"menu\">";
$output .= $tree;
$output .= "</ul>";
return $output;
}
}
function phptemplate_menu_item($mid, $children = '', $leaf = TRUE) {
return '<li class="'. ($leaf ? 'leaf' : ($children ? 'expanded' : 'collapsed')) .'">'. menu_item_link($mid) . $children ."</li>\n";
}
/*
* Add backlinks required by license to footer.
*
* This back linking maybe only removed, if you possess
* a YAML Framework and YAML for Drupal license.
*
* For more information read the "YAML" and "YAML for Drupal" license, please.
*
* Licenses:
* YAML - http://www.yaml.de
* YAML for Drupal - http://www.yaml-for-drupal.com
*/
function phptemplate_footer_message($output = '', $delimiter = ' | ') {
$output .= '<p>';
// If you don't like the validation links, simply comment out the following four lines.
$output .= t('<p style="text-align:center;"><a href="http://validator.w3.org/check/referer" title="Validate XHTML" target="_blank">XHTML</a>');
$output .= $delimiter;
$output .= t('<a href="http://jigsaw.w3.org/css-validator/check/referer" title="Validate CSS" target="_blank">CSS</a>');
$output .= $delimiter;
/*
GERMAN:
Diese Rückverlinkung darf nur entfernt werden,
wenn Sie eine YAML-Framework Lizenz besitzen.
:: Lizenzbedingungen: http://www.yaml.de
ENGLISH:
This back linking maybe only removed,
if you possess a YAML Framework license.
:: License conditions: http://www.yaml.de
*/
$output .= t('<a href="http://www.corsado.de/" target="_blank">Corsado.de</a> © 2006-@year', array('@year' => date('Y')));
$output .= $delimiter;
/*
GERMAN:
Diese Rückverlinkung darf nur entfernt werden,
wenn Sie eine YAML für Drupal Lizenz besitzen.
:: Lizenzbedingungen: http://www.yaml-fuer-drupal.de
ENGLISH:
This back linking maybe only removed,
if you have possess a YAML for Drupal license.
:: License conditions: http://www.yaml-for-drupal.com
*/
$output .= t('Design von <a href="http://www.zoe-and-rick.de/" target="_blank">Zoe-and-Rick.de</a> © @year', array('@year' => date('Y')));
$output .= '</p>';
return $output;
}
/*
* We will detect if client is Internet Explorer. Then we are able to add
* the XML prolog for XHTML Standard Compliance Mode for other Browsers.
*
* Today IE is the only known Software we need to workaround and therefor we
* only detect IE browser and suppose all other browsers render correctly with
* XML prolog.
*/
function _browser_xml_prolog_compliant () {
$ua = $_SERVER['HTTP_USER_AGENT'];
if (eregi("msie",$ua) && !eregi("opera",$ua)) {
// This is not a Opera pose as IE
$clientdata = explode(" ",stristr($ua,"msie"));
$client['version'] = $clientdata[1];
if ($client['version'] >= 7) {
// IE >= 7.0: http://blogs.msdn.com/ie/archive/2005/09/15/467901.aspx
$xml_prolog_compliant = true;
}
else {
// IE <= 6.0
$xml_prolog_compliant = false;
}
}
// all other browsers
else {
$xml_prolog_compliant = true;
}
return $xml_prolog_compliant;
}
Über Hilfe würde ich sehr freuen.
Gruß
Popkpopff
- Anmelden oder Registrieren um Kommentare zu schreiben
Neue Kommentare
vor 3 Tagen 10 Stunden
vor 3 Tagen 13 Stunden
vor 3 Tagen 13 Stunden
vor 3 Tagen 13 Stunden
vor 4 Tagen 10 Stunden
vor 4 Tagen 12 Stunden
vor 5 Tagen 9 Stunden
vor 6 Tagen 2 Stunden
vor 6 Tagen 3 Stunden
vor 6 Tagen 6 Stunden