The last project I was working on was having a requirement hiding the file URL in browser, for security reason. The file was actually PDF file and was containing user's order data. So to restrict the access to PDF file I've created a page callback, where I've written small piece of code to show the PDF output directly in page. Here is the sample code:
Yogesh Chaugule's Blog
The answer is YES. It is possible to point your primary domain to a sub-folder within public_html rather than public_html itself. Here is some information that should allow you to do so yourself.
In order to set up your main domain to use a sub-folder on your hosting account you will need to set up a redirect in the .htaccess file in the public_html folder so that the server knows that any request for your main domain will be redirected to a sub-folder on public_html.
Drupal 7 field module defines a field level template file, which defines the HTML structure of the field. We can use this file to override the display of field including changing how label will be display. The file is named as field.tpl.php which you can find in side the "DRUPAL_ROOT/modules/field/theme/" directory.
To show welcome message in Drupal we can identify whether user is logged in or not using simple code snippet below. You can write this code in either block or custom module which adds block or create a variable in template.php to use in a template:
The above code will find the HTML element i.e. div in our case, containing text as "John", and add underline to it.
Here is how you can find the difference between two different timezones
Now a days there are always tasks which require email notification, such examples are notify user on account creation, periodic notification for activities done by user, notify user on submission of form, etc. There are lots of other cases where you need to test the email and its content. In this post I'll be telling how can we send an email from our localhost.
Just came across a situation, where wanted to alter the allowed values in views exposed filter depending on users who are viewing them.
View allows site admin to expose its filter value to user, so they can apply different filters while viewing views output. But what if you need to show the allowed list depending on users.