Skip to main content

Posts

Showing posts from 2011

To get pager on page

Use of pager query :   Drupal 4.6 - 6 :  pager_query($query, $limit = 10, $element = 0, $count_query = NULL) Perform a paged database query. Use this function when doing select queries you wish to be able to page. The pager uses LIMIT-based queries to fetch only the records required to render a certain page. However, it has to learn the total number of records returned by the query to compute the number of pages (the number of records / records per page). This is done by inserting "COUNT(*)" in the original query. For example, the query "SELECT nid, type FROM node WHERE status = '1' ORDER BY sticky DESC, created DESC" would be rewritten to read "SELECT COUNT(*) FROM node WHERE status = '1' ORDER BY sticky DESC, created DESC". Rewriting the query is accomplished using a regular expression.  $output1 .= theme('pager',null, $count, 0); This is used to get the number. We can use this pager query in "Custom Search"

To get Twiter Tweets on Drupal page/Block

add script as : http://widgets.twimg.com/j/2/widget.js; add this code below with new script tag : new TWTR.Widget({ version: 2, type: 'search', search: 'rainbow', interval: 30000, title: 'It\'s a double rainbow', subject: 'Across the sky', width: 250, height: 300, theme: { shell: { background: '#8ec1da', color: '#ffffff' }, tweets: { background: '#ffffff', color: '#444444', links: '#1985b5' } }, features: { scrollbar: false, loop: true, live: true, hashtags: true, timestamp: true, avatars: true, toptweets: true, behavior: 'default' } }).render().start();

For Custom Data In Event Participant

Function Below shows Following When Participating for an event Using custom data : 1) Get the custom data contact . 2) If not Get then Create new contact . 3) Create New Participant for Event . 4) Check for Organization & create if organization not exist . 5) Check for Relationship & create if previous not available . function eventType_customPath_civicrm_post( $op, $objectName, $objectId, &$objectRef ) {     if ( $objectName == 'Participant' && $op == 'create' ) {         require_once 'api/api.php';         $config =& CRM_Core_Config::singleton( );         $participantParams = $config->_customParams;         $participantFirstNameId = array( 'custom_22', 'custom_60', 'custom_62' );   /* add custom first name Id */         $participantLastNameId = array( 'custom_59', 'custom_61', 'custom_63' );    /* add custom last name Id */         $participantEmailId = array( 'cus

Create Replication of drupal using script in linux

First of all Copy the settings.php & civicrm settings.php files & paste it as settings.php.dist & civicrm.settings.php.dist. Edit the settings.php.dist :- $db_url=' '; $db_prefix = ' '; Edit Civicrm settings.php :- Replace the code from the file with the following code . 1)  define( 'CIVICRM_UF_DSN'           , ' ' ); 2)  define( 'CIVICRM_DSN'          , ' ' ); 3)  $civicrm_root = ''; 4)  define( 'CIVICRM_TEMPLATE_COMPILEDIR', '' ); 5)  define( 'CIVICRM_UF_BASEURL'      , '' ); After that create one script file as filename.sh ( for ex.  drupal-rep.sh)  &  copy the following code into the file. /************************ Script file code **********************************/ echo "Have you copy files 'civicrm.settings.php.dist' and 'settings.php.dist'       in sites/default of the source drupal ( 'y' or 'n' ) ? " read copyFil

Dedupe type in civicrm

In civicrm, there is Dedupe functionality which check the duplicate contacts & merge it . It check contacts for contact type ( like Individual, Household, Organization )  . To open dedupe click on Contact . It gives condition on which civicrm checks duplicate contact . If we add the rule just go to edit rule or create new dedupe . Default Dedupe Rule Settings Fuzzy Rules for Individual => First Name AND Last Name AND Email Organization => Organization Name OR Email Household => Household Name OR Email Strict Rules for Individual => Email Organization => Organization Name OR Email Household => Household Name OR Email

Difference between pixels and em When giving size in em & px.

PIXEL SIZE : By setting font size with pixel you can fully control over the font size. Example: h1 {font-size:60px} h2 {font-size:40px} p {font-size:16px} Above examples allows Chrome, Firefox, and Safari to resize the text, but not Internet Explorer. The text can be resized in all browsers using the zoom tool (however, this resizes the entire page, not just the text). .EM SIZE : To avoid the resizing problem in IE many  web designer  use em instead of pixel. And it is recommended by W3C. The default font size in browser is 16px. And 1 em is equal to current font size it means 1 em is equal 16px. Here is the formula to  calculate  pixel to em : Pixels /16 = em That means if font size is 60px it will be in em is 3.75em. With the em size you can adjust the font size in all browser. But there is problem in IE . The problem is when you resizing the text, it becomes larger than it should when made larger, and smaller than it should when made smaller. To solve this pro

Create contact using custom field in civicrm 4.0 (civicrm API)

Create contact using custom field in prifile when event registration. Create Contacts using API in civicrm 4.0 in drupal 7 on post process.  If the contact exists then it o/p that contacts id & if not exists then it create new contact & gives the o/p . function eventType_customPath_civicrm_postProcess( $formName, &$form ){     if( $formName == 'CRM_Event_Form_Registration_Confirm' ){         $participantContact = $form->getVar('_params');         $participantFirstNameId = array( 'custom_11', 'custom_15', 'custom_19' );   /* add custom first name Id */         $participantLastNameId = array( 'custom_12', 'custom_16', 'custom_20' );    /* add custom last name Id */         $participantEmailId = array( 'custom_13', 'custom_17', 'custom_21' );       /* add custom email Id */         $participant = array( );         for( $count = 0; $count < 3; $count++ ) {             $pa

Allow Your Own Inner Light to Guide You

Allow Your Own Inner Light to Guide You There comes a time when you must stand alone. You must feel confident enough within yourself to follow your own dreams. You must be willing to make sacrifices. You must be capable of changing and rearranging your priorities so that your final goal can be achieved. Sometimes, familiarity and comfort need to be challenged.   There are times when you must take a few extra chances and create your own realities. Be strong enough to at least try to make your life better. Be confident enough that you won't settle for a compromise just to get by. Appreciate yourself by allowing yourself the opportunities to grow, develop, and find your true sense of purpose in this life. Don't stand in someone else's shadow when it's your sunlight that should lead the way.     Be a strong person in life .

Engineering मध्ये काय असतं

Engineering मध्ये काय असतं Assignment, Drawing sheet, Exam आणि Result शिवाय काही नसतं Assignment म्हणजे काय असतं शुद्धलेखानाच काम असतं Drawing sheet म्हणजे काय असतं काचेवरच कोरिव काम असतं Exam म्हणजे काय असतं एकमेकांना मदत करण्याच काम असतं Result म्हणजे काय असतं पार्टीला जाण्याचा कारण असतं Electrical मध्ये काय असतं Transformer शिवाय काय नसतं Mechanical मध्ये काय असतं Rankine cycle शिवाय काय नसतं Civil मध्ये काय असतं कराचीच्या mean sea level शिवाय काय नसतं Production मध्ये काय असतं Male female शिवाय काय असतं IT मध्ये काय असतं Copy Paste शिवाय काय नसतं Electronics मध्ये काय असतं पोरींशिवाय काही नसतं First Year मध्ये काय असतं नविन मित्र भेट्न्याचा निमित्त असतं Second year मध्ये काय असतं Diploma चे मित्र येण्याचा कारण असतं Third year मध्ये काय असतं Drop मधील मित्र येणे असतं Last year मध्ये काय असतं मित्रांशिवाय काही नसतं Thats why engineering म्हणजे काय असतं मित्र बनवन्याच काम असt

Nice Thought

Never expect things to happen. struggle and make them happen. Never expect yourself to be given a good valuecreate a value of your own If a drop of water falls in lake there is no identity.But if it falls on a leaf of lotus it shine like a pearl.so choose the best place where you would shine Falling down is not defeat...Defeat is when your refuse to get up Ship is always safe at shore...But is is not built for it When your successful your well wishers know who you are when you are unsuccessful you know who your well wishers are It is great confidence in a friend to tell him your faults; greater to tell him/her To the world you might be one person, but to one person you just might be the world Even the word 'IMPOSSIBLE' says 'I M POSSIBLE' Always Aim high for the best, but also be prepared for the worst Effort is important, but knowing where to make an effort in your life makes all the difference