Simply the best Bookmark !!

26 01 2007

Every Developer/Designer should have this on the top of the their bookMarks !

the site includes :

  • Tutorials ( Everything  Flash , php , ajax , css etc )
  • Site reviews ( best sites ever)
  • free useful tools ( fonts , code snippets )
  • and much MORE !

I cant say more that You’ll have to see it  your self !!

http://www.smashingmagazine.com 





Getting WordPress posts into Flash!

25 01 2007

flash worspress flashblog

After reading few documentation about some APIs & classes used with wordpress, i was able to get flash to read the titles and arrange them with their links .

not only that , its now possible to get the post title , post link , post entry(description) etc …
This will be one of the elements that i ‘ll be using in my ZAINALS ver 2 🙂

lovely eyh ?





Sketching Zainals.com Version 2!

23 01 2007

Yea , I have started Brainstorming & sketching Zainals.com version 2 ,Currently thinking of new IDEAS for the new site , i’ll also be looking for fonts , color schemes and a good layout to beging with , if anyone can inspire me then please do 😀  .

This one will be more “Dynamic” over Animation wise , or thats what i will be trying to do .
With my current status it will take me bout 1-2 Months (less or more) to get it done.
Wish me good luck Eyh ?





Using Flash local shared Object !

19 01 2007

If you have experienced web Development (PHP ASP Etc), then you must know what cookies are !
they are like containers that are used to store users information on their machine while browsing  a particular site , it can contain anything the developer specify (username , encrypted passwords , date , time , etc …) .

Now meet the flash cookies AKA local shared objects , its as well used to save user data .
We had a case scenario discussed back at Designersblock

Brief : Suppose you had a flash banner html embed that has a sound running in the background & it can be turned on/off .
A user turns off the sound , but when he clicks a link to another page on the same site , the banner starts the music again , so how to avoid this ? Ohh ya Local shared  object !! before i start , a good simple tutorial about LSO can be found HERE.
here is how :

 var Mysound:Sound = new Sound();
local_data = SharedObject.getLocal(“user_data”);
Mysound.attachSound(“track1”);
checkSound();
this.onEnterFrame = function() {
if(local_data.data.CheckStatus == undefined){
local_data.data.CheckStatus == “on”
checkSound();
delete this.onEnterFrame;
}
}

function checkSound() {
if(local_data.data.CheckStatus == “on”){
Mysound.start();
}else{
Mysound.stop();
}

}
On_button.onPress = function() {
if(local_data.data.CheckStatus != “on”){
local_data.data.CheckStatus =”on”;
local_data.flush();
checkSound();
}
}
Off_Button.onPress = function() {
if(local_data.data.CheckStatus != “off”){
local_data.data.CheckStatus =”off”;
local_data.flush();
checkSound();
}
}





The “TOTTI” Returns

18 01 2007

YEAH , the teams worst nightmare is back , looking forward for the match between Roma & Inter Milan .





Mambo dance on youtube… lol !

16 01 2007

Nutterz , i love this video … seriously its simple nothing special but makes me giggle when i watch it !
Anyone knows the tracks name ?





Sending email attachments in PHP Using phpmailer class !

10 01 2007

A friend of mine asked me for such a script that will attach Jpg Images and send it to a particular email , so i started one from scratch .
The Basic idea is to upload the images to the server and then use phpmailer class to attach the files and send them .
The files can be found @Zainals
PHPMailer Class can be found @ http://phpmailer.sourceforge.net/
To Learn more about file uploads visit Plus2Net

Make sure you have a directory called upload and set its chmod to 777 .

oh well , sharing is caring eyh ?

first of all we need to setup the form that will interface with the users , i have found this multi browse code @ : Plus2Net
<?php
$max_no_img=5; // Maximum number of images value to be set here
echo "<form method=post action=attach.php enctype='multipart/form-data'>";
for($i=1; $i<=$max_no_img; $i++){
echo "<tr><td>Photo $i: </td><td>
<input type=file name='images[]' class='bginput'></td></tr>";
}

?>

