Recent Topics

1 Feb 07, 2006 06:36    

Ok latest question in the pursuit of getting my BLOG site the way I want it.
I am trying to add an ad space on the top of the individual blog pages and just below the header like this (the banner that says MyPlainview.com):
http://www.myplainview.com/ryan/blogadexample.jpg

Well I can ad the same ad to all the blog pages by adding this to the _main.php of the kubrick2evo skin:

<h2 class="pagetitle"><?php
single_cat_title();
single_month_title();
single_post_title();
arcdir_title();
last_comments_title();
stats_title();
profile_title();
?></h2>

<!-- =================================== START OF MAIN AREA =================================== -->
<img src="468x60.jpg">
<?php // --- START OF POSTS ---
if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post
if( isset($MainList) ) while( $Item = $MainList->get_item() ) {
// $MainList->date_if_changed(); ?>
<div class="bPost" lang="<?php $Item->lang() ?>">

That works however my problem and question to you is that I want different fixed ads to show up in that position for each of the different blogs. Basically we plan on selling sponsoships to each blog so as I have it the same ad will show up on all the blogs. Is there a way to make that ad unique depending upon which blog is called up?

2 Feb 07, 2006 15:52

You could use a different skin for each blog. Or you could add some code like this

switch ($blog) 
{
case 1:
echo '<img src="image for blog one goes here" />';
break;
case 2:
echo '<img src="image for blog two goes here" />';
break;
} 

3 Feb 07, 2006 16:01

ok the switching of skins is out cause they all need to keep the same style. I am a complete novice at this so I really don't understand the code example you gave. Could you further explain that? Thanks!

4 Feb 07, 2006 16:09

Sure, I'll explain it.

Find this part of your _main.php file:

<!-- =================================== START OF MAIN AREA =================================== -->
<img src="468x60.jpg">
<?php // --- START OF POSTS --- 


and make it look like this:

<!-- =================================== START OF MAIN AREA =================================== -->
<?php
switch ($blog)
{
case 1:
echo '<img src="image for blog one goes here" />';
break;
case 2:
echo '<img src="image for blog two goes here" />';
break;
}
 // --- START OF POSTS --- 

What that's doing is checking the value of $blog, which is the id of the blog that is being displayed, then it can display a different image for each blog. Copy and paste to make a new section for each blog, case 3, case 4, etc. If you are going to be having more than ten blogs, then this might get to be a long section. If that's the case, then I have another idea that might work better.

5 Feb 07, 2006 16:12

ok thank that helps!
I shouldn't have more than 10 blogs at least not for a long while.
I will try that right now.

6 Feb 07, 2006 16:54

Hey that will work great thanks!


Form is loading...