function widget($args, $widget_args = 1) { extract($args); if (is_numeric($widget_args)) { $widget_args = array('number' => $widget_args); } $widget_args = wp_parse_args($widget_args, array('number' => -1)); extract($widget_args, EXTR_SKIP); $options_all = get_option('widget_stray_quotes'); if (!isset($options_all[$number])) { return; } $options = $options_all[$number]; if ($options["sequence"] == "Y") { $sequence = false; } else { $sequence = true; } if ($options["noajax"] == "Y") { $noajax = true; } else { $noajax = false; } if ($options["disableaspect"] == "Y") { $disableaspect = true; } else { $disableaspect = false; } $linkphrase = $options["linkphrase"]; $widgetid = $number; $multi = $options["multi"]; settype($multi, "integer"); $categories = isset($options["groups"]) ? explode(',', $options["groups"]) : array("default"); $offset = 0; $timer = $options["timer"]; $fullpage = false; $quotesoptions = get_option('stray_quotes_options'); if ($quotesoptions['stray_multiuser'] == 'Y') { $contributor = $options["contributor"]; } else { $contributor = ''; } //output the quote(s) echo $before_widget . $before_title; echo $options["title"]; echo $after_title; echo get_stray_quotes($categories, $sequence, $linkphrase, $multi, $timer, $noajax, $offset, $widgetid, $fullpage, 'quoteID', 'ASC', '', $disableaspect, $contributor); echo $after_widget; }
<?php // If your 'wp-content' directory is not in the default location you have to enter the path to your blog here. Example: '/home/www/public_html/wp' $changedDir = ''; if ($_POST['action'] == 'newquote') { if (!$changedDir) { $changedDir = preg_replace('|wp-content.*$|', '', __FILE__); } include_once $changedDir . '/wp-config.php'; $categories = isset($_POST['categories']) ? $_POST['categories'] : ''; $sequence = isset($_POST['sequence']) ? $_POST['sequence'] : ''; $linkphrase = isset($_POST['linkphrase']) ? $_POST['linkphrase'] : ''; $widgetid = isset($_POST['widgetid']) ? $_POST['widgetid'] : ''; $multi = isset($_POST['multi']) ? $_POST['multi'] : ''; $offset = isset($_POST['offset']) ? $_POST['offset'] : ''; $timer = isset($_POST['timer']) ? $_POST['timer'] : ''; $sort = isset($_POST['sort']) ? $_POST['sort'] : ''; $orderby = isset($_POST['orderby']) ? $_POST['orderby'] : ''; $disableaspect = isset($_POST['disableaspect']) ? $_POST['disableaspect'] : ''; $contributor = isset($_POST['contributor']) ? $_POST['contributor'] : ''; echo get_stray_quotes($categories, $sequence, $linkphrase, $multi, $timer, false, $offset, $widgetid, false, $orderby, $sort, '', $disableaspect, $contributor); }
function stray_id_shortcode($atts, $content = NULL) { extract(shortcode_atts(array("id" => '1', "linkphrase" => '', "noajax" => true, "disableaspect" => false), $atts)); return get_stray_quotes('', true, $linkphrase, '', '', $noajax, '', '', '', '', '', $id, $disableaspect); }