HaLe Blog twitter
HaLe Blog Rss

Drupal cache headers are driving me nuts!

Posted by Kim | Posted in Coding, Content Management Systems, Drupal, PHP | Posted on 10-10-2011

0

A client of ours had this problem on their website, where users who had logged out, could still see their profile page as if they were connected!

After googling (what else!) I found the answer to be in a slight change of the headers being sent by Drupal:

File: /includes/bootstrap.inc, line 728 / 765

From:

Cache-Control:store, no-cache, must-revalidate, post-check=0, pre-check=0

To:

Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0

More info on this issue can be found here: http://drupal.org/node/197786#comment-1565612, the patch is right here: http://drupal.org/files/issues/login_linger.patch

Magento : menu items order

Posted by lhe | Posted in Coding, Databases, E-Commerce, Magento, MySQL, PHP | Posted on 19-10-2010

5

We have been working on some Magento e-shops and it needs to be said, its a nice enough system.
However, it is not a CMS. This means that when you create pages, you dont have all the freedom you would enjoy when using Drupal or WordPress for example.
You can create pages and they will appear in the main menu. But then you start looking at the sort order of those menu items.
Guess what, nothing to be found in the admin interface to control it. So you go ” NOOOOOOOOOOoooooooooo….”……

No panic! Stay calm… with some minor db data changes and a little coding we can get it all to work.
First of all, let’s ask the obvious question “Why on earth is it not a standard admin function to be able to manipulate the page order?”
No idea, but it is foreseen in the database.
In the table

cms_page

you will find a collumn called

sort_order

. You can use this collumn to decide on the order.

Go refresh your page… Nothing changed, right? Hehe, well you need to do one more thing.
Open this file :

magento/app/design/frontend/default/maried/template/catalog/navigation

Find this line (should be line number 60):

$cms_pages->getSelect()->where('is_active = 1');

And add the sortorder so the line becomes :

$cms_pages->getSelect()->where('is_active = 1')->order('sort_order');

Now go and refresh your page… TADA!!!

Geshi Supported Languages

Posted by Kim | Posted in Coding | Posted on 23-04-2010

1

It took us *too* long to find a list of supported languages for our GeShi Code Highlighter so here it is, to never more forget it!

Supported Languages

The following languages are supported in the lang attribute:

abap, actionscript, actionscript3, ada, apache, applescript, apt_sources, asm, asp, autoit, avisynth, bash, bf, bibtex, blitzbasic, bnf, boo, c, c_mac, caddcl, cadlisp, cil, cfdg, cfm, cmake, cobol, cpp-qt, cpp, csharp, css, d, dcs, delphi, diff, div, dos, dot, eiffel, email, erlang, fo, fortran, freebasic, genero, gettext, glsl, gml, bnuplot, groovy, haskell, hq9plus, html4strict, idl, ini, inno, intercal, io, java, java5, javascript, kixtart, klonec, klonecpp, latex, lisp, locobasic, lolcode lotusformulas, lotusscript, lscript, lsl2, lua, m68k, make, matlab, mirc, modula3, mpasm, mxml, mysql, nsis, oberon2, objc, ocaml-brief, ocaml, oobas, oracle11, oracle8, pascal, per, pic16, pixelbender, perl, php-brief, php, plsql, povray, powershell, progress, prolog, properties, providex, python, qbasic, rails, rebol, reg, robots, ruby, sas, scala, scheme, scilab, sdlbasic, smalltalk, smarty, sql, tcl, teraterm, text, thinbasic, tsql, typoscript, vb, vbnet, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xml, xorg_conf, xpp, z80