Upgrade for Drupal 5
harriska2 - January 18, 2007 - 05:40
| Project: | FriendsElectric |
| Version: | HEAD |
| Component: | Suggestions |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
It is so close to working right out of the box for Drupal 5 final version. I'm tempted to just implement this almost working version....
1. The category link and read more link in the story segments doesn't work (the story listings on the front page). This is the only killer for me - you can read the rest of the story whether or not you are logged in.
2. The Home button at top shows array
3. When listing views to show and edit, it just gives unlinked "array" for each
Drupal 4.7 version:
http://kathyandcalvin.com/
Drupal 5 version:
http://teachernotes.org/kathy2/kathy/

#1
That is - you CAN'T click on the link to read the rest of the story. Sorry about that.
#2
Well, I went ahead and removed some stuff from nodes.tpl (links to the terms - replaced with Read More and the node_link) and page.tpl (top menu buttons). I also memorized the links to edit views as the page that displays the admin for views has broken links for edit, view, delete, etc. I stuck it in production for 5.1 and it seems to work pretty well.
#3
Ugh, one work around left - the Post Comment link. Trying to find where Friends Electric addresses the link.
#4
Hi Kathy. Your work is really appreciated! Are you going to publish your patch here?
#5
I will but dang, it's a total hack, not a patch.
#6
OK, I think I've sort of hacked a working-but-not-so-pretty version for 5.x. Here is what I did:
/themes/friendselectric/node.tpl.php:
<div class="node<?php print ($sticky) ? " sticky" : ""; ?>">
<?php if ($page == 0): ?>
<h2 class="title"><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>
<?php print $picture ?>
<div class="content">
<?php print $content ?>
</div>
<?php if ($picture): ?>
<span class="clear"></span>
<?php endif; ?>
<?php if ($submitted): ?>
<div class="info"><?php print theme('username', $node) . ' – ' . str_replace('-', ' – ', format_date($node->created)) ?></div>
<?php endif; ?>
<!-- Not themed links but they do work -->
<?php
print '<p></p>';
print '<p class="small">';
$all_links = array();
foreach ($node->links as $link) {
$all_links[] = l($link['title'], $link['href'],
$link['attributes'], $link['query'],
$link['fragment'], FALSE, $link['html']) ;
}
if ( count($all_links) ) {
print implode(' | ', $all_links);
}
print '</p>';
?>
</div>
/themes/friendselectric/template.php - comment out the function phptemplate_links completely:
<?php
function phptemplate_wrap_content($text) {
$text = preg_replace('!<pre>!i', '<div class="pre"><pre>', $text);
$text = preg_replace('!</pre>!i', '</pre></div>', $text);
return $text;
}
function phptemplate_wrap_links($link, $n) {
$classes = array("lw1", "lw2");
$before = $after = "";
foreach ($classes as $c) {
$before .= '<span class="'. $c .'">';
$after .= '</span>';
}
$link = preg_replace('!<a[^>]*>!i', '\0'. $before, $link);
$link = preg_replace('!</a[^>]*>!i', $after . '\0', $link);
return $link;
}
/*
function phptemplate_links($links, $delimiter = " – ") {
return implode($delimiter, $links);
}
*/
function phptemplate_menu_item_link($item, $link_item) {
/* Wrapper span */
return l('<span class="lw1">'. check_plain($item['title']) .'</span>', $link_item['path'], array_key_exists('description', $item) ? array('title' => $items['description']) : array(), NULL, NULL, FALSE, TRUE);
}
function phptemplate_comment_thread_collapsed($comment) {
if ($comment->depth) {
$output = '<div style="padding-left:'. ($comment->depth * 25) ."px;\">\n";
$output .= theme('comment_view', $comment, '', 0);
$output .= "</div>\n";
}
else {
$output .= theme('comment_view', $comment, '', 0);
}
return $output;
}
function phptemplate_comment_thread_expanded($comment) {
$output = '';
if ($comment->depth) {
$output .= '<div style="padding-left:'. ($comment->depth * 25) ."px;\">\n";
}
$output .= theme('comment_view', $comment, module_invoke_all('link', 'comment', $comment, 0));
if ($comment->depth) {
$output .= "</div>\n";
}
return $output;
}
#7
One more change to get some sort of working but non-themed buttons along the top (primary and secondary). I added the
<div id="top-nav">segment and<?php print $scripts ?>line to:/themes/friendselectric/page.tpl.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language; ?>" xml:lang="<?php print $language; ?>">
<head>
<title><?php print $head_title ?></title>
<meta http-equiv="Content-Style-Type" content="text/css" />
<?php print $head ?>
<?php print $styles ?>
<!--Added-->
<?php print $scripts ?>
<script type="text/javascript"> </script>
</head>
<body><div class="bw1"><div class="bw2"><div id="body-wrap">
<div id="header"><div class="hw1"><div class="hw2">
<?php if ($logo): ?>
<a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" id="site-logo" /></a>
<?php endif; ?>
<?php if ($site_name): ?>
<h1 id="site-name" class="<?php print $site_slogan ? 'with-slogan' : 'without-slogan'; ?>"><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a></h1>
<?php endif; ?>
<?php if ($site_slogan): ?>
<span id="site-slogan"><?php print $site_slogan; ?></span>
<?php endif; ?>
<?php print $search_box ?>
<!--Added-->
<div id="top-nav">
<?php if (isset($primary_links)):
print '<ul id="primary">';
foreach ($primary_links as $link) {
print '<li>'. l($link['title'], $link['href'],
$link['attributes'], $link['query'],
$link['fragment'], FALSE, $link['html']) .'</li>';
}
print '</ul>';
endif; ?>
<?php if (isset($secondary_links)):
print '<ul id="secondary">';
foreach ($secondary_links as $link) {
print '<li>'. l($link['title'], $link['href'],
$link['attributes'], $link['query'], $link['fragment'], FALSE, $link['html']) .'</li>';
}
print '</ul>';
endif; ?>
</div>
</div></div></div>
<div id="content" class="content-<?php print $layout; ?>"><div class="cw1"><div class="cw2"><div class="cw3"><div class="cw4"><div class="cw5"><div class="cw6"><div class="cw7"><div class="cw8">
<div id="content-wrap" class="content-wrap-<?php print $layout; ?>">
<?php if ($sidebar_left != ""): ?>
<div class="sidebar" id="sidebar-left">
<?php
// Mark first block title
list($a, $b) = explode('<h2>', $sidebar_left, 2);
print $a . '<h2 class="first">' . $b;
?>
</div>
<?php endif; ?>
<div id="main" class="main-<?php print $layout; ?>"><div id="main-wrap" class="main-wrap-<?php print $layout; ?>"><div class="mw1">
<?php print $header ?>
<?php if ($mission != ""): ?>
<div id="mission"><div class="sw1"><div class="sw2"><div class="sw3"><?php print $mission; ?></div></div></div></div>
<?php endif; ?>
<?php print $breadcrumb ?>
<?php if ($title): ?>
<h2 class="main-title"><?php print $title; ?></h2>
<?php endif; ?>
<?php if ($tabs): ?>
<?php print $tabs; ?>
<?php endif; ?>
<?php if ($help): ?>
<p id="help"><?php print $help; ?></p>
<?php endif; ?>
<?php if ($messages): ?>
<div id="message"><?php print $messages; ?></div>
<?php endif; ?>
<?php print phptemplate_wrap_content($content) ?>
<?php if ($footer_message): ?>
<div id="footer" class="footer-<?php print $layout; ?>"><p><?php print $footer_message; ?></p></div>
<?php endif; ?>
</div></div>
</div>
</div>
<?php if ($sidebar_right): ?>
<div class="sidebar" id="sidebar-right">
<?php
// Mark first block title
list($a, $b) = explode('<h2>', $sidebar_right, 2);
print $a . '<h2 class="first">' . $b;
?>
</div>
<?php endif; ?>
<span class="clear"></span>
</div></div></div></div></div></div></div></div></div>
<?php print $closure;?>
</div></div></div><div id="end" class="end-<?php print $layout; ?>"><div class="ew1"><div class="ew2"></div></div></div></body>
</html>
#8
Ugh, this really doesn't work for IE7.
#9
The tweaks in comment #14 in this issue seemed to fix things in IE 7 for me.
#10
Thanks leafish. I made almost all the style.css changes except adding the left and right top styles and it works great in IE7 now.
#11
See my post at http://drupal.org/node/170948#comment-296052.
#12
subscribing