but u see this is my entire, <br>Already there i used the switch case,for the configure purpose ,view and so,<br><br>Then how can i use , for the $deleta...<br><br><br><?php<br>// $Id$<br>/**<br>* Implementation of hook_block().<br>
*<br>* Displays the most recent (x) blog titles on the user profile page. (x) is set in block configuration admin section.<br>*/<br>function ptHeadlines_block($op = 'list', $delta = 0, $edit = array()) {<br> global $user;<br>
switch ($op) {<br> case 'list':<br> $block[0]['info'] = t('More Headline');<br> $block[0]['title'] = t('More Headline');<br><br> <br> return $block;<br> <br>
case 'configure':<br> $form['ptHeadlines_blog_num_posts'] = array(<br> '#type' => 'textfield',<br> '#title' => t('Number of Headlines to display'),<br>
'#default_value' => variable_get('ptHeadlines_blog_num_posts', 5),<br> );<br> return $form;<br> <br> case 'save':<br> if ($delta == 0) {<br> variable_set('ptHeadlines_blog_num_posts', (int) $edit['ptHeadlines_blog_num_posts']);<br>
}<br> return;<br> <br> case 'view':<br> if (user_access('access content') && $delta == 0 && arg(0)=='user') {<br> $num_posts = variable_get('ptHeadlines_blog_num_posts', 5);<br>
// $current_user_profile = arg(1);<br> $result = db_query_range("select cn.nid,cn.title,nr.title,nr.timestamp,nr.body,nr.teaser from node as cn,node_revisions as nr where cn.nid=nr.nid and cn.type='article'ORDER BY nr.timestamp DESC", NULL, 1, $num_posts);<br>
<br><br> if (db_num_rows($result)) {<br> $items = array();<br> while ($blog_posts = db_fetch_object($result)) {<br> $items[] = "<p>".l(ucwords($blog_posts->title), 'node/'. $blog_posts->nid)."</p>".substr($blog_posts->teaser, 0, 175)."&nbsp;&nbsp;&nbsp;".l("More","node/".$blog_posts->nid)."<br>";<br>
// $items[]=substr($blog_posts->title, 0, 175)."<br><br><br>";<br><br> }<br> $block['subject'] = t('More Headlines');<br> // Theme our array of links as an unordered list<br>
$block['content'] = theme('item_list_ameex', $items);<br> // if (db_num_rows($result) == $num_posts) {<br> // //$block['content'] .= '<div class="block-view-more">'. l(t('View more'), 'blog/'. $current_user_profile, array(), NULL, NULL, FALSE, FALSE) .'</div>';<br>
// } <br> }<br> }<br> <br> //this is block for top Headlines<br> <br> <br> return $block; <br> }<br>}<br><br><br><br>