WBCE Home | WBCE Hilfe | WBCE Addon Repository | Impressum | Datenschutz

WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

You are not logged in.

#1 06.09.2019 17:58:50

florian
Administrator

Droplet: getSectionByName

Mit diesem Droplet können Abschnitte anhand ihres Namens gezogen werden.
Aufruf: [[getSectionByName?name=Namedesabschnitts]]

Basiert auf dem "alten" SectionPicker-Droplet. Kann daher sein, dass die Zeile $wb_page_data = usw. gar nicht erforderlich ist.

global $database, $wb, $TEXT;
$content = ' ';
$query_sec = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE namesection = '$name' ");
if($query_sec->numRows() > 0) { 
	$section = $query_sec->fetchRow(); 
	$section_id = $section['section_id']; 
	$module = $section['module']; 
	ob_start();
	require(WB_PATH.'/modules/'.$module.'/view.php'); 
	$content = ob_get_contents();
    	ob_end_clean();
} 
$wb_page_data = str_replace('</head>','<link href="'.WB_URL.'/modules/'.$module.'/frontend.css" rel="stylesheet" type="text/css" media="screen" />'."\n".'<script src="'.WB_URL.'/modules/'.$module.'/frontend.js" type="text/javascript"> </script>'."\n".'</head>', $wb_page_data );    	
return $content;

Offline

Board footer

Powered by FluxBB

up