<input type=hidden name="confirmLandingURL" value="http://neobuxultimatestrategy.com/redirect.php?url=basics"> </form> <br /> <span class="note">We hate spam and will never sell your email address to others. </span> </td> </tr> </table> </div> </center> <?php $selP = 'SELECT * FROM posts WHERE status <> "I" ORDER BY postedOn DESC LIMIT 10'; $resP = mysql_query($selP, $conn) or die(mysql_error()); while ($p = mysql_fetch_assoc($resP)) { $recentPosts .= '<p align="left"><a href="./?p=' . $p['url'] . '">' . shortenText($p['subject'], 35) . '</a></p>'; } ?> <p> </p> </td> <td width="20px"></td> <td align="center" id="rightCol"> <br /> <center> <div class="optin" id="optin"> <table width="310px" cellpadding="0"> <tr> <td align="center">
function getFeed($feed_url, $type) { // Type: Movie(0), TV(1), Animated(2) $content = file_get_contents($feed_url); $x = new SimpleXmlElement($content); $token = new \Tmdb\ApiToken('1e5387b55fe12efeb19db53ea9ca88a1'); $client = new \Tmdb\Client($token); if ($type != 1) { $all_genres = $client->getGenresApi()->getGenres(); $all_genres_ids = array(); foreach ($all_genres['genres'] as $genre) { array_push($all_genres_ids, $genre['id']); } $current_ids = array(); foreach ($x->channel->item as $entry) { /* @@ Modification for TMDB API @@ */ $movie_title = $entry->title; $title = modifyTitle($movie_title); $result = $client->getSearchApi()->searchMovies($title); $movie = array_values($result)[1][0]; /* @@ Check if result is found from TMDB API @@ */ if (count($movie) > 0) { if (!in_array(intval($movie['id']), $current_ids)) { array_push($current_ids, intval($movie['id'])); } else { continue; } /* @@ Title @@ */ $original_title = shortenText($movie['original_title'], 40); /* @@ Plot (overview) @@ */ $plot = shortenText($movie['overview'], 285); /* @@ Release year @@ */ $released_year = substr($movie['release_date'], 0, 4); /* @@ Release year @@ */ $genres = $movie['genre_ids']; $genre_string = getGenreString($genres, $all_genres_ids, $all_genres); $poster_url = "http://image.tmdb.org/t/p/w500/" . $movie['poster_path']; $backdrop_url = "http://image.tmdb.org/t/p/w500" . $movie['backdrop_path']; $content_url = "https://www.themoviedb.org/movie/" . $movie['id']; renderTable($original_title, $plot, $released_year, $genre_string, $poster_url, $backdrop_url, $content_url, $entry->link); } else { if ($type != 2) { // Teiknimyndir eru oft á íslensku og þ.a.l. ekki á TMDB $plot = "Ekki fundust upplýsingar um þessa mynd.<br>Titill hennar gæti verið stafsettur vitlaust.<br>Einnig gæti verið að þetta sé sjónvarsþáttur."; renderTable($entry->title, $plot, null, null, null, null, null, $entry->link); } } } } else { // TV SHOWS foreach ($x->channel->item as $entry) { $tv_show_title = $entry->title; $tv_show_title = modifyTvShowTitle($tv_show_title); $result = $client->getSearchApi()->searchTv($tv_show_title); $tv_show = array_values($result)[1][0]; if (count($tv_show) > 0) { $tv_show_title = $tv_show['name']; $tv_show_title .= ' ' . getEpisodeNumber($entry->title); $plot = shortenText($tv_show['overview'], 300); $released_year = substr($tv_show['first_air_date'], 0, 4); $genres = $tv_show['genre_ids']; $genre_string = getGenreString($genres, $all_genres_ids, $all_genres); $poster_url = "http://image.tmdb.org/t/p/w500/" . $tv_show['poster_path']; $backdrop_url = "http://image.tmdb.org/t/p/w500" . $tv_show['backdrop_path']; $content_url = "https://www.themoviedb.org/tv/" . $tv_show['id']; renderTable($tv_show_title, $plot, $released_year, $genre_string, $poster_url, $backdrop_url, $content_url, $entry->link); } } } }
public function printPosts() { $html = "<h1>Nyheter</h1>\n"; foreach ($this->posts as $post) { $title = htmlentities($post->title, null, 'UTF-8'); $data = CTextFilter::doAllFilters(htmlentities($post->data, null, 'UTF-8')); $slug = htmlentities($post->slug, null, 'UTF-8'); $published = htmlentities($post->published, null, 'UTF-8'); $updated = htmlentities($post->updated, null, 'UTF-8'); $publishedBy = htmlentities($post->publishedBy, null, 'UTF-8'); $updatedBy = htmlentities($post->updatedBy, null, 'UTF-8'); $category = htmlentities($post->category, null, 'UTF-8'); // Shorten text in "alla" view if ($this->longText) { $data = shortenText($data, "news.php?slug={$slug}"); } if ($this->shot1) { $html .= CDatabaseHandle::createBreadcrumb('Nyheter', 'slug', $title); if ($this->longText) { $html .= $this->getCategorys(); } $this->shot1 = false; } $html .= "<section class='blog-post'>\n"; $html .= "<article>\n"; $html .= "<header>\n"; $html .= "<h2>" . ($this->longText ? "<a href='news.php?slug={$slug}'>{$title}</a>" : "{$title} <a title='Tillbaka till alla poster' href='news.php'>↩</a>") . "</h2>\n"; $html .= "</header>\n"; $html .= "<p class='cat'>Kategori: " . (empty($category) ? "<a href='news.php?cat=ovrigt'>övrigt</a>" : "<a href='news.php?cat={$category}'>{$category}</a>") . "</p>\n"; $html .= "<div " . ($this->longText ? null : "style='min-height: 200px;'") . ">\n"; $html .= $data . "\n"; $html .= "</div>\n"; $html .= "<footer>\n"; $html .= "<p>" . ($updated ? "Uppdaterad: {$updated} av {$updatedBy}<br>" : null) . "Publicerad: {$published} av {$publishedBy}</p>\n"; $html .= "</footer>\n"; $html .= "</article>\n"; $html .= "</section>\n"; } return $html; }
$tbl .= $row1 . "<td colspan=" . $numfields . ">No results returned" . $cell2 . $row2; } if ($ck_bool) { $tbl = "<br><textarea cols=80 rows=20 name=\"txt\">" . $th . $tbl . "</textarea>"; } else { $tbl = "<table colspan=100% border=1 cellpadding=10>" . $th . $tbl . "</table>"; } $res = 'Query: ' . $_POST['sql'] . "<br>Tables: " . $table_name . "<hr>" . $tbl . $res_ct_lbl; } } //query history list for ($i = sizeof($_SESSION['test_query'][$_GET['h']]) - 1; $i >= 0; $i--) { $thisQuery = $_SESSION['test_query'][$_GET['h']][$i]; $dispQuery = str_replace("\"", """, $thisQuery); //replace quotes $dispQuery = shortenText($dispQuery, 50); //shorten the query if ($thisQuery != $_SESSION['test_query'][$_GET['h']][$i + 1]) { $history_opt .= "<option value=\"" . str_replace("\"", """, $thisQuery) . '">' . $dispQuery . '</option>'; } } if (!$_POST[dbName]) { $_POST[dbName] = $dbList[0]; } $selectT = 'show tables from ' . $_POST[dbName]; $queryT = mysql_query($selectT, $conn) or print mysql_error(); while ($t = mysql_fetch_assoc($queryT)) { foreach ($t as $table) { if ($_POST[tableName] == $table) { $pick = 'selected'; } else {
?> <?php echo empty($flora->latin_name) ? "" : "<span><b>" . $flora->latin_name . "</b> (Latijnse benaming)</span>"; ?> <?php echo empty($flora->family_name) ? "" : "<span><b>" . $flora->family_name . "</b> (Wetenschappelijke soortnaam)</span>"; ?> <?php echo empty($flora->cultivar_name) ? "" : "<span><b>" . $flora->cultivar_name . "</b> (Cultivarnaam)</span>"; ?> <?php echo empty($flora->origin) ? "" : "<span><b>" . $flora->origin . "</b> (Herkomst)</span>"; ?> </td> <td><?php echo shortenText($flora->description, 350); ?> <a href="/flora-informatie/<?php echo $flora->id; ?> " title="Meer informatie over <?php echo $flora->name; ?> ">Meer informatie →</a></td> </tr> <?php } ?> </tbody> </table> </div>
function buildDailyDigest() { /* Returns error logs for the day. All times are UTC. */ global $debug, $message, $success, $errorDbc, $returnThis; $output = ''; try { $midnight = strtotime('-1 day', mktime(0, 0, 0)); $startDate = isset($_POST['startDate']) ? $_POST['startDate'] : date('Y-m-d H:i:s', $midnight); $endDate = isset($_POST['endDate']) ? $_POST['endDate'] : date('Y-m-d H:i:s', $midnight + 86399); $params = array($startDate, $endDate); //$time = new Adrlist_MeasureTime('countStmt'); $countStmt = $errorDbc->prepare("SELECT COUNT(errorId) AS 'count' FROM errorReporting WHERE errorDatetime BETWEEN ? AND ?"); $countStmt->execute($params); $row = $countStmt->fetch(PDO::FETCH_ASSOC); //$debug->add($time->output()); $itemCount = $row['count']; $pagination = new Adrlist_Pagination('buildDailyDigest', 'dailyDigest', $itemCount); $offsetLimit = $pagination->offsetLimit(); list($offset, $limit) = $offsetLimit; $dailyDigestStmt = "SELECT\n\terrorId AS 'errorId',\n\terrorDatetime AS 'datetime',\n\tserverName AS 'serverName',\n\thttpHost AS 'httpHost',\n\thttpResponseStatusCode AS 'httpResponseStatusCode',\n\tuserAgent AS 'userAgent',\n\trequestUri AS 'requestUri',\n\tremoteAddress AS 'remoteAddress',\n\thttpReferrer AS 'httpReferrer',\n\tdebug AS 'debug'\nFROM\n\terrorReporting\nWHERE\n\tdatetime BETWEEN ? AND ?\nORDER BY\n\tserverName,httpHost,errorDatetime\nLIMIT " . $offset . ', ' . $limit; //Get all of the items for statistics. $debug->add($dailyDigestStmt); $debug->printArray($params, '$params'); $dailyDigestStatsStmt = $errorDbc->prepare($dailyDigestStmt); //$time = new Adrlist_MeasureTime('dailyDigestStatsStmt'); $dailyDigestStatsStmt->execute($params); //$debug->add($time->output()); //General Statistics like how many errors per domain. $errors = array(); $serverNameArray = array(); $sucker = 0; /* array( * 0 => array( * Name, * Date, * etc * ), * 1 => array( * Name, * Date, * etc * ) * ) */ while ($row = $dailyDigestStatsStmt->fetch(PDO::FETCH_ASSOC)) { } //Get just the server names to count them. $serverNamesStmt = $errorDbc->prepare("SELECT\n\tserverName AS 'serverName'\nFROM\n\terrorReporting\nWHERE\n\terrorDatetime BETWEEN ? AND ?"); $serverNamesStmt->execute($params); while ($row = $serverNamesStmt->fetch(PDO::FETCH_ASSOC)) { if (!array_key_exists($row['serverName'], $serverNameArray)) { $serverNameArray[$row['serverName']] = 0; } $serverNameArray[$row['serverName']] = $serverNameArray[$row['serverName']] + 1; } $debug->printArray(array($serverNameArray), '$serverNameArray'); $newServerNameArray = array(); foreach ($serverNameArray as $key => $value) { $newServerNameArray[] = array($key, $value); } $generalStatsTitleRow = array('Server Name', '# of Records'); $generalStatsCssWidths = array(20, 5); $generalStatsBuildRows = new Adrlist_BuildRows($generalStatsTitleRow, $newServerNameArray, $generalStatsCssWidths); $generalStats = '<div class="bold textCenter textLarge" style="margin-top:2em">General Statistics</div> ' . $generalStatsBuildRows->output(); $dailyDigestStmt = $errorDbc->prepare($dailyDigestStmt); $dailyDigestStmt->execute(array($startDate, $endDate)); //$pagination = new BuildPagination($itemCount,$offset,$limit,'dailyDigest'); //$pagination->setPagesNumbersToDisplay(25); //$pagination = $pagination->output(); //Column widths in em. $widthDatetime = 8; $widthServerName = '18'; $widthHttpHost = 18; $widthHttpResponse = 8; $widthUserAgent = 15; $widthRequestUri = 18; $widthRemoteAddress = 8; $widthHttpReferrer = 20; $widthDebug = 8; $cssWidths = array(2, 8, 18, 18, 8, 15, 18, 8, 20, 8); $titleRow = array('', 'Datetime', 'Server Name', 'Http Host', 'HTTP Response Status Code', 'User Agent', 'Request URI', 'Remote Address', 'Http Referrer'); $pagination = $pagination->output(); $buildRows = new Adrlist_BuildRows($titleRow, '', $cssWidths); $table = $buildRows->outputTitleRow(); $class = 'rowAlt'; $x = $offset + 1; while ($row = $dailyDigestStmt->fetch(PDO::FETCH_ASSOC)) { if ($class == 'rowWhite') { $class = 'rowAlt'; } else { $class = 'rowWhite'; } $table .= '<div class="hand ' . $class . ' clear relative" style="overflow:hidden" id="errorTrigger' . $row['errorId'] . '" errorId="' . $row['errorId'] . '"> <div class="row">' . $x . '</div> <div class="row" style="width:' . $widthDatetime . 'em;">' . $row['datetime'] . '</div> <div class="row" style="width:' . $widthServerName . 'em;">' . $row['serverName'] . '</div> <div class="row" style="width:' . $widthHttpHost . 'em;"> <span id="httpHostShortShowHide' . $row['errorId'] . '">' . shortenText($row['httpHost'], $widthHttpHost, false, true, true) . '</span> <span class="hide" id="HttpHostLongShowHide' . $row['errorId'] . '">' . $row['httpHost'] . '</span> </div> <div class="row" style="width:' . $widthHttpResponse . 'em;">' . $row['httpResponseStatusCode'] . '</div> <div class="row" style="width:' . $widthUserAgent . 'em;"> <span id="userAgentShortShowHide' . $row['errorId'] . '">' . shortenText($row['userAgent'], $widthUserAgent, false, true, true) . '</span> <span class="hide" id="userAgentLongShowHide' . $row['errorId'] . '">' . $row['userAgent'] . '</span> </div> <div class="row" style="width:' . $widthRequestUri . 'em;"> <span id="requestUriShortShowHide' . $row['errorId'] . '">' . shortenText($row['requestUri'], $widthRequestUri, false, true, true) . '</span> <span class="hide" id="requestUriLongShowHide' . $row['errorId'] . '">' . urldecode($row['requestUri']) . '</span> </div> <div class="row" style="width:' . $widthRemoteAddress . 'em;">' . $row['remoteAddress'] . '</div> <div class="row" style="width:' . $widthHttpReferrer . 'em;"> <span id="httpReferrerShortShowHide' . $row['errorId'] . '">' . shortenText($row['httpReferrer'], $widthHttpReferrer, false, true, true) . '</span> <span class="hide" id="httpReferrerLongShowHide' . $row['errorId'] . '">' . $row['httpReferrer'] . '</span> </div> <div class="break hide textLeft" id="debugShowHide' . $row['errorId'] . '">' . $row['debug'] . '</div> </div> '; $x++; } $output .= 'Showing <input type="text" id="startDate" value="' . $startDate . '"> to <input type="text" id="endDate" value="' . $endDate . '"> <span class="buttonBlueThin" id="dateRangeGo">Go</span>' . $generalStats . '<div class="hr3"></div><div class="bold textCenter textLarge" style="margin-top:1em">Errors</div>' . $pagination . $table . $pagination; if (MODE == 'buildDailyDigest') { $success = true; $returnThis['output'] = $output; $returnThis['container'] = 'dailyDigestHolder'; } } catch (PDOException $e) { error(__LINE__, '', '<pre>' . $e . '</pre>'); } if (MODE == 'buildDailyDigest') { returnData(); } else { return $output; } }
<?php include 'adminCode.php'; if ($_GET['id']) { $userID = $_GET['id']; } $selS = 'select *, date_format(purchased,"%m/%d/%y %h:%i %p") as purchasedDate from sales where affiliate="' . $userID . '" order by purchased'; $resS = mysql_query($selS, $conn) or die(mysql_error()); while ($s = mysql_fetch_assoc($resS)) { $displayEmail = shortenText($s[payerEmail], 25); $itemName = shortenText($s[itemName], 30); $amount = $s[amount]; $salesTotal += $amount; $selU = 'select id, username, email from users where paypal="' . $s[payerEmail] . '" limit 1'; $resU = mysql_query($selU, $conn) or die(mysql_error()); $u = mysql_fetch_assoc($resU); $username = $u[username]; $contactEmail = $u[email]; $userID = $u[id]; if (!isset($username)) { $username = '******'; } if (!isset($contactEmail)) { $contactEmail = 'N/A'; } $salesContent .= '<tr> <td><a href="custView.php?id=' . $s[id] . '">' . $s[transID] . '</a></td> <td>' . $s[purchasedDate] . '</td> <td><a href="product/productNew.php?id=' . $s[productID] . '">' . $itemName . '</a></td> <td>
dbInsert($dbOptions); } $disUpd = 'disabled'; } else { if ($_POST[upd]) { $dbOptions = array('tableName' => 'links', 'dbFields' => array('name' => $_POST['name'], 'url' => $_POST['url']), 'cond' => 'where id="' . $_GET['id'] . '"'); dbUpdate($dbOptions); } } $error = '<p><font color=red><b>' . $error . '</b></font></p>'; $selL = 'select * from links order by name'; $resL = mysql_query($selL, $conn) or die(mysql_error()); while ($l = mysql_fetch_assoc($resL)) { $id = $l['id']; $linkList .= '<tr><td><a href="?id=' . $id . '">' . $l['name'] . '</a></td> <td><a href="' . $l['url'] . '" target=_blank>' . shortenText($l['url'], 40) . '</a></td></tr>'; if ($_GET[id] == $id) { $u = $l; $disAdd = 'disabled'; } } ?> <div class=moduleBlue><h1>Add New Link</h1> <div class="moduleBody"> <?php echo $error; ?> <form method=post> <table> <tr> <td>Name</td><td><input type=text class=activeField name=name value="<?php
?> "> <div class="caption"> <h3><?php echo $row['Name']; ?> </h3> <h5><?php echo formatDate($row['BirthDate']); ?> ~ <?php echo formatDate($row['DeathDate']); ?> </h5> <p><?php echo shortenText($row['Obituary'], 150); ?> </p> <a class="readmore" href="obit.php?id=<?php echo urlencode($row['id']); ?> " role="button">Read More</a> </div> </div> </div> <?php } ?> <?php } else { ?>
<?php $adir = '../'; include $adir . 'adminCode.php'; $sel = 'select * from products order by id desc'; $res = mysql_query($sel, $conn) or die(mysql_error()); while ($p = mysql_fetch_assoc($res)) { $id = $p['id']; $theList .= '<tr valign="top"><td><a href="productNew.php?id=' . $id . '">' . $id . '</a></td> <td><a href="productNew.php?id=' . $id . '">' . shortenText($p[itemName], 30) . '</a><br /> >> <a href="../../' . $p['folder'] . '" target="_blank">Visit Sales Page</a></td> <td>' . $p['itemPrice'] . '</td> <td>' . $p['itemNumber'] . '</td> <td align="center">' . $p['affProgram'] . '</td> <td align="center"><a href="productEmailsList.php">Edit</a></td></tr>'; } ?> <table class="moduleBlue" cellspacing=0 cellpadding=2> <tr> <th>Product ID</th><th>Item Name</th><th>Item Price</th><th>Item #</th> <th>Affilate Program</th><th>Emails</th></tr> <tbody><?php echo $theList; ?> </tbody> </table> <p> </p> <?php
$query = "SELECT * FROM `posts` WHERE id = {$id}"; $post = $db->select($query)->fetch_assoc(); // Create query & run SELECT query for categories $query = "SELECT * FROM `categories`"; $categories = $db->select($query); ?> <div class="blog-post"> <h2 class="blog-post-title"><?php echo $post['title']; ?> </h2> <p class="blog-post-meta"><?php echo formatDate($post['date']); ?> by <a href="#"><?php echo $post['author']; ?> </a></p> <p><?php echo shortenText($post['body']); ?> </p> <a class="readmore" href="post.php?id=<?php echo urldecode($post['id']); ?> ">Read More</a> </div> <?php include 'includes/footer.php';
<input type=hidden name=page value="' . $url . '"> <input type=submit class="btn info" name=reset onclick="confirm(\'Are you sure you want to reset the views for this page to 0?\')"> </form> </td> </tr>'; } $selB = 'select url, subject from posts order by url'; $resB = mysql_query($selB) or die(mysql_error()); while ($b = mysql_fetch_assoc($resB)) { $url = $b['url']; $postURL = '/?p=' . $url; $uniqueViews = $views[$postURL][uniqueViews]; $rawViews = $views[$postURL][rawViews]; $blogViews .= '<tr> <td>' . shortenText($b[subject], 35) . '</td> <td><a href="../?p=' . $url . '" target=_blank>' . shortenText($postURL, 50) . '</a></td> <td>' . $uniqueViews . '</td> <td>' . $rawViews . '</td> <td> <form method=post> <input type=hidden name=page value="' . $postURL . '"> <input type=submit class="btn info" name=reset onclick="confirm(\'Are you sure you want to reset the views for this page to 0?\')"> </form> </td> </tr>'; } $selS = 'select url from memberpages order by url'; $resS = mysql_query($selS) or die(mysql_error()); while ($s = mysql_fetch_assoc($resS)) { $url = $s['url']; $page = '/?action=' . $url;
$oneDay = 60 * 60 * 24; if ($_SESSION[before] == '') { $_SESSION[before] = date('Y-m-d', time() + $oneDay); } if ($_SESSION[after] == '') { $_SESSION[after] = $installDate; } $searchFor .= ' joinDate >= "' . $_SESSION[after] . ' 00:00:00" and joinDate <= "' . $_SESSION[before] . ' 23:59:59"'; $sel = 'select * from users where ' . $searchFor . ' '; $res = mysql_query($sel, $conn) or die(mysql_error()); while ($u = mysql_fetch_assoc($res)) { $u = formatFields($u); $searchResults .= '<tr> <td><a href="updateProfile.php?id=' . $u[id] . '">' . $u[username] . '</a></td> <td><a href="updateProfile.php?id=' . $u[id] . '">' . shortenText($u[email], 30) . '</a></td> <td>' . shortenText($u[paypal], 30) . '</td> <td>' . $u[fname] . ' ' . $u[lname] . '</td> <td>' . $u[joinDate] . ' </td> </tr>'; } ?> <form method=post> <table> <tr> <td> <div class="moduleBlue"><h1>Affiliate Search</h1> <div class="moduleBody"> <p><?php echo $msg; ?>
<p>Total: <b><?php echo $salesPickMonth; ?> </b></p> </div> </div> <p> </p><br /> <div class="moduleBlue"><h1>Breakdown by Product</h1> <div class="moduleBody"> <table> <?php foreach ($product as $id => $amt) { $productTotal = '$' . number_format($amt[total], 2); $productName = shortenText($amt[itemName], 30); $productName = '<a href="product/productNew.php?id=' . $id . '">' . $productName . '</a>'; echo '<tr> <td>' . $productName . '</td> <td>' . $productTotal . '</td></tr>'; } ?> </table> </div> </div> </td> </tr> </table> <?php include 'adminFooter.php';
function buildCharacters($selectedcharId = false, $id = '', $tabIndex = 1) { /* Returns a simple drop down list of characters. $selected = (optional) numeric charId to set the selected option. $id = (optional) id for the select tag. $tabIndex = (optional) tabindex. */ global $debug, $message, $Dbc; $output = ''; try { $selectCharactersQuery = "SELECT\n\tcharId AS 'charId',\n\tcharacters AS 'charName',\n\tcharColor AS 'charColor',\n\tdeleted AS 'deleted'\nFROM\n\tcharacters\nWHERE\n\tlistId = ?"; $selectCharactersQuery .= "ORDER BY\n\tcharacters"; //Select all characters that are not marked as deleted. $stmt = $Dbc->prepare($selectCharactersQuery); $params = array($_SESSION['listId']); $stmt->execute($params); $output .= '<div class="ui-field-contain"> '; $output .= empty($id) ? '<label for="characterSelect" class="select">Character</label><select name="characterSelect" id="characterSelect" data-mini="true" data-inline="true" tabindex="' . $tabIndex . '">' : '<label for="' . $id . '" class="select">Character</label><select name="' . $id . '" id="' . $id . '" data-mini="true" data-inline="true" tabindex="' . $tabIndex . '" data-wrapper-class="center textCenter"><optgroup label="Active Characters">'; $deletedOption = ''; $foundRows = false; while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { $debug->printArray($row, '$row'); $foundRows = true; if (!empty($selectedcharId) && is_numeric($selectedcharId) && $selectedcharId == $row['charId']) { $thisOption = '<option selected="selected" value="' . $row['charId'] . '" style="background-color:#' . $row['charColor'] . '">' . $row['charName'] . '</option>'; if (empty($row['deleted'])) { $output .= $thisOption; } else { $deletedOption .= $thisOption; } } else { $thisOption = '<option value="' . $row['charId'] . '" style="background-color:#' . $row['charColor'] . '">' . shortenText($row['charName'], 15, false, true) . '</option>'; if (empty($row['deleted'])) { $output .= $thisOption; } else { $deletedOption .= $thisOption; } } } $output .= '</optgroup>'; $output .= !empty($deletedOption) ? '<optgroup label="Deleted Characters" style="background-color:#' . COLORLIGHTRED . '">' . $deletedOption . '</optgroup>' : ''; $output .= '</select></div>'; if (!$foundRows) { $message .= 'No characters were found.'; pdoError(__LINE__, $stmt, $params, true); } $output .= '</select>'; } catch (PDOException $e) { error(__LINE__, '', '<pre>' . $e . '</pre>'); } return $output; }
?> <h2 class="blog-post-title"><?php echo $record['title']; ?> </h2> <p class="blog-post-meta"><?php echo formatDate($record['date']); ?> <a href="#"> <?php echo $record['author']; ?> </a></p> <p><?php echo shortenText($record['body']); ?> </p> <a class="readmore" href="post.php?id=<?php echo urlencode($record['id']); ?> ">Read More</a> <?php } ?> </div> <!-- /.blog-post --> <?php } else { ?> <p>There are no posts yet</p>
echo $row['Title']; ?> " title="<?php echo $row['ImagePath']; ?> "/></td> <td><?php echo $row['Year']; ?> </td> <td><?php echo $row['Title']; ?> </td> <td><?php echo shortenText($row['Description'], 100); ?> </td> <td><?php echo $cat['Name']; ?> </td> <td><a class="btn btn-primary" href="edit_image.php?id=<?php echo $row['id']; ?> " role="button"><span class="glyphicon glyphicon-pencil"></span> Edit</a><br><br></td> </tr> <?php } ?> </table>
</div><!-- post-details --> </header> <div class="post-image"> <img src="<?php echo BASE_URI; ?> images/<?php echo $post->photo; ?> " alt="city skyline"> </div><!-- post-image --> <div class="post-excerpt"> <p><?php echo shortenText($post->body); ?> <a href="post.php?id=<?php echo urlencode($post->id); ?> "> continue reading »</a></p> </div><!-- post-excerpt --> </article><!-- post --> <?php } ?> <?php } else {
while ($row = $posts->fetch_assoc()) { ?> <div class="blog-post"> <h2 class="blog-post-title"><?php echo $row["title"]; ?> </h2> <p class="blog-post-meta"><?php echo formatDate($row["date"]); ?> by <a href="#"><?php echo $row["author"]; ?> </a></p> <?php echo shortenText($row["body"]); ?> <a class="read-more" href="post.php?id=<?php echo urlencode($row["id"]); ?> ">Read More</a> </div><!-- /.blog-post --> <?php } ?> <?php } else { ?> <p>There are no posts in this category.</p> <?php }
while ($row = $posts->fetch_assoc()) { ?> <div class="blog-post"> <h2 class="blog-post-title"><?php echo $row['title']; ?> </h2> <p class="blog-post-meta"><?php echo formatDate($row['date']); ?> by <a href="#"><?php echo $row['author']; ?> </a></p> <?php echo shortenText($row['body']); ?> <a class="readmore" href="post.php?id=<?php echo urlencode($row['id']); ?> ">Read More</a> </div><!-- /.blog-post --> <?php } ?> <?php } else { ?> <p>There are no posts yet</p>
if (sizeof($_POST['id']) > 0) { foreach ($_POST['id'] as $deleteThis) { $del = 'delete from posts where id="' . $deleteThis . '"'; $res = mysql_query($del, $conn); } } } $sel = 'SELECT *, date_format(postedOn, "%m/%d/%Y %h:%i %p") as postedTime, p.id as id, u.id as uid from posts p left join users u on p.postedBy = u.id order by postedOn asc'; $res = mysql_query($sel, $conn) or die(mysql_error()); while ($p = mysql_fetch_assoc($res)) { $pID = $p[id]; $subject = stripslashes($p['subject']); $theList .= '<tr valign="top" title="' . $subject . '"> <td><a href="postNew.php?id=' . $pID . '">' . $pID . '</a> </td><td><a href="postNew.php?id=' . $pID . '">' . shortenText($subject, 30) . '</a></td> <td>' . $p['postedTime'] . '</td> <td><a href="' . $websiteURL . '?p=' . $p['url'] . '" target="_blank" >View</a></td> <td><input type=checkbox name="id[]" value="' . $pID . '"> </td> </tr>'; } ?> <form method="POST"> <table class=moduleBlue cellspacing=0 cellpadding=2> <tr> <th>Post ID </th> <th>Subject</th> <th>Date & Time</th> <th>View</th> <th>Delete</th>