You are hereDrupal 6
Drupal 6
Fusion theme classes for node add and node edit pages
I almost always use Fusion theme as my base theme, one thing its missing and developers of it seem not to care is a class that is in body and is different for node add and node edit pages, so I usually go to template.php and around line 64, after
$body_classes[] = (arg(0) == 'forum') ? 'forum' : ''; // Forum page
}
I add this two
$body_classes[] = (arg(2) == 'edit') ? 'node-edit' : '';
Box Shadow in IE7 and IE8
Finally in IE9 MS started to support proper and useful CSS tags. But at this moment in time you still need to have support for IE7 and IE8. So If you want to make some nice box shadows, you are in a problem. Luckly this page comes to help http://css3pie.com/
works as it should, donate to those people, they made your life much easier :-)
Just a note on this. when adding this to your CSS, put in an path to your CSS files and this .htc file like
background-image:url("../images/miletic_footer_bg.png");
background-repeat:repeat-x;
Facebook-style Micropublisher change link of attachment
Facebook-style Micropublisher works great with Facebook-style Statuses and is one of the coolest "new" drupal modules. Statuses are lightweight for database but statuses also can have their own page like nodes. Problem is that in my case this is not out of the box solution. So again i made some hacking :-)
I wanted status attacmhments to lead to status page when clicked. So i had to change how it is linked. I changed fbsmp.module one line in function fbsmp_render_attachment this one
Setting The Front Page Per Language
This often has given me lots of headaches, how to setup front page for each language. There are several ways, depending on your site configuration chooses one.
1.This way you do it with "path" module and different nodes with same Alias.
http://drupal-translation.com/content/setting-front-page-language
2.With multilanguage variables like it's described here
http://drupal.org/node/313272
3.With views, just add a view page and put filter on it to select current users language
"Node translation: Language = Current user’s language" and add that view on site information page as home.
Different domain name for each language
I always wanted to tried this, finally I got a client who was willing to do this for his site.
So I added 3 domains to drupal site. Then i selected "Domain name only" as the Language negotiation options and then inputed domains for each language in language configuration, pretty easy. Then comes the server part, with VPS this is not a problem, I edited my site file (virtual host file) which is in etc/apache2/sites-avaialble
and added
ServerName www.yourdomain.com
ServerAlias www.yourdomain.com
ServerAlias www.french-yourdomain.fr
ServerAlias www.german-yourdomain.de
Hiding History in User profile view
This option of showing user history seems more obsolite then useful, se lets hide it.
For Drupal 6, copy this file from your /sites/modules/user directory:
user-profile-category.tpl.php, put the copy into your custom theme directory and within that file, replace the code with this
<h3><?php print $title; ?></h3>
<?php endif; ?>
<?php if ($title != t(History)) : ?>
<dl<?php print $attributes; ?>>
<?php print $profile_items; ?>
</dl>
One time login destination override
There is a great module for people you registred manually but you need to give them login information after this. It is one time login module but it lacks option to redirect users to their user edit page, which is the first thing they should do, enter their NEW PASSWORD.
So i made a little hack for this. Open module file and go to 508 line and just add this line
This will redirect your users to their edit user page directly on first login.
Drupal Calc and age of users
I am bulding a view with stats for users that are registred and inputed DOB. Currently core profile module and views (drupal 6) don't play along when using dates. The way data is stored seems to be the problem. Anyway you can't filter and sort your users by date, but you can make this happen with customfield PHP code. You get current year and DOB year from user like this and just calculate and you will get age of user, which you can then sort with table view if it is in customfield.
Code filter fix and help
I was trying to use code filter module for this page, but without any luck. As most users i was getting this error and couldn't do anything to make it work. So I made my own solution for this. I created CSS class
padding: 5px;
border: 1px solid #CCC;
background-color: #EEE;
line-height: 18px;
}
I am using BUE editor where you can easily edit how "code" button will format text when you click it so you just added in BUE configuration
Posting to your Facebook wall as user or post to Facebook fan page as admin
Let's first install Drupal for Facebook module as it's stated in readme file.
1.First download and install FB PHP-SDK, download from http://github.com/facebook/php-sdk. Extract the files, and place them in sites/all/libraries/facebook-php-sdk on your site
2.Your theme page.tpl.php and others need the following attribute at the end of the tag: xmlns:fb="http://www.facebook.com/2008/fbml"
3. Add this 2 lines to end of your settings.php include "sites/all/modules/fb/fb_url_rewrite.inc"; include "sites/all/modules/fb/fb_settings.inc";