Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
This must have been asked somewhere, but after searching for about 20 minutes I can't find anything. How can I put an ad after the first node on my homepage? I know there's a loop, but I can't figure out how to set a variable outside node.tpl.php so I can increment the loop.
This is what I'd like to do: if ($postnum == $showads) {
ad here.
} $postnum++;
It's not working because setting $postnum and $showads in page.tpl.php doesn't allow node.tpl.php to see them.
I have been attempting to figure this problem out for a week+ now. I have searched drupal extensively, but found no mention of this. What I am seeing is that my buddylist links are not re-populating my user_profile.tpl.php form with the buddies information when they are clicked. I am fairly new to drupal so there might be a simple mistake that I am making. Can someone please take a look at my code (below) and give me a push in the right direction?
template.php
<?php
/**
* Catch the theme_profile_profile function, and redirect through the template api
*/
function phptemplate_user_profile($user, $fields = array()) {
// Pass to phptemplate, including translating the parameters to an associative array. The element names are the names that the variables
// will be assigned within your template.
/* potential need for other code to extract field info */
return _phptemplate_callback('user_profile', array('user' => $user, 'fields' => $fields));
}
?>
Before you point me to http://drupalart.org/phpbb , i have already tried that. It is a decent start, but only seems to work with drupal 4.6.x. I am using 4.7 rc2.
I have done the flatforum module and I can't get it the way i want it.
Sorry for being prolific, but here's another fun one.
I very recently discovered (because I don't usually check these things when they were working before) that the front page to one of the sites I'm working on kinda borked. Oops. I get a nice white screen of nothing rendering, where before there was a nice front page with all kinds of stuff you might expect on a front page (log in box, new stuff, mission statement, etc).