Jump to content

Insert Div tag in a function


werushka

Recommended Posts

Hi I am new to PHP i have code that I am trying to edit, the code is below.

 

function phptemplate_views_view_table ($view, $nodes, $type) {
  	$fields = _views_get_fields();
           foreach ($nodes as $node) {
      $row = array();
      $row2 = array();
    foreach ($view->field as $field) {
      if ($fields[$field['id']]['visible'] !== FALSE) {
           switch ($field['field']) {

		  case 'pic';
	        $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
	        $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']);
	        $row[] = $cell;
	      break;

          case 'title';
            $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
            $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']);
            $row[] = $cell;
          break;

          case 'totalcount';
            $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
            $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']);
            $row[] = $cell;
          break;

          case 'name';
            $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
            $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']);
            $row2[] = $cell;
          break;

          case 'subscribe';
            $cell['data'] = views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node, $view);
            $cell['class'] = "view-field ". views_css_safe('view-field-'. $field['queryname']);
            $row2[] = $cell;
          break;
          }
      }
    }
    $rows[] = $row;
    $rows[] = $row2;
  }
  return theme('table', $view->table_header, $rows);

}  

 

What I want to do is group row and row2 so that it sits inside div class=rowgroup and give div id tags to "pic","title","totalcount","name", "subscribe"

 

If i can understand this it would be great for me so I can start to theme by trial error.

 

Thanks 

Link to comment
https://forums.phpfreaks.com/topic/145026-insert-div-tag-in-a-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.