Dont choose a script just because it suits your needs!!

12 Feb

I’m blogging after a long time.
This post is not exactly about coding but I chose to write it here because its related to coding.
If u are a newbie to programming (here considering php) / a manager (like a site owner) who wants to get your work done and found a script or you may say a software or a framework which just suit your needs, then I’m talking about you and for you.
please check some point before you decide to use that script.

So, now you might be thinking what am I talking about and why?
Introducing myself, I am a freelance web – developer and web -deigner, and right now I am helpless and angry with the script my employer choose to use, on which I had to work!

So, what I am talking about is before you are so sure that the software or framework suits you well, just think about it once, just check if the code is well structured, well documented atleast have a good support forum.

Because, how good functionality your script might be having, it obviously needs some changes, additions, and change of design.
Which finally results in hiring a web – developer who can work on it!

Everything is fine until now, but when this developer sits on this code, unless he is very brilliant he gets irritated by the code if it is not well documented, not well written, not well framed just like me today! And finally resulting in frustation, and which result in lack of interest and wastage of time!

So, if you want a site with a unique or rare functionality, I’d say hire a developer who can do that from the core, if you dont find a good script (remember: well documented, well framed, well supported).

Thanks for reading

Advertisements

New freelance job

1 Nov

I couldn’t add more posts because my work burden increased a lot.

And recently I want to share this thing that I’ve got picked by emplyer for my javascript skills.

If you have ever heared about dodge windows in ubuntu or linux compiz, thats what I have to make in javascript.

And I have posted an example of my earlier javascript animation, he got impressed.

So here’s the code which cam make dodge window animation.

Hope you’ll like it.

http://jsfiddle.net/pahnin/Cps5B/

live typing js

25 Oct

I had this idea since a long time before, the “IDEA” is to print the text of desired element or to say in more technical way display the text like the computer is typing.

That is we append each letter after a certain time gap to our target element, so that it looks like live typing.

If you don’t understand yet you better take a look at this http://jsbin.com/eyewuy

prestashop free image slider module

24 Oct

It took long enough for me to post here, cause I was bsy with many works.

Finally I have completed one working project(many IMP features yet to be added). It is an image slider module for prestashop.

Click here to see more about the project. Mean while I have some code snipplets which can make your better I’ll post them soon..

Simple Photo Gallery from img in li

18 Sep

To make a image gallery capable of having a light-box and can move around photos with arrow keys.
I’ll add next and prev buttons in next post.

My html code


	<div id="popopen_wrap">

		<div id="img_holder_bg" >

		</div>

			<div id="img_holder"><img src="" id="maximised" width='600' height='400'></div>

	</div>

	<div id="ribbon_wrap">

		<div id='ribbon'>

			<ul id='list'>

				<li><img id="thumbnail" class="first" src="cal.jpg" width='150' height='150' ></li>

				<li><img id="thumbnail" src="china.jpg" width='150' height='150' ></li>

				<li><img id="thumbnail" src="egypt.jpg" width='150' height='150' ></li>

				<li><img id="thumbnail" src="pyramid.jpg" width='150' height='150' ></li>

				<li><img id="thumbnail" src="rio.jpg" width='150' height='150' ></li>

				<li><img id="thumbnail" src="some.jpg" width='150' height='150' ></li>

				<li><img id="thumbnail" src="taj.jpg" width='150' height='150' ></li>

				<li><img id="thumbnail" class="last" src="taj_m.jpg" width='150' height='150' ></li>

				</ul>

				</div>

				</div>

As you can see I’ve put the images in a ul list.
I’ll show you how to do that dynamically with php in later posts.
And there are some wrap divs I’ve used for positioning.
popopen_wrap is the parent div which is displayed with opacity in bg when we click on thumbnail images.
img_holder_bg is div used for backgournd opacity.

Now here is my css file

*{

margin: 0;

padding: 0;

}

ul{

list-style: none;

}

#ribbon ul li{

float: left;

}

#ribbon_wrap{

position: absolute;

width: 100%;

top: 55%;

}

#ribbon{

width: 1000px;

margin: 0 auto;

overflow: hidden;

height: 150px;

}

#popopen_wrap{

width:  100%;

height: 100%;

position: absolute;

display: none;

z-index: 3000;

}

#img_holder_bg{

opacity: 0.7;

background: black;

width:  100%;

height: 100%;

position: absolute;

z-index: 3005;

}

#img_holder_wrap{

height: 600px;

position: absolute;

width: 100%;

}

#img_holder{

position: fixed;

top: 50%;

left: 50%;

margin-left: -300px;

margin-top: -200px;

z-index: 3010;

border: 10px solid white;

}

We are using the fixed sized output images.
The later posts will explain how to auto position when size of the photos changes.

My javascript code

 $(document).ready(function() {
	 $("#img_holder_bg").click(function(){
	   $("#popopen_wrap").hide();
   });
   $("img#thumbnail").click(function(){
	   $("#popopen_wrap").show();
	   $("img#maximised").attr("src",$(this).attr("src"));
	   $(this).addClass("selected");
	   $(document).keydown(function(event){
		   if(event.keyCode==27){
			   $("#popopen_wrap").hide();
			   }
			else if(event.keyCode==39){
				$("img#maximised").attr("src",function(){
					if($(".selected").hasClass('last')){
						$(".selected").removeClass("selected");
						$(".first").addClass("selected");
						return $(".first").attr("src");}
					else {
						$nxt=$(".selected");
						$(".selected").removeClass("selected");
						$nxt.parent().next().children("img#thumbnail").addClass("selected");
						return $(".selected").attr("src");}
					});
				}
			else if(event.keyCode==37){
				$("img#maximised").attr("src",function(){
					if($(".selected").hasClass('first')){
						$(".selected").removeClass("selected");
						$(".last").addClass("selected");
						return $(".last").attr("src");}
					else {
						$prev=$(".selected");
						$(".selected").removeClass("selected");
						$prev.parent().prev().children("img#thumbnail").addClass("selected");
						return $(".selected").attr("src");}
					});
				}

	});
});
});

In fact this javascript code is not entirely mine, one of my friend have written the basic key storke movement using array in pure javascript.
I’ve ported that into jquery and added dynamic checking of what to display next.

Hope you liked it! I’ll update with better

General css to be included in every page

17 Sep

I include this css part in every page.
Its just a good practise to avoid some problems in css.

* {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}

a { margin: 0; padding: 0; font-size: 100%; vertical-align: baseline; background: transparent; }
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
/* customize your colors for selected text here */
::selection{
	background: #A50B0B;
	color: #E9E9E9;
}
::-moz-selection{
	background: #A50B0B;
	color: #E9E9E9;
}
body {
	line-height: 1;
	background: #f5f6f7;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}

Thanks for visiting

Simple way to use mysql sanitizer function in php

17 Sep

If you don’t know yet mysql_real_escape_string() is the php function to sanitize a given string for mysql quires so as to prevent sql inejections.

But its irritating to use it every time you want to sanitize.
So, lets simplify the burden.

function __($var){
	return mysql_real_escape_string($var);
	}

By using this function, You just need to put $variable inside __()

$sql="SELECT * FROM `new` WHERE title='".__($_POST['title'])."'";

Thanks for visiting