0) { foreach ($array as $k => $v) { if (is_array($v)) { foreach ($v as $k2 => $v2) { if ($k2 == $on) { $sortable_array[$k] = $v2; } } } else { $sortable_array[$k] = $v; } } switch ($order) { case SORT_ASC: asort($sortable_array); break; case SORT_DESC: arsort($sortable_array); break; } foreach ($sortable_array as $k => $v) { $new_array[$k] = $array[$k]; } } return $new_array; } function includePageTemplate($currentPage, $numEntries, $entriesPerPage) { if ($mode == "random") { ?> Weitere zufällige Kanäle anzeigen $entriesPerPage) { ?>
" href="/kanaele/" style="border-radius: 0px 0px 0px 4px;">1 = $buttonPage) { ?> " href="/kanaele/"> = $buttonPage) { ?> " href="/kanaele/" style="border-radius: 0px 0px 4px 0px;">
$channel["id"], "name" => $channel["name"], "youtubeName" => $channel["youtubeName"], "title" => $channel["title"], "keywordIds" => $channel["keywordIds"], "shortDescription" => $channel["shortDescription"], "copySmallBanner" => $channel["copySmallBanner"], "copyBigBanner" => $channel["copyBigBanner"], "numSubscribers" => $channel["numSubscribers"], "cookies" => $channel["cookies"], "points" => 0, "randomValue" => $channel["randomValue"]); $numHitKeywords = 0; $add = false; // Add channel when the filter isn't used if ($searchString == "") $add = true; foreach ($searchKeywords as $searchKeyword) { // Add channel when the search matches some keywords $result = mysql_query("SELECT id, title FROM channelKeywords WHERE REPLACE(REPLACE(REPLACE(LOWER(title), '\'', ''), '-', ''), ' ', '') LIKE LOWER('".$searchKeyword."')"); if (mysql_num_rows($result) != 0) { $keyword = mysql_fetch_array($result); if (strpos($addingChannel["keywordIds"], $keyword["id"]) !== false) { $numHitKeywords += 1; } } // Add channel when the search matches the name /*if ((strpos(strtolower($channel["title"]), strtolower($searchKeyword)) !== false) or (strpos(strtolower($channel["youtubeName"]), strtolower($searchKeyword)) !== false)) { $addingChannel["points"] += 1; $add = true; }*/ } if ($numHitKeywords >= count($searchKeywords)) $add = true; $addingChannel["points"] += $addingChannel["randomValue"] * 15; $addingChannel["points"] += $addingChannel["cookies"]; //if ($channel["linked"] == "1") $addingChannel["points"] += 1; //$addingChannel["points"] += $channel["stars"]; if ($add) array_push($allChannels, $addingChannel); } $numChannels = count($allChannels); $allChannels = array_sort($allChannels, "points", SORT_DESC); //$allChannels = array_sort($allChannels, "numSubscribers", SORT_DESC); //$allChannels = array_sort($allChannels, "randomValue", SORT_DESC); //$allChannels = array_sort($allChannels, "cookies", SORT_DESC); // Copy the channels which will showed on the current page in a new array $channels = array(); $i = 0; $n = 0; $numChannelsPerPage = 10; foreach ($allChannels as $channel) { if (($i >= ($page - 1) * $numChannelsPerPage) && ($i < $page * $numChannelsPerPage)) { array_push($channels, $channel); $n++; if ($n >= $numChannelsPerPage) break; } $i++; } ?>
Sortiert nach Kekse und Zufall
">
35) echo(substr($channel["title"], 0, 33).".."); else echo($channel["title"]); ?>
0) { ?> 0) { ?>
Bewertung
Platzhalter

Anmelden

Neu hier? Registrieren »

Partner

YouTube Forum: TubePro