Posts

Showing posts from September, 2011

Drupal adsense in content

This tip will show you how to insert your ads in the middle of your content with Drupal 6 . Drupal 6 has many modules with lots of functions to do things, but if you can get to do things without installing a new module is much better! So, if you want to insert adsense or any other javascript based ads in the middle of you content, in between your paragraphs, you can do it with a little bit of php. 1. Open your active theme folder, usually in /sites/all/themes/my_active_theme 2. Open the file page.tlp.php please do a backup of this file first 3. Search the line:   <?php print $content ?> and insert this code right before <?php // Show ads when user is not logged in if(!user_is_logged_in()) { // Show ads in the middle of content $adsBlock='<script type="text/javascript">PLACE YOUR JAVASCRIPT CODE HERE</script>'; $arr = explode ("</p>", $content); // center content ads insert ads after first paragraph $arr[1] = $ads

Configure Xampp on Windows

As you already know Xampp is a prepared environment to develop web applications with Apache, PHP and MySQL. The good thing is that you don't have to spend time to install and configure these separately. Once you've installed it  you may have to configure Xampp on windows to adapt it to your needs though, so here you can see some tips and tricks to tune up your Xampp installation on Windows Launch PHP on the command line Add C:\xampp\php\ to your environment variable windows PATH Append your XAMPP PHP directory at the back of what is already there ;C:\xampp\php\ Increase PHP memory limit Edit php.ini in c:/xampp/php/php.ini change memory_limit to whatever you want: memory_limit=256M Add your web sites Go to the Httdocs folder create a folder named old, cut and paste all loose files (not directories) Then copy or create your own website folders: /httdocs/website_1 /httdocs/website_2 /httdocs/website_3 You will access to them like this: http://localho

Ubuntu 10: window buttons to the right

Image
One more thing with Ubuntu 10: windows buttons are on the left instead of the right trying to imitate the Apple style. I prefer the buttons to the right for a simple reason: the window title is the first thing you see to the left and the whole window top space is so much better optimized. I really hope they revert this: hey people from Canonical do not micmick Apple stuff, please, keep on thinking about users as before!  I had to do some search to find how to change this one and here is the trick: > Press ALT+F2 button to launch the Run application window > Type gconf-editor Navigate to Apps -> Metacity -> General Double click on button_layout, values are: close,minimize,maximize: Change values to menu:close,minimize,maximize Well, I did mine to menu:minimize,maximize,close To get the close control all to the right That makes it easy if use both Windows and Linux regurlaly

Back to Ubuntu 10

Last night a virus killed my Windows XP, katusha a form or worm attacked my laptop.  I decided to get back to Ubuntu as fighting against viruses, reformating my laptop every six month and reinstalling the OS and all the software can be annoying! And now wich Ubuntu version to choose ? I prefer a LTS (Long Term Support) version of course. The 10.04 LTS version "The Lucid Lynx" is supported till April 2013. For all the other new versions a 6 months update is due. I've tried Ubuntu 11.04 but it slowed down my laptop too much so I went back to Ubuntu 10. But there are so many thing I still love about Windows (omg!, ha!) I really love the Arial font type as it is my favourite for internet browsing. Times New Roman and Courier New are still the best! In fact Courier New is my favourite for programming . So, to install the Microsoft font package in Ubuntu just type: sudo apt-get install msttcorefonts Anwser yes to all the license questions. I've opened Firefo