Customising Firefox 3
Tuesday, May 13th, 2008If, like me you have recently upgraded to Firefox 3 and you have spent years using Tabbed Browser Preferences to manage your tabs position in the window, colour, order etc etc, then you, like me, are quite disappointed with the lack of configuration the tab bar has within Firefox 3.
Developer Comments: This extension is an enhancement for the basic tab controls provided in Firefox 1.0. It replaces the existing user interface with a new, more visible user interface, and also includes UI for other hidden features that are part of the browser, as well as features provided explicitly by the extension.
Tabbrowser Prefs is not currently available for Firefox 3 on Windows or Linux, which left me feeling frustrated. I would love to have felt annoyed, but can you really be annoyed when the info to build your very own plugin is out there?
I decided I had to do something. I had to have my tab bar on the bottom of the window at least. So, I went off and researched it.
After about 5 minutes I found out that the main interface to Firefox is controlled entirely by CSS. This is perfect. I located the CSS style sheet, googl’d some more and found the CSS variables needed to modify the interface settings. So now I am going to share it with everyone of you.
Ubuntu Hardy Heron Version
Open up nautilus and show hidden files. then navigate to:
- /home/.mozilla/firefox/your.profile/chrome
By default userChrome.css fie does not exist, so you need to create it before you can start adding your preferences. There’s actually an example file that exists by default, called userChrome-example.css. You can just rename that file by removing the -example part. Then open this file in leaf/mouse pad or any other text editor and add the following code and save it.
- /* Display the tabbar at the bottom */ #content > tabbox { -moz-box-direction: reverse; }
Windows XP/Vista Versions
Open up My Computer or File Explorer and show hidden files. then navigate to:
- C:\Documents andSettings\[UserName]\ApplicationData\Mozilla\Firefox\Profiles\your.proifile\chrome
By default userChrome.css fie does not exist, so you need to create it before you can start adding your preferences. There’s actually an example file that exists by default, called userChrome-example.css. You can just rename that file by removing the -example part. Then open this file in notepad or any other text editor and add the following code and save it.
- /* Display the tabbar at the bottom */ #content > tabbox { -moz-box-direction: reverse; }
PHP code to check server status
Tuesday, October 3rd, 2006Borntwisted came up with a wonderful idea to check that his free host was running without having to visit the a page or check the ftp.
He wrote a short piece of HTML that would pull an image off his website, if the server failed to respond the ALT tage would display OFFLINE.
I like to code things in php so I decided to take this a step further and not actually use any images, thus saving on bandwidth on my server everytime the page loads.
The full code is at the bottom of this post but I am going to break it down and try to explain how each section works.
First of all we need to connect to the server and check to see if a file exists. This file can be anything you like, I chose to use an image called online.gif.
I declared a variable call $url which holds the data needed to connect to the server. @fopen is the php command to connect to the server and open the chosen file. The reason the @ symbol is used is to supress the error that will be returned when the file cannot be found.
Using "r" tells the command we want to open the file in read only mode.
Now we use a simple ifelse statment to output the correct part of the formula. The first part of the formula as below asks if the condition is true (if file exists) and will output the command below it.
- if ($url) {
Before the command is outputted we have to close the connection to the file for security purposes. fclose closes the connection to the server which is defined again by our variable $url.
Now we can output the following command if the file is found on the server. Basically this is the TRUE part of the conditional statement. We now ECHO a line of code to the browser which will be converted into HTML and displayed as what you will see. Do not worry about the div's and classes, that is just CSS styling for the page I have this code on.
- }
The following code is the FALSE part of the staement, which is outputted if the above connection cannot find the file. It has similar styling to the above command but this time you will notice that the div class is set to "offline". This is so a different colour is displayed.
- else {
- }
- ?>
That's all there is to it. The code is simple and works well. If you use this code you may notice that when the file is removed by yourself the script doe snot update, this is simply because of the server it is on. Sometimes servers take a few minutes to update.
The code as a whole is listed below and I have also added the CSS that I have used. Modify to your needs.
- .holder{
- width:80px;
- margin-left:5px;
- }
- .name{
- float:left;
- }
- .online{
- text-align:center;
- width:8px;
- height:8px;
- padding:2px;
- background:#75f475;
- float:right;
- border:1px solid #000;
- margin-bottom:2px;
- }
- .offline{
- text-align:center;
- width:8px;
- height:8px;
- padding:2px;
- background:#ef2424;
- float:right;
- border:1px solid #000;
- margin-bottom:2px;
- }
Dynamic Menus for WordPress
Thursday, April 27th, 2006The standard WordPress navigation menu is limited in that it does not show sub menus. it will list every single page on your website in one long list in the navigation section.
For larger sites this can become troublsome. Who wants 50 links running down the side of the page just for the content. It can also be very confusing to site visitors.
I decided I needed a simple script to display the sub menu only when the parent page was clicked, - a working example of this is on the right hand side of this page - so I wrote a little script to do this, and in the spirit of open source, here is the turorial so that you can make it yourself.
Styling individual comments for WordPress
Thursday, April 20th, 2006I wanted a little script that would allow me to have specific styles for individual comments depending on the authour.
I had a look around for WordPress plugins and other info, but could not find anything that actually worked.
So I wrote my own little switch statment to sort it all out.
- <?php
- switch (comment_author_email){
- case ($comment->comment_author_email == 'friend@friend.com'):
- $style = '<div class="friendcomment">';
- break;
- case ($comment->comment_author_email == 'you@you.com'):
- $style = '<div class="authorcomment">';
- break;
- default:
- $style = '<div class="defaultcomment">';
- break;}?>
This involves modifying the comments.php file in your theme folder.
Find:
- <cite><?php comment_author_link() ?></cite>
And add this code above that line: Make sure you put the correct email addresses in.
- <?php
- switch (comment_author_email){
- case ($comment->comment_author_email == 'friend@friend.com'):
- $style = '<div class="friendcomment">';
- break;
- case ($comment->comment_author_email == 'you@you.com'):
- $style = '<div class="authorcomment">';
- break;
- default:
- $style = '<div class="defaultcomment">';
- break;}?>
Now find:
- <?php comment_text() ?>
Add the following on the line below:
- </div>
That's it for the comments.php file. Now open your style sheet, usually called style.css and add the following rules to the end of your style sheet, modify to yoru own needs.
- .authorcomment {
- background: #ffffcc;
- padding:10px;
- border:2px solid #000;
- color:#333;
- min-height:90px;
- }
- .friendcomment {
- background: #fff;
- padding:10px;
- border:2px solid #000;
- color:#333;
- min-height:90px;
- }
- .defaultcomment {
- background: #eee;
- padding:10px;
- border:2px solid #000;
- color:#333;
- min-height:90px;
- }
Thats everything. Save and upload your files and see for yourself.
New WordPress Theme and Mod available
Monday, April 10th, 2006Morning Theme
Quite aptly named, since it was very early in the morning that I created this
WordPress has hundreds of themes out there for you to choose from. I know there to be at least 700 as I search through a huge list looking for something that would suit my needs.
Each to there own though, because I couldnt find one remotely close to what I wanted. So, after 2 hours I had my first layout up and running. Since then I have been tinkering with the style and finally made this.
It is by no means the last style I will create, but for now it is here to stay.
You can find this Theme in the downloads section under WordPress Themes and Mods. But, if your too lazy to click through to there, you can just click here
Festive Images
On that same page you will find the Festive Images mod. You can also see it running at the top of this site. Just wait till Easter. It allows you to have a certain image show up on a certain day. Ideal for having your Cristmas logo displayed over Cristmas, and you will not have to remember to upload it and edit the file.
Once you have added your dates to the script, and told it where to find each new image. just save it, upload it and your done.
Automation at its best.
Search
Previous Posts
- Ubuntu Install Screenshots Posted by Soddengecko February 7, 2010
- HOW TO: Move Ubuntu Home folder to another drive Posted by Soddengecko February 7, 2010
- HOW TO: Random password generator on Ubuntu and other Linux systems Posted by Soddengecko February 7, 2010
- HOW TO: Perform system backup in Ubuntu – Part 2 – Restore Posted by Soddengecko February 7, 2010
- HOW TO: Perform system backup in Ubuntu – Part 1 – Backup Posted by Soddengecko February 7, 2010
- SBS 2003: Mapping network drives for users at logon Posted by Soddengecko February 7, 2010
- Sharepoint Services not configured for use with ASP.NET 2.xxxxx Posted by Soddengecko November 26, 2009
- Customising Firefox 3 Posted by Soddengecko May 13, 2008
- How to: Install Ubuntu packages with HTML link Posted by Soddengecko March 15, 2008
- How to: Increase ext3 and reiserfs performance Posted by Soddengecko March 11, 2008
Recently Updated
Archives
People
Linkies
- Matthew Moore This blog belongs to an associate of mine. He likes to jibber jabber on a bit, and he has decided to document his exercising habits lately, but look back and check out some of the good stuff. Added on March 22nd, 2008 @ 12:08
- Fight for Kisses Probably the best shaving advert I have seen. Not much by the way of pretentious bullshit and it actually has a couple of funny moments. Worth a watch. Added on October 25th, 2007 @ 09:52
- Speedtest.net Speedtest.net is a broadband connection analysis tool with a huge selection of geographically dispersed testing servers. Ookla provides this service free to hundreds of thousands of people every day. If you are experiencing slowness with your Internet connection or are simply interested in testing your speed, Speedtest.net is for you. Added on October 15th, 2007 @ 22:09
- Sadikhov Forums A forum of like minded people helping others achieve the coveted CCNA qualification. The site is aimed at helping those understand the complex issues presented in the exams and making sure you understand them before wasting your money. Added on October 15th, 2007 @ 22:09
- RouterSim.com RouterSim has been the leader in IT simulation training since 1999. RouterSim's Industry expert Todd Lammle offers you the best learning tools available. We have expanded our offerings to match your budget and needs. RouterSim offers simulators, computer-based training videos, online CCNA simulation testing, and exam preparation software. Added on October 15th, 2007 @ 22:08
- Generic Linux rules of thumb for security The only secure box is turned off and locked in the back room -- but it's also not much use to anyone Added on October 15th, 2007 @ 22:06




by @ 20:14
