$smarty->assign("ErrorMessage", $error_message); $smarty->display('error_page.tpl'); } } } else { handle_error_no_exit('productions.code: ' . mysql_error()); $smarty->display('main.tpl'); $error_message = get_error_message(); $smarty->assign("ErrorMessage", $error_message); $smarty->display('error_page.tpl'); } mysql_close($dbh); } else { handle_error_no_exit('productions.code: I cannot connect to the database because: ' . mysql_error()); $smarty->display('main.tpl'); $error_message = get_error_message(); $smarty->assign("ErrorMessage", $error_message); $smarty->display('error_page.tpl'); } $smarty->display('footer.tpl'); function BuildEventKeywordList($categoryID, $eventName, $eventTypeID, $eventID) { switch ($eventTypeID) { case 3: if ($eventID == 162) { $keywords = "chicagocubs, chicagocubs.com, chicagocubs com, chicago cubs com, chicagocub, cubs.com, cubs com"; } else { $keywords = BuildSportsKeywordList($categoryID, $eventName); } break; case 4:
function resolve_ambiguous_event($smarty, $cats, $sanEventName) { $categoryInfo = fixup_url($smarty, $cats); $query = "SELECT EventID, EventName, CategoryID FROM Events WHERE SanitizedEventName='" . $sanEventName . "' AND " . "CategoryID=" . $categoryInfo['categoryID']; if ($query_result = mysql_query($query)) { $num_rows = mysql_num_rows($query_result); if ($num_rows == 1) { $table_row = mysql_fetch_row($query_result); $eventDetails['eventID'] = $table_row[0]; $eventDetails['eventName'] = $table_row[1]; $eventDetails['categoryID'] = $table_row[2]; } ## put redirect or something here } else { # 5xx status code header('HTTP/1.0 500 Internal Server Error'); handle_error_no_exit('ticket_dispatch.code: resolve_ambiguous_event query failed: ' . mysql_error()); $error_message = get_error_message(); $smarty->assign("ErrorMessage", $error_message); $smarty->display('main.tpl'); $smarty->display('error_page.tpl'); } return $eventDetails; }
} echo PHP_EOL . PHP_EOL; echo '> Checking Symfony requirements:' . PHP_EOL . ' '; $messages = array(); foreach ($symfonyRequirements->getRequirements() as $req) { /** @var $req Requirement */ if ($helpText = get_error_message($req, $lineSize)) { echo_style('red', 'E'); $messages['error'][] = $helpText; } else { echo_style('green', '.'); } } $checkPassed = empty($messages['error']); foreach ($symfonyRequirements->getRecommendations() as $req) { if ($helpText = get_error_message($req, $lineSize)) { echo_style('yellow', 'W'); $messages['warning'][] = $helpText; } else { echo_style('green', '.'); } } if ($checkPassed) { echo_block('success', 'OK', 'Your system is ready to run Symfony2 projects'); } else { echo_block('error', 'ERROR', 'Your system is not ready to run Symfony2 projects'); echo_title('Fix the following mandatory requirements', 'red'); foreach ($messages['error'] as $helpText) { echo ' * ' . $helpText . PHP_EOL; } }
</span> <?php $password = array('name' => 'passwordfield', 'value' => "", 'class' => 'text-center form-control', 'placeholder' => 'Password'); echo form_password($password); ?> <span class=" input-group-btn form-field-clear-btn-group" id="password-field-clear-btn-group" > <button disabled data-target="password" id="password-field-clear-btn" class="form-field-clear-btn btn btn-default" type="button"> <i class="fa fa-times text-danger"></i> </button> </span> </div> <span id="passwordfield-help-block" class="margin-bottom-0 padding-left-50 <?php echo has_message("passwordfield") ? "" : "sr-only"; ?> help-block"> <i class=" fa fa-exclamation-circle"></i> <span id="passwordfield-message"><?php echo has_message("passwordfield") ? get_error_message("passwordfield") : ""; ?> </span></span> </div> <hr class="margin-top-0 margin-left-15 margin-right-15"> <div class="row margin-top-10"> <div class="col-sm-5 col-sm-offset-1"> <div class="form-group"> <button type="submit" name = "loginbtn" id="loginformsubmitbtn" class = " btn btn-default btn-md form-control input-md"> <i class="fa fa-sign-in"></i> Sign in </button> </div> </div> <div class="col-sm-5"> <div class="form-group">
function list_all_venues($smarty) { $query = "SELECT SanitizedRegionCode, RegionCode FROM Venues WHERE 1 GROUP BY RegionCode ORDER BY RegionCode ASC"; # $query = "SELECT SanitizedRegionCode, RegionCode FROM Productions LEFT JOIN Venues on (Productions.VenueID = Venues.VenueID) WHERE 1 GROUP BY RegionCode ORDER BY RegionCode ASC"; if ($query_result = mysql_query($query)) { while ($table_row = mysql_fetch_row($query_result)) { $sanitizedRegionCode = $table_row[0]; $regionCode = $table_row[1]; $url = "/venues/{$sanitizedRegionCode}/"; $states[] = array("name" => "{$regionCode}", "url" => "{$url}"); } $title = "Find All Venues"; $smarty->assign("title", $title); $keywords = "find all Venues, find all venue tickets"; $smarty->assign("SeoKeywords", $keywords); $smarty->assign("MetaDescr", "All Venues. Select a venue to find and buy event Tickets at MongoTickets."); $smarty->display('main.tpl'); $breadcrumb_str = '<a href="/">Home</a>'; $breadcrumb_str = AppendBreadcrumb($breadcrumb_str, '/venues/', 'Venues'); $smarty->assign("Breadcrumbs", $breadcrumb_str); $smarty->assign("h1", 'Choose a Region'); if (count($states) > 0) { $smarty->assign("States", $states); $smarty->assign("NumStates", count($states)); $smarty->display('all_venues.tpl'); } else { echo "<div id=\"content\">"; echo "<div id=\"breadcrumb_trail\">{$breadcrumb_str}</div>"; echo "<div id=\"no_tickets\">"; echo "<h1>All Venues</h1>"; echo "<p>There are no venues</p>"; echo "</div>"; } } else { # 5xx status code header('HTTP/1.0 500 Internal Server Error'); handle_error_no_exit('venues.code:list_venues_in_state(): I cannot connect to the database because: ' . mysql_error()); $error_message = get_error_message(); $smarty->assign("ErrorMessage", $error_message); $smarty->display('main.tpl'); $smarty->display('error_page.tpl'); } }
} else { $query = "SELECT\n g.*,\n u1.username AS player_one,\n u2.username AS player_two,\n g.player_one as player_one_id,\n g.player_two as player_two_id,\n s1.user_id as user_one_id,\n s2.user_id as user_two_id\n FROM games g\n INNER JOIN submissions s1 ON g.player_one = s1.submission_id\n INNER JOIN users u1 ON s1.user_id = u1.user_id\n INNER JOIN submissions s2 ON g.player_two = s2.submission_id\n INNER JOIN users u2 ON s2.user_id = u2.user_id\n WHERE g.game_id = {$game_id}"; $result = mysql_query($query); if (!$result || mysql_num_rows($result) == 0) { $query = str_replace("FROM games g", "FROM games_archive g", $query); $result = mysql_query($query); } if (!$result) { echo "Could not query the database.\n"; } else { $row = mysql_fetch_assoc($result); if ($playback_string = get_playback($game_id)) { $row['playback_string'] = $playback_string; $row['using_compression'] = true; } if ($error_message = get_error_message($game_id)) { $row['error_message'] = $error_message; } if ($row) { foreach ($row as $key => $value) { echo "{$key}={$value}\n"; } } } } function get_playback($game_id) { $sql = "SELECT * from playback where game_id = {$game_id}"; $q = mysql_query($sql); $result = mysql_fetch_assoc($q); if ($result['playback_string'] != '') {
$app->configureMode('production', function () use($app) { error_reporting(0); $app->notFound(function () use($app) { $page = new ErrorController(404); $page->render(); }); $app->error(function (Exception $e) use($app) { $app->response()->status(500); if (!$app->request()->isAjax()) { $page = new ErrorController(500); $page->render(); } $app->stop(); if (file_exists(BASE_DIR . '/.gbemail')) { foreach (explode('\\n', file_get_contents(BASE_DIR . '/.gbemail')) as $email) { mail(trim($email), "GetchaBooks Error", get_error_message($e)); } } }); }); $app->hook('slim.before', function () use($app) { global $referrers; $request = $app->request(); define('BASE_URL', $request->getUrl() . $request->getRootUri() . '/'); define('CURRENT_URL', $request->getUrl() . $request->getPath()); define('MOBILE_DEVICE', strpos(strtolower($request->getUserAgent()), 'mobile') !== false); // remove extra slashes $path = $request->getPath(); $newPath = preg_replace("#/{2,}#", '/', $path); if ($path != $newPath) { $app->redirect($request->getUrl() . $newPath, 301);
function write_response_file_error($error) { $jsonResponse = new stdClass(); $jsonResponse->backupStatus = 'error'; $jsonResponse->backupMessage = get_error_message($error); write_response_file($jsonResponse); }
function fwp_multiundelete_page() { // If this is a POST, validate source and user credentials FeedWordPressCompatibility::validate_http_request('feedwordpress_feeds', 'manage_links'); $link_ids = isset($_REQUEST['link_ids']) ? $_REQUEST['link_ids'] : array(); if (isset($_REQUEST['link_id'])) { array_push($link_ids, $_REQUEST['link_id']); } if (isset($GLOBALS['fwp_post']['confirm']) and $GLOBALS['fwp_post']['confirm'] == 'Undelete') { if (isset($GLOBALS['fwp_post']['link_action']) and is_array($GLOBALS['fwp_post']['link_action'])) { $actions = $GLOBALS['fwp_post']['link_action']; } else { $actions = array(); } $do_it = array('unhide' => array()); foreach ($actions as $link_id => $what) { $do_it[$what][] = $link_id; } $links = array(); if (count($do_it['unhide']) > 0) { $links = get_bookmarks(array('include' => implode(', ', $do_it['unhide']), 'hide_invisible' => 0)); } $errs = $success = array(); foreach ($links as $linkdata) { $linkdata->link_visible = 'Y'; $result = wp_update_link((array) $linkdata); if (is_wp_error($result)) { $errs[] = get_error_message('db_update_error'); } else { $success[] = 'resubscribing post: ' . $linkdata->link_id; } } if (count($success) > 0) { echo "<div class=\"updated\">\n"; if (count($errs) > 0) { echo "There were some problems processing your "; echo "re-subscribe request. [SQL: " . implode('; ', $errs) . "]"; } else { echo "Your re-subscribe request(s) have been processed."; } echo "</div>\n"; } return true; // Continue on to Syndicated Sites listing } else { $targets = array(); if (is_array($link_ids) && count($link_ids) > 1) { $targets = get_bookmarks(array('include' => implode(',', $link_ids), 'hide_invisible' => 0)); } else { if (count($link_ids) == 1) { $targets[] = get_bookmark(array_shift($link_ids)); } } ?> <form action="admin.php?page=<?php echo FWP_SYNDICATION_PAGE_SLUG; ?> &visibility=Y" method="post"> <div class="wrap"> <?php FeedWordPressCompatibility::stamp_nonce('feedwordpress_feeds'); ?> <input type="hidden" name="action" value="<?php print FWP_RESUB_CHECKED; ?> " /> <input type="hidden" name="confirm" value="Undelete" /> <h2>Re-subscribe to Syndicated Links:</h2> <?php foreach ($targets as $cur_link) { $subscribed = 'Y' == strtoupper($cur_link->link_visible); $link_url = esc_html($cur_link->link_url); $link_name = esc_html($cur_link->link_name); $link_description = esc_html($cur_link->link_description); $link_rss = esc_html($cur_link->link_rss); if (!$subscribed) { ?> <fieldset> <legend><?php echo $link_name; ?> </legend> <table class="editform" width="100%" cellspacing="2" cellpadding="5"> <tr><th scope="row" width="20%"><?php _e('Feed URI:'); ?> </th> <td width="80%"><a href="<?php echo $link_rss; ?> "><?php echo $link_rss; ?> </a></td></tr> <tr><th scope="row" width="20%"><?php _e('Short description:'); ?> </th> <td width="80%"><?php echo $link_description; ?> </span></td></tr> <tr><th width="20%" scope="row"><?php _e('Homepage:'); ?> </th> <td width="80%"><a href="<?php echo $link_url; ?> "><?php echo $link_url; ?> </a></td></tr> <tr style="vertical-align:top"><th width="20%" scope="row">Subscription <?php _e('Options'); ?> :</th> <td width="80%"><ul style="margin:0; padding: 0; list-style: none"> <li><input type="radio" id="unhide-<?php echo $cur_link->link_id; ?> " name="link_action[<?php echo $cur_link->link_id; ?> ]" value="unhide" checked="checked" /> <label for="unhide-<?php echo $cur_link->link_id; ?> ">Turn back on the subscription for this syndication source.</label></li> <li><input type="radio" id="nothing-<?php echo $cur_link->link_id; ?> " name="link_action[<?php echo $cur_link->link_id; ?> ]" value="nothing" /> <label for="nothing-<?php echo $cur_link->link_id; ?> ">Leave this feed as it is. I changed my mind.</label></li> </ul> </table> </fieldset> <?php } } ?> <div class="submit"> <input class="button-primary delete" type="submit" name="submit" value="<?php _e('Re-subscribe to selected feeds »'); ?> " /> </div> </div> <?php return false; // Don't continue on to Syndicated Sites listing } }
/** * Update a custom field post * * @param * * @return */ function update_field() { // Retrieve the existing settings for the field so we can compare $existing = get_post($_POST['custom_field_id']); if (!$existing) { if (MDJM_DEBUG == true) { MDJM()->debug->log_it('Unable to update field with ID: ' . $_GET['id'] . '. May not exist', true); } wp_redirect(mdjm_get_admin_page('custom_event_fields') . '&message=5'); exit; } $id = wp_update_post(array('ID' => $_POST['custom_field_id'], 'post_title' => wp_strip_all_tags($_POST['field_label']), 'post_content' => !empty($_POST['field_desc']) ? $_POST['field_desc'] : '', 'post_name' => sanitize_title($_POST['field_label']), 'post_status' => 'publish'), true); /** * Success * We can now add the meta data */ if (!empty($id)) { if (MDJM_DEBUG == true) { MDJM()->debug->log_it('Custom field updated ' . $_POST['field_label'], true); } foreach ($_POST as $key => $value) { if (substr($key, 0, 5) != '_mdjm') { continue; } // Add the meta data to the post update_post_meta($id, $key, $value); } wp_redirect(mdjm_get_admin_page('custom_event_fields') . '&message=2'); exit; } else { if (MDJM_DEBUG == true && is_wp_error($id)) { MDJM()->debug->log_it('Unable to create custom field ' . $_POST['field_label'] . '. ' . get_error_message(), true); } wp_redirect(mdjm_get_admin_page('custom_event_fields') . '&message=4'); exit; } }
public function validates_format_of($prop, $format, $message = false) { if ($prop === false) { $this->validate_format_of = array(); } else { if (!is_array($prop)) { $prop = array($prop); } foreach ($prop as $k => $p) { # add the error message if there isn't one $message = $message ? $message : get_error_message(VALIDATION_FORMAT, $p); $this->validate_format_of[strtolower($p)] = array($format, $message); } } }
} elseif (empty($tables[$token_data['table']])) { $error = error("Token error. Table \"{$token_data['table']}\" is not defined"); } else { $errors = cw_call('cw_can_edit_on_place', array($token_data), array()); } if (!empty($token_data['pk'])) { $pk_fields = cw_query("SHOW KEYS FROM {$tables[$token_data['table']]} WHERE Key_name = 'PRIMARY'"); if (count($pk_fields) > 1) { $error = error('Token error. Primary key is specified, but table has multicolumn primary key. Use "where" instead'); } if (count($pk_fields) == 0) { $error = error('Token error. Primary key is specified, but table has no primary key. Use "where" instead'); } } if (is_error()) { cw_add_top_message(get_error_message(), 'E'); return $error; } $where = array(); if (!empty($token_data['pk'])) { $where[] = $pk_fields[0]['Column_name'] . ' = ' . $token_data['pk']; } if (!empty($token_data['where'])) { $where[] = $token_data['where']; } $cw_tokens[$request_prepared['token']]['old_value'] = cw_query_first_cell($q = "SELECT {$token_data['field']} FROM {$tables[$token_data['table']]} WHERE " . join(' AND ', $where)); cw_array2update($token_data['table'], array($token_data['field'] => $request_prepared['value']), join(' AND ', $where)); cw_add_top_message("Data has been saved successfully"); if ($token_data['handler']) { cw_call($token_data['handler'], array($token_data, $request_prepared['value'])); }