function redirect_show_ui() { $redirectkey = fly_redirect_slug(); $redirects = get_option('flytonic_custom_redirects'); if (!$redirects) { $redirects = array(); } if ($_POST['action'] == 'Create Redirect') { if (array_key_exists($_POST['key'], $redirects)) { $cr_error = 'Key already exists'; } elseif ($_POST['key'] == '' || $_POST['url'] == '') { $cr_error = 'Key and URL are both required fields'; } else { $redirect = array('key' => $_POST['key'], 'url' => $_POST['url'], 'hits' => 0); $redirects[$_POST['key']] = $redirect; update_option('flytonic_custom_redirects', $redirects); } } elseif ($_POST['action'] == 'Save Changes') { $rvalues = $_POST['redirects']; foreach ($rvalues as $key => $info) { $redirects[$key]['url'] = $info['url']; if ($info['key'] != $key) { $redirects[$key]['key'] = $info['key']; $redirects[$info['key']] = $redirects[$key]; unset($redirects[$key]); } } update_option('flytonic_custom_redirects', $redirects); } elseif ($_GET['action'] == 'delete-redirect') { unset($redirects[$_GET['key']]); update_option('flytonic_custom_redirects', $redirects); } elseif ($_GET['action'] == 'reset-redirect') { if (array_key_exists($_GET['key'], $redirects)) { $redirect = $redirects[$_GET['key']]; $redirect['hits'] = 0; $redirects[$_GET['key']] = $redirect; update_option('flytonic_custom_redirects', $redirects); } } ?> <style> .redirects_table th { text-align: left; } .redirects_table { width: 700px !important; } </style> <div class="wrap meta-box-sortables"> <div class="icon32" id="icon-themes"><br></div> <h2>Custom Redirects</h2> <div id="poststuff"> <br /><br /> <form method="post" action="?page=redirect-options"> <table class="redirects_table widefat" width=620> <thead> <tr> <th width=120>Redirect Key</th> <th width=400>Url</th> <th width=75>Hits</th> <th width=160>Actions</th> </tr> </thead> <tbody> <?php if (count($redirects) == 0) { ?> <tr> <td colspan="4"><em>No custom redirects</em></td> </tr> <?php } else { ?> <?php foreach ($redirects as $redirect) { ?> <tr> <td><span><a href="<?php echo bloginfo('home'); ?> /<?php echo $redirectkey; ?> /<?php echo $redirect['key']; ?> "><?php echo $redirect['key']; ?> </a></span> <input type="text" style="width: 75px; display: none" name="redirects[<?php echo $redirect['key']; ?> ][key]" value="<?php echo $redirect['key']; ?> " /></td> <td><span><?php echo $redirect['url']; ?> </span> <input type="text" style="width: 300px; display: none" name="redirects[<?php echo $redirect['key']; ?> ][url]" value="<?php echo $redirect['url']; ?> " /> </td> <td><?php echo $redirect['hits']; ?> </td> <td> <span><a href="#" onclick="editRow(this)">Edit</a> | </span> <a href="?page=redirect-options&action=delete-redirect&key=<?php echo $redirect['key']; ?> ">Delete</a> | <a href="?page=redirect-options&action=reset-redirect&key=<?php echo $redirect['key']; ?> ">Reset Hits</a></td> </tr> <?php } ?> <?php } ?> </tbody> </table> <br /> <input type="submit" name="action" value="Save Changes" /> </form> <script> function editRow(o) { jQuery(o).parent().hide(); jQuery(o).parents('tr').find('td span').hide(); jQuery(o).parents('tr').find('td input').show(); } </script> <br /> <h3>Create a custom redirect</h3> <?php if ($cr_error != '') { ?> <strong style="color: #990000;"><?php echo $cr_error; ?> </strong> <?php } ?> <form method="post" action="?page=redirect-options"> <label>Key:</label> <input type="text" name="key" value="<?php echo $_POST['key']; ?> " /> <label>URL:</label> <input style="width: 200px" name="url" value="<?php echo $_POST['url']; ?> " type="text" /> <input type="submit" name="action" value="Create Redirect" /> </form> </div><!--poststuff--> </div><!--wrap--> <?php }
function fly_bonustable_func($atts) { extract(shortcode_atts(array('num' => 5, 'orderby' => 'date', 'sort' => 'DESC', 'tag' => '', 'platform' => '', 'software' => '', 'version' => ''), $atts)); if ($orderby == 'date') { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC')); } else { if ($orderby == '_as_roomname') { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'order' => $sort, 'orderby' => 'meta_value', 'meta_key' => $orderby)); } else { if ($orderby == 'order') { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'order' => $sort, 'orderby' => 'menu_order')); } else { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'order' => $sort, 'orderby' => 'meta_value_num', 'meta_key' => $orderby)); } } } $i = 0; $posts = array(); foreach ($loop->posts as $p) { if ($i >= $num) { continue; } if ($tag != '' && !has_term($tag, 'affiliate-tags', $p)) { continue; } if ($platform != '' && !has_term($platform, 'platform-tags', $p)) { continue; } if ($software != '' && !has_term($software, 'network-tags', $p)) { continue; } $custom = get_post_custom($p->ID); $posts[] = $p; $i++; } $redirectkey = fly_redirect_slug(); if ($version == 1 || $version == '') { $ret = ' <table class="topbonuses"> <tr> <th >' . (get_gambling_option("replace-head-site") != "" ? get_gambling_option("replace-head-site") : "Bingo Site") . '</th> <th class="hideme">' . (get_gambling_option("replace-head-bonus-nd") != "" ? get_gambling_option("replace-head-bonus-nd") : "No Deposit Bonus") . '</th> <th ><span class="hilite">' . (get_gambling_option("replace-head-bonus-su") != "" ? get_gambling_option("replace-head-bonus-su") : "Signup Bonus") . '</span></th> <th class="hideme">' . (get_gambling_option("replace-head-bonus-rl") != "" ? get_gambling_option("replace-head-bonus-rl") : "Reload Bonus") . '</th> <th>' . (get_gambling_option("replace-head-visit") != "" ? get_gambling_option("replace-head-visit") : "Visit Site") . '</th> </tr> '; $x = 0; global $post; $opost = $post; foreach ($posts as $post) { setup_postdata($post); $x = $x + 1; $ret .= ' <tr ' . ($x == 1 ? "class='alt'" : "") . '> <td class="logocol"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '"> ' . get_the_post_thumbnail($post->ID, 'casino-icon', array('class' => 'logo')) . '</a><br /> <a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '">' . get_post_meta($post->ID, "_as_roomname", true) . '</a> </td> <td class="bonuscol hideme">' . get_post_meta($post->ID, "_as_nodeposit", true) . '</td> <td class="bonuscol"><span class="hilite">' . get_post_meta($post->ID, "_as_bonustext", true) . '</span></td> <td class="bonuscol hideme">' . get_post_meta($post->ID, "_as_reload", true) . '</td> <td class="visitcol"><a ' . (get_theme_option('redirect-new-window') != "" ? "target=\"_blank\"" : "") . ' href="' . get_bloginfo('url') . '/' . $redirectkey . '/' . get_post_meta($post->ID, "_as_redirectkey", true) . '/" class="visbutton">' . (get_gambling_option("replace-vis-button") != "" ? get_gambling_option("replace-vis-button") : "Play Now") . '</a></td> </tr> '; } $post = $opost; } else { if ($version == 2) { $ret = ' <table class="midsites"> <tr> <th> </th> <th class="hideme">' . (get_gambling_option("replace-head-site") != "" ? get_gambling_option("replace-head-site") : "Bingo Site") . '</th> <th class="hideme">' . (get_gambling_option("replace-head-btype") != "" ? get_gambling_option("replace-head-btype") : "Bonus Type") . '</th> <th ><span class="hilite">' . (get_gambling_option("replace-head-bamt") != "" ? get_gambling_option("replace-head-bamt") : "Bonus Amount") . '</span></th> <th>' . (get_gambling_option("replace-head-rev") != "" ? get_gambling_option("replace-head-rev") : "Review") . '</th> </tr> '; $x = 0; global $post; $opost = $post; foreach ($posts as $post) { setup_postdata($post); $x = $x + 1; $ret .= ' <tr ' . ($x % 2 == 0 ? "class='alt'" : "") . '> <td class="logocol"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '"> ' . get_the_post_thumbnail($post->ID, 'casino-icon', array('class' => 'logo')) . '</a></td> <td class="casinoname hideme"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '">' . get_post_meta($post->ID, "_as_roomname", true) . '</a></td> <td class="bonuscol hideme">' . (get_gambling_option("replace-mid-btype2") != "" ? get_gambling_option("replace-mid-btype2") : "Signup Bonus") . '</td> <td class="bonuscol"><span class="hilite">' . get_post_meta($post->ID, "_as_subonus", true) . '</span></td> <td class="visitcol"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '" class="visbutton blue">' . (get_gambling_option("replace-mid-rev") != "" ? get_gambling_option("replace-mid-rev") : "Review") . '</a></td> </tr> '; } $post = $opost; } else { if ($version == 3) { $ret = ' <table class="midsites"> <tr> <th> </th> <th class="hideme">' . (get_gambling_option("replace-head-site") != "" ? get_gambling_option("replace-head-site") : "Bingo Site") . '</th> <th class="hideme">' . (get_gambling_option("replace-head-btype") != "" ? get_gambling_option("replace-head-btype") : "Bonus Type") . '</th> <th ><span class="hilite">' . (get_gambling_option("replace-head-bamt") != "" ? get_gambling_option("replace-head-bamt") : "Bonus Amount") . '</span></th> <th>' . (get_gambling_option("replace-head-rev") != "" ? get_gambling_option("replace-head-rev") : "Review") . '</th> </tr> '; $x = 0; global $post; $opost = $post; foreach ($posts as $post) { setup_postdata($post); $x = $x + 1; $ret .= ' <tr ' . ($x % 2 == 0 ? "class='alt'" : "") . '> <td class="logocol"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '"> ' . get_the_post_thumbnail($post->ID, 'casino-icon', array('class' => 'logo')) . '</a></td> <td class="casinoname hideme"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '">' . get_post_meta($post->ID, "_as_roomname", true) . '</a></td> <td class="bonuscol hideme">' . (get_gambling_option("replace-mid-btype3") != "" ? get_gambling_option("replace-mid-btype3") : "No Deposit Bonus") . '</td> <td class="bonuscol"><span class="hilite">' . get_post_meta($post->ID, "_as_nodeposit", true) . '</span></td> <td class="visitcol"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '" class="visbutton blue">' . (get_gambling_option("replace-mid-rev") != "" ? get_gambling_option("replace-mid-rev") : "Review") . '</a></td> </tr> '; } $post = $opost; } else { if ($version == 4) { $ret = ' <table class="midsites"> <tr> <th> </th> <th class="hideme">' . (get_gambling_option("replace-head-site") != "" ? get_gambling_option("replace-head-site") : "Bingo Site") . '</th> <th class="hideme">' . (get_gambling_option("replace-head-btype") != "" ? get_gambling_option("replace-head-btype") : "Bonus Type") . '</th> <th ><span class="hilite">' . (get_gambling_option("replace-head-bamt") != "" ? get_gambling_option("replace-head-bamt") : "Bonus Amount") . '</span></th> <th>' . (get_gambling_option("replace-head-rev") != "" ? get_gambling_option("replace-head-rev") : "Review") . '</th> </tr> '; $x = 0; global $post; $opost = $post; foreach ($posts as $post) { setup_postdata($post); $x = $x + 1; $ret .= ' <tr ' . ($x % 2 == 0 ? "class='alt'" : "") . '> <td class="logocol"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '"> ' . get_the_post_thumbnail($post->ID, 'casino-icon', array('class' => 'logo')) . '</a></td> <td class="casinoname hideme"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '">' . get_post_meta($post->ID, "_as_roomname", true) . '</a></td> <td class="bonuscol hideme">' . (get_gambling_option("replace-mid-btype4") != "" ? get_gambling_option("replace-mid-btype4") : "Reload Bonus") . '</td> <td class="bonuscol"><span class="hilite">' . get_post_meta($post->ID, "_as_reload", true) . '</span></td> <td class="visitcol"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '" class="visbutton blue">' . (get_gambling_option("replace-mid-rev") != "" ? get_gambling_option("replace-mid-rev") : "Review") . '</a></td> </tr> '; } $post = $opost; } } } } $ret .= '</table>'; return $ret; }
function fly_topbinog_func($atts) { extract(shortcode_atts(array('num' => 5, 'orderby' => 'date', 'sort' => 'DESC', 'tag' => '', 'platform' => '', 'software' => ''), $atts)); if ($orderby == 'date') { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC')); } else { if ($orderby == '_as_roomname') { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'order' => $sort, 'orderby' => 'meta_value', 'meta_key' => $orderby)); } else { if ($orderby == 'order') { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'order' => $sort, 'orderby' => 'menu_order')); } else { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'order' => $sort, 'orderby' => 'meta_value_num', 'meta_key' => $orderby)); } } } $i = 0; $posts = array(); foreach ($loop->posts as $p) { if ($i >= $num) { continue; } if ($tag != '' && !has_term($tag, 'affiliate-tags', $p)) { continue; } if ($platform != '' && !has_term($platform, 'platform-tags', $p)) { continue; } if ($software != '' && !has_term($software, 'network-tags', $p)) { continue; } $custom = get_post_custom($p->ID); $posts[] = $p; $i++; } $redirectkey = fly_redirect_slug(); $ret = ' <div class="bingositesout"> '; $x = 0; global $post; $opost = $post; foreach ($posts as $post) { setup_postdata($post); $x = $x + 1; $width = get_post_meta($post->ID, "_as_rating", true) * 20; $ret .= ' <div ' . ($x == 1 ? "class='bingosites top'" : "class='bingosites'") . '> <div class="rank"><span>' . $x . '</span> </div> <div class="logoarea"><a title="' . get_post_meta($post->ID, "_as_roomname", true) . '" href="' . get_permalink() . '"> ' . get_the_post_thumbnail($post->ID, 'casino-logo', array('class' => 'logo')) . '</a> </div> <div class="info"> <h3>' . get_post_meta($post->ID, "_as_roomname", true) . '</h3> <span class="rate fl"> <span class="ratetotal" style="width: ' . $width . '%;"></span></span> <div class="summary">' . get_the_excerpt() . '</div></div> <div class="buttons"><a href="' . get_permalink() . '" class="visbutton size1 blue mb">' . (get_gambling_option("topsites-rev-button") != "" ? get_gambling_option("topsites-rev-button") : "Read Review") . '</a> <br /><a ' . (get_theme_option('topsites-rev-button') != "" ? "target=\"_blank\"" : "") . ' href="' . get_bloginfo('url') . '/' . $redirectkey . '/' . get_post_meta($post->ID, "_as_redirectkey", true) . '/" class="visbutton size1 marz">' . (get_gambling_option("topsites-pn-button") != "" ? get_gambling_option("topsites-pn-button") : "Play Now") . '</a> </div> </div> '; } $post = $opost; $ret .= '</div> <!--.bingositesout-->'; return $ret; }
* @package bingotheme */ get_header(); ?> <section id="content" class="main-content"> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php $redirectkey = fly_redirect_slug(); ?> <div class="topreview"> <div class="topleft"><h1><?php the_title(); ?> </h1></div> <div class="topright"><?php if (get_gambling_option('review-rating')) { echo get_gambling_option('review-rating'); } else { ?> Rating<?php } ?>
function widget($args, $instance) { extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $detailslink = $instance["detailslink"]; $version = $instance["version"]; /* Before widget (defined by themes). */ echo $before_widget; /* Title of widget (before and after defined by themes). */ if ($title) { echo $before_title . $title . $after_title; } $key = $instance["ts_sort"]; if ($key == 'order') { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'desc')); } elseif ($key == 'date') { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'orderby' => 'date', 'order' => 'DESC')); } elseif ($key == 'name') { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC')); } else { $loop = new WP_Query(array('post_type' => 'casino', 'posts_per_page' => -1, 'orderby' => 'meta_value_num', 'meta_key' => $key, 'order' => 'desc')); } $i = 0; $posts = array(); foreach ($loop->posts as $p) { if ($i >= $instance["numsites"]) { continue; } if ($instance['tag'] != '' && !has_term($instance['tag'], 'affiliate-tags', $p)) { continue; } if ($instance['networktag'] != '' && !has_term($instance['networktag'], 'network-tags', $p)) { continue; } if ($instance['plattag'] != '' && !has_term($instance['plattag'], 'platform-tags', $p)) { continue; } $custom = get_post_custom($p->ID); $posts[] = $p; $i++; } $content = apply_filters('topsites_content', $posts, $version); if (!is_array($content) && $content != "") { echo $content; } else { ?> <table class="depositwidget"> <tr> <th colspan="2" class="site"><?php if (get_gambling_option('widget2-site')) { echo get_gambling_option('widget2-site'); } else { ?> Site<?php } ?> </th> <th class="maxbonus"><span class="hilite"><?php if (get_gambling_option('widget2-bonus')) { echo get_gambling_option('widget2-bonus'); } else { ?> Bonus<?php } ?> </span></th> <th class="wager"><?php if (get_gambling_option('widget2-det')) { echo get_gambling_option('widget2-det'); } else { ?> Details<?php } ?> </th> </tr> <?php $x = 0; global $post; $opost = $post; $redirectkey = fly_redirect_slug(); foreach ($posts as $post) { setup_postdata($post); $x = $x + 1; $width = get_post_meta($post->ID, "_as_rating", true) * 20; ?> <tr <?php if ($x == 1) { echo 'class="top"'; } ?> > <td class="icon"><a title="<?php echo get_post_meta($post->ID, "_as_roomname", true); ?> " href="<?php the_permalink(); ?> "><?php the_post_thumbnail('casino-icon', array('class' => 'logo')); ?> </a></td> <td class="sitename"><a title="<?php echo get_post_meta($post->ID, "_as_roomname", true); ?> " href="<?php the_permalink(); ?> "><?php echo get_post_meta($post->ID, "_as_roomname", true); ?> </a></td> <td class="bonus"><span class="hilite"> <?php if ($version == 'Version 1' || $version == '') { ?> <?php echo get_post_meta($post->ID, "_as_bonusper", true); ?> % <?php } else { if ($version == 'Version 2') { echo get_post_meta($post->ID, "_as_nodeposit", true); ?> <?php } else { if ($version == 'Version 3') { echo get_post_meta($post->ID, "_as_subonus", true); ?> <?php } else { echo get_post_meta($post->ID, "_as_reload", true); } } } ?> </span></td> <td class="wager"> <?php if ($detailslink) { ?> <a href="<?php the_permalink(); ?> " class="visbutton sm"><?php if (get_gambling_option('widget2-det')) { echo get_gambling_option('widget2-det'); } else { ?> Details<?php } ?> </a> <?php } else { ?> <a <?php if (get_theme_option('redirect-new-window')) { echo "target=\"_blank\""; } ?> href="<?php bloginfo('url'); ?> /<?php echo $redirectkey; ?> /<?php echo get_post_meta($post->ID, "_as_redirectkey", true); ?> /" class="visbutton sm"><?php if (get_gambling_option('widget2-detb')) { echo get_gambling_option('widget2-detb'); } else { ?> Details<?php } ?> </a> <?php } ?> </td> </tr> <?php } $post = $opost; ?> </table> <?php } // end default /* After widget (defined by themes). */ echo $after_widget; }