Showing posts with label WWW. Show all posts
Showing posts with label WWW. Show all posts

Tuesday, April 3, 2012

Disabled input with JQuery

We have in html inputs like text, radio, select and textareas.

In my situation i had radio inputs and i needed to create trigger which should effect other inputs ( disable them ).

My inputs:
<input name="order_type" type="radio" value="2" /><br />
<input name="order_type" type="radio" value="3" /><br />
<input name="order_type" type="radio" value="4" />
Other section which i want to disable:
<input class="viewspereach" name="text" type="text" value="" />

JQuery:
$("input[name=order_type]").change(check_ordertype);
  
  function check_ordertype()
  {
    var order_type = $("input[name=order_type]:checked").attr("value");
    
    if(order_type == 4)
    { 
      $(".viewspereach").prop('disabled', true);

    }
    else
    {
      $(".viewspereach").prop('disabled', false);
    }
  }
Demo: http://igloro.info/demos/disableinput.php

Thursday, January 26, 2012

Change prestashop stores google maps zoom


Good day visitor.

In prestashop there is "Stores" section.

To change zoom of the default map which loads up after navigating there, go to:


  • /js/ folder
  • open stores.js
Go to line 196.

You will see code like this:

map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(defaultLat, defaultLong),
zoom: 15,
mapTypeId: 'roadmap',
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}
});

Change Zoom to whatever you like.

Good luck!

Wednesday, January 18, 2012

Days in months of year


Are you lazy to count how many there are days in months of certain year?

I have created small php counter for my self.

Its pretty useful so i want to share it.

http://www.drunksick.com/index.php?p=daysinmonth

Main part of code:

for($year_s;$year_s<$year_f;$year_s++)
{
  for($month=1;$month<=12;$month++)
  {
    echo $month."'th month of ".$year_s." has: ".cal_days_in_month(CAL_GREGORIAN, $month, $year_s)." days
";
  }
}

Thursday, December 15, 2011

htaccess redirect from www to non-www

Code for htaccess to create redirect from site's url with www to site's url without www:
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC] RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Source: http://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www

Tuesday, September 27, 2011

Joomla K2 watermark image

We need to edit file - item.php which exists in our administrator folder, full path:
\administrator\components\com_k2\models\item.php

first we need to define the variable:
$img_url_watermark = "../images/watermark.png"; //(line 202)

near the comment line
//Original image

Then we need to paste the lines after each image comment to which we want to add watermark (i recommand not to add to small and xsmall... images )
$handle->image_watermark = $img_url_watermark;
$handle->image_watermark_position = "TL";

Than we need to add the code:
//gallery watermark
if($dir = opendir($savepath.DS.$row->id)) {
while (false !== ($file = readdir($dir))) {
$handle = new Upload ($savepath.DS.$row->id.'/'.$file);
$handle->allowed = array('image/*');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->image_resize = ture;
$handle->image_x = 1024;
$handle->image_ratio_y = true;
$handle->image_watermark = $img_url_watermark;
$handle->image_watermark_position = "TL";
$handle->image_convert = "jpg";
$handle->jpeg_quality = 85;
$handle->Process($savepath.DS.$row->id);
$handle->Clean();
}
closedir($dir);
}
//end

After the code:

if (!JArchive::extract($savepath.DS.$handle->file_dst_name, $savepath.DS.$row->id)) {
$mainframe->redirect('index.php?option=com_k2&view=items', JText::_('Gallery upload error: Cannot extract archive!'), 'error');
} else {
$row->gallery = '{gallery}'.$row->id.'{/gallery}';
}
JFile::delete($savepath.DS.$handle->file_dst_name);
$handle->Clean();

Its about 430~ line

That is all.... done :)

p.s. some sources where the solution was fount

http://api.ning.com/files/HXT6DGp5WSJFHL5RzYp-Jb*WUL4Ep5eAy*opKr8s8KN4pt-DDD92wDPKlmNCmWeQd8msVcosqVIjDLKY3jJ-pZ*6PcJz56pR/diff1.gif
http://api.ning.com/files/*txNFL3oxugapDshDybYqwZ6pM1HRBera8DL7uZp5keDIc40jfg8UZf-SEvT3aVakQ35-yRj-RYTlZXBcGxHOa0R2gQPSkPN/diff2and3.gif
http://api.ning.com/files/2ryzVIrGkDjAz*ZMCXk1aYFdbHTiKTrxNSCfUK97YXCGDhmGv7azhnkMQ1cnJp7EdCivLSbtwdV1HmnwnnjnleMveePM*1LS/diff4.gif
http://community.getk2.org/forum/topics/im-just-trying-to-add-a-png

Monday, July 11, 2011

Ping domain

Have you ever tried to ping any site or domain? The site will allow you to do this - http://www.igloro.info/en/ping.html

Once you are there, just type your desired url or domain name and press Ping.

My outcome:
http://pilotaz.blogspot.com is Alive (76 ms)

RGB test

Have you ever wanted to test how looks one or another rgb hex code? So the page will allow you to do the trick - http://www.igloro.info/en/rgbtest.html .

It is very easy to use. Just enter your desired rgb hex value and press test.

Site description:

RGB test - is a tester which allows you to test how hex color could look.
source: http://www.igloro.info/en/rgbtest.html

My outcome:

RGB: #c0c0c0
Red: 192, Green: 192, Blue: 192
Inverse RGB: #3f3f3f
Red: 63, Green: 63, Blue: 63

Md5 generator

Md5 is coding. And most of time it used for mysql database's passwords. After coding password with md5 you will get 25 chars length string.

There are a lot of good md5 generators, example:


Sometimes people required to create md5 force way. So just input your password or whatever else string into string field and press genereate md5.

Here is my result for "password" string md5 generation:

md5: 5f4dcc3b5aa765d61d8327deb882cf99
sha1: 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
md4: 8a9d093f14f8701df17732b2bb182c74
crc32b: 35c246d5
crc32: bbeda74f
md2: f03881a88c6e39135f0ecc60efd609b9

Wednesday, July 6, 2011

Web development - seo keywords optimization tools - my new blog


So, few days ago i created my new blog for my new project - igloro.info ( You are all welcome to visit my new blog here: http://seokeywordstools.blogspot.com/ ). I write update's news there and description about all tools we are created.

Saturday, July 2, 2011

Seo keywords optimization tools.


Currently working on my own new project. In the project im trying to create tool for monitoring seo keywords of other projects.

I have a lot fun and im trying to use most newest tools to create it. There already is some good tools, like keywords searching, google pagerank counter, urls counter, google analytics monitoring and much much more coming!

Hope to see some testers there and ill would like to hear some suggestions from your side if you are very interested in it.

It is a bit bugged for now but ill fix everything very soon.

Also it will be multi language project. But for beggining there will be only 2 languages - Lithuanian and English.

Source: http://www.igloro.info

Monday, May 16, 2011

Google chrome Program too big to fit in memory [ Solution ]


Today for first time i meet the problem.

I was browsing as always... many tabs - like 10. Most of them are text. Suddenly my pc showed BSOD. After restart google chrome want start. And shows cmd windows for a second.

With cmd.exe ( start > cmd.exe ) , you can run same google chrome to see error message. It was - "Program too big to fit in memory".

After some google searches i read nothing interesting but only complains and questions about the problem.

I was not worried about my bookmarks because im using google sync.

1. So i just opened firefox.
2. Went to Google Chrome download page.
3. Downloaded / Ran setup
4. After installation all came back to normal.

Also last session was saved... and i could see pages which was opened before BSOD.

In worst situation you can lose your bookmarks. So its up to you...

Leave a comment if your bookmarks haven't erased after install. If you didn't used google sync. Cheers.

Hope it will help you guys. 

Thursday, May 5, 2011

Input is not proper UTF-8, indicate encoding !

I faced with the error while exporting huge xml.

My solution for this was changing the code:
foreach($adData as $itemData )
{
$xmlData .= "<item><![CDATA[".$itemData."]]></item>";
}


Into this:
foreach($adData as $itemData )
{
$table = array('&' => '&amp;', '<' => '&lt;', '>' => '&gt;', '"' => '&quot;');
$data = str_replace(array_keys($table), array_values($table), $itemData);
$date = str_replace(" ","",$data); //there is one strange square symbol. after converting into chars //for blogspot it was removed :(
$data = htmlspecialchars(html_entity_decode($data, ENT_QUOTES, 'UTF-8'), ENT_NOQUOTES, 'UTF-8');
$xmlData .= "<item><![CDATA[".$itemData."]]></item>";
}

Hope it will help you solving your problem.
Anyways. Good luck!

Friday, April 22, 2011

Video editor online free - JayCfut


I was trying to find freeware which will silent videos audio track and add another one. I tried some of freewares like - wax , windows movie maker, avidemux ( linux video editor on windows ). Maybe they are good and maybe im not so experienced for the freewares but i found better free ware for myself - jaycut.com . It is website which contains java video editor, and so you can edit videos online.
After finishing your project it will generate file and send url to your e-mail.

Website of the project: http://jaycut.com/

A little about JayCut:
Why edit video online?
No need for downloads or installs
Instant access via any web browser
No specific hardware requirements
Access uploaded content anywhere, anytime
Works on all computers and browsers
Use content on the web in movies, e.g. YouTube videos
Collaborative editing, work together with other users from around the world.
Fueled by a passion for web video and creativity, JayCut was founded in 2007 and has since worked with some of world’s leading brands and received several prestigious awards.
In early 2006 we started asking ourselves if web video couldn't be about more than just consumption. We wanted to add creativity into to the equation. Nine months later, in December 2006, we had laid the foundation for what would come to be the world's most advanced technology for online video editing. The company was founded early 2007 and since 2008 we license the video editing tool to other companies and websites.
Today, JayCut is a privately held company based in Stockholm, Sweden. Our customers include some of theworld’s leading brands, and the company and technology has received some of the most prestigious awards in the industry. But our firm belief is that we've just scratched the surface of what web video can be.
Ask yourself what would happen if anyone could edit video, anywhere, with any mobile device, using any media on the web and finally publish the result to any device or website. Join us in starting this creative revolution!

Video i created:

Friday, April 15, 2011

Solution 1030:Got error 139 from storage engine

Today i meet with one big problem while updating MySQL database. The error is 1030:Got error 139 from storage engine.
The problem is that rows has limit.
I was trying to change limit, but there is no need.

Solution for this is very easy. All you need to change ENGINE of your table. While engine almost does nothing, and it will not effect on your values. ( Please read http://dev.mysql.com/doc/refman/5.0/en/storage-engines.html , before doing something ).

I had no time to read this so i executed the query:
ALTER TABLE `table_name` ENGINE = MYISAM

It worked for me. Hope it will work for you too.

Sunday, April 10, 2011

CSS trick to cover with perfect background width and height


There is one cool trick to fill place with background, even if their sizes different. Just use the code for css:
body {
background-image: url(bg.jpg);
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

The goal here is a background image on a website that covers the entire browser window at all times. Let's put some specifics on it:

  • Fills entire page with image, no white space
  • Scales image as needed
  • Retains image proportions (aspect ratio)
  • Image is centered on page
  • Does not cause scrollbars
  • As cross-browser compatible as possible
  • Isn't some fancy shenanigans like Flash

We can do this purely through CSS thanks to the background-size property now in CSS3. We'll use the html element (better than body as it's always at least the height of the browser window). We set a fixed and centered background on it, then adjust it's size using background-size set to the cover keyword.

Works in

  • Safari 3+
  • Chrome Whatever+
  • IE 9+
  • Opera 10+ (Opera 9.5 supported background-size but not the keywords)
  • Firefox 3.6+ (Firefox 4 supports non-vendor prefixed version)

Source: http://css-tricks.com/perfect-full-page-background-image/

The article can also mean: css tricks

Saturday, April 2, 2011

htaccess doesnt work on windows of xampp [Solved]


My situation: I have xampp and perfectly working website. And problem is that site does nothing, while changing htaccess.

Here is solutions for this:

  • go to xampp folder and search for httpd.conf in apache/conf folders.
  • open it
  • make sure that LoadModule rewrite_module modules/mod_rewrite.so is uncommented
  • find all AllowOverride and changed None to All. All AllowOverride!!! There should be 3 of them..
It worked for me.. and might help you.

Happy htaccess editing!

Thursday, March 31, 2011

Page speed checker by Google



Here you go... google launched Page speed online analyzer. While it analyzes, it gives you lots of suggestions after completeing them, you website speed will improve!
There is 2 methods of analyzing - Desktop and Mobile. After analyze you will get number from 0 till 100 which describes your result of website speed.

URL: http://pagespeed.googlelabs.com/

Tuesday, March 22, 2011

Rounded corners border CSS Problem in IE [ Internet Explorer ] [ Joomla ] [ Solved ]


Here you go.. There is an css code for "good" browsers to change your div's corners to rounded ones. But "bad" browsers such as Internet Explorer ( IE - IE6, IE7 and so on... doesnt works pretty good under this conditions.. ), so here is solution for this problem.


CSS CODE EXAMPLE OF DIV WITH CLASS = "box"
.box {
-moz-border-radius: 15px; /* Firefox */
-webkit-border-radius: 15px; /* Safari and Chrome */
border-radius: 15px; /* Opera 10.5+, future browsers, and now also Internet Explorer 6+ using IE-CSS3 */
-moz-box-shadow: 10px 10px 20px #000; /* Firefox */
-webkit-box-shadow: 10px 10px 20px #000; /* Safari and Chrome */
box-shadow: 10px 10px 20px #000; /* Opera 10.5+, future browsers and IE6+ using IE-CSS3 */
behavior: url(ie-css3.htc); /* This lets IE know to call the script on all elements which get the 'box' class */

}

There should be like this: "behavior: url(path/to/ie-css3.htc);"

Download url of the ie-css3.htc file. Put the file into root and css folder. ( and into other folders in other cases.. ^^ ):
http://uploading.com/files/dm247e4c/pie.zip/

I faced with this problem while doing rounded corners in Joomla template. Also this resources might be helpful

Friday, February 25, 2011

Hidden new line in string PHP


I guess you seen the problem, or maybe facing with it at the moment. So if you echo the string with pre tags, it will show normally. But without pre tags, it shows ugly... just like a plain text.

The problem is that there is hidden new lines symbols like /r or /n and so on...

Just by replacing the with str_replace is not enough. So here solution for it:

$value = preg_replace('/[\r\n]+/', '\n', $value);
echo htmlentities($value);

Tuesday, February 22, 2011

Real Megatron Tank from Transformers 2

Can you believe it? Real replica of Megatron Tank from Transformers 2 was made by one chinese metal artist. Full weight of the tank is more than 5000 kg.

Here is image of megatron tank made by fan


And here photos from real life