public function actionIndex() { global $API_CODE; if (!empty($_REQUEST['s'])) { $s = trim($_REQUEST['s']); $data = get_all_data(true, true, false, true); $result_array = array(); foreach ($data as $_data) { if (strpos(@$_data['user'], $s) !== false || strpos($_data['post_content'], $s) !== false || strpos($_data['reply_content'], $s) !== false || strpos($_data['b_username'], $s) !== false) { $result_array[] = $_data; } } if (defined('API_MODE')) { $json_array = array('messages' => $result_array, 'nums' => count($result_array)); die(function_exists('json_encode') ? json_encode($json_array) : CJSON::encode($json_array)); } $nums = count($result_array); $this->render('search_result', array('data' => $result_array, 'nums' => $nums)); } elseif (defined('API_MODE')) { $error_array = array('error_code' => '400', 'error' => $API_CODE['400'], 'error_detail' => t('NO_SEARCH_PARAM')); die(function_exists('json_encode') ? json_encode($error_array) : CJSON::encode($error_array)); } else { header("Location:index.php"); } }
function add_directory_listing($dir, $disabled, $makediff, $stats, &$list) { global $diffpath; $handle = opendir($dir); while (($entry = readdir($handle)) !== false) { if ($entry != '.' && $entry != '..') { $type = filetype($dir . $entry); if ($type == 'file') { $file = $dir . $entry; $hash = get_file_hash($file); $parsed = array('file' => $file, 'hash' => $hash); $parsed['state'] = 'New'; $parsed['staged'] = 'N'; if ($makediff) { $command = $diffpath; $args = array('-u', '/dev/null', $parsed['file']); $h = start_command($command, $args); close_stdin($h); $diff = htmlentities(get_all_data($h)); clean_up($h); } else { $diff = false; } list($str, $prefix) = html_file($file, $parsed['state'], $parsed['staged'], $parsed['hash'], $diff, $disabled); echo $str; $parsed['prefix'] = $prefix; $list[] = $parsed; } elseif ($type == 'dir') { add_directory_listing($dir . $entry . '/', $disabled, $makediff, $stats, $list); } else { interpret_not_supported($dir . $entry, __FILE__, __LINE__); } } } return $list; }
public function actionRSS() { $data = get_all_data(true, true); header('Content-Type: text/xml; charset=utf-8', true); $now = date("D, d M Y H:i:s T"); $borad_name = ZFramework::app()->board_name; $output = <<<HERE <?xml version="1.0" encoding="utf-8"?> <rss version="2.0"> <channel> <title>{$borad_name}</title> <link>{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}</link> <language>en</language> <pubDate>{$now}</pubDate> <lastBuildDate>{$now}</lastBuildDate> HERE; foreach ($data as $m) { $output .= "\t<item><title>"; if ((int) $m['uid'] > 0) { $output .= htmlentities($m['b_username']); } else { $output .= htmlentities($m['user']); } $output .= "</title><pubDate>" . date("D, d M Y H:i:s T", $m['time']) . "</pubDate><description><![CDATA[" . $m['post_content']; if (@$m['reply_content']) { $output .= "<br />" . strip_tags(t('ADMIN_REPLIED', array('{admin_name}' => ZFramework::app()->admin, '{reply_time}' => date("D, d M Y H:i:s T", $m['reply_time']), '{reply_content}' => $m['reply_content']))); } $output .= "]]></description></item>\n"; } $output .= "\t</channel>\n</rss>"; echo $output; }
function send_list_updates($artist_created, $album_created, $ttid, $send = true) { global $mysqlc, $returninfo, $prefs; if (!array_key_exists('inserts', $returninfo)) { $returninfo['inserts'] = array(); } if ($artist_created !== false && $prefs['sortcollectionby'] == "artist") { debuglog("Artist " . $artist_created . " was created", "USER RATING", 8); // We had to create a new albumartist, so we send back the artist HTML header // We need to know the artist details and where in the list it is supposed to go. array_push($returninfo['inserts'], do_artists_from_database('a', $prefs['sortcollectionby'], $artist_created)); } else { if ($album_created !== false) { debuglog("Album " . $album_created . " was created", "USER RATING", 8); // Find the artist $artistid = find_artist_from_album($album_created); if ($artistid === null) { debuglog("ERROR - no artistID found!", "USER RATING", 1); } else { array_push($returninfo['inserts'], do_albums_from_database('a', 'album', $artistid, $album_created, false)); } } else { if ($ttid !== null) { debuglog("Track " . $ttid . " was modified", "USER RATING", 8); $albumid = find_album_from_track($ttid); if ($albumid === null) { debuglog("ERROR - no albumID found!", "USER RATING", 1); } else { array_push($returninfo['inserts'], array('type' => 'insertInto', 'where' => 'aalbum' . $albumid, 'html' => do_tracks_from_database('a', 'album', $albumid, true))); } } } } if ($send) { $returninfo['stats'] = alistheader(get_stat('ArtistCount'), get_stat('AlbumCount'), get_stat('TrackCount'), format_time(get_stat('TotalTime'))); if ($ttid) { $returninfo['metadata'] = get_all_data($ttid); } print json_encode($returninfo); } }
fwrite($new_file, $end); fwrite($new_file, $response_status); fwrite($new_file, $url); fwrite($new_file, $content_type); fwrite($new_file, $screen_shot_url); //fwrite($new_file, $creative_url); fwrite($new_file, $creative_screen_shot_url); fwrite($new_file, $landing_page_url); fwrite($new_file, $landing_page_screen_shot_url); fwrite($new_file, $more_info_link); fclose($new_file); } } } } get_all_data($geoEdgeClient, $my_path); // $response = $client->SearchAds( '2015-07-09 00:00:00', 'f0e7a35c85dcb6f950899afaef8b7387' ); // $response = $client->GetAd( '1teEgrFreMQnoMGyFB_Xfw', 7 ); // // // Projects // $response = $client->ListProjects(); // $response = $client->GetProject( $project_id ); // $response = $client->earchProjects(); // $response = $client->ScanStatus( $scan_id ); // // // Alerts // $response = $client->ListAlerts(); // $response = $client->TriggerTypes(); // $response = $client->GetAlertHistory( $alerts_history_id ); // $response = $client->SearchAlertsHistory(); // // // ADS // $response = $client->GetAd( $ad_id ); //$response = $client->SearchAds( '2015-12-21 00:00:00' );
} $ttids = find_item($uri, $title, $artist, $album, $albumartist, forcedUriOnly($urionly, getDomain($uri))); if (count($ttids) > 0) { foreach ($ttids as $ttid) { foreach ($attributes as $pair) { debuglog("Removing " . $pair["attribute"] . " " . $pair["value"], "USERRATING"); $result = true; $r = remove_tag($ttid, $pair["value"]); if ($r == false) { debuglog("FAILED Removing " . $pair["attribute"] . " " . $pair["value"], "USERRATING", 2); $result = false; } } if ($result) { send_list_updates($artist_created, $album_created, $ttid, false); $returninfo['metadata'] = get_all_data($ttid); } } print json_encode($returninfo); } else { debuglog("TTID Not Found", "USERRATING", 2); header('HTTP/1.1 417 Expectation Failed'); } break; case 'delete': $ttids = find_item($uri, null, null, null, null, true); if (count($ttids) == 0) { header('HTTP/1.1 400 Bad Request'); } else { delete_track(array_shift($ttids)); }
<select name="country"> <option value="India" selected>India</option> </select> </div> </div> <div class="form-1"> <select name="state" id="state"> <option value="" hidden>Select State</option> <?php $result = get_all_data('tbl_state'); foreach ($result as $resu) { ?> <option value="<?php echo $resu['state_name']; ?> " <?php echo isset($post_details['state']) && $post_details['state'] == $resu['state_name'] ? "selected" : ""; ?> ><?php echo $resu['state_name']; ?> </option> <?php } ?>