<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>WOW!!! THANKS EVERY SO MUCH!!! I would have never gotten that
far on my own! I really, really, really appreciate that CK Ng!!!!<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Brendan <o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
themes-bounces@drupal.org [mailto:themes-bounces@drupal.org] <b>On Behalf Of </b>Ng
Chin Kiong<br>
<b>Sent:</b> Tuesday, April 14, 2009 2:59 AM<br>
<b>To:</b> A list for theme developers<br>
<b>Subject:</b> Re: [themes] targeting variables in my node-blog.tpl.php file<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<p class=MsoNormal>If you want to remove blog_usernames_blog from $link,
put this in template.php<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal>/* duplicate theme_links() and add the 3rd line (marked with
HERE) */<o:p></o:p></p>
</div>
<div>
<div>
<p class=MsoNormal>function phptemplate_links($links, $attributes =
array('class' => 'links')) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $output = '';<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal> // HERE: just add this line, the rest are
from theme_links() <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> unset($links['blog_usernames_blog']);<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> <o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> if (count($links) > 0) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $output = '<ul'.
drupal_attributes($attributes) .'>';<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal> $num_links = count($links);<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $i = 1;<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal> foreach ($links as $key => $link) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $class = $key;<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal> // Add first, last and active
classes to the list of links to help out themers.<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> if ($i == 1) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $class .= ' first';<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> }<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> if ($i == $num_links) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $class .= ' last';<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> }<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> if (isset($link['href'])
&& ($link['href'] == $_GET['q'] || ($link['href'] == '<front>'
&& drupal_is_front_page()))) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $class .= ' active';<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> }<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $output .= '<li'.
drupal_attributes(array('class' => $class)) .'>';<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal> if (isset($link['href'])) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> // Pass in $link as
$options, they share the same keys.<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $output .=
l($link['title'], $link['href'], $link);<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> }<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> else if (!empty($link['title'])) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> // Some links are actually
not links, but we wrap these in <span> for adding title and class
attributes<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> if (empty($link['html'])) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $link['title'] =
check_plain($link['title']);<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> }<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $span_attributes = '';<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> if
(isset($link['attributes'])) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $span_attributes =
drupal_attributes($link['attributes']);<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> }<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $output .= /*'<span'.
$span_attributes .'>'.*/ $link['title'] /*.'</span>'*/;<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> }<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal> $i++;<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $output .=
"</li>\n";<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> }<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal> $output .= '</ul>';<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> }<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal> return $output;<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal>}<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal>For changing $submitted, add to your template.php<o:p></o:p></p>
</div>
<div>
<div>
<p class=MsoNormal>function phptemplate_node_submitted($node) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> // make your changes<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> return t('By !username (posted on @datetime)'),<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> array(<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> '!username' =>
theme('username', $node),<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> '@datetime' => format_date($node->created),<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> ));<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal>}<o:p></o:p></p>
</div>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal>For phptemplate_preprocess_node, if you want to
introduce new variables or modify existing one. Of course it can be used to
change submitted as well, but not $links as it has been generated.<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<div>
<p class=MsoNormal>function phptemplate_preprocess_node(&$vars, $hook) {<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $author = theme('username', $vars['node']);<o:p></o:p></p>
</div>
<div>
<div>
<p class=MsoNormal> $date = format_date($vars['node']->created,
'medium');<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal> $vars['submitted'] = $author . ' - ' . $date;<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal>}<o:p></o:p></p>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</div>
<div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'>Cheers,<br>
CK Ng<br>
<br>
forDrupal Premium Themes (<a href="http://fordrupal.com">http://fordrupal.com</a>)<br>
- we make drupal beautiful<br>
<br>
<o:p></o:p></p>
<div>
<p class=MsoNormal>On Tue, Apr 14, 2009 at 1:50 PM, brendan, <a
href="http://fresh-off.com">fresh-off.com</a> <<a
href="mailto:hello@fresh-off.com">hello@fresh-off.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p><span style='font-size:11.0pt;color:#1F497D'>Here's as far as I was able to
get using CK Ng's suggestion:</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;font-family:"Lucida Console";color:black'>function
phptemplate_preprocess_node(&$vars, $hook) {</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;font-family:"Lucida Console";color:black'>
//try to remove 'blog_usernames_blog' from links array</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;font-family:"Lucida Console";color:black'>
$vars['links'] = unset($links[0]);</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;font-family:"Lucida Console";color:black'>}</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>it throws this error on the
template.php page:</span><o:p></o:p></p>
<p><b><span style='font-size:11.0pt;color:#1F497D'>Parse error: syntax error,
unexpected T_UNSET</span></b><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>As I said, writing php from
scratch is difficult for me. Am I even on the right track?</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>Thanks for any help!</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>Brendan</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p><b><span style='font-size:10.0pt'>From:</span></b><span style='font-size:
10.0pt'> <a href="mailto:themes-bounces@drupal.org" target="_blank">themes-bounces@drupal.org</a>
[mailto:<a href="mailto:themes-bounces@drupal.org" target="_blank">themes-bounces@drupal.org</a>]
<b>On Behalf Of </b>brendan, <a href="http://fresh-off.com" target="_blank">fresh-off.com</a><br>
<b>Sent:</b> Monday, April 13, 2009 6:02 PM<o:p></o:p></span></p>
<div>
<div>
<p class=MsoNormal><span style='font-size:10.0pt'><br>
<b>To:</b> 'A list for theme developers'<br>
<b>Subject:</b> Re: [themes] targeting variables in my node-blog.tpl.php file<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p> <o:p></o:p></p>
<p><b><span style='font-size:11.0pt;color:#1F497D'>Thanks for your responses CK
Ng and J. Sint Jago!</span></b><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>I don’t think my PHP skills are
good enough to write the necessary function from scratch. However, I'm usually
able to modify existing examples. </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>CK, Based on your response to
Sebastian and the reading on Drupal.org, it seems I need to add
phptemplate_preprocess_node() to template.php. But I'm not sure
exactly how its supposed to be written.</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>Using the Devel Mod I got the
following info (or see attached screenshot): </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>---</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>parents: node.tlp.php <
page.tlp.php</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>function called:
theme_links()</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>Candidates Function names:
myTheme_links < phptemplate_links < theme_links</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>Next it lists 2 arrays for the
theme_links() function. Those elements are: links array &
attributes array</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>The links array has 3 elements,
the first of which is the array I don’t want to display:
blog_usernames_blog </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>----</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>I think that’s all of the
information I need, but I'm still not sure what to do next, or where to find an
example of the code to modify and insert into template.php to keep it from
showing blog_usernames_blog.</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'>I'm stuck, any further
suggestions?</span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p><b><span style='font-size:10.0pt'>From:</span></b><span style='font-size:
10.0pt'> <a href="mailto:themes-bounces@drupal.org" target="_blank">themes-bounces@drupal.org</a>
[mailto:<a href="mailto:themes-bounces@drupal.org" target="_blank">themes-bounces@drupal.org</a>]
<b>On Behalf Of </b>Ng Chin Kiong<br>
<b>Sent:</b> Friday, April 10, 2009 2:09 AM<br>
<b>To:</b> A list for theme developers<br>
<b>Subject:</b> Re: [themes] targeting variables in my node-blog.tpl.php file</span><o:p></o:p></p>
</div>
<p> <o:p></o:p></p>
<div>
<p>brendan,<o:p></o:p></p>
</div>
<div>
<p> <o:p></o:p></p>
</div>
<div>
<p>You can use template preprocessor. See my latest reply on "Re: how to
stop a 'view' from showing a field?"<o:p></o:p></p>
</div>
<div>
<p> <o:p></o:p></p>
</div>
<div>
<p style='margin-bottom:12.0pt'><br clear=all>
Cheers,<br>
CK Ng<br>
<br>
forDrupal Premium Themes (<a href="http://fordrupal.com" target="_blank">http://fordrupal.com</a>)<br>
- we make drupal beautiful<o:p></o:p></p>
<div>
<p>On Fri, Apr 10, 2009 at 3:53 PM, brendan, <a href="http://fresh-off.com"
target="_blank">fresh-off.com</a> <<a href="mailto:hello@fresh-off.com"
target="_blank">hello@fresh-off.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p><b>Hello, </b><o:p></o:p></p>
<p><span style='color:black'>I can't seem to figure out how to effectively
target two different values in my node-blog.tpl.php file:</span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><b><span style='color:#76923C'>$submitted</span></b><o:p></o:p></p>
<p><b><span style='color:#76923C'>$links</span></b><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><span style='color:black'>For the $submitted value, I'd like to insert some
xhtml tags in there so that I can target them with CSS. </span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><span style='color:black'>Currently it writes the data to the page like
this:</span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><span style='color:black'>---</span><o:p></o:p></p>
<p><span style='font-family:"Lucida Console";color:#76923C'>Submitted by
super_user on April 9, 2009 - 2:49pm</span><o:p></o:p></p>
<p><span style='color:black'>---</span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><span style='color:black'>But I'd like to get some xhtml tags around the <b>User</b>
and the <b>Month</b>. It would also be nice if I could delete the hour -
but that’s not as important.</span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><span style='color:black'>For the <b>$links</b> value, I'd like to figure
out how to remove the <b>Author</b>. Currently, the $links value writes<i>:</i></span><i><span
style='color:#76923C'>"Author's Blog"</span><span style='color:black'>,
</span><span style='color:#76923C'>"Read More..."</span><span
style='color:black'>,</span></i><span style='color:black'> and </span><i><span
style='color:#76923C'>"Add comments"</span></i><span
style='color:black'> to the teaser. How do I remove just the
"Authors blog" info from the $links value? </span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><span style='color:black'>Unfortunately, I know enough PHP to get myself
confused a lot, and I've been googling and searching Drupal.org all day with no
luck. </span><o:p></o:p></p>
<p><span style='color:black'>Hopefully the nice folks on this list can help!!</span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><b><span style='color:black'>brendan, <a href="http://fresh-off.com"
target="_blank">fresh-off.com</a></span></b><o:p></o:p></p>
<p><span style='color:black'>Creative Direction & Consultation: Web | Print
| Brand</span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><span style='color:black'><a href="http://fresh-off.com" target="_blank">http://fresh-off.com</a></span><o:p></o:p></p>
<p><span style='color:black'><a href="mailto:hello@fresh-off.com"
target="_blank">hello@fresh-off.com</a></span><o:p></o:p></p>
<p><span style='color:black'>206.328.1067</span><o:p></o:p></p>
<p><span style='color:black'>seattle.usa</span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
<p><span style='color:black'> </span><o:p></o:p></p>
</div>
</div>
<p style='margin-bottom:12.0pt'><br>
_______________________________________________<br>
themes mailing list<br>
<a href="mailto:themes@drupal.org" target="_blank">themes@drupal.org</a><br>
<a href="http://lists.drupal.org/mailman/listinfo/themes" target="_blank">http://lists.drupal.org/mailman/listinfo/themes</a><o:p></o:p></p>
</div>
<p> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
_______________________________________________<br>
themes mailing list<br>
<a href="mailto:themes@drupal.org">themes@drupal.org</a><br>
<a href="http://lists.drupal.org/mailman/listinfo/themes" target="_blank">http://lists.drupal.org/mailman/listinfo/themes</a><o:p></o:p></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>