Hi dear<br><br>I want to restrict the block display in all pages,<br><br>I want to display my block in home page only,<br><br>this is my home page URL<br><br><a href="http://localhost/test">http://localhost/test</a> ======> i want to display my block when this url is in the address bar,<br>
<br>in other place , i dont want to display...<br><br>this is my code , tell which place i wants to made the changes<br><br><?php<br><br><br>function cEvents_block($op = 'list', $delta = 0){<br> <br><br> switch ($op){<br>
<br> //this is array for display the caption for the block<br> case 'list':<br> $blocks[1]['info'] = t('cEvents');<br> return $blocks;<br>
<br> case 'configure':<br> if ($delta == 0) {<br> $form['approval_block_num_posts'] = array(<br> '#type' => 'textfield',<br>
'#title' => t('Number of pending comments to display'),<br> '#default_value' => variable_get('approval_block_num_posts', 5),<br> );<br>
}<br> return $form;<br> <br> case 'view':<br> <br> <br> if(arg(0)!='node' ||arg(0)!='user'||arg(1)!='user/*'){<br>
<br> <br> <br> // $modpath = drupal_get_path('module', 'cEvents');<br> //drupal_add_css($modpath .'/cEvents.css', 'module');<br> $num_rows=db_num_rows(db_query("select nid from node where type='events'"));<br>
if($num_rows>0){<br> if ($delta == 1 ) {<br> <br> //drupal_add_css(drupal_get_path('module', 'cEvents') .'/cEvents.css');<br>
$sql ="select cn.nid,cn.field_contact_person_value,cn.field_sponsor_value,cn.field_location_value,nr.title,nr.body,nr.teaser from content_type_events as cn,node as n ,node_revisions as nr where nr.nid=cn.nid and n.type like 'events' and n.nid=nr.nid";<br>
<br> //$cEvents_block[] = "<div class='column2-unit' >";<br> <br> <br> $result = db_query_range(db_rewrite_sql($sql), 0, 5);<br> while ($node = db_fetch_object($result)) {<br>
$cEvents_block[] .=l($node->title,"node/".$node->nid)." <br>Sponser &nbsp;".$node->field_sponsor_value."<br>contact person &nbsp;".$node->field_contact_person_value."<br>Location &nbsp;".$node->field_location_value;<br>
<br> <br> <br> }<br> <br> // $cEvents_block[].="</div>";<br> $block['subject'] = t('Events');<br> $block['content'] = theme('item_list_ameex', $cEvents_block);<br>
}<br> return $block;<br> }<br> }<br> }<br>}<br><br><br><br>