Web Dev Recent Entries

nl.ai.malware.jpg

Pages of my friend's web sites were overwritten and inserted malicious javascript code. Google's alert message appeared on one of those sites, so I just thought someone reported the site as infectious by ill will.

I looked for tips to ged rid of it, and investigated suspicious files on the server. Then I found "log.php" which includes web shell function (and all crack tools) based on php. The script can hack files and database, and even brute force codes are inside it.

I guess it was infected via theme file of WordPress. A part of library files in the theme "arras", "timthumb.php" has vulnerability. They attacked it and inserted the code.

See also the site "Tips for removing website malware -- Redleg".

mpptumbr.jpg

I have left my tumblr interface almost default for a long time because I did not have much interest and fun on Tumblr. For my business demands, I changed the design of my tumblr blog page and added Like Button of Facebook in it.

For adding Like Button to each entry of Tumblr, "url" of og tag has not be set in head tag. It disturbs Like action for each entry. And "Send" fanction does not work correctly in each entry (I guess it is because of XFBML).

mobilesafari-bgimage-size.png

On iOS, Safari automatically resizes image size defined by CSS (background-image) to viewport size at the size of 900 pixel width x 2200 pixel height (and vice versa).

You need separate block elements which defined background image with CSS.

Here is a note for no transparent image in transparent box element.


<style type="text/css">
<!--
#imageFrame { background-color: rgba(255,255,255,0.7); filter: alpha(opacity=70); }
#imageFrame img { position: relative; }
-->
</div>

<div id="imageFrame">
<img src="example.jpg" />
</div>


"background-color: rgba(255,255,255,0.7);" is for FF3.x, Safari3.x, 4.x.

"filter: alpha(opacity=70)" and "position: relative" of img tag are for IE8.

And only IE6 and IE7 need "background-color: #FFF;" after "background-color: rgba(255,255,255,0.7);", so you have to detect useragent and write css by javascript.


function uacsssw() {
 if(navigator.userAgent.match(/MSIE 6/) || navigator.userAgent.match(/MSIE 7/)){
  document.write(
   '<style type="text/css">'+
   '<!--'+
   '#imageFrame { background-color: #FFF; }'+
   '-->'+
   '</style>'
  )
 }
 if(navigator.userAgent.match(/Firefox\/2/)){
  document.write(
   '<style type="text/css">'+
   '<!--'+
   '#imageFrame { background-color: #FFF; }'+
   '-->'+
   '</style>'
  )
 }
}


You have to insert this function after style definition.

Because FireFox2 can not overwrite transparent tag of outside box element on image object, I gave it up... Please let me know if you know any trick for FF2.

notransparentimg-in-transparentbox.png

lightbox2onareatag.jpg

Lightobox2 can't work on area tag as default.

To solve this problem, it needs replace imageLink.rel with Element.readAttribute($(imageLink),"rel") in prototype.js.

Detail:
insert the line below in line 194.

if (!target.rel) target.rel=Element.readAttribute($(target), "rel");

Quote from discussion in Pat &Alex Blogging.

google-mobile.jpg

Google mobile lists both PC site and Mobile site in same result list. And its wireless transcoder tries to transcode PC site for mobile device.

To avoid it and redirect to mobile site from the URL in search results, just add a link tag in head tag of PC site.

<link rel="alternate" media="handheld" href="alternate_page.htm" />

Support page on Google (Japanese)

csshomepage.png

Anchor tags which link to the part of its page placed inside of a box element with clearfix collapse top margin of the box element.

You need clear floated objects after the box element.

Anyone knows alternate way of clearfix?


# do not use "clear" on the frame which tagged floated elements, and use clear on the object after the frame.

ffflash100percentfix.jpg

FireFox ignores the size of Flash if it is set by percent. FireFox renders HTML strictly based on Doctype when Doctype is HTML 4.0, XHTML 1.0 or later version.

I had to code HTML with this type of Flash that other person made, and faced this problem. I didn't know this old issue.

The solution is adding size 100% for parent elements.

<style type="text/css">
<!--
html,body { height: 100%; width: 100%; }
-->
</style>

You also need add elements outside of Flash tags.

You can see a description about this issue on Adobe Developer Connection page.

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=3644&productId=1&loc=ja

fficon.jpg

FireFox ignores style attribute in JavaScript without "document.getElementsById('STYLE')".

imagemagicklogo.jpg

This is a note for adding comments to JPEG file by ImageMagick.

Sample to forbid transfer for docomo and au.

# convert -comment 'copy="NO",kddi_copyright=on" TARGETFILE_NAME.jpg CONVERTEDFILE_NAME.jpg

About this archive

This page contains entries in category of Web Dev

Previous category is

UNIX

Next category is

Windows

Recent entries are in

Index Page.

Past entries are in

Archive page

RSS RSS