iCreativeLabs blog

We LOVE our JOBS and we SHARE for you
Subscribe

Archive for the ‘code’

Play cheat with W3C CSS Validator

If you design or create website you must validated the CSS and HTML. You can find the css and html validator from w3c validator. When i used thickbox in my site the css not valid cause thickbox used css3 and the validation use css level 2 :(

Icreativelabs not validate the css


I think i must played cheat with this validation cause it’s make me feel sick. I make some modification for the engine for played cheat with this W3C engine.

First I learn what engine that W3C have and if found this on my engine [HTTP_USER_AGENT] => W3C_Validator/1.575 .When i see that i got the point, W3C used custom engine and the call the engine with W3C_Validator . I think i can modified my code and put some code for hide my thickbox.css from this engine.

This is the code for hide my CSS


<?php
$text         = $_SERVER["HTTP_USER_AGENT"];
$findme        = 'W3C';
$engine = strstr($email, $findme);
if (!preg_match("/".$findme."/i", $text)) { ?>
<link rel="stylesheet" href="thickbox.css" type="text/css" media="screen" />
<?php } ?>

You just need change the line 6 with your css that you want hide :)

And when i checked on W3C once more time, they said this site already validating :D you can see here

Icreativelabs css is valid


Popularity: 8% [?]


Got Problem with FCKEditor In Jamit

This late of night for writing something useful, but i try to describe the problem and solver in just a few paragraph.

This FCKeditor case. When I try customizing Jamit Job Board I got error on admin Page. This error only came on FCKEditor, you can see the error code below

uncaught exception: Permission denied to set property Window.FCK_STATUS_NOTLOADED
....
fckeditor.html (line 183)
uncaught exception: Permission denied to get property Window.FCKeditorAPI

For your attention in our tested case everything run smoothly, but when I test again after my client said they found some error like before I got some error like my client said.

Hmmmm what’s wrong with the code…

I learn every code and html output, everything not on mess, all tag already close. Trying on uncle google an still can’t found anything.

At last I found the problem when I watch every case in before. The problem it’s on HTTP address. In wrong version i used www before the address and the correct setting it’s without www.

For solved the address problem I used .htaccess rewrite

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.eastafricajobs.com$
RewriteRule (.*)$ http://eastafricajobs.com/$1 [R=301,L]

That’s code will rewrite your url and will redirect www.eastafricajobs.com to eastafricajobs.com

Problem done and one jobs has solved

Popularity: 2% [?]


Adjacency list tree on MySQL

sebetulnya ini kupipas dari blog sayah *hayoo tebak blog saya apa coba..* berhubung dari kemaren dikejar2 si “luffy” untuk posting,apa boleh buat… *huh!*

Modelling hierarchy data in relational database is hard.

Adjacency list is one of few method to modelling this data to SQL.
if you do not know about adjacency list, or you want to know other method than adjacency list, you might wanto to read Joe Celko’s Trees and Hierarchies in SQL for Smarties

Adjacency list is known with its “easy to insert but hard to retrieve”.

continue reading

Popularity: 7% [?]


code snippet ready

Tes source code

CSS :

#button {
font-weight: bold;
border: 2px solid #fff;
}

PHP :

<?php echo 'hello world!'; ?>

SQL :

SELECT a.* FROM a LEFT JOIN b ON a.id=b.a_id;

Popularity: 2% [?]