Recent Topics

1 Jan 06, 2008 17:55    

My b2evolution Version: Not Entered

Hi,

I have been lurkng here, soaking up all the excellent information posted here, and this is my first post.

yes I don't know squat about php and on a good day, I can half way keep from breaking things on my blogs..

But all I really want to do is add a few small clickable link buttons in the sidebar of my blog mainpage.

one button I want to use has this code to add...

<a href=http://www.leftyblogs.com><img src=http://www.leftyblogs.com/mini2.gif border=0></a>

my blog is http://nebraskablue.com/index.php

I am using The Crystal Glass skin as the default and NON-switchable skin.

If one of the Guru's on here on help me figure out HOW to add image buttons like this below the credits in the sidebar.. I would be very grateful.

And I would like to put up a BIG thank you to all the great folks on
here that help those struggling with php, and make this place so good.

Paul :D

2 Jan 06, 2008 18:11

Good old 1 dot 10 dot 2!

Here's the crash course: php works on your server to make an html page by using a bunch of logic and pulling bits out of your database. You can also mix regular old html inside your php stuff. There: no you're an expert! Make backups of your files as you tinker. That way everything that goes wrong can be undone and you can feel happy about learning what to not do next time :)

Now get yourself a nice document editor, but not a "word document" editor. I like HTML Kit because it's free and I like it. Plain old notepad works, but it's better to get something a little bit "smart" because smart ones will color tags and stuff for you to kind of help you make good php documents. Notepad++ is another good free one.

Now open up your blog/skins/crystal_glass/_main.php file and immediately save it as "_main_TEST.php". Take a look at what you have there. Notice the comments that point out what each little bit is doing? Cool yah?

Find this bit if you can:

<?php 
/* ------------------------- SKINS LIST INCLUDED HERE --------------------------
 * customize this with settings in skins/skinname/_skinslist.php 
 * this is a hack - it is NOT an official part of b2evolution!
 */
if( ! $Blog->get('force_skin') ) {
	require( dirname(__FILE__).'/_skinslist.php');
	} // -------------------------- END OF SKINS LIST ------------------------- ?>


<?php // --------------------- WHO'S ONLINE INCLUDED HERE ----------------------
if( empty($generating_static) && ! $Plugins->trigger_event_first_true('CacheIsCollectingContent') ) { ?>
	<div class="bSideItem">
	<h3 class="sideItemTitle"><?php echo T_('Who\'s Online?') ?></h3>
	<?php $Sessions->display_onliners(); ?>
	</div>
	<?php 
	} // ------------------------- END OF WHO'S ONLINE ------------------------ ?>

That's telling your server to make the skins list if it's allowed, but it's not so it doesn't. It then tells your server to make the "who's online" block. So if you wanted to add that link right above your "who's online" block you simply add it in there.

	require( dirname(__FILE__).'/_skinslist.php');
	} // -------------------------- END OF SKINS LIST ------------------------- ?>

<a href=http://www.leftyblogs.com><img src=http://www.leftyblogs.com/mini2.gif /></a>

<?php // --------------------- WHO'S ONLINE INCLUDED HERE ----------------------
if( empty($generating_static) && ! $Plugins->trigger_event_first_true('CacheIsCollectingContent') ) { ?>

Oh I took out the 'border=0' bit because you don't actually need it, and I put a "space-slash" to close your image tag. It's the way hip cats make tags in xhtml ;)

Anyway now use your favorite FTP program to upload that new file to skins/crystal_glass/ on your server, then rename it to _main.php and check out your blog.

3 Jan 06, 2008 18:15

Hi Paul NE Blue,

Welcome to the forum and thanks or your kind words.

Crack open /skins/crystal_glass/_main.php and find lines 292-298:

</div>



</div>

<?php } // end hiding the sidebar on single post pages ?>


The first </div> in this snippet is the end of the previous item and that is the "powered by" section.
You want to add something below that. I will give an extended example, cut away what is not needed at your blog.

</div> <!-- end of previous item -->


<div class="bSideItem"> <!-- start of new item -->
<h3>External links</h3><!-- title bar-->
<ul><!-- unordered list -->
  <li><a href=http://www.leftyblogs.com><img src=http://www.leftyblogs.com/mini2.gif border=0></a></li><!-- your first link-->
  <li><!-- your second link goes here --></li>
</ul>
</div><!-- end of side item -->


</div><!-- end of sidebar -->

<?php } // end hiding the sidebar on single post pages ?>

Good luck

4 Jan 06, 2008 19:03

A great big thanks to ED and Afwas...

I am very grateful, I will get in and tinker with the directions you posted (AFTER I make a back up)..

I am sorry I don't have any Mojo (Rep points) to give you..

But if either of you find your way down to Lincoln, Nebraska... I'll pay your bar tab and help you run it up....

Thank you!

Paul

5 Jan 06, 2008 23:00

Thank you EdB and Afwas..

I used a little bit of both your help and got it working.

I modified the location of the buttons to my own media file folder,

so I could manipulate them to the size I wanted and can add borders later on.

you can see it here - http://nebraskablue.com/index.php

It looks good... thank you!

Paul

6 Jan 06, 2008 23:10

To get rid of the >> arrows try this:

</div> <!-- end of previous item --> 
<div class="bSideItem"> <!-- start of new item --> 
<h3>Good Links</h3><!-- title bar--> 
<ul style="list-style-type: none"><!-- unordered list -->  
 <li><a href="http://www.leftyblogs.com"><img src="http://www.nebraskablue.com/media/mini2.bmp"></a></li><!-- your first link-->  
 <li><a href="http://www.moreasslessbush.com/"><img src="http://www.nebraskablue.com/media/moreass.bmp"></a></li><!-- your second link-->  
<li><!-- your third link goes here --></li> 
</ul> 
</div><!-- end of side item --> 


</div><!-- end of sidebar --> 


The difference is here:

<ul style="list-style-type: none"><!-- unordered list --> 

Happy blogging


Form is loading...