X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=include%2Ffunctions.php;h=971c61e2f4e5e54bd9d81c1105f84ee66fd95e1e;hb=6322ac79a020ab584d412d782d62b2ee77d7c6cf;hp=1ae5bbbe2c6b1fcf711fd068e64ad92e0861ad84;hpb=2cfbb448fb197837c063c377c042beb3ba704a52;p=tt-rss.git diff --git a/include/functions.php b/include/functions.php index 1ae5bbbe..971c61e2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1,6 +1,6 @@ readICO($iconFile); - //TODO: error logging - if(count($ico->images)==0) - return null; - else { - $image = @$ico->images[count($ico->images)-1]->getImageResource(); - } - $type = "ico"; - } - elseif(strtolower($imgInfo['mime'])=='image/png') { - $image = imagecreatefrompng($iconFile); - $type = 'png'; - } - elseif(strtolower($imgInfo['mime'])=='image/jpeg') { - $image = imagecreatefromjpeg($iconFile); - $type = 'jpg'; - } - elseif(strtolower($imgInfo['mime'])=='image/gif') { - $image = imagecreatefromgif($iconFile); - $type = 'gif'; - } - //TODO: error logging - if (is_null($image)) - return null; - $width = imagesx($image); - $height = imagesy($image); - $pixel = imagecreatetruecolor(1, 1); - imagecopyresampled($pixel, $image, 0, 0, 0, 0, 1, 1, $width, $height); - $rgb = imagecolorat($pixel, 0, 0); - $color = imagecolorsforindex($pixel, $rgb); - return $color; - } function print_select($id, $default, $values, $attributes = "") { print " 0) { @@ -3743,7 +3672,7 @@ $filename = substr($url, strrpos($url, "/")+1); - $player = format_inline_player($link, $url, $ctype); + $player = format_inline_player( $url, $ctype); if ($player) array_push($entries_inline, $player); @@ -3764,7 +3693,7 @@ array_push($entries, $entry); } - if ($_SESSION['uid'] && !get_pref($link, "STRIP_IMAGES") && !$_SESSION["bw_limit"]) { + if ($_SESSION['uid'] && !get_pref( "STRIP_IMAGES") && !$_SESSION["bw_limit"]) { if ($always_display_enclosures || !preg_match("/SetServer('localhost', 9312); + $sphinxpair = explode(":", SPHINX_SERVER, 2); + + $sphinxClient->SetServer($sphinxpair[0], $sphinxpair[1]); $sphinxClient->SetConnectTimeout(1); $sphinxClient->SetFieldWeights(array('title' => 70, 'content' => 30, @@ -3893,7 +3824,7 @@ return $ids; } - function cleanup_tags($link, $days = 14, $limit = 1000) { + function cleanup_tags( $days = 14, $limit = 1000) { if (DB_TYPE == "pgsql") { $interval_query = "date_updated < NOW() - INTERVAL '$days days'"; @@ -3911,7 +3842,7 @@ WHERE post_int_id = int_id AND $interval_query AND ref_id = ttrss_entries.id AND tag_cache != '' LIMIT $limit_part"; - $result = db_query($link, $query); + $result = db_query( $query); $ids = array(); @@ -3922,8 +3853,8 @@ if (count($ids) > 0) { $ids = join(",", $ids); - $tmp_result = db_query($link, "DELETE FROM ttrss_tags WHERE id IN ($ids)"); - $tags_deleted += db_affected_rows($link, $tmp_result); + $tmp_result = db_query( "DELETE FROM ttrss_tags WHERE id IN ($ids)"); + $tags_deleted += db_affected_rows( $tmp_result); } else { break; } @@ -3934,8 +3865,8 @@ return $tags_deleted; } - function print_user_stylesheet($link) { - $value = get_pref($link, 'USER_STYLESHEET'); + function print_user_stylesheet() { + $value = get_pref( 'USER_STYLESHEET'); if ($value) { print "