Exemple #1
0
	function makeView() {
		GLOBAL $data;
		GLOBAL $db;
		GLOBAL $parser;
		
		$data->set($this->parent);
		
		// Get first field name for parent list 
			// if isset list fields
			if (isset($data->list_fields)) {
				$columns = $data->list_fields;	
			}
			// get columns as array
			if (isset($columns)) {
				$columns_array = explode(',', $columns);
			} else {
				$columns_array = array(0=>'name');	
			}
			$parent_column=$columns_array[0];
		
		$parent_table = $data->table;
		
		$parent_list=cmsList($parent_column,$_GET['order'],$_GET['order_type'],$cond,'cms/cross_list', 'dynamic_list');
		
		$data->set($this->child);
		
		$child_table=$data->table;
		
		$parser->setCaption(array(
			'caption_name'	=> formatCaption($parent_column)
		));
		
		$query = "SELECT p.$parent_column as element, c.id, '".$this->parent."' as parent_type, '".$this->child."' as type, p.id as parent_id, 0 as back FROM $parent_table p, $child_table c WHERE p.id=c.$this->cross_field ORDER BY c.".$data->order;
		$rows = $db->query($query);
		
		$child_list = $parser->makeList($rows,'cms/cross_list','child_list');
		
		$parser->loadTemplate('cms/cross_list');
		
		$parser->tpl->parseVariable(array(
			'child_list'	=> $child_list,
			'parent_list'	=> $parent_list
		),'cross_list');
		
		return $parser->tpl->get();		
		
		
	}
Exemple #2
0
?>
</h3>
			<section>
            	<?php 
cmsList('hui_part_one', 30, 32, 110);
?>
			</section>
		</section>
		<section class="custom-center">
			<h3><?php 
list_title('hui_part_two', '自定义栏目二');
?>
</h3>
			<section>
            	<?php 
cmsList('hui_part_two', 36, 42, 150);
?>
			</section>
		</section>
		<aside class="contact">
			<h3>联系方式</h3>
			<div>
            	<?php 
echo get_option('hui_contact');
?>
			</div>
		</aside>
	</div>

<?php 
get_footer();