Drupal — the design errors that just won’t go away!
Apr 6, 2010 Drupal, techno-babble
Recently, while designing a site in Drupal using the theme acquia prosper (awesome theme, very customizable, gives a lot of control without you needing to go deep into theme css files or sub-theming), I just happened to fumble upon a few things that just wouldn’t go away.. ah the hours wasted! Well if this can help someone, I’d be very happy.
1. FCKEditor loves to add <p> tags. Problem becomes even worse if you are making a block with only an image in it and FCKEditor just won’t let you take that <p> tag out. Of course you can disable FCKeditor and enter everything manually, but I’m sure we will all agree that FCKEditor along with IMCE just makes life a lot easier when adding images to the site. One solution is to configure the FCKEditor module so that on <Enter> it adds a <br /> tag instead of a <p> tag. The other solution ties in with the second problem below
2. Even without FCKEditor, when you go and check your site on IE, you see the block is just not positioned properly! What’s going on? You check the source and you find a <p> tag AGAIN around the image! What the? If you create a block with the intent of only including a simple image tag in the code (or anything besides text), Drupal will surround your code with paragraph tags. The tags, by default, come along with a 1em margin on both top and bottom — right, while Firefox may show your design properly, IE definitely doesn’t. Solution? You can always just put a small code in the CSS file. In my case, with Acquia prosper (and Skinr module), I was able to add a custom CSS class to the block which then was defined in the local.css file:
.custom-css-name p{
margin:0;}
So that works. You can also try a CSS override in the following manner: #your-block-id p { margin: 0; }
Or finally, you can always create a new block input type that doesn’t convert spaces into unwanted tags. Basically a new input format that will have the following property unchecked:
Converts line breaks into HTML (i.e. <br> and <p> tags).
I hope this helps if you have also run across this problem … ah that pesky <p> tag that just won’t go away!
Tags: acquia prosper, css, Drupal, drupal theme
Good Looking Burgers — What’s the secret?
Jan 8, 2010 Did You Know, techno-babble
Well here’s an interesting movie to watch
Tags: digital manipulation, video
Pranav Mistry – Sixth Sense
Dec 1, 2009 techno-babble
This is just awesome! This type of technology will revolutionize the world as we know. I’m sure the applications are great, but what boggles my mind is how smart this young fella is. Watch the video and enjoy:
Tags: pranav mistry, sixth sense, virtual world
Drupal Updating / Upgrading
Oct 30, 2009 Drupal, techno-babble
Updating or Upgrading Drupal is not an easy task. Compared to Wordpress, where the updating is simply a mouse-click away, Drupal requires you to do certain things that can take a bit of time in extremely extensive sites. I recently had to update my Drupal installation from 6.12 to 6.14
Now this being my first Drupal installation, and as much as I love this CMS, the updating process can be a pain if not following the instructions carefully. The instructions can be found in “upgrade.txt” file located in your drupal zip file, also you can find tons of instructions online. An excellent website learnbythedrop.com can help you out a lot if you are looking for tutorials on Drupal. Here’s the video I followed to help me update Drupal. Posting it here so that it can get more recognition on the web! They say you can fill an ocean, one drop at a time….
Tags: Drupal
Drupal 6 Installation issues
Oct 1, 2009 Drupal, techno-babble
Drupal 6 requires php directive “register_globals” to be off. This is not always the case depending on your hosting environment or even your own requirements as Drupal may not be the only thing residing on your virtual server.
There are several work arounds for the issue if you come across an error during installation asking you to turn “register_globals” off. It may work for you or it may not work for you, but the final one will definitely do the job. Just to be safe, try the fixes in the order below:
1. You can always add or edit the .htaccess file in your root directory with the following line:
php_flag register_globals off
This may or may not work depending on whether the apache configuration on your host allows directives to be fed through the .htaccess file. Find out more about .htaccess files by going to http://www.freewebmasterhelp.com/tutorials/htaccess/
2. So that didn’t work huh? Fret not, here’s another solution. Place a “php.ini” file in your root directory with the following line:
register_globals = 0
did that work? Basically you are telling php to initialize with the setting for your directory.
3. Wait, we didn’t cover the fact that you may be running your own server! Well if you are lucky enough to have your own server and control over your php.ini file, simply change the register_globals variable to ‘off’ in your php.ini file. More information can be found at the php website about how to configure your php.ini file.
4. You could also try adding the following line to your .htaccess file (it has been proven to work on 1&1 webservers):
AddType x-mapp-php5 .php
This directive simply tells the server to use php5 for .php files instead of php4 (which might be the default for several webhosts out there)
5. Ok genius, nothing worked, now what? Yup, that was my case as well, nothing worked, seemed the host didn’t allow default settings to be changed. Well there’s always the “ask your hosting provider” answer. If you are so inclined to do so, send them an email and ask them how to turn the “register_globals” variable off for your particular site. They might not be of much help, but you never know. Or, (Yes!) there’s another method. You can simply tell Drupal to ignore it when installing. It requires you to change the install file located in modules/system directory called “system.install“. Go ahead and find the line:
if (!empty($register_globals) && strtolower($register_globals) != ‘off’)
and change the “!=” to “==” . The line should now read:
if (!empty($register_globals) && strtolower($register_globals) == ‘off’)
Curious to know what you are doing here? Well you are simply telling the system.install file change the “not equal to” to “equal to”. Basically, you fooled the system into treating a response which would mean that “register_globals” is “on” into treating it as “register_globals” is “off”. You will not get any more errors when doing the install now.
Now, remember, it is unsafe to have register_globals on. Your system is not fully secure if that directive is on. So if you are willing to take the risk, you can implement the solutions provided in this post.
Tags: Drupal
Open Source CMS Comparitive Analysis
Sep 15, 2009 techno-babble
Are you looking for an open source CMS? There are way too many systems out there and everybody has its own choice, providing their own pros and cons about the various systems out there. I came across a nice report which I felt like sharing with others who may be visiting these open source demo sites with the same dilemma as myself, which one is best?
Link to the report:
http://www.waterandstone.com/downloads/2008OpenSourceCMSMarketSurvey.pdf
While you are at it, couple of other sites that may be of interest to you are:
http://www.opensourcecms.com/
http://www.oscom.org/matrix/index.html
If anybody reading this has any thoughts on the open source CMS systems, please share. I personally have liked playing with Drupal a lot.
Tags: CMS, Open Source, Web Publishing
Mysql – Appending data
Jul 10, 2007 mysql, techno-babble
Problem:
Appending data from one table to another table where duplicate might exist.
Solution:
A simple “Insert into table2 select * from table1″ query will give errors saying “duplicate records exist”, to go around it, the following query should do the job:
INSERT INTO MASTERTABLE
SELECT *
FROM NEWTABLE
WHERE NEWTABLE.`UNIQUEID` NOT
IN (SELECT `UNIQUEID`
)
MySQL non-matching Records
Jun 15, 2007 mysql, techno-babble
Problem: Finding records in Table b that do not match records in Table a
This sort of problem may arise when you need to scrub a file against another or run a duplicate scan on a file against another to weed out any duplicates that may exist prior to doing whatever it is you need to do with that file. Lets assume that both the tables have a field called “PHONE” that identifies your clients as unique.
The query that you will need to run uses LEFT JOIN function
SELECT * FROM TableB b
LEFT OUTER JOIN TableA a ON b.`PHONE` = a.`PHONE`
WHERE a.`PHONE` IS NULL
This should do it.
Scribus – Page Numbering
Apr 2, 2007 Linux, techno-babble
So I have been working with Scribus for the last few days for a project at work. Being on Linux, I always look for software that let me do what needs to be done that are opensource, Scribus ended up being the perfect desktop publishing solution that works on Linux. If you are looking for Desktop publishing solution, Scribus can do the job for you and if I’m not mistaken, it works on multiple operating systems (including Windows). Now my advice is that if you are going for Scribus, make sure you go for the latest version, even though it is from their nightly developped version, you are more likely to have better functions, more functions and a stable version if you do that. I am currently using 1.3.3.6 and I think a better version is out already. In any case, the post is to help with the page-numbering issue.
So I made my little booklet and realized that my page numbers were showing up wrong, after 10 or so pages, I started getting 1-2-3-4 repeated all over! What’s wrong? Apparently, you need to tell Scribus that you want more than 10 pages. So on my master template, where I had put up a # sign to indicate I want the page number to come there, I had to put up ## signs for pages more than 20. Simple solution, weird behaviour.
Thought I’d share this with the world.
Tags: scribus
Converting flv to mpg in Ubuntu
Mar 12, 2007 Linux, techno-babble
In case you ever need to convert one of those flash videos that you find all over the web these days (for example on youtube.com), you can use your linux box very easily to do so. But first, download the .flv (flash video) file from the website. To do that, use “unplug” addon for Mozilla firefox (just go to the Firefox addon site and search for “unplug”).
The plugin gives you a few choices to download streaming video/audio from a site by giving you (what it assumes) to be the best link to download the media file.
So after you have downloaded the flv file, simply open up the terminal and run this command:
user@server:~$ ffmpeg -i get_video.flv -ab 56 -ar 22050 -b 500 -s 320X240 video.mpg
A great link that gives more information about this process is in my del.icio.us and here it is: http://ubuntuforums.org/showthread.php?p=1656936
Tags: flash video, FLV, Linux, Ubuntu