And now for the PHP Part , excuse the sloppness :
<?php
require("class.phpmailer.php");
//Variables Declaration
$name = "the Submitter";
$email_subject = "Images Attachment";
$Email_msg ="A visitor submitted the following :\n";
$Email_to = "you@yourSite.com"; // the one that recieves the email
$email_from = "someone@someone.net";
$dir = "uploads/$filename";
chmod("uploads",0777);
$attachments = array();
//
checkType();
//
//------Check TYPE------\\
function checkType() {
while(list($key,$value) = each($_FILES[images][type])){
strtolower($value);
if($value != "image/jpeg" AND $value != "image/pjpeg" AND $value != "") {
exit('Sorry , current format is <b>'.($value).'</b> ,only Jpeg or jpg are allowed.') ;
}
}
//
checkSize();
//
}
//-------END OF Check TYPE--------\\
//
//---CheckSizeFunction ---\\
function checkSize(){
while(list($key,$value) = each($_FILES[images][size]))
{
$maxSize = 5000000;
if(!empty($value)){
if ($value > $maxSize) {
echo"Sorry this is a very big file .. max file size is $maxSize Bytes = 5 MB";
exit();
}
else {
$result = "File size is ok !<br>";
//
}
//
}
//
}
uploadFile();
//
}
//-------END OF Check Size--------\\
//
//==============upload File Function============\\
//
function uploadFile() {
global $attachments;
while(list($key,$value) = each($_FILES[images][name]))
{
//
if(!empty($value))
{
$filename = $value;
//the Array will be used later to attach the files and then remove them from server ! array_push($attachments, $filename);
$dir = "uploads/$filename";
chmod("uploads",0777);
$success = copy($_FILES[images][tmp_name][$key], $dir);
}
//
}
//
if ($success) {
echo " Files Uploaded Successfully<BR>";
SendIt();
//
}else {
exit("Sorry the server was unable to upload the files...");
}
//
}
//
//==== PHP Mailer With Attachment Func ====\\
//
function SendIt() {
//
global $attachments,$name,$Email_to,$Email_msg,$email_subject,$email_from;
//
$mail = new PHPMailer();
$mail->IsSMTP();// send via SMTP
$mail->Host = "localhost"; // SMTP servers
$mail->SMTPAuth = false; // turn on/off SMTP authentication
$mail->From = $email_from;
$mail->FromName = $name;
$mail->AddAddress($Email_to);
$mail->AddReplyTo($email_from);
$mail->WordWrap = 50;// set word wrap
//now Attach all files submitted
foreach($attachments as $key => $value) { //loop the Attachments to be added ...
$mail->AddAttachment("uploads"."/".$value);
}
$mail->Body = $Email_msg."Name : ".$name."\n";
//
$mail->IsHTML(false);// send as HTML
$mail->Subject = $email_subject;
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
//
echo "Message has been sent";
// after mail is sent with attachments , delete the images on server ...
foreach($attachments as $key => $value) {//remove the uploaded files ..
unlink("uploads"."/".$value);
}
//
}
//
?>

I know the that its hard to read the script of this blog , The PHP file is available @ Zainals





Tagged Once again by –G–

9 01 2007

Yep , G did it again  so here we are …
things that make me happy:

  • A Grey cold morning
  •  when my wife calls
  • When i help someone
  • accomplish a programming language challenge for the first time
  • crack/guess a password
  • when i get an A grade
  • after a tough workout in ze gym
  • scoring a goal
  • meet old time friends
  • when -G- blogs about her shoes 😛
  • when -JuNe- blogs about her DuSo 😛
  • when my family & everyone around me are happy

i tag the Aliens roaming about my house yesterday 😀





Meet the Italian Hero …

6 01 2007

Marco Materazzi

First of all i would like to congratulate Bahrain for the lonely “1” goal they scored against Inter Milan today at Bahrain Stadium , the match ended 6-1 Milan , after 3 fans jumped of to the restricted area and ran towards Adriano.

Great efforts were taken to keep the game running by both teams , despite the Bahrainian fans & crowd were “WHOING” like dogs whenever Marco Materazzi touches the ball , how nice of you really . Idiots ! get over it .

To me ,Materazzi is a Hero , you can always see that on his face with his Devilish smile ” This is tough , this is animal , can you handle it ? ” He’s an ace , ignored all the shouts and carried on with the game 😀

Code Name : Matrix ( memorize it Biatchs!!)





20 Ways the World Could End…

5 01 2007

First , let me introduce you to an informative blog that i visit nearly everyday ( The guy has my intrests ) …
Meet  Cyberspace Nova  .
Now i was reading an article on his blog about ” 20 ways the world could end ” interesting eyh ?  Point # 20 pulled my attention , scarey … you have to read it .

Discover.com article written by Corey S. Powell really cover all the paths that can lead to disaster we don’t want to happen…