I Build Web Sites

Do you need to take your dull website and make it shine? That's what SLiK INTERACTIVE is here to do, offering a range of web design services to meet your internet needs.

  • Mizu
  • Flow Go Riding Center
  • TW's Grille and Bar

So I know in Wordpress there are several built-in functions for checking what page the user is currently viewing, but I needed to be able to check what page when not using Wordpress. After some searching I found this really simple PHP snippet for doing just that. Add this code somewhere in your PHP file so you can perform an action depending on the current URL:

 

1
2
3
4
5
6
7
8
9
10
<?php
 
$uri = $_SERVER['REQUEST_URI'];
if ($uri == "/") {
      echo "You're on the homepage";
} else {
     echo "You're on an internal page";
}
 
?>

Joomla CHMOD Trick when Installing Extensions


Are you getting Joomla an error like it can’t create a new directory when you try to install an extension? I can’t remember where I found it but this little PHP script will allow you to change the permissions for all of the  necessary folders in one shot when run in a browser. It will save you much time and headache trying to do it one by one. Thanks to the original creator! This is how to use it:


  1. Copy and paste the text into a new text file. Save it as “chmod.php”
  2. Upload the file to the root of your site and go to the following URL in your browser: http://www.yoursite.com/chmod.php?chmod=0777
  3. Upon hitting return, you should get a screen indicating success listing all of the directories of which it has changed the permissions. If something went wrong then you will get a different screen indicating it failed. Usually this is because the base path is wrong in chmod.php. ( The base path is usually something like “httpdocs/” )
  4. Install your extensions
  5. Once you’ve installed your extensions, go to: http://www.yoursite.com/chmod.php?chmod=0755 to change the permissions back to 755 so your files aren’t vulnerable.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
 
<?php
 
// your ftp credentials
$ftp_server='your_server';
$ftp_user='ftp username';
$ftp_pass='ftp password';
 
// where is Joomla installed? (trailing slash required)
 
$base = 'httpdocs/';
 
// what files or directories need chmod applied? (trailing slash optional)
$dirs = array( 'administrator/backups',
               'administrator/components',
               'administrator/language',
               'administrator/language/en-GB',
               'administrator/modules',
               'administrator/templates',
               'administrator/cache',
               'components',
               'images',
               'images/banners',
               'images/stories',
               'media',
               'language',
               'language/en-GB',
               'language/pdf_fonts',
               'modules',
               'plugins',
               'plugins/content',
               'plugins/editors',
               'plugins/editors-xtd',
               'plugins/search',
               'plugins/system',
               'plugins/user',
               'plugins/xmlrpc',
               'tmp',
               'templates',
               'cache'
             );
 
// default to safe 0755 setting
if ($_GET['chmod']) {
    $ftp_chmod = $_GET['chmod'];
} else {
    $ftp_chmod = "0755";
}
echo "chmod=".$ftp_chmod.'<br/>';
 
// connect via ftp and apply chmod
$conn_id = ftp_connect("$ftp_server");
ftp_login($conn_id, $ftp_user, $ftp_pass);
foreach( $dirs as $dir ){
    if (ftp_site($conn_id, 'CHMOD '.$ftp_chmod.' '.$base.$dir)) {
        echo "success ";
    } else {
        echo "failed ";
    }
    echo $base.$dir.'<br/>';
}
ftp_close($conn_id);
 
echo 'DONE';
?>

Samsung SP H03 Pico Project – Test Run

samsung_pico_projector_1

Okay so this thing is pretty cool.

It’s a cool little projector with the capability of connecting to various devices for the ultimate portable projecting experience, so let’s test it out…



Here’s the SP H03, Samsung’s newest pico projector designed with portability in mind. This tiny 2.5-inch thing comes with a 1GB internal memory so you can load files like movies, photos, music files, pdf’s, etc and present them all without a computer or video source connected.


The screen size ranges from roughly 9 to 80 inches with a native WVGA 854×480 native resolution. With only 30 lumens of lighting power, you really need a dim to completely dark room to fully take advantage of the screen size and image visibility.


Okay now on to my experience with it so far…

I really wanted to use this little projector as a secondary monitor for my laptop, so I went out and bought some needed cables. I got a minidisplay to VGA adapter for $30, 6′ VGA Monitor Cable 15 Pin Male to Male, and a USB cable male to male. ( The USB male to male was for connecting the supplied adapter cable with the projector, but this method did not work ) When I tried to connect everything and start up the devices (projector and macbook) the projector was not being recognized by my laptop. Interesting…


I tried again, but slightly differently this time, and got it to work! The instructions said to turn off both computer and projector, then connect them, then turn on. That wasn’t working so I unplugged the connection while both were still on and after plugging it back in it worked! My bad…


So after purchasing another cable ( mini USB to USB ) I was able to connect the projector as an external hard drive, allowing me to transfer files to and from the projector.


I also was able to connect my XBOX 360 to it via the supplied A/V cable. That’s some immersive gaming! It has to be really dark for best results though.


PROS:

  • Not bad for the price.
  • The size and portability are a definite plus.
  • The picture quality is good

CONS:

  • Not bright enough
  • Projector must be very close is room is not dim
  • Works best in dim to completely dark room
  • Need to purchase additional cables for connecting to computer ( miniUSB and VGA )

7/10

 

So I just returned from the Walmart in Poway, CA since that was the closest store that had any 3GS iPhone’s in stock. Good thing I left when I did this morning because they only had 2 black ones in stock and there was a guy who got in line behind me, who I could just tell was there for an iPhone. ( Confirmed as I was leaving )


For a price of $97 for an iPhone, and not the bare 3G but the faster and video-recording equipped 3GS, it was time for me to upgrade to a true smartphone. I was perfectly happy with my little sony ericsson which allowed me to play all my mp3’s in my truck or even right on the phone for some instant mobile tunes. Yet, it did lack the email functionality I’ve always been missing. My new iPhone should change all that…


So what do you think?

Was it a better deal to wait until the next iPhone 4 just announced today or is the iPhone 3GS essentially the same thing, with plenty of life still left in it?

Media Temple Hacked!

mt_hacked  Okay so I just discovered this morning that Media Temple has been hacked bigtime! After receiving an email from them detailing that my FTP/SSH password had been reset due to suspicious activity, I did a little googling and discovered I am not an isolated case. Many people just got the same email! So I attempted to connect via FTP to several different MT hosted sites I’ve developed, each with their own MT account and CAN’T CONNECT TO ANY OF THEM!


Yesterday I received a phone call from a client because he said their site was down. After inspecting the index.php file, I discovered some extra php script injected into the top and bottom of the source code. This caused some suspicion yesterday but now I know that all of this is a Media Temple problem. I’ve read that they store their passwords in plain text in a database…


Happy Thanksgiving!


MORE INFO:
http://michaeltorbert.com/blog/media-temple-hacked/

http://news.ycombinator.com/item?id=962414

Superfish Menu IE Z-Index Bug

Someday, us developers will not need to worry about IE6 fixes…but until that day comes we all must suffer!


Anyways, if you are using a superfish menu in Joomla then you may have noticed that in IE6, you can’t see the vertical drop-down menu because it is being covered up by the main content of the page. Turns out this is called the Z-Index Bug, which is only associated with IE6 and IE7. Awesome.


The FIX:


If your HTML looks something like this:


1
2
3
4
<div id="header">
<div id="nav" class="sf-menu">Here the menu</div>
</div>
<div id="content">Here the content</div>

Then you should add the following CSS to each of these elements:


1
2
3
4
5
6
#header {
    z-index:2;
}
#content {
    z-index:1;
}

This ensures that the entire header div, which contains the superfish menu, has a z-index that is greater than the main content div, which was overlapping the drop-down menu. Worked for me!