10th March 2007
This is a collection of links related to the multiple-language content in Drupal CMS.
i18n module
i18n: Getting the whole thing to work : http://drupal.org/node/81094
Patch: Translations of menu titles and descriptions: http://drupal.org/node/70919
Translated links: http://drupal.org/node/67814
i18n: menu not expanding with URL-Alias: http://drupal.org/node/80820
There was an alternative module to i18n, but I cannot find it at the moment.
Posted in CMS, Drupal, PHP, Programming, Web | No Comments »
19th February 2007
After IE7 came out, it got much harder for HTML/CSS coders to maintain compatibility with both IE6 and IE7.
IE7 is pushing IE6 out, as it is a high-priority update; however, massive part of users will remain on IE6 for various reasons, not excluding the licensing issues (non-licensed/fake-licensed Windows XP will not let install IE7).
The problem is: after installing IE7, you no longer have IE6 (which is replaced by IE7).
However, there is a good and simple solution, enabling one to run IE3 through IE7 on one computer.
To do so, just install the latest version of IE you want (I assume it’s IE7), and then point your browser to evolt’s archive of browsers (what an excellent collection!). You will have to “install” (just copy, really) each older IE you want into a separate directory, and create a short-cut for each. (You may want to use all-in-one installer, found here – also a great package, though I didn’t use it.)
After I installed IE6, I also copied some additional files to its folder (like wininet.dll, version 6.00.2900.2180 or like that), to avoid problems with cookies disabled in IE6.
However, there is a huge problem with multiple IEs: Print Preview and Print do not work at all!
After some searching, I found two bug reports:
- clicking on any bookmark will not load the bookmark, but will open the Print dialogue
- trying to use the bookmark-derived Print dialogue appears not to work: produces blank page
Read the rest of this entry »
Posted in Programming, Software, Web, XHTML/CSS | 3 Comments »
19th February 2007
I was looking to solve this extremely common problem – when you need to vertical-align:top/middle/bottom something within the DIV element. So far not a single solution fits my exact case, but I collected different solutions here for convenient reference.
- vertical-align CSS property should be applied to the inline element within your DIV (which is a block element), and NOT to the DIV itself. For this to work, you may need to set line-height and font-size to the height of the enveloping DIV element:
<div>
<img src="/images/demoBoxH.gif" alt="" />
</div>
div{
height:200px;
width:200px;
background:blue;
text-align:center;
line-height:200px;
font-size:200px;
}
*>div{
font-size:12px
}
img{
vertical-align:middle
}
- there is a different approach: for the element within your DIV, set display:absolute and bottom:0px (or top:0px) to vertically align to bottom or top, respectively. Note that this approach doesn’t let aligning to “middle”, and that it works best when only one block-level element is aligned – otherwise elements will overlap at the bottom/top of container DIV. Container DIV should be set to position:relative.
- another approach: we can set the container DIV to
div {display:table-cell;vertical-align:middle}
because for table cells vertical-align property works as one might expect from common sense and the text-align property. Basically, by doing so we ask the browser to treat our DIV as a table-cell, where vertical-align works just perfectly. However, this approach appears not to work on most IE browsers (probably except for IE7 only, but I didn’t try, as I need IE6 support as well).
- one more table-cell-display-based solution by Nikola:
.nav_next a {
display: table-cell;
width: 85px;
text-align: center;
padding-top: 60px;
position: relative;
top: 60px;
margin-top: -60px;
}
This time, display:table-cell is applied to the immediate text container (anchor in the example), and then padding-top is added to push text to the bottom. Should work in FF3 and IE6; in FF3, this solution worked in a test setup without the last 3 CSS attributes, but YMMV.
- vertical alignment can be simulated with margins, applied to the element(s) within the container DIV. This is a simple approach and I would recommend it, if the heights of the container and elements within it are known (otherwise, this method is of no help). Example application of this method: if you have a DIV container 200px high, and need to position some SPANed text within it; first, set SPAN to
span {display:block; height:20px}
(or whatever height value fits your requirements), and then set margins to vertically align the SPAN. To align your SPAN to top, you would apply
span {display:block; height:20px;margin-bottom:180px}
to your SPAN; to align to bottom –
span {display:block; height:20px;margin-top:180px}
to align in the middle –
span {display:block; height:20px;margin:90px 0px}
References:
(The problem I have involves vertically aligning two DIVs within a container DIV so that DIV1 is aligned to top, and DIV2 is aligned to bottom, and their content is aligned appropriately to top/bottom, and that it works in at least IE6, IE7, FF2. If anyone has a ready solution – please comment. When I find mine, I’ll add it to the list above.)
Posted in Programming, XHTML/CSS | 5 Comments »
22nd January 2007
Update: the same solution seems to still apply to dotProject 2.1.2; the post instructions have been modified for dP 2.1.2.
Update 2: fsmullin suggested a method to fix a similar error in index_table.php, the files_count_max cannot be found error when you click the FILES tab/menu item. His suggestion is now incorporated into the post.
Update 3: this post is still relevant for dotProject 2.1.3.
In one of my recent posts about project management software I stated the desire to extensively test dotProject 2.0.4. However, many shared hosting providers appear incompatible with dotProject: the right to CREATE TEMPORARY TABLES in MySQL is not granted, but is needed by dotProject.
Here’s sample error (2.0.4):
query failed(CREATE TEMPORARY TABLE tasks_sum SELECT task_project, COUNT(distinct task_id) AS total_tasks,
SUM(task_duration * task_percent_complete * IF(task_duration_type = 24, 8.0, task_duration_type))/
SUM(task_duration * IF(task_duration_type = 24, 8.0, task_duration_type)) AS project_percent_complete FROM `tasks` GROUP BY task_project)
For 2.1.2, sample error would be:
Table ‘tasks_total’ doesn’t exist
I tried looking for solutions, and here’s what I found…
Read the rest of this entry »
Posted in PHP, Programming, Software, Web | 10 Comments »
9th December 2006
As described in my previous post, there are some rather simple mechanisms to enable visitor’s browser to cache content, and avoid unnecessary load on your servers. In this post I’ll take a look at some parts of the practical implementation of the caching mechanism on the server, using PHP.
Read the rest of this entry »
Posted in PHP, Programming, Web | 1 Comment »
18th October 2006
In this post: some caching-related HTTP request and response headers discussed.
Modern websites are “dynamic” by nature – content you get depends on a number of variables and conditions. The simplest example – being a “guest” or a “registered” user of some forum; in both cases you get content generated by the same script/program, but it differs because of your “registered” state.
Another example – web-photogallery. By design, it is wise to always keep the original photo (the largest and presumably of the highest quality). When gallery visitor’s browser requests any smaller version of the photo – we can dynamically resize (often downsize) the original and feed the resulting photo to the browser. This scheme works OK until your gallery gets more and more visitors – CPU load climbs up and increases wait time when accessing your gallery. Evidently, caching is needed.
Read the rest of this entry »
Posted in PHP, Programming, Web | 1 Comment »
1st October 2006
If you ever need to add AdSense units to your Gallery2 installation, and find no module for this – try following the text below. I compiled it from several sources (primary menalto.com Gallery2 forum), and did everything written here myself here.
Primary source of information was this post, but I recommend that you follow instructions here.
To add AdSense to your Gallery2 sidebar (when using the Matrix theme as a sample): Read the rest of this entry »
Posted in CMS, Programming, Web | 3 Comments »