If we cannot by reason, by influence, by example, by strenuous effort, and by personal sacrifice, mend the bad places of civilization, we certainly cannot do it by force... ~Auberon Herbert
23 November 2007
Written by
Yours Truly (

)
Published on November 23rd, 2007 @ 06:31:30 pm, using 1322 words, 14246 views
I’ve been using b2evolution as my blogging platform for several years now, and have always found the default template switcher located in the sidebar to be, well, boring. It’s a text-based list that shows the various skins available on a b2evo blog from which that blog’s readers can select to customize their reading experience. The operative words here are “text based list". Clever skin names aside, it does little to show the reader what a template actually looks like before being selected, and eye-candy is always welcome, right? With this in mind, I set about putting together a more visually intuitive way of displaying to the user what b2evo skins look like, without that user actually having to switch to that skin in order to see it.
What I came up with is a small piece of PHP code which renders a tiled list to display thumbnails of each b2evo skin, replacing the boring, and uninformative, text list. At the time of this writing, the tiled list can be seen in action in the sidebar of each skin on this blog.
If you’d like to implement a similar list on your own b2evolution blog, you’ll need a few things first… Since I’m providing you with the code here, you’ll need the ability to copy and paste text from one file to another. Simple enough, yeah? Second, you’ll need some kind of graphics editing program, such as Adobe Photoshop or the free GIMP software, which is actually a pretty powerful piece of software. In any case, you’ll need some kind of graphics program in which to create the thumbnails to be displayed in the list…
Alright, on with the show…
Read the full text of this post...
07 November 2007
Written by
Yours Truly (

)
Published on November 7th, 2007 @ 10:10:27 pm, using 559 words, 2072 views
For those of you who are avid music listeners, you may want to have the ability to easily include a text box beneath your blog posts in which to quickly list the music to which you're currently listening. This can be quickly achieved by adding a small block of CSS to your b2evo skin's stylesheet, and a small piece of javascript to the toolbar code in the b2evo core.
The CSS block shown below is the one used for the "Contemporaneous Auditory Narcotics" DIV which lives under the post body and which can be seen in most posts on this site. Add a similar block to the stylesheet in your b2evo skin and adjust the color and text to suit your b2evo skin:
Read the full text of this post...
05 August 2007
Written by
Yours Truly (

)
Published on August 5th, 2007 @ 07:25:20 pm, using 288 words, 749 views
A while back I found myself needing the ability to uniquely identify each blog on my b2evolution system. I wanted to be able to display blog-specific CSS styles and header imagery, while using the same b2evo skin across the entire site, rather than developing slightly varied skins for each blog.
The solution is rather simple, and allows each blog to be styled uniquely, while still allowing the remaining stylesheet definitions to cascade over elements which are not called by the unique identifier. So... on to the code...
Adding the following code to your b2evo skin's /skinname/_main.php file will cause the 'body' tag to be ID'd with the '$blog_shortname' of the specific blog. Essentially, this will ID the body tag as id=1 for Blog All, id=2 for Blog A, and so on....
The following code will work on b2evo 0.9.x...
<body id="<?php echo $Blog->disp( 'shortname' ) ?>">
...and the following code works in b2evolution 1.10.x...
<body id="blog<?php echo $blog ?>">
Once this code has been implemented in the _main.php file of your favorite b2evo skin, you can assign blog-specific styles to your CSS stylesheet as so:
body#blog2 #header {
background: #000 url(images/blog2header.jpg) top center no-repeat;
text-align: left;
}
body#blog3 #header {
background: #000 url(images/blog3header.jpg) top center no-repeat;
text-align: right;
}
The CSS style shown above works with the second PHP example, and can be used in b2evolution 1.10.x blogs...
Contemporaneous Auditory Narcotics:
or, What my speakers are currently pumping...
Decoder & Substance - Heist / Curvature
This post is the creative work of Yours Truly and is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 License.