RSS

Facebook Application (Basic Setup)

Today I am going to describe basic page setup for a Facebook application. This post only for beginners who are new in Facebook and afraid after watching long form while going to create new facebook application. This is pretty simple so don’t get upset with the huge form. You need to give only the respective fields of your application target audience. Like you need to setup Mobile Web block if you are going to develop this app for mobile users.

  1. At first you need to install FB developer app to create new app in FB. You can install it form developers.facebook.com
  2. Click on Create New App link from the right corner of the page.
  3. Give your app display name and app namespace (you may skip the app namespace for here).
  4. After select the check click continue you will be redirect to the main setup page after giving the captcha code.
  5. Your email address will be automatically populated here, if you want you can change it.
  6. Enter your domain name which one will be use for your domain.
  7. Select category and subcategory (if necessary)
  8. Enter the Site URL, Canvas URL and Secure Canvas URL from Website and App on Facebook block.
  9. You don’t need to configure other block if you don’t work to create FB app version for mobile, IOS or Android.
Basic App Setup of FB

Basic App Setup on FB

I will write other configuration of Facebook application…

 

Advertisements
 
Leave a comment

Posted by on February 27, 2012 in Uncategorized

 

Tags:

Vertical Text with CSS

You may looking for how to write vertical text with CSS. I was also looking for this some days before. After searching on google I found the solution how to make vertical text with CSS properties.

Vertical Text with CSS

Vertical Text with CSS

This is tested on Opera 10.5, Firefox 10.0, IE8+ and Webkit based browsers (Safari, chrome etc), so that is pretty encompassing.

This is the HTML markup text

This is a vertical text.

Here is the CSS class property for vertical text with css

.vertical-text{
-webkit-transform:rotate(90deg);
-moz-transform:rotate(90deg);
-o-transform:rotate(90deg);
writing-mode:tb-rl;
white-space:nowrap;
width: 20px;
}

Line 1: For webkit browsers like Safari, Chrome etc.
Line 2: For Mozilla Firefox
Line 3: For Opera
Line 6: For IE
You need to definately specify the CSS white-space and width property to make the text vertical.

 
Leave a comment

Posted by on February 27, 2012 in Uncategorized

 

Tags: ,

Using Nice Menus with Drupal Primary Links

Nice Menus module help us to make Drupal menus into drop down or flyout (left or right) menus. This module only use CSS for most of the browsers (Firefox, Opera, Safari, Chrome etc.) and with additional Javascript for troublesome browsers (IE).

  • Nice Menu provides up to 10 (ten) blocks configure with different drupal menus item.
  • It provides default styling which can be override from sites theme CSS files.
  • User can customize menus functionality with the theme functions

Customization

The module includes a default CSS layout file (nice_menus_default.css) which is loaded for nice menus. You can change the default layout if you are not like this. This is suggested that you can create a new customized CSS file and replace the default CSS file from Administer -> Themes -> Configure -> Global settings -> “Path to custom nice menus CSS file” here. This ensures smooth future upgrades as no editing of the module files is necessary. Also note that you should not edit the regular nice_menus.css file since this contains the “logic” that makes Nice Menus work. A good starting point for your custom file is to make a copy of the default file, then edit it to taste. You can look through Nice Menus CSS Examples for some basic CSS edits.

Nice Menus Custom

Advanced theming

If you’re creating or modifying your own theme, you can integrate nice menus more deeply by making use of these functions:
theme_nice_menus() — themes any menu tree as a nice menu.
theme_nice_menus_primary_links() — themes your primary links as a nice menu.

 
Leave a comment

Posted by on February 13, 2012 in Drupal

 

Tags: ,

“OR” search with Apache Solr

Apache Solr is most popular and powerful open source enterprise search platform from the Apache Lucene project. I am using Apache Solr search platform mostly with my Drupal projects. Recently I got one requirement from one of my client to do search with keyword and taxonomy term for a specific content type. Where user can select multiple taxonomy term i.e. we need to do a OR search between the taxonomy terms based on user selection.

After doing some investigation we found that Drupal Apache Solr module doesn’t provide any custom search facility that will meet the client requirement. So I have planned to write a custom module for this. While working on custom module I found a real problem, it seems Faceted Search doesn’t allow to do OR search. So, I have started search on web again. After doing some searching I found one solution how to do “OR” search with Apache Solr Faceted search.

I have modified the Apache Solr query from my custom module by implementing “hook_apachesolr_modify_query“.

  • Collect the current subquery with apache_drupal_query() function.
  • Add taxonomy term ids into the collected sub query with add_filter() function.
  • Finally add all subquery into main query with “OR” operator.

function my_module_apachesolr_modify_query(&$query, &$params, $caller) {
if(isset($_GET[‘tids’])){
$term_ids = explode(‘,’, $_GET[‘tids’]);
$subquery = apachesolr_drupal_query();
foreach ($term_ids as $key => $value){
$subquery->add_filter(‘tid’, $value);
}
$query->add_subquery($subquery, ‘OR’);
watchdog(“my_module”, “Add subquery search for selected term id from my module search page.”);
}
}

 
Leave a comment

Posted by on February 8, 2012 in Drupal

 

Tags: , ,

How to add single on/off checkbox with CCK in Drupal

Always I have to spend some extra time while going to add a single on/off checkbox with CCK in Drupal. Each time I think to write a post about it and finally I am going to documented it help others.

This is pretty simple to work with CCK fields in Drupal. But adding on/off checkbox is different from other CCK fields.

  • To add a single on/off checkbox go to Manage Field option for the specific content type
  • Add a new field with single on/off checkbox selection
Add single on/off checkbox

Add single on/off checkbox

  • Into allowed values list we need to add two entry. First one will be ignored and second one will be display into content add/edit page.
Add two values into allowed values field

Add two values into allowed values field

  • Finally checkbox will appear into content add/edit page
Single on/off checkbox

Single on/off checkbox

 
1 Comment

Posted by on February 8, 2012 in Drupal

 

Tags: ,

Increase upload filesize in PHP from applicatoin

PHP calculates and displays the maximum file size that you can set based upon two PHP settings: ‘post_max_size’ and ‘upload_max_filesize’. Since ‘post_max_size’ is the limit for all the content of your post, many people choose ‘post_max_size’ to be a multiple of ‘upload_max_filesize’ to allow multiple files to be uploaded, but this is not essential. The upload module limits the size of a single attachment to be less than either post_max_size, or upload_max_filesize, whichever is smaller. The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.

To increase maximum upload limit we need to change into PHP.ini file. Maximum file upload size that you can set based upon two PHP settings: ‘post_max_size’ and ‘upload_max_filesize’. Since ‘post_max_size’ is the limit for all the content of your post, many people choose ‘post_max_size’ to be a multiple of ‘upload_max_filesize’ to allow multiple files to be uploaded, but this is not essential. The upload module limits the size of a single attachment to be less than either post_max_size, or upload_max_filesize, whichever is smaller. The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.
But we don’t have access into PHP.ini file while we are using a shared hostings. Still you can increase maximum upload file size from your application level. There is two way to do that. One is using PHP code and another is by .htaccess file.

Using .htaccess

Add the below to your .htaccess file in your root directory.

php_value upload_max_filesize 10M
php_value post_max_size 10M

By PHP code

Add following codes into your settings.php file

• ini_set(‘upload_max_filesize’, ’10M’);
• ini_set(‘ post_max_size’, ’10M’);

I will prefer to use .htaccess file to increase upload file size. Also you need to increase maximum executoin time for last files upload

php_value max_execution_time 300 #(default in ms)

The PHP documentation states that the memory_limit setting also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size. If this is an issue, see the page on how to Increase memory available to PHP (3 methods)

 
Leave a comment

Posted by on December 28, 2010 in PHP

 

Tags: , ,

How to publish blog post from Microsoft Office 2007

To publish blog post from Microsoft Office 2007 you have to follow the following steps

  1. Open Microsoft Office 2007
  2. Go Publish -> Blog from the office button. See Fig-1
  3. Then register your account here.
  4. If you using wordpress blog then change the xmlrpc server name. example: if your blog name is http://myblog.wordpress.com then your xmlrpc server name will be http://myblog.wordpress.com/xmlrpc
  5. WordPress allowed you to post an image but blogger does not allow it yet. I don’t know about other blogs because I have not tested those yet.

     

Fig – 1

Note: Your user name & password may be hacked by this time because Microsoft Office 2007 sends your user name & password each time to post and retrieve data from your blog.

 
1 Comment

Posted by on November 9, 2008 in Microsoft Office 2007 Blog Post

 

Tags: