My b2evolution Version: 2.x
Hi,
I am attempting to add some coding to the sidebar that will display a different Amazon.com ad based on the chosen category.
I know a little bit about PHP and am pretty sure what I want to construct is an if / elseif statement. Something along the lines of -
<?php
if ( $category = "Music" )
echo "Amazon coding here" ;
elseif ( $category = "Movies" )
echo "Amazon coding here" ;
repeat for each category i need it for ---
else die;
?>
I always have trouble with the variables part.
Can someone tell me if I am thinking along the right lines?
Is $category the variable I need to use with b2evo to call the category names?
Can I make it only check the main category of a post, rather than a sub-category?
Is echo the correct function I need?
Anyone willing to give me a blank template to use where I can just put in category name and the Amazon code? (To make sure I don't miss a simple ; or { and mess it all up. lol )
Thanks to anyone that can help,
Gene :-)
In case it matters I am using the Russian b2evolution skin.
It's a tad of a ballache to get $Item into the sidebar, but when you do you need to code something along the lines of :
¥