function filterContent($content) { $content = EzGA::preFilter($content); if (EzGA::$noAds) { return $content; } if (!empty($this->options['force_widget']) && self::$ezCount == 0) { // reserve a count for the widget self::$ezMax--; } $plgName = EzGA::getPlgName(); if (self::$ezCount >= self::$ezMax) { return $content . " <!-- {$plgName}: Unfiltered [count: " . self::$ezCount . " is not less than " . self::$ezMax . "] -->"; } $adMax = self::$ezMax; $adCount = 0; if (!is_singular()) { if (isset(EzGA::$options['excerptNumber'])) { $adMax = EzGA::$options['excerptNumber']; } } list($content, $return) = EzGA::filterShortCode($content); if ($return) { return $content; } $this->handleDefaults(); $wc = str_word_count($content); $metaOptions = EzGA::getMetaOptions(); $show_leadin = $metaOptions['show_leadin']; $leadin = ''; if ($show_leadin != 'no' && empty($this->options['header_leadin']) && $wc > $this->options['wc_leadin']) { if (self::$ezCount < self::$ezMax && $adCount++ < $adMax) { $leadin = $this->mkAdBlock("leadin"); } } $show_midtext = $metaOptions['show_midtext']; $midtext = ''; if ($show_midtext != 'no' && $wc > $this->options['wc_midtext']) { if (self::$ezCount < self::$ezMax && $adCount++ < $adMax) { if (!EzGA::$foundShortCode) { $paras = EzGA::findParas($content); $half = sizeof($paras); while (sizeof($paras) > $half) { array_pop($paras); } $split = 0; if (!empty($paras)) { $split = $paras[floor(sizeof($paras) / 2)]; } if ($this->options['force_midad'] || $half > 10) { $midtext = $this->mkAdBlock("midtext"); $content = substr($content, 0, $split) . $midtext . substr($content, $split); } } else { $midtext = $this->mkAdBlock("midtext"); } } } $show_leadout = $metaOptions['show_leadout']; $leadout = ''; if ($show_leadout != 'no' && $wc > $this->options['wc_leadout']) { if (self::$ezCount < self::$ezMax && $adCount++ < $adMax) { $leadout = $this->mkAdBlock("leadout"); if (!EzGA::$foundShortCode && strpos($show_leadout, "float") !== false) { $paras = EzGA::findParas($content); $split = array_pop($paras); if (!empty($split)) { $content1 = substr($content, 0, $split); $content2 = substr($content, $split); } } } } if (!empty($this->options['header_leadin'])) { $this->leadin = $leadin; $leadin = ''; } if (!empty($this->options['footer_leadout'])) { $this->leadout = $leadout; $leadout = ''; } if (EzGA::$foundShortCode) { $content = EzGA::handleShortCode($content, $leadin, $midtext, $leadout); } else { if (empty($content1)) { $content = $leadin . $content . $leadout; } else { $content = $leadin . $content1 . $leadout . $content2; } } return $content; }
<?php require 'header.php'; $plgName = EzGA::getPlgName(); $plgSlug = EzGA::getPlgMode(); if ($plgSlug == 'google-adsense-ultra') { $plgSlug = 'google-adsense'; } $plgPrice = EzGA::$plgPrice; require_once '../lib/Ftp.php'; $ftp = new Ftp(); require_once 'Updater.php'; $updater = new Updater($plgSlug); ?> <div> <ul class="breadcrumb"> <li> <a href="#">Home</a> </li> <li> <a href="#">Update <?php echo $plgName; ?> </a> </li> </ul> </div> <style type="text/css"> label{width:100px;} </style> <?php
function getHeader() { ob_start(); $plgName = EzGA::getPlgName(); $plgSlug = EzGA::getSlug(); $plgModeName = EzGA::$pluginModes[$plgSlug]; $isPro = EzGA::$isPro; $plgPrice = EzGA::$plgPrice; if (!empty(EzGA::$options['eztheme'])) { $themeCSS = "css/bootstrap-" . strtolower(EzGA::$options['eztheme']) . ".min.css"; } else { $themeCSS = "css/bootstrap-cerulean.min.css"; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title><?php echo $plgName; ?> </title> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content="Ads EZ Plugin for Google AdSense"> <meta name="author" content="Manoj Thulasidas"> <!-- The styles --> <link id="bs-css" href="<?php echo $themeCSS; ?> " rel="stylesheet"> <link href="css/bootstrap-editable.css" rel="stylesheet"> <link href="css/charisma-app.css" rel="stylesheet"> <link href='css/bootstrap-tour.min.css' rel='stylesheet'> <link href="css/font-awesome.min.css" rel="stylesheet"> <link href="css/fileinput.min.css" rel="stylesheet"> <link href="css/bootstrap-colorpicker.min.css" rel="stylesheet"> <link href="css/ez-admin.css" rel="stylesheet"> <style type="text/css"> .popover{width:600px;} <?php if (empty(EzGA::$options['breadcrumbs'])) { ?> .breadcrumb {display:none;} <?php } ?> </style> <!-- jQuery --> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <!-- The HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- The fav icon --> <link rel="shortcut icon" href="img/favicon.ico"> </head> <body> <!-- topbar starts --> <div class="navbar navbar-default" role="navigation"> <div class="navbar-inner"> <a id="index" class="navbar-brand" href="index.php"> <img alt="Ads EZ Logo" src="img/ads-ez.png" class="hidden-xs"/> <span><?php echo $plgName; ?> </span></a> <div class="btn-group pull-right"> <?php $standaloneURL = plugins_url('index.php', __FILE__); ?> <a id="standAloneMode" href="<?php echo $standaloneURL; ?> " target="_blank" data-content="Open <?php echo $plgName; ?> admin apge in a new window independent of WordPress admin interface. The standalone mode still uses WP authentication, and cannot be accessed unless logged in." data-toggle="popover" data-trigger="hover" data-placement="left" title='Standalone Admin Screen'><span class="btn btn-info"><i class="glyphicon glyphicon-resize-full"></i> Standalone Mode</span></a> <a id="update" href="update.php" data-content="If you would like to check for regular updates, or install a purchased module or Pro upgrade, visit the Updates page." data-toggle="popover" data-trigger="hover" data-placement="left" title='Updates Page'><span class="btn btn-info" ><i class="fa fa-cog fa-spin"></i> Updates <?php if (!$isPro) { ?> <span class="badge red">Pro</span> <?php } ?> </span> </a> </div> </div> </div> <!-- topbar ends --> <div class="ch-container"> <div class="row"> <!-- left menu starts --> <div class="col-sm-2 col-lg-2"> <div class="sidebar-nav"> <div class="nav-canvas"> <div class="nav-sm nav nav-stacked"> </div> <ul class="nav nav-pills nav-stacked main-menu"> <li id="dashboard"><a href="index.php"><i class="glyphicon glyphicon-home"></i><span> Dashboard</span></a> </li> <li id='tour'><a href="tour.php"><i class="glyphicon glyphicon-road"></i><span> Tour and Help</span></a></li> <?php if ($isPro) { $optionSets = EzGA::getOptionSets(); echo <<<EOF <li class="accordion"> <a id='{$plgSlug}' href="#"><i class="glyphicon glyphicon-plus"></i><span> {$plgModeName}</span></a> <ul class="nav nav-pills nav-stacked"> <li id='{$plgSlug}-admin'><a href="{$plgSlug}-admin.php"><i class="glyphicon glyphicon-check"></i><span> Settings</span></a></li> EOF; foreach ($optionSets as $o) { if (in_array($o, EzGA::$unSettable)) { $verb = 'Edit '; } else { $verb = 'Switch to '; } echo <<<EOF <li id="{$plgSlug}-{$o}"><a href="{$plgSlug}-admin.php?optionset={$o}"><i class="glyphicon glyphicon-export red"></i><span> {$verb} <code>{$o}</code></span></a></li> EOF; } echo <<<EOF <li id="{$plgSlug}-add"><a href="optionset.php"><i class="glyphicon glyphicon-export red"></i><span> Manage Option Sets</span></a></li> </ul> </li> EOF; ?> <li id='pro'><a href="pro.php" class="red"><i class="glyphicon glyphicon-cog"></i><span><b> Pro Features</b></span></a></li> <?php } else { echo <<<EOF <li id='{$plgSlug}-admin'><a href="{$plgSlug}-admin.php"><i class="glyphicon glyphicon-check"></i><span> {$plgModeName}</span></a></li> EOF; ?> <li id='goPro'><a href="pro.php" class="red goPro" data-toggle="popover" data-trigger="hover" data-content="Get the Pro version of <?php echo $plgModeName; ?> for <i>only</i> $<?php echo $plgPrice[$plgSlug]; ?> . Tons of extra features. Instant download." data-placement="right" title="Upgrade to Pro" data-product="<?php echo $plgSlug; ?> "><i class="glyphicon glyphicon-shopping-cart"></i><span><b> Go Pro!</b></span></a></li> <?php } ?> <li id="options"><a href="options.php"><i class="glyphicon glyphicon-cog"></i><span> Options</span></a></li> <li id="i18n"><a href="i18n.php"><i class="glyphicon glyphicon-globe"></i><span> Languages</span></a></li> </div> </div> </div> <!--/span--> <!-- left menu ends --> <noscript> <div class="alert alert-block col-md-12"> <h4 class="alert-heading">Warning!</h4> <p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> enabled to use this site.</p> </div> </noscript> <div id="content" class="col-lg-10 col-sm-10"> <!-- content starts --> <?php $header = ob_get_clean(); return $header; }