Skip to main content

Posts

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 ...

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 cop...

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 ...

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 = arra...