Archive

Archive for September 29th, 2008

qTranslate Tag Cloud Fixed

September 29th, 2008

qTranslate Tag Cloud Fixed

If you have qTranslate plugin for wordpress and you have some issues on your tag cloud.

The problem was that the function that generated the tag cloud in spanish the size of the sources they put comma instead of point

On /wp-includes/category-template.php in function wp_generate_tag_cloud check the line 422, str_replace() fix the problem:

418
419
420
421
422
423
424
	foreach ( $counts as $tag => $count ) {
		$tag_id = $tag_ids[$tag];
		$tag_link = clean_url($tag_links[$tag]);
		$a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . attribute_escape( sprintf( __ngettext('%d topic','%d topics',$count), $count ) ) . "'$rel style='font-size: " .
			str_replace(",",".",( $smallest + ( ($count - $min_count ) * $font_step ) ))
			. "$unit;'>$tag</a><!-- $font_step -->";
	}

web ,

Simple PHP Templates

September 29th, 2008

Simple PHP Templates

This is my Template function:

 $value) {
			$t=str_replace('{'.strtoupper($part).'}',$value,$t);
		}
	}
	return  $t;
}
?&gt;

example.tpl:

 
	{TITLE}
<div id="main">{MAIN}</div>
<div id="other">{OTHER}</div>

other.tpl:

<form id="{FORM_NAME}" action="{SOME_PATH}">
<!-- etc... -->
</form>

Using the function and templates:

 

Result:

 
	Some Page
<div id="main">Bla, Bla, Bla...</div>
<div id="other">
<form id="frmLogin" action="login.php">
			<!-- etc... -->
			</form></div>

develop, web