function pwaplusphp_shortcode($atts, $content = null) { $PRO_VERSION = isProActive(); $overrides_array = array(); // Rob - Fixes undefined. // Free shortcode options extract(shortcode_atts(array("album" => 'NULL'), $atts)); extract(shortcode_atts(array("filter" => ''), $atts)); extract(shortcode_atts(array("tag" => 'NULL'), $atts)); // Pro shortcode options extract(shortcode_atts(array("cover" => ''), $atts)); extract(shortcode_atts(array("comments" => ''), $atts)); extract(shortcode_atts(array("header" => 'NULL'), $atts)); extract(shortcode_atts(array("hide_albums" => 'NULL'), $atts)); // Free shortcode overrides extract(shortcode_atts(array("images_per_page" => 'NULL'), $atts)); extract(shortcode_atts(array("image_size" => 'NULL'), $atts)); extract(shortcode_atts(array("thumbnail_size" => 'NULL'), $atts)); extract(shortcode_atts(array("picasaweb_user" => 'NULL'), $atts)); // Pro shortcode overrides extract(shortcode_atts(array("page_header" => 'NULL'), $atts)); extract(shortcode_atts(array("random_photos" => 'NULL'), $atts)); // Rob extract(shortcode_atts(array("show_n_albums" => 'NULL'), $atts)); // Free overrides handling if ($images_per_page != "" && $images_per_page != "NULL") { $overrides_array["images_per_page"] = $images_per_page; } if ($image_size && $image_size != "NULL") { $overrides_array["image_size"] = $image_size; } if ($thumbnail_size != "" && $thumbnail_size != "NULL") { // Rob $overrides_array["thumbnail_size"] = $thumbnail_size; } if ($picasaweb_user && $picasaweb_user != "NULL") { $overrides_array["picasaweb_user"] = $picasaweb_user; } if ($hide_albums && $hide_albums != "NULL") { $overrides_array["hide_albums"] = $hide_albums; } // Pro overrides handling if ($page_header && $page_header != "NULL") { $overrides_array["page_header"] = $page_header; } if ($show_n_albums && $show_n_albums != "NULL") { $overrides_array["show_n_albums"] = $show_n_albums; } if ($random_photos && $random_photos != "NULL") { //Rob $overrides_array["random_photos"] = $random_photos; } // // PRO if (isset($comments) && $comments != "") { if (function_exists("pwaplusphp_pro_getRecentComments")) { $out = pwaplusphp_pro_getRecentComments($comments); } else { $out = "<strong>This is a PRO feature.</strong>"; } return $out; // PRO } else { if ($cover == "TRUE" && (!isset($_GET["album"]) || isset($album))) { if ($PRO_VERSION == "TRUE") { $out = pwaplusphp_pro_dumpAlbumList($album, $cover); } else { $out = "<strong>This is a PRO feature.</strong>"; } return $out; // Free } else { if ($album == "NULL" && !isset($_GET["album"]) && $random_photos == "NULL" && $tag == "NULL") { if ($PRO_VERSION == "TRUE") { $out = pwaplusphp_pro_dumpAlbumList($filter, "FALSE", $overrides_array); } else { $out = dumpAlbumList($filter, "FALSE", $overrides_array); } return $out; // Pro } else { if ($random_photos != "NULL") { // Rob $out = pwaplusphp_pro_randomPhoto($overrides_array); // return $out; // } else { if ($album != "NULL") { // Pro if ($album == "random_photo") { if ($PRO_VERSION == "TRUE") { $out = pwaplusphp_pro_randomPhoto($overrides_array); // need to depreciate. } else { $out = "<strong>This is a PRO feature.</strong>"; } } else { if ($album == "random_album") { if ($PRO_VERSION == "TRUE") { $out = pwaplusphp_pro_dumpAlbumList("RANDOM"); } else { $out = dumpAlbumList("RANDOM"); } } else { if ($PRO_VERSION == "TRUE") { $out = pwaplusphp_pro_showAlbumContents($album, "TRUE", $tag, $overrides_array); } else { $out = showAlbumContents($album, "TRUE", $tag, $overrides_array); } } } } else { if (isset($_GET["album"])) { $album = $_GET["album"]; if ($PRO_VERSION == "TRUE") { $out = pwaplusphp_pro_showAlbumContents($album, "FALSE", $tag, $overrides_array); } else { $out = showAlbumContents($album, "FALSE", $tag, $overrides_array); } } else { if ($tag != "NULL") { if ($PRO_VERSION == "TRUE") { $out = pwaplusphp_pro_showAlbumContents($album, "FALSE", $tag, $overrides_array); } else { $out = showAlbumContents($album, "FALSE", $tag, $overrides_array); } } } } return $out; } } } } }
<?php global $PRO_VERSION; global $THIS_VERSION; error_reporting(E_ERROR | E_WARNING | E_PARSE); //$pro_functions = dirname(__FILE__).'/proFunctions.php'; //if (file_exists($pro_functions)) { // echo "FILE $pro_functions"; // require_once($pro_functions); //} $PRO_VERSION = isProActive(); echo "<div class='wrap'>"; echo "<div id='icon-plugins' class='icon32'></div><h2>PWA+PHP Plugin Settings</h2><br />"; if ($_GET['loc'] == "finish") { echo "<div style='width: 71%; margin: 0px 0px 0px 20px; padding: 5px; background-color: #ffffcc; border: #e6e6e6 1px solid;'>Configuration is complete and PWA+PHP is ready for use. Create a page with contents \"[pwaplusphp]\" to see your albums.</div>"; } echo "<table cellspacing=20><tr><td width='75%' valign=top>"; #============================================================================================== # Copyright 2012 Scott McCandless (smccandl@gmail.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.