function dynamic_text_function($atts, $content = null) { ob_start(); //start buffer $url = "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; $escaped_url = htmlspecialchars($url, ENT_QUOTES, 'UTF-8'); $dtdomchoices = shortcode_atts(array('domain' => ''), $atts); $dtcollection = dbPull(); //pull dynamic domain db info foreach ($dtcollection as $dtkey => $dtvalue) { $urlkey = get_option($dtkey); $dt_dom1 = strtolower($urlkey); if ($dtdomchoices['domain'] === $dtkey) { //match db data against attribute if ($dt_dom1 === "") { //error catch if no option value exists echo ""; } elseif (strpos($escaped_url, "{$dt_dom1}") === false) { //mismatch catch echo ""; } else { //return content if match is found return do_shortcode($content); } } } return ob_get_clean(); //end buffer }
public function delMultiVal() { //Delete all options if (isset($_POST[deleteme])) { //reset all domains if the option button is pressed $datadynamic = dbPull(); foreach ($datadynamic as $key => $value) { delete_option($key); unregister_setting('dynamic_text_settings', $key); add_option("DynamicDomain_1", "Change Me", "", "yes"); register_setting('dynamic_text_settings', 'DynamicDomain_1'); } } }
<?php include 'configure.php'; include 'connect.php'; include 'dbFunc.php'; header('Content-Type: text/xml'); echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; echo '<response>'; if (isset($_GET['NameInput'])) { $userInput = $_GET['NameInput']; } // choose then pull down the database you want. $pull = "t4"; dbPull($pull); // select everything from the database table. $dbItems = Qquery("SELECT * FROM `picks`"); // spread out the table from the db // $ARay = QfetchArray($dbItems); $daata = array(); while ($ARay = QfetchArray($dbItems)) { array_push($daata, $ARay['Name']); } /*/ while ($row = $Array) { $da= explode('-', $row['date']); $daa= $da[1]."-".$da[2]."-".$da[0]; echo ' <tr> <td>'.$daa.'</td> <td>'.$row['usir'].'</td> <td style="width: 300px">'.$row['msg'].'</td> </tr>