<div>If you want to remove blog_usernames_blog from $link, put this in template.php</div><div><br></div><div>/* duplicate theme_links() and add the 3rd line (marked with HERE) */</div><div><div>function phptemplate_links($links, $attributes = array('class' => 'links')) {</div>
<div> $output = '';</div><div><br></div><div> // HERE: just add this line, the rest are from theme_links() </div><div> unset($links['blog_usernames_blog']);</div><div> <br></div><div> if (count($links) > 0) {</div>
<div> $output = '<ul'. drupal_attributes($attributes) .'>';</div><div><br></div><div> $num_links = count($links);</div><div> $i = 1;</div><div><br></div><div> foreach ($links as $key => $link) {</div>
<div> $class = $key;</div><div><br></div><div> // Add first, last and active classes to the list of links to help out themers.</div><div> if ($i == 1) {</div><div> $class .= ' first';</div><div>
}</div><div> if ($i == $num_links) {</div><div> $class .= ' last';</div><div> }</div><div> if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page()))) {</div>
<div> $class .= ' active';</div><div> }</div><div> $output .= '<li'. drupal_attributes(array('class' => $class)) .'>';</div><div><br></div><div> if (isset($link['href'])) {</div>
<div> // Pass in $link as $options, they share the same keys.</div><div> $output .= l($link['title'], $link['href'], $link);</div><div> }</div><div> else if (!empty($link['title'])) {</div>
<div> // Some links are actually not links, but we wrap these in <span> for adding title and class attributes</div><div> if (empty($link['html'])) {</div><div> $link['title'] = check_plain($link['title']);</div>
<div> }</div><div> $span_attributes = '';</div><div> if (isset($link['attributes'])) {</div><div> $span_attributes = drupal_attributes($link['attributes']);</div><div>
}</div><div> $output .= /*'<span'. $span_attributes .'>'.*/ $link['title'] /*.'</span>'*/;</div><div> }</div><div><br></div><div> $i++;</div><div> $output .= "</li>\n";</div>
<div> }</div><div><br></div><div> $output .= '</ul>';</div><div> }</div><div><br></div><div> return $output;</div><div>}</div><div><br></div></div><div><br></div><div>For changing $submitted, add to your template.php</div>
<div><div>function phptemplate_node_submitted($node) {</div><div> // make your changes</div><div> return t('By !username (posted on @datetime)'),</div><div> array(</div><div> '!username' => theme('username', $node),</div>
<div> '@datetime' => format_date($node->created),</div><div> ));</div><div>}</div></div><div><br></div><div><br></div><div>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.</div>
<div><br></div><div>function phptemplate_preprocess_node(&$vars, $hook) {<br></div><div> $author = theme('username', $vars['node']);<br></div><div><div> $date = format_date($vars['node']->created, 'medium');</div>
<div> $vars['submitted'] = $author . ' - ' . $date;</div><div>}</div><div><br></div></div><div><br></div>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><br><div class="gmail_quote">On Tue, Apr 14, 2009 at 1:50 PM, brendan, <a href="http://fresh-off.com">fresh-off.com</a> <span dir="ltr"><<a href="mailto:hello@fresh-off.com">hello@fresh-off.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple">
<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></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;font-family:"Lucida Console";color:black">function phptemplate_preprocess_node(&$vars, $hook) {</span></p>
<p><span style="font-size:11.0pt;font-family:"Lucida Console";color:black"> //try to remove 'blog_usernames_blog' from links array</span></p>
<p><span style="font-size:11.0pt;font-family:"Lucida Console";color:black"> $vars['links'] = unset($links[0]);</span></p>
<p><span style="font-size:11.0pt;font-family:"Lucida Console";color:black">}</span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D">it throws this error on the template.php page:</span></p>
<p><b><span style="font-size:11.0pt;color:#1F497D">Parse error: syntax error, unexpected T_UNSET</span></b></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></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></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D">Thanks for any help!</span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D">Brendan</span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></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<div><div></div><div class="h5"><br>
<b>To:</b> 'A list for theme developers'<br>
<b>Subject:</b> Re: [themes] targeting variables in my node-blog.tpl.php file</div></div></span></p>
</div>
</div><div><div></div><div class="h5">
<p> </p>
<p><b><span style="font-size:11.0pt;color:#1F497D">Thanks for your responses CK Ng and J. Sint Jago!</span></b></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></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></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></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D">Using the Devel Mod I got the following info (or see attached
screenshot): </span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D">---</span></p>
<p><span style="font-size:11.0pt;color:#1F497D">parents: node.tlp.php < page.tlp.php</span></p>
<p><span style="font-size:11.0pt;color:#1F497D">function called: theme_links()</span></p>
<p><span style="font-size:11.0pt;color:#1F497D">Candidates Function names: myTheme_links <
phptemplate_links < theme_links</span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></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></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></p>
<p><span style="font-size:11.0pt;color:#1F497D">----</span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></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></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D">I'm stuck, any further suggestions?</span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p><span style="font-size:11.0pt;color:#1F497D"> </span></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></p>
</div>
<p> </p>
<div>
<p>brendan,</p>
</div>
<div>
<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?"</p>
</div>
<div>
<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</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:</p>
<div>
<div>
<p><b>Hello, </b></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></p>
<p><span style="color:black"> </span></p>
<p><b><span style="color:#76923C">$submitted</span></b></p>
<p><b><span style="color:#76923C">$links</span></b></p>
<p><span style="color:black"> </span></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></p>
<p><span style="color:black"> </span></p>
<p><span style="color:black">Currently it writes the data to the page like
this:</span></p>
<p><span style="color:black"> </span></p>
<p><span style="color:black">---</span></p>
<p><span style="font-family:"Lucida Console";color:#76923C">Submitted by
super_user on April 9, 2009 - 2:49pm</span></p>
<p><span style="color:black">---</span></p>
<p><span style="color:black"> </span></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></p>
<p><span style="color:black"> </span></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></p>
<p><span style="color:black"> </span></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></p>
<p><span style="color:black">Hopefully the nice folks on this list can help!!</span></p>
<p><span style="color:black"> </span></p>
<p><span style="color:black"> </span></p>
<p><b><span style="color:black">brendan, <a href="http://fresh-off.com" target="_blank">fresh-off.com</a></span></b></p>
<p><span style="color:black">Creative Direction & Consultation: Web | Print
| Brand</span></p>
<p><span style="color:black"> </span></p>
<p><span style="color:black"><a href="http://fresh-off.com" target="_blank">http://fresh-off.com</a></span></p>
<p><span style="color:black"><a href="mailto:hello@fresh-off.com" target="_blank">hello@fresh-off.com</a></span></p>
<p><span style="color:black">206.328.1067</span></p>
<p><span style="color:black">seattle.usa</span></p>
<p><span style="color:black"> </span></p>
<p><span style="color:black"> </span></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></p>
</div>
<p> </p>
</div>
</div></div></div>
</div>
<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><br>
<br></blockquote></div><br>