Index: branches/2.8.x/CHANGELOG
===================================================================
--- branches/2.8.x/CHANGELOG	(revision 1620)
+++ branches/2.8.x/CHANGELOG	(revision 1621)
@@ -11,6 +11,9 @@
 ! = Update/Change
 ===============================================================================
 
+24 Feb-2012 Build 1621 Werner v.d.Decken(DarkViper)
+# Droplet [SectionPiocker] fixed
++ Added new droplets [ShowWysiwyg] and [ShowRandomWysiwyg]
 24 Feb-2012 Build 1620 Dietmar Woellbrink (Luisehahne)
 # fixed FCKeditor lang files to utf-8 (Tks to Ruebenwurzel
 24 Feb-2012 Build 1619 Dietmar Woellbrink (Luisehahne)
Index: branches/2.8.x/wb/admin/interface/version.php
===================================================================
--- branches/2.8.x/wb/admin/interface/version.php	(revision 1620)
+++ branches/2.8.x/wb/admin/interface/version.php	(revision 1621)
@@ -51,5 +51,5 @@
 
 // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
 if(!defined('VERSION')) define('VERSION', '2.8.3');
-if(!defined('REVISION')) define('REVISION', '1620');
+if(!defined('REVISION')) define('REVISION', '1621');
 if(!defined('SP')) define('SP', '');
Index: branches/2.8.x/wb/modules/droplets/example/SectionPicker.php
===================================================================
--- branches/2.8.x/wb/modules/droplets/example/SectionPicker.php	(revision 1620)
+++ branches/2.8.x/wb/modules/droplets/example/SectionPicker.php	(revision 1621)
@@ -2,27 +2,28 @@
 //:Use [[SectionPicker?sid=123]]
 global $database, $wb, $TEXT, $DGTEXT;
 $content = '';
-if( intval($sid)>0 ) {
-	$sql  = 'SELECT `page_id`, `section_id`, `module` FROM `'.TABLE_PREFIX.'sections` ';
-	$sql .= 'WHERE `section_id` = '.(int)$sid;
-	$sql .= '';
-	if($query_sec = $database->query($sql))
-	{
-		$section = $query_sec->fetchRow();
-		$section_id = $section['section_id'];
-		$module = $section['module'];
-		$_sFrontendCss = '/modules/'.$module.'/frontend.css';
-		if(is_readable(WB_PATH.$_sFrontendCss)) {
-			$_sSearch = preg_quote(WB_URL.'/modules/'.$module.'/frontend.css', '/');
-			if(preg_match('/<link[^>]*?href\s*=\s*\"'.$_sSearch.'\".*?\/>/si', $wb_page_data)) {
-				$_sFrontendCss = '';
-			}else {
-				$_sFrontendCss = '<link href="'.WB_URL.$_sFrontendCss.'" rel="stylesheet" type="text/css" media="screen" />';
-			}
-		} else { $_sFrontendCss = ''; }
-		ob_start();
-		require(WB_PATH.'/modules/'.$module.'/view.php');
-		$content = $_sFrontendCss.ob_get_clean();
+$sid = isset($sid) ? intval($sid) : 0;
+if( $sid ) {
+	$sql  = 'SELECT `module` FROM `'.TABLE_PREFIX.'sections` ';
+	$sql .= 'WHERE `section_id`='.$sid;
+	if (($module = $database->get_one($sql))) {
+		if (is_readable(WB_PATH.'/modules/'.$module.'/view.php')) {
+			$_sFrontendCss = '/modules/'.$module.'/frontend.css';
+			if(is_readable(WB_PATH.$_sFrontendCss)) {
+				$_sSearch = preg_quote(WB_URL.'/modules/'.$module.'/frontend.css', '/');
+				if(preg_match('/<link[^>]*?href\s*=\s*\"'.$_sSearch.'\".*?\/>/si', $wb_page_data)) {
+					$_sFrontendCss = '';
+				}else {
+					$_sFrontendCss = '<link href="'.WB_URL.$_sFrontendCss.'" rel="stylesheet" type="text/css" media="screen" />';
+				}
+			} else { $_sFrontendCss = ''; }
+			ob_start();
+			$oldSid = $section_id; // save old sectionID
+			$section_id = $sid;
+			require(WB_PATH.'/modules/'.$module.'/view.php');
+			$content = $_sFrontendCss.ob_get_clean();
+			$section_id = $oldSid; // restore old sectionID
+		}
 	}
 }
 return $content;
\ No newline at end of file
Index: branches/2.8.x/wb/modules/droplets/example/ShowWysiwyg.php
===================================================================
--- branches/2.8.x/wb/modules/droplets/example/ShowWysiwyg.php	(nonexistent)
+++ branches/2.8.x/wb/modules/droplets/example/ShowWysiwyg.php	(revision 1621)
@@ -0,0 +1,17 @@
+//:Display one defined WYSIWYG section
+//:Use [[ShowSection?section=10]]
+global $database;
+	$content = '';
+	$section = isset($section) ? intval($section) : 0;
+	if ($section) {
+		if (is_readable(WB_PATH.'/modules/wysiwyg/view.php')) {
+		// if valid section is given and module wysiwyg is installed
+			$iOldSectionId = intval($section_id); // save old SectionID
+			$section_id = $section;
+			ob_start(); // generate output by regulary wysiwyg module
+			require(WB_PATH.'/modules/wysiwyg/view.php');
+			$content = ob_get_clean();
+			$section_id = $ioldSectionId; // restore old SectionId
+		}
+	}
+return $content;
\ No newline at end of file

Property changes on: branches/2.8.x/wb/modules/droplets/example/ShowWysiwyg.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision HeadURL
\ No newline at end of property
Index: branches/2.8.x/wb/modules/droplets/example/ShowRandomWysiwyg.php
===================================================================
--- branches/2.8.x/wb/modules/droplets/example/ShowRandomWysiwyg.php	(nonexistent)
+++ branches/2.8.x/wb/modules/droplets/example/ShowRandomWysiwyg.php	(revision 1621)
@@ -0,0 +1,20 @@
+//:Randomly display one WYSIWYG section from a given list
+//:Use [[ShowRandomWysiwyg?section=10,12,15,20]] possible Delimiters: [ ,;:|-+#/ ]
+global $database;
+	$content = '';
+	if (isset($section)) {
+		if( preg_match('/^[0-9]+(?:\s*\[\,\|\-\;\:\+\#\/]\s*[0-9]+\s*)*$/', $section)) {
+			if (is_readable(WB_PATH.'/modules/wysiwyg/view.php')) {
+			// if valid arguments given and module wysiwyg is installed
+				$iOldSectionId = intval($section_id); // save old SectionId
+				// split and sanitize arguments
+				$aSections = preg_split('/[\s\,\|\-\;\:\+\#\/]+/', $section);
+				$section_id = $sections[array_rand($sections)]; // get random element
+				ob_start(); // generate output by wysiwyg module
+				require(WB_PATH.'/modules/wysiwyg/view.php');
+				$content = ob_get_clean();
+				$section_id = $ioldSectionId; // restore old SectionId
+			}
+		}
+	}
+return $content;
\ No newline at end of file

Property changes on: branches/2.8.x/wb/modules/droplets/example/ShowRandomWysiwyg.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision HeadURL
\ No newline at end of property
