@import \"/includes/jwtabs/tabs_slides.css\"; "; $header .= ""; return $header; } function jwTabs( $text, $published = true ) { //$text = 'test'.$text; $enable_tabs = 1; $enable_slides = 1; // JS loader selection $use_optimized_loader = 0; // Use optimized JS code loader? 0=no and 1=yes. Default is 0. if (!$published) { if (preg_match_all("/{tab=.+?}/", $text, $matches, PREG_PATTERN_ORDER) > 0) { foreach ($matches[0] as $match) { $match = str_replace("{tab=", "", $match); $match = str_replace("}", "", $match); $text = str_replace( "{tab=".$match."}", "", $text ); $text = str_replace( "{/tabs}", "", $text ); } } if (preg_match_all("/{slide=.+?}/", $text, $matches, PREG_PATTERN_ORDER) > 0) { foreach ($matches[0] as $match) { $match = str_replace("{slide=", "", $match); $match = str_replace("}", "", $match); $text = str_replace( "{slide=".$match."}", "", $text ); $text = str_replace( "{/slide}", "", $text ); } } return; } $path = $_SERVER['DOCUMENT_ROOT']; $live_site = 'http://'.$_SERVER['HTTP_HOST']; static $tabid; // Start Tabs Replacement // index.php if($enable_tabs) { $b=1; if (preg_match_all("/{tab=.+?}{tab=.+?}|{tab=.+?}|{\/tabs}/", $text, $matches, PREG_PATTERN_ORDER) > 0) { foreach ($matches[0] as $match) { if($b==1 && $match!="{/tabs}") { $tabs[] = 1; $b=2; } elseif($match=="{/tabs}"){ $tabs[]=3; $b=1; } elseif(preg_match("/{tab=.+?}{tab=.+?}/", $match)){ $tabs[]=2; $tabs[]=1; $b=2; } else { $tabs[]=2; } } } @reset($tabs); $tabscount = 0; if (preg_match_all("/{tab=.+?}|{\/tabs}/", $text, $matches, PREG_PATTERN_ORDER) > 0) { foreach ($matches[0] as $match) { if($tabs[$tabscount]==1) { $match = str_replace("{tab=", "", $match); $match = str_replace("}", "", $match); $text = str_replace( "{tab=".$match."}", "

".$match."

", $text ); $tabid++; } elseif($tabs[$tabscount]==2) { $match = str_replace("{tab=", "", $match); $match = str_replace("}", "", $match); $text = str_replace( "{tab=".$match."}", "

".$match."

", $text ); } elseif($tabs[$tabscount]==3) { $text = str_replace( "{/tabs}", "
", $text ); } $tabscount++; } } } // End Tabs Replacement // Start Slides Replacement // index.php if($enable_slides) { if (preg_match_all("/{slide=.+?}/", $text, $matches, PREG_PATTERN_ORDER) > 0) { foreach ($matches[0] as $match) { $match = str_replace("{slide=", "", $match); $match = str_replace("}", "", $match); $text = str_replace( "{slide=".$match."}", "
".$match."
", $text ); $text = str_replace( "{/slide}", "
", $text ); } } } // End Slides Replacement return $text; } ?>