osCommerce PHP4 -> PHP5 Fixes
There are a few problems that come from moving an old install of osCommerce to a new server with PHP5 or just simply upgrading from PHP4 to PHP5. (more…)
Put LazzyMonk’s Blog onto the Magento Main Page
On the CMS page that you want to see the blog on, just use the following code:
The Coolest Clock
The Industrious Clock by Yugo Nakamura
Read more to see it in action: (more…)
MySQL Update Query
Reminder to myself what a MySQL update query looks like.
products_length=0, products_width=0, products_height=0
WHERE products_width=’12′;
Easy PHP/Javascript rollover images for osCommerce links
The javascript portion:
function JavaCatTab($num) {
echo ‘tab’ . $num . ‘up = new Image();’;
echo ‘tab’ . $num . ‘up.src = "images/design/tab_’ . $num . ‘.gif" ;’;
echo ‘tab’ . $num . ‘down = new Image() ;’;
echo ‘tab’ . $num . ‘down.src = "images/design/tab_’ . $num . ‘down.gif" ;’;
}
?>
<script language="JavaScript" type="text/javascript">
<!–
if (document.images) {
<?php
JavaCatTab(’01′);
JavaCatTab(’02′);
JavaCatTab(’03′);
JavaCatTab(’04′);
JavaCatTab(’05′);
JavaCatTab(’06′);
JavaCatTab(’07′);
?>
}
function buttondown( buttonname )
{
if (document.images) {
document[ buttonname ].src = eval( buttonname + "down.src" );
}
}
function buttonup ( buttonname )
{
if (document.images) {
document[ buttonname ].src = eval( buttonname + "up.src" );
}
}
// –>
</script>
The links portion (place below the first part somewhere):
function catTab($num, $link) {
echo ‘<a onmouseover=buttondown("tab’ . $num . ‘") onmouseout=buttonup("tab’ . $num . ‘") href="’ . tep_href_link(FILENAME_DEFAULT, $link) . ‘">’;
echo ‘<img src="images/design/tab_’ . $num . ‘.gif" name="tab’ . $num . ‘" border="0" />’;
echo ‘</a>’;
}
catTab(’01′,‘cPath=48′);
catTab(’02′,‘cPath=62′);
catTab(’03′,‘cPath=56′);
catTab(’04′,‘cPath=59′);
catTab(’05′,‘cPath=55′);
catTab(’06′,‘cPath=63′);
catTab(’07′,‘cPath=57′);
?>
Firebug Addon for Firefox
“Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.”
Shorter nested IF statements in Excel
This code checks to see if A1 equals the letters K, H or L.
Instead of using:
You can use:
As you can see, it’s a lot shorter and makes a lot more sense. Especially if you need to add more to it in the future.
Easy stylesheets with basic PHP
Create a file called stylesheet.php and link to it in you’re page. Then play with this code:
header(‘Content-type: text/css’);
// Colour scheme
$primary = "#44749d";
$secondary = "#c6d4e1";
$tertiary = "#ffffff";
$quaternary = "#ebe7e0";
$quinary = "#bdb8ad";
?>
BODY {
background: <?php echo $tertiary ?>;
color: #000000;
margin: 0px;
}
