Hey Everyone! Sorry to be another template.php question, but I have tried every placement and can't get this thing to work. Here is my template.php code...any help is greatly appreciated!!!!

<?
function _phptemplate_variables($hook, $vars) {
//print ('

');
	//print_r($vars);
	//print ('

');

/*** poll *****************/
/*
if($hook=='block'&&$vars['block']->module=='poll'&&$vars['block']->delta=='0'){
$vars['block']->content='

What do you think?
'.$vars['block']->content.'

';
}
*/

/*** Navigation *****************/
if($hook=='block'&&$vars['block']->module=='user'&&$vars['block']->delta=='1'){
//print_r($vars);
$vars['block']->content='

'.$vars['block']->subject.'

'.$vars['block']->content.'

';
}

/*** User Login *****************/
if($hook=='block'&&$vars['block']->module=='user'&&$vars['block']->delta=='0'){
//print_r($vars);
$vars['block']->content='

'.$vars['block']->subject.'

'.$vars['block']->content.'

';
}

/*** Search *****************/
if($hook=='block'&&$vars['block']->module=='search'&&$vars['block']->delta=='0'){
//print_r($vars);
$vars['block']->content='

'.$vars['block']->subject.'

'.$vars['block']->content.'

';
}

//print_r($vars);
/*
if($hook=='page'&&arg(0)=='search'){
$vars['content']='

Search results
'.$vars['content'].'

';

}
*/

return $vars;
}

function phptemplate_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
$title = drupal_get_title();
if (!empty($title)) {
$breadcrumb[]=$title;
}
return implode(' ', $breadcrumb);
}
else return 'Home';
}

/**
* views template to output a view.
* This code was generated by the views theming wizard
* Date: Fri, 07/04/2008 - 14:35
* View: press_room
*
* This function goes in your template.php file
*/
function phptemplate_views_view_list_press_room($view, $nodes, $type) {
$fields = _views_get_fields();

$taken = array();

// Group our nodes
$set = array();

//we have 2 level grouping - by year, by month
foreach ($nodes as $node) {
$t=strtotime($node->node_data_field_published_field_published_value);
$node=node_load($node->nid);
$set[date('Y',$t)][date('F',$t)][]=$node;
}

// Set up some variables that won't change.
$base_vars = array(
'view' => $view,
'view_type' => $type,
);

$output = '';
foreach ($set as $year => $months) {
$items = array();
//$output.='

'.$year.'

';
foreach ($months as $month => $nodes){
$output.='

'.$month.' '.$year.'

';
foreach($nodes as $i=>$node){
$vars = $base_vars;
$vars['node'] = $node;
$vars['count'] = $i;
$vars['stripe'] = $i % 2 ? 'even' : 'odd';
$output.=_phptemplate_callback('views-list-press_room', $vars);
}
}
}
return $output;
}

/*** to show blocks on 404 page ******************************************/
function snv_page($content, $show_blocks = TRUE) {

// Set additional conditions to change $show_blocks if you want here..
// The following will always set $show_blocks to TRUE.
$show_blocks = $show_blocks ? $show_blocks : TRUE;

// phptemplate_page is what gets called usually but the
// theme function allows us to override it with the themes' name.
// We're calling it directly here so we don't have to copy tons of code.
return phptemplate_page($content, $show_blocks);
}

?>

Comments

Sound-n-Vision’s picture

Assigned: Sound-n-Vision » Unassigned
nicholasthompson’s picture

you simply need to add the code from the readme into your _phptemplate_variables function. It should only apply to page hooks

Sound-n-Vision’s picture

Status: Active » Closed (fixed)

Thanks! I ended up getting it to work after some experimenting.