Recent Topics

1 Mar 19, 2009 00:30    

My b2evolution Version: 2.x

I'm trying to make the correct archive month and archive year appear in my skin. If I use Request Title, it has too much information that I can't seem to edit, even with changing the arcdir_text and catdir_text (I really would just want to delete any catdir info and simplify the arcdir text. See below:

request_title( array(
			'auto_pilot' => 'none',
			'title_before'=> '<h2>',
			'title_after' => '</h2>',
			'title_none'  => '',
			'glue'        => ' - ',
			'title_single_disp' => true,
			'format'      => 'htmlbody',
			'arcdir_text' =>  T_('from'),
			'catdir_text' => T_(''),
			
		) );

Does anyone know a way in a template I could just use some type of $arc_month and $arc_year and have that work, or make request_title -- which can get that info work? I read the source code for request_title: http://doc.b2evolution.net/v-2-4/__filesource/fsource_evocore__blogsinc_core_template.funcs.php.html#a169

but it didn't help.

Thanks in advance.

2 Mar 19, 2009 00:44

P.S. I'm really looking for the equivalent in the older version(s) of B2evolution of single_month_title() -- I want to be able to have on the archive pages something like Press Releases from April 2008. I'm using stub pages with a custom skin if this helps. Thanks again.

3 Mar 23, 2009 21:38

I've ended up with a type of kludge, since I didn't find out about a variable to use. Here's what I used:

if(isset($_SERVER['QUERY_STRING']) && ($_SERVER['QUERY_STRING'] != ''))
{

     parse_str($_SERVER['QUERY_STRING'], $strings);
}
if ($strings['m']) { 
	$thedate=$strings['m'];
	$theyear=substr($thedate, 0,4);
	$themonth=substr($thedate, 4,2);
	$themonth=$month[zeroise($themonth,2)];
	

}

<?php 
if ($themonth !='') {
	echo '<p class="index-title">Archives for '.$themonth.' '.$theyear.'</p>';
}
?>

If anyone can think of something better, please let me know. Otherwise, maybe this will help someone else.

4 Mar 24, 2009 02:47

global $m, $month, $month_abbrev;
if( !empty($m) )
{	// Archives mode only
	$m_num = substr($m, 4, 2);
	$year = substr($m, 0, 4);
	
	$cur_month = $month[zeroise($m_num, 2)];  // September
	$cur_month_abbrev = $month_abbrev[zeroise($m_num, 2)];  // Sep
	
	// Archives for September 2009
	echo '<p class="index-title">Archives for '.$cur_month.' '.$year.'</p>';	
}

Not tested

5 Mar 24, 2009 21:12

Great, thanks! Works great, and much less of a kludge.


Form is loading...