Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.5.0
- * @ Author : DeZender
- * @ Release on : 09.06.2012
- * @ Official site : http://DeZender.Net
- *
- */
- function ayar($alan) {
- global $ayar;
- return $ayar[$alan];
- }
- function getPagingQuery($sql, $itemPerPage = 10) {
- if (( isset( $_GET['page'] ) && 0 < (int)$_GET['page'] )) {
- $page = (int)$_GET['page'];
- } else {
- $page = 1;
- }
- $offset = ( $page - 1 ) * $itemPerPage;
- return $sql . ( '' . ' LIMIT ' . $offset . ', ' . $itemPerPage );
- }
- function getPagingLink($sql, $itemPerPage = 10, $strGet = '', $sayfa, $son = false, $seo = false) {
- global $db;
- $result = $db->sorgu( $sql );
- $pagingLink = '';
- $totalResults = $db->say( $result );
- $totalPages = ceil( $totalResults / $itemPerPage );
- $numLinks = 10;
- if ($strGet) {
- if ($seo) {
- $strGet = '-' . $strGet;
- } else {
- $strGet = '&' . $strGet;
- }
- }
- if (1 < $totalPages) {
- if ($seo === false) {
- if (isset( $_GET[$sayfa] )) {
- $self = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
- $self .= '?' . $sayfa . '=' . $_GET[$sayfa] . '';
- } else {
- $self = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
- }
- } else {
- if (isset( $_GET[$sayfa] )) {
- $self = '' . $_GET[$sayfa] . '';
- }
- }
- if (( isset( $_GET['page'] ) && 0 < (int)$_GET['page'] )) {
- $pageNumber = (int)$_GET['page'];
- } else {
- $pageNumber = 1;
- }
- if ($_GET['page'] == 'r') {
- $pageNumber = 'r';
- }
- if (1 < $pageNumber) {
- $page = $pageNumber - 1;
- if (1 < $page) {
- if ($seo != false) {
- $prev = '' . ' <a class="page_previous" href="' . $self . '-p' . $page . $strGet . '.html' . $son . '"><b>«</b></a> ';
- } else {
- $prev = '' . ' <a class="page_previous" href="' . $self . '&page=' . $page . $strGet . $son . '"><b>«</b></a> ';
- }
- } else {
- if ($seo != false) {
- $prev = '' . ' <a class="page_previous" href="' . $self . '-p' . $page . $strGet . '.html' . $son . '"><b>«</b></a> ';
- } else {
- $prev = '' . ' <a class="page_previous" href="' . $self . '&page=' . $page . $strGet . $son . '"><b>«</b></a> ';
- }
- }
- } else {
- $prev = '';
- $first = '';
- }
- if ($pageNumber < $totalPages) {
- $page = $pageNumber + 1;
- if ($seo != false) {
- $next = '' . ' <a class="page_next" href="' . $self . '-p' . $page . $strGet . '.html' . $son . '"><b>»</b></a> ';
- } else {
- $next = '' . ' <a class="page_next" href="' . $self . '&page=' . $page . $strGet . $son . '"><b>»</b></a> ';
- }
- } else {
- $next = '';
- $last = '';
- }
- $start = $pageNumber - $pageNumber % $numLinks + 1;
- $end = $start + $numLinks - 1;
- $end = min( $totalPages, $end );
- $pagingLink = array( );
- $page = $start;
- while ($page <= $end) {
- if (( $page == $pageNumber && $pageNumber != 'r' )) {
- $pagingLink[] = '' . ' <a class="page_current">' . $pageNumber . '</a> ';
- } else {
- if ($page == 1) {
- if ($seo != false) {
- $pagingLink[] = '' . ' <a href="' . $self . '-p' . $page . $strGet . '.html' . $son . '">' . $page . '</a> ';
- } else {
- $pagingLink[] = '' . ' <a href="' . $self . '&' . $strGet . $son . '">' . $page . '</a> ';
- }
- } else {
- if ($seo != false) {
- $pagingLink[] = '' . ' <a href="' . $self . '-p' . $page . $strGet . '.html' . $son . '">' . $page . '</a> ';
- } else {
- $pagingLink[] = '' . ' <a href="' . $self . '&page=' . $page . $strGet . $son . '">' . $page . '</a> ';
- }
- }
- }
- if (( ( ( isset( $_GET['m'] ) && $_GET['m'] === 'album' ) && $page == 2 ) && banner( 34 ) )) {
- if ($_GET['page'] === 'r') {
- $pagingLink[] = '' . ' <a class="page_current" href="' . $self . '-pr' . $strGet . '-Reklam.html' . $son . '">R</a> ';
- } else {
- $pagingLink[] = '' . ' <a href="' . $self . '-pr' . $strGet . '-Reklam.html' . $son . '">R</a> ';
- }
- }
- ++$page;
- }
- $pagingLink = implode( '', $pagingLink );
- $pagingLink = $first . $prev . $pagingLink . $next . $last;
- }
- return $pagingLink;
- }
- function smtp_gonder($gonderici_adi, $gonderici_mail, $to, $konu, $message) {
- global $ayar;
- global $library_folder;
- include( $library_folder . 'Smtp.php' );
- $smtp = new SMTP( $ayar['smtp_host'], 587, $ayar['smtp_user'], base64( $ayar['smtp_pass'], true ) );
- if ($smtp->sendMail( $gonderici_adi, $gonderici_mail, $to, $konu, $message )) {
- return TRUE;
- }
- unset( $smtp );
- }
- function mail_gonder($gmail, $gadsoy, $gonmail, $konu, $mesaj) {
- $headers = 'MIME-Version: 1.0
- ';
- $headers .= 'Content-type: text/html; charset=iso-8859-9
- ';
- $headers .= 'X-Mailer: PHP
- ';
- $headers .= 'X-Sender: PHP
- ';
- $headers .= '' . 'From: ' . $gadsoy . '<' . $gonmail . '>
- ';
- $headers .= '' . 'Reply-To: ' . $gadsoy . '<' . $gonmail . '>
- ';
- $headers .= '' . 'Return-Path: ' . $godsoy . '<' . $gonmail . '>
- ';
- @mail( $gmail, $konu, $mesaj, $headers );
- }
- function change_title($new_title) {
- $output = ob_get_contents( );
- ob_end_clean( );
- $output = preg_replace( '/<title>(.*?)<\/title>/', '' . '<title>' . $new_title . '</title>', $output );
- echo $output;
- }
- function dynamic_meta($desc, $key, $title = false, $url = false, &$image = false) {
- $output = ob_get_contents( );
- ob_end_clean( );
- $description = tirnaksil( $desc );
- $keywords = tirnaksil( character_limiter( $key, 160 ) );
- $output = preg_replace( '/<title>(.*?)<\/title>/', '<title>' . $title . ' - ' . ayar( 'siteadi' ) . '</title>', $output );
- $output = preg_replace( '/<meta\s+name="description.*?>/si', '<meta name="description" content="' . $description . '" />', $output );
- $output = preg_replace( '/<meta\s+name="keywords.*?>/si', '<meta name="keywords" content="' . $keywords . '" />', $output );
- $output = preg_replace( '/<meta\s+property="og:title.*?>/si', '<meta property="og:title" content="' . tirnaksil( $title ) . '" />', $output );
- $output = preg_replace( '/<meta\s+property="og:url.*?>/si', '<meta property="og:url" content="' . $url . '" />', $output );
- $output = preg_replace( '/<meta\s+property="og:description.*?>/si', '<meta property="og:description" content="' . tirnaksil( $description ) . '" />', $output );
- $output = preg_replace( '/<meta\s+property="og:image.*?>/si', '<meta property="og:image" content="' . $image . '" />', $output );
- $output = preg_replace( '/<meta\s+property="fb:image.*?>/si', '<meta property="fb:image" content="' . $image . '" />', $output );
- $output = preg_replace( '/<link\s+rel="image_src.*?>/si', '<link rel="image_src" href="' . $image . '" />', $output );
- echo $output;
- }
- function keywords_insert($keywords, $detailKeywords = FALSE) {
- $keywords = trim( $keywords );
- $keywords = preg_replace( '/\s\s+/', ' ', $keywords );
- if ($detailKeywords === TRUE) {
- $keywords = str_replace( '.', '', $keywords );
- $keywords = str_replace( '-', '', $keywords );
- $keywords = str_replace( '_', '', $keywords );
- $keywords = str_replace( ':', '', $keywords );
- }
- $keywords = str_replace( ',', '', $keywords );
- $keywords = str_replace( '/', '', $keywords );
- $keywords = str_replace( '\'', '', $keywords );
- $stop_words = array( 'ben', 'sen', 'hakkında', 'bir', 'nerede', 'ki', 'kim', 'nerede', 've', 'com', 'de', 'en', 'için', 'tarafından', 'nasıl', 'ne', 'içinde', 'ile', 'böyle', 'saatleri', 'saat', 'arasında', 'sadece', 'yalnız', 'yalnızca', 'ara', 'önce', 'sonra', 'verileceğini', 'vereceğini', 'ettiği', 'geçti', 'www', '!', '.', '?', '=', '-' );
- $words = explode( ' ', $keywords );
- if (is_array( $words )) {
- $i = 0;
- while ($i < sizeof( $words )) {
- if (in_array( $words[$i], $stop_words )) {
- unset( $words[$i] );
- }
- if (( $detailKeywords === TRUE && is_numeric( $words[$i] ) )) {
- unset( $words[$i] );
- }
- ++$i;
- }
- foreach ($words as $word) {
- $export[] = $word;
- }
- }
- if ($detailKeywords === TRUE) {
- return $export;
- }
- $i = 0;
- $keys = '';
- foreach ($export as $key) {
- if (0 < $i) {
- $keys .= ', ';
- }
- $keys .= $key;
- ++$i;
- }
- return $keys;
- }
- function keywords2link($detail, $keywords = array( )) {
- global $ayar;
- if (is_array( $keywords )) {
- foreach ($keywords as $key) {
- $in_keys = '/' . $key . '/';
- $in[] = $in_keys;
- $out_keys = '<a href="' . $ayar['url'] . 'haberleri/' . urlencode( $key ) . '" title="' . $key . '" class="klink">' . $key . '</a>';
- $explode_key = explode( ' ', $key );
- if ($explode_key) {
- foreach ($explode_key as $ek) {
- if (preg_match( '' . '#' . $ek . '#', $ayar['url'] )) {
- $out_keys = $key;
- continue;
- }
- }
- }
- $out[] = $out_keys;
- }
- }
- return preg_replace( $in, $out, $detail );
- }
- function word_limiter($str, $limit = 100, $end_char = '...') {
- if (trim( $str ) == '') {
- return $str;
- }
- preg_match( '/^\s*+(?:\S++\s*+){1,' . (int)$limit . '}/', $str, $matches );
- if (strlen( $str ) == strlen( $matches[0] )) {
- $end_char = '';
- }
- return rtrim( $matches[0] ) . $end_char;
- }
- function character_limiter($str, $n = 500, $end_char = '...') {
- if (strlen( $str ) < $n) {
- return $str;
- }
- $str = preg_replace( '/\s+/', ' ', str_replace( array( '
- ', '
- ', '
- ' ), ' ', $str ) );
- if (strlen( $str ) <= $n) {
- return $str;
- }
- $out = '';
- foreach (explode( ' ', trim( $str ) ) as $val) {
- $out .= $val . ' ';
- if ($n <= strlen( $out )) {
- $out = trim( $out );
- return (strlen( $out ) == strlen( $str ) ? $out : $out . $end_char);
- }
- }
- }
- function tarih($tarih) {
- list( $yil, $ay, $gun ) = preg_split( '/[-\:\/ ]/', $tarih );
- $tarih = '' . $gun . '.' . $ay . '.' . $yil;
- return $tarih;
- }
- function tarihsaat($tarih) {
- list( $yil, $ay, $gun, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
- $tarih = '' . $gun . '.' . $ay . '.' . $yil . ' ' . $saat . ':' . $dakika . ':' . $saniye;
- return $tarih;
- }
- function tarihymd($tarih) {
- list( $yil, $ay, $gun, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
- $tarih = '' . $yil . '-' . $ay . '-' . $gun;
- return $tarih;
- }
- function saat($tarih) {
- list( $yil, $ay, $gun, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
- return $tarih = '' . $saat . ':' . $dakika;
- }
- function tarihsaat2($tarih) {
- list( $yil, $ay, $gun, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
- $aylar = array( '01' => 'Ocak', '02' => 'Şubat', '03' => 'Mart', '04' => 'Nisan', '05' => 'Mayıs', '06' => 'Haziran', '07' => 'Temmuz', '08' => 'Ağustos', '09' => 'Eylül', '10' => 'Ekim', '11' => 'Kasım', '12' => 'Aralık' );
- $tarih = '' . $gun . ' ' . $aylar[$ay] . ' ' . $yil . ', ' . $saat . ':' . $dakika;
- return $tarih;
- }
- function tarihsaat3($tarih, $saat_gizle = FALSE) {
- list( $yil, $ay, $gun, $gunadi, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
- $aylar = array( '01' => 'Ocak', '02' => 'Şubat', '03' => 'Mart', '04' => 'Nisan', '05' => 'Mayıs', '06' => 'Haziran', '07' => 'Temmuz', '08' => 'Ağustos', '09' => 'Eylül', '10' => 'Ekim', '11' => 'Kasım', '12' => 'Aralık' );
- $gunler = array( 'Monday' => 'Pazartesi', 'Tuesday' => 'Salı', 'Wednesday' => 'Çarşamba', 'Thursday' => 'Perşembe', 'Friday' => 'Cuma', 'Saturday' => 'Cumartesi', 'Sunday' => 'Pazar' );
- if ($gunler[$gunadi] != '') {
- $tarih = '' . $gun . ' ' . $aylar[$ay] . ' ' . $yil . ' ' . $gunler[$gunadi];
- } else {
- $tarih = '' . $gun . ' ' . $aylar[$ay] . ' ' . $yil;
- }
- if ($saat_gizle === FALSE) {
- if (( $saat && $dakika )) {
- $tarih .= ' ' . $saat . ':' . $dakika;
- }
- }
- return $tarih;
- }
- function gunler($gun) {
- $gunler = array( 'Monday' => 'Pazartesi', 'Tuesday' => 'Salı', 'Wednesday' => 'Çarşamba', 'Thursday' => 'Perşembe', 'Friday' => 'Cuma', 'Saturday' => 'Cumartesi', 'Sunday' => 'Pazar' );
- return $gunler[$gun];
- }
- function utf82ascii($string) {
- $patterns[0] = '/Å' . chr( 158 ) . '/';
- $patterns[1] = '/ÅŸ/';
- $patterns[2] = '/Ä°/';
- $patterns[3] = '/ı/';
- $patterns[4] = '/Ä' . chr( 158 ) . '/';
- $patterns[5] = '/ÄŸ/';
- $patterns[6] = '/Ü/';
- $patterns[7] = '/ü/';
- $patterns[8] = '/Ö/';
- $patterns[9] = '/ö/';
- $patterns[10] = '/Ç/';
- $patterns[11] = '/ç/';
- $replacements[0] = 'Ş';
- $replacements[1] = 'ş';
- $replacements[2] = 'İ';
- $replacements[3] = 'ı';
- $replacements[4] = 'Ğ';
- $replacements[5] = 'ğ';
- $replacements[6] = 'Ü';
- $replacements[7] = 'ü';
- $replacements[8] = 'Ö';
- $replacements[9] = 'ö';
- $replacements[10] = 'Ç';
- $replacements[11] = 'ç';
- return preg_replace( $patterns, $replacements, $string );
- }
- function suz($veri) {
- $habunu_bul = array( 'İ', 'Ş', ' ', 'Ü', 'Ç', 'Ğ', 'Ö', 'ı', 'ş', 'ü', 'ç', 'ğ', 'ö', 'ı', 'ğ', 'ç', 'ö', 'ş', 'ü', 'Ç', 'Ü', 'İ', 'Ö', 'Ş' );
- $habunu_yaz = array( 'I', 'S', '-', 'U', 'C', 'G', 'O', 'i', 's', 'u', 'c', 'g', 'o', 'i', 'g', 'c', 'o', 's', 'u', 'c', 'u', 'i', 'o', 's' );
- $veri = strtolower( str_replace( $habunu_bul, $habunu_yaz, $veri ) );
- $veri = str_replace( ' ', '-', $veri );
- $veri = str_replace( '\'', '', $veri );
- $veri = str_replace( '’', '', $veri );
- $veri = str_replace( '.', '', $veri );
- $veri = str_replace( '(', '', $veri );
- $veri = str_replace( ')', '', $veri );
- $veri = str_replace( '[', '', $veri );
- $veri = str_replace( '"', '', $veri );
- $veri = str_replace( '\\', '', $veri );
- $veri = str_replace( ']', '', $veri );
- $veri = str_replace( '"', '', $veri );
- $veri = str_replace( ':', '', $veri );
- $veri = str_replace( ';', '', $veri );
- $veri = str_replace( ',', '', $veri );
- $veri = str_replace( '&', '', $veri );
- $veri = str_replace( '&', '', $veri );
- $veri = str_replace( '*', '', $veri );
- $veri = str_replace( '%', '', $veri );
- $veri = str_replace( '/', '', $veri );
- $veri = str_replace( '+', '', $veri );
- $veri = str_replace( ( '' . '$' ), '', $veri );
- $veri = str_replace( '#', '', $veri );
- $veri = str_replace( '!', '', $veri );
- $veri = str_replace( '?', '', $veri );
- $veri = str_replace( '’', '', $veri );
- $veri = str_replace( '<', '', $veri );
- $veri = str_replace( '>', '', $veri );
- $veri = str_replace( '|', '', $veri );
- $veri = str_replace( '', '', $veri );
- $veri = str_replace( '=', '', $veri );
- $veri = str_replace( 'font-color', '', $veri );
- $veri = str_replace( 'font', '', $veri );
- $veri = str_replace( 'ff0000', '', $veri );
- $veri = str_replace( '0000ff', '', $veri );
- $veri = str_replace( 'blink', '', $veri );
- return $veri;
- }
- function linkyap($veri, $ek, $id) {
- $suz = suz( $veri );
- if ($ek === false) {
- $ayrac = '';
- $uzanti = '';
- $ek = '';
- $uzanti = '';
- $veri = '' . $id . '-' . $suz . '';
- } else {
- $ayrac = '-';
- $id = $id;
- $ek = $ek;
- $uzanti = '.html';
- $veri = '' . $suz . '' . $ayrac . '' . $ek . ',' . $id . '' . $uzanti . '';
- }
- return $veri;
- }
- function islembutonlari() {
- global $d;
- global $row;
- echo '<input type="submit" name="save" id="save" value="Kaydet - Güncelle"/>
- ';
- if (isset( $_GET['ID'] )) {
- echo '<input name="sil_buton" type="submit" value="Sil" id="sil_buton" onclick="return onay(\'' . $row['baslik'] . '\')"/>
- ';
- }
- echo '<input name="geri_don" type="button" value="Geri Dön" onclick="git(\'?file=' . $d . '\');"/>
- ';
- }
- function yukle($input, &$yol) {
- $izinli = array( 'swf', 'SWF', 'jpg', 'JPG', 'gif', 'GIF' );
- $dosya = $_FILES[$input];
- $yeni_isim = trim( strtolower( stripslashes( strtr( $dosya['name'], 'ÜŞÇİĞÖüöşçiğı?', 'USCIGOuoscigi_' ) ) ) );
- $yeni_isim = str_replace( ' ', '_', $yeni_isim );
- if (file_exists( '' . $yol . '/' . $yeni_isim . '' )) {
- $dagit = explode( '.', $yeni_isim );
- $ismi = $dagit[0];
- $uzan = $dagit[1];
- $rast = rand( 1, 100000 );
- $yeni_isim = '' . $ismi . '_' . $rast . '.' . $uzan . '';
- $yeni_isim = strtolower( $yeni_isim );
- }
- $uzanti = substr( $yeni_isim, 0 - 3, 3 );
- if (( in_array( $uzanti, $izinli ) && $input )) {
- list( $width, $height, $type, $attr ) = getimagesize( $dosya['tmp_name'] );
- $resim_url = '' . $yol . '/' . $yeni_isim;
- $gonder = @move_uploaded_file( $dosya['tmp_name'], $resim_url );
- chmod( '' . $resim_url, 420 );
- } else {
- hata( 'Dosya Formatı Geçersiz' );
- }
- return $yeni_isim;
- }
- function limitle($Text, $Min, $Max) {
- if (strlen( $Text ) < $Min) {
- $Limit = $Min - strlen( $Text );
- } else {
- if ($Max <= strlen( $Text )) {
- $words = explode( ' ', $Text );
- $check = 1;
- while ($Max <= strlen( $Text )) {
- $c = count( $words ) - $check;
- $Text = substr( $Text, 0, ( strlen( $words[$c] ) + 1 ) * ( 0 - 1 ) );
- ++$check;
- }
- }
- }
- return $Text;
- }
- function tirnaksil($veri, $special_chars = TRUE) {
- return ($special_chars === TRUE ? trim( htmlspecialchars( strip_tags( $veri ) ) ) : trim( str_replace( $sil, '', $veri ) ));
- }
- function editor($input, $row, $w, $h) {
- global $ayar;
- global $system_dir;
- $oFCKeditor = new FCKeditor( $input );
- $oFCKeditor->Config['CustomConfigurationsPath'] = 'myconfig.js';
- $oFCKeditor->Config['ProcessHTMLEntities'] = 'false';
- $oFCKeditor->Config['IncludeLatinEntities'] = 'false';
- $oFCKeditor->Config['IncludeGreekEntities'] = 'false';
- $oFCKeditor->Config['IgnoreEmptyParagraphValue'] = 'true';
- $oFCKeditor->Config['FillEmptyBlocks'] = 'false';
- $oFCKeditor->Config['EnterMode'] = 'br';
- $oFCKeditor->BasePath = $ayar['url'] . 'FCKeditor/';
- $oFCKeditor->Value = $row;
- $oFCKeditor->Width = $w;
- $oFCKeditor->Height = $h;
- $oFCKeditor->Create( );
- }
- function editor2($input, $row, $w, $h) {
- global $ayar;
- global $system_dir;
- $oFCKeditor = new FCKeditor( $input );
- $oFCKeditor->Config['CustomConfigurationsPath'] = 'myconfig2.js';
- $oFCKeditor->Config['ProcessHTMLEntities'] = 'false';
- $oFCKeditor->Config['IncludeLatinEntities'] = 'false';
- $oFCKeditor->Config['IncludeGreekEntities'] = 'false';
- $oFCKeditor->Config['IgnoreEmptyParagraphValue'] = 'true';
- $oFCKeditor->Config['FillEmptyBlocks'] = 'false';
- $oFCKeditor->BasePath = $ayar['url'] . 'FCKeditor/';
- $oFCKeditor->Value = $row;
- $oFCKeditor->Width = $w;
- $oFCKeditor->Height = $h;
- $oFCKeditor->Create( );
- }
- function sirala($durum, $id, $sira, &$tablo) {
- global $db;
- if ($durum === 'yukari') {
- $row = $db->tekcek( '' . 'SELECT id, sira FROM ' . $tablo . ' WHERE sira > ' . $sira . ' ORDER BY sira LIMIT 1 ' );
- $iiid = $row['id'];
- $ssira = $row['sira'];
- $db->sorgu( '' . 'UPDATE ' . $tablo . ' SET sira = \'' . $sira . '\' WHERE id = \'' . $iiid . '\' LIMIT 1' );
- $db->sorgu( '' . 'UPDATE ' . $tablo . ' SET sira = \'' . $ssira . '\' WHERE id = \'' . $id . '\' LIMIT 1' );
- return null;
- }
- if ($durum === 'asagi') {
- $row = $db->tekcek( '' . 'SELECT id, sira FROM ' . $tablo . ' WHERE sira < ' . $sira . ' ORDER BY sira DESC LIMIT 1 ' );
- $iiid = $row['id'];
- $ssira = $row['sira'];
- $db->sorgu( '' . 'UPDATE ' . $tablo . ' SET sira = \'' . $sira . '\' WHERE id = \'' . $iiid . '\' LIMIT 1' );
- $db->sorgu( '' . 'UPDATE ' . $tablo . ' SET sira = \'' . $ssira . '\' WHERE id = \'' . $id . '\' LIMIT 1' );
- }
- }
- function kategoriyolu($catid) {
- global $db;
- $sonuc = '';
- $sql = $db->sorgu( 'SELECT * FROM haberkat WHERE id = \'' . $catid . '\'' );
- $current_category = $db->assoc( $sql );
- $ref = $catid;
- while (!$last_category) {
- $n_parent_categories += 1;
- $sql = $db->sorgu( 'SELECT * FROM haberkat WHERE id = \'' . $ref . '\'' );
- $parent_categories[$n_parent_categories - 1] = $db->assoc( $sql );
- if ($parent_categories[$n_parent_categories - 1]['parent'] == 0) {
- $last_category = true;
- continue;
- }
- $ref = $parent_categories[$n_parent_categories - 1]['parent'];
- }
- if ($catid != 1) {
- $x = $n_parent_categories - 1;
- while (1 <= $x) {
- if ($parent_categories[$x]['id'] == 1 & $l == 1) {
- } else {
- $sonuc .= url_title( $parent_categories[$x]['baslik'] ) . '/';
- }
- --$x;
- }
- $sonuc .= url_title( $current_category['baslik'] );
- }
- return $sonuc;
- }
- function rmanset_sayisi() {
- global $db;
- $sayi = $db->tekcek( 'SELECT COUNT(id) AS sayi FROM haber WHERE rmanset = \'1\' AND aktif = \'1\' AND onay = \'1\'' );
- if ($sayi['sayi'] <= 10) {
- return $sayi['sayi'] - 1;
- }
- return 9;
- }
- function rmanset_iframe(&$limit) {
- global $db;
- global $ayar;
- global $url;
- $where = 'fmanset = \'1\' AND aktif = \'1\' AND onay = \'1\'';
- $q = $db->getir( '' . 'SELECT id, baslik, spot, resim, hresim, hta, tarih, renk, kalin, ziplat FROM haber WHERE ' . $where . ' ORDER BY tarih DESC LIMIT 15' );
- if (!$q) {
- return false;
- }
- $i = 1;
- foreach ($q as $row) {
- if ($row['resim'] === '') {
- $resim = $row['hresim'];
- } else {
- $resim = '' . URL . 'images/haberler/' . $row['resim'] . '';
- }
- $baslik = baslik_stili( $row[renk], $row[kalin], $row[ziplat], $row['baslik'] );
- echo '<li>
- ';
- echo '<a href="' . $url . '' . $row['hta'] . '-h' . $row['id'] . '.html" target="_blank">
- ';
- echo '<img src="' . $resim . '" />
- ';
- echo '</a>
- ';
- echo '<span>' . $baslik . '</span>
- ';
- echo '<p>' . strip_tags( $row['spot'] ) . ' <a href="' . $url . '' . $row['hta'] . '-h' . $row['id'] . '.html" class="devami" target="_blank">Devamını Oku</a></p>
- ';
- echo '<em>' . tarihsaat2( $row['tarih'] ) . '</em>
- ';
- echo '</li>';
- ++$i;
- }
- echo '</li>';
- }
- function kategori_to_id($kategori) {
- global $db;
- $row = $db->tekcek( 'SELECT id FROM haberkat WHERE hta = \'' . $kategori . '\' LIMIT 1' );
- return $row['id'];
- }
- function baslik_stili($renk, $kalin, $ziplat, $veri) {
- $baslik = $veri;
- if ($renk) {
- $baslik = '<font style="color:' . $renk . '">' . $veri . '</font>';
- }
- if ($kalin) {
- $baslik = '<b>' . $veri . '</b>';
- }
- if ($ziplat) {
- $baslik = '<blink>' . $veri . '</blink>';
- }
- if (( $kalin && $ziplat )) {
- $baslik = '<b><blink>' . $veri . '</blink></b>';
- }
- if (( $kalin && $renk )) {
- $baslik = '<b><font style="color:' . $renk . '">' . $veri . '</font></b>';
- }
- if (( $ziplat && $renk )) {
- $baslik = '<blink><font style="color:' . $renk . '">' . $veri . '</font></blink>';
- }
- if (( ( $ziplat && $renk ) && $kalin )) {
- $baslik = '<b><blink><font style="color:' . $renk . '">' . $veri . '</font></blink></b>';
- }
- return $baslik;
- }
- function cokokunan($limit) {
- global $db;
- $bugun = date( 'Y-m-d' );
- $q = $db->getir( 'SELECT baslik, hta, renk, kalin, ziplat FROM haber WHERE aktif = \'1\' AND onay = \'1\' AND tarih <= \'' . date( 'Y-m-d H:i:s' ) . ( '' . '\' AND tarih > DATE_SUB(CURDATE(),INTERVAL 1 MONTH) AND hit NOT IN(0) ORDER BY hit DESC LIMIT ' . $limit ) );
- if (!$q) {
- return false;
- }
- foreach ($q as $row) {
- $baslik = baslik_stili( $row['renk'], $row['kalin'], $row['ziplat'], word_limiter( $row['baslik'], 5 ) );
- echo ' <li><a href="' . URL . $row['hta'] . '.htm">' . $baslik . '</a></li>
- ';
- }
- }
- function cokyorumlanan($limit) {
- global $db;
- $bugun = date( 'Y-m-d' );
- $q = $db->getir( 'SELECT baslik, hta, renk, kalin, ziplat FROM haber WHERE aktif = \'1\' AND onay = \'1\' AND tarih <= \'' . date( 'Y-m-d H:i:s' ) . ( '' . '\' AND tarih > DATE_SUB(CURDATE(),INTERVAL 1 MONTH) AND yorum NOT IN(0) ORDER BY yorum DESC LIMIT ' . $limit ) );
- if (!$q) {
- return false;
- }
- foreach ($q as $row) {
- $baslik = baslik_stili( $row['renk'], $row['kalin'], $row['ziplat'], word_limiter( $row['baslik'], 5 ) );
- echo ' <li><a href="' . URL . $row['hta'] . '.htm">' . $baslik . '</a></li>
- ';
- }
- }
- function ozelhaber($limit) {
- global $db;
- global $url;
- $bugun = date( 'Y-m-d' );
- $q = $db->getir( '' . 'SELECT id, baslik, hta, renk, kalin, ziplat FROM haber WHERE ozelhaber = \'1\' AND aktif = \'1\' AND onay = \'1\' ORDER BY id DESC LIMIT ' . $limit );
- if ($q) {
- $row_n = array( );
- foreach ($q as $row) {
- $link = $url . $row['hta'] . '-h' . $row['id'] . '.html';
- $row['baslik'] = baslik_stili( $row['renk'], $row['kalin'], $row['ziplat'], limitle( $row['baslik'], 0, 70 ) );
- $row['hta'] = $link;
- $row_n[] = $row;
- }
- return $row_n;
- }
- }
- function ilancat() {
- global $db;
- global $ayar;
- global $url;
- $q = $db->getir( 'SELECT id, baslik, hta FROM ilankat WHERE parent=\'0\' AND aktif = \'1\' ORDER BY sira' );
- if ($q) {
- foreach ($q as $row) {
- echo '<div id="ilancat" class="esitle">
- ';
- echo '<a href="' . $ayar['url'] . 'seri-ilanlar/' . $row['hta'] . '-ilanlari" class="baslik">' . $row['baslik'] . '</a>';
- $q2 = $db->getir( 'SELECT id, baslik, hta FROM ilankat WHERE parent=\'' . $row['id'] . '\' AND aktif = \'1\' ORDER BY baslik' );
- if ($q2) {
- foreach ($q2 as $row2) {
- $ilansayisi = $db->sayac( 'ilanlar', '(catid=\'' . $row2['id'] . '\' and aktif=\'1\' and onay = \'1\' AND yayin=\'0000-00-00\') OR (catid=\'' . $row2['id'] . '\' and aktif=\'1\' and onay = \'1\' AND yayin>= \'' . date( 'Y-m-d H:i:s' ) . '\') ' );
- echo '<a href="' . $url . 'seri-ilanlar/' . $row2['hta'] . '-ilanlari">' . $row2['baslik'] . ' <i>(' . $ilansayisi . ')</i></a>';
- }
- }
- echo '</div>
- ';
- }
- }
- }
- function sonilan_home($limit) {
- global $db;
- global $ayar;
- global $url;
- $q = $db->getir( 'SELECT baslik, resim, hta, fiyat, (SELECT adsoyad FROM uyeler WHERE ilanlar.uid=uyeler.id LIMIT 1) as adsoyad FROM ilanlar WHERE aktif = \'1\' AND onay = \'1\' AND yayin >= \'' . date( 'Y-m-d H:i:s' ) . ( '' . '\' ORDER BY id DESC LIMIT ' . $limit ) );
- if ($q) {
- foreach ($q as $row) {
- if (( $row['resim'] === '' || !file_exists( $ayar['url'] . 'images/ilanlar/thumbs/' . $row['resim'] . '' ) )) {
- $resim = '' . ayar( 'url' ) . '/images/ilanlar/resimyok.jpg';
- } else {
- $resim = '' . ayar( 'url' ) . '/images/ilanlar/thumbs/' . $row['resim'] . '';
- }
- echo '<div class="ilanlar">
- ';
- echo '<a href="' . $url . 'seri-ilanlar/' . $row['hta'] . '">
- ';
- echo '<img src="' . $resim . '" width="55" border="0"/>';
- echo '<b>' . $row['baslik'] . '</b><br>
- ';
- if ($row['fiyat'] != 0) {
- echo 'Fiyat: ' . $row['fiyat'] . ' TL<br>';
- }
- if ($row['uid'] != 0) {
- echo 'Ekleyen: ' . $row['adsoyad'] . '<br>';
- }
- echo '</a>
- ';
- echo '</div>
- ';
- }
- }
- }
- function sektorler() {
- global $db;
- global $ayar;
- global $url;
- $q = $db->getir( 'SELECT id, baslik, hta FROM firmakat WHERE parent=\'0\' AND aktif = \'1\' ORDER BY sira' );
- if ($q) {
- foreach ($q as $row) {
- echo '<div id="ilancat" class="esitle">
- ';
- echo '<a href="' . $url . 'firma-rehberi/' . $row['hta'] . '-firmalari" class="baslik">' . $row['baslik'] . '</a>';
- $q2 = $db->getir( 'SELECT id, baslik, hta FROM firmakat WHERE parent=\'' . $row['id'] . '\' AND aktif = \'1\' ORDER BY baslik' );
- if ($q2) {
- foreach ($q2 as $row2) {
- $firmasayisi = $db->sayac( 'firmalar', 'catid=\'' . $row2['id'] . '\' and aktif=\'1\'' );
- echo '<a href="' . $ayar['url'] . 'firma-rehberi/' . $row2['hta'] . '-firmalari">' . $row2['baslik'] . ' <i>(' . $firmasayisi . ')</i></a>';
- }
- }
- echo '</div>
- ';
- }
- }
- }
- function anamanset($limit, $sayfa) {
- global $db;
- global $ayar;
- global $seo_id;
- global $temam;
- if ($ayar['haber_siralama']) {
- $order = 'sira DESC';
- } else {
- $order = 'tarih DESC';
- }
- if ($ayar['manset_tipi'] === 'numarali') {
- $numarali = TRUE;
- $sql_limit = $limit . ', 9';
- } else {
- $numarali = FALSE;
- $sql_limit = 10;
- }
- $q = $db->getir( '' . 'SELECT id, baslik, spot, resim, hta, sdakika_flash, video, iliski_album, iliski_video FROM haber WHERE aktif = \'1\' AND fmanset = \'1\' AND onay = \'1\' ORDER BY ' . $order . ' LIMIT ' . $sql_limit );
- if (!$q) {
- return false;
- }
- return $q;
- }
- function anamanset_nav() {
- $row = array( );
- $i = 1;
- while ($i <= 10) {
- if ($i === 1) {
- $row[$i]['a'] = 0;
- $row[$i]['class'] = ' page_current';
- } else {
- if ($i === 2) {
- $row[$i]['a'] = 9;
- $row[$i]['class'] = '';
- } else {
- if (2 < $i) {
- $row[$i]['a'] = 9 * $i;
- $row[$i]['class'] = '';
- }
- }
- }
- ++$i;
- }
- return $row;
- }
- function gencyazar_sayi() {
- global $db;
- $sq = $db->sorgu( '
- SELECT id,
- (SELECT COUNT(*) FROM makaleler WHERE makaleler.yid=yazarlar.id AND makaleler.aktif=\'1\') as sayi
- FROM yazarlar
- WHERE aktif = \'1\' AND yazartipi=\'6\'
- ' );
- $sayi = array( );
- while ($r = $db->assoc( $sq )) {
- if ($r['sayi']) {
- $sayi[] = $r['sayi'];
- continue;
- }
- }
- return $sayi;
- }
- function sayfalarcat_block() {
- global $db;
- $q = $db->getir( 'SELECT id, baslik, hta FROM icerik_icerik WHERE aktif = \'1\' ORDER BY sira' );
- if (!$q) {
- return false;
- }
- return $q;
- }
- function sayfalar() {
- global $db;
- global $url;
- $q = $db->getir( 'SELECT baslik, id,hta, (SELECT COUNT(id) FROM icerik_icerik WHERE icerik_icerik.catid=icerik_menu.id AND aktif = \'1\') AS kayit FROM icerik_menu WHERE aktif = \'1\' AND id !=\'1\' ORDER BY sira' );
- if (!$q) {
- return false;
- }
- foreach ($q as $row) {
- echo '<div id="ilanpart">
- ';
- echo '<a href="' . $url . $row['hta'] . '-sk' . $row['id'] . '.html">
- ';
- echo '<b>' . $row['baslik'];
- if ($row['kayit']) {
- echo ' (' . $row['kayit'] . ')';
- }
- echo '</b>
- ';
- echo '</a>
- ';
- echo '</div>
- ';
- }
- }
- function sayfa($sayfa_id = false, $limit = false) {
- global $db;
- $where = '';
- if ($sayfa_id) {
- $where = ' AND id NOT IN(' . $sayfa_id . ')';
- }
- $q = $db->getir( '' . 'SELECT id, baslik, hta FROM icerik_icerik WHERE aktif = \'1\' ' . $where . ' ORDER BY sira' );
- if (!$q) {
- return false;
- }
- return $q;
- }
- function linkler($limit) {
- global $db;
- $q = $db->getir( 'SELECT baslik, url FROM linkler WHERE aktif = \'1\' ORDER BY baslik' );
- if (!$q) {
- return false;
- }
- foreach ($q as $row) {
- echo ' <li><a href="' . $row['url'] . '" target="_blank">' . $row['baslik'] . '</a></li>';
- }
- }
- function zamanonce($d) {
- $ts = time( ) - strtotime( str_replace( '-', '/', $d ) );
- if (31536000 < $ts) {
- $val = round( $ts / 31536000, 0 ) . ' yıl';
- } else {
- if (2419200 < $ts) {
- $val = round( $ts / 2419200, 0 ) . ' ay';
- } else {
- if (604800 < $ts) {
- $val = round( $ts / 604800, 0 ) . ' hafta';
- } else {
- if (86400 < $ts) {
- $val = round( $ts / 86400, 0 ) . ' gün';
- } else {
- if (3600 < $ts) {
- $val = round( $ts / 3600, 0 ) . ' saat';
- } else {
- if (60 < $ts) {
- $val = round( $ts / 60, 0 ) . ' dakika';
- } else {
- $val = $ts . ' saniye';
- }
- }
- }
- }
- }
- }
- return $val;
- }
- function zamansonra(&$future) {
- $future = strtotime( $future );
- $periods = array( array( 60 * 60 * 24 * 365, 'yıl' ), array( 60 * 60 * 24 * 30, 'ay' ), array( 60 * 60 * 24 * 7, 'hafta' ), array( 60 * 60 * 24, 'gün' ), array( 60 * 60, 'saat' ), array( 60, 'dakika' ) );
- $today = time( );
- $since = $future - $today;
- $countx = sizeof( $periods );
- $i = 0;
- $j = $countx;
- while ($i < $j) {
- $seconds = $periods[$i][0];
- $name = $periods[$i][1];
- if ($count = floor( $since / $seconds ) != 0) {
- break;
- }
- ++$i;
- }
- $print = ($count == 1 ? '1 ' . $name : '' . $count . ' ' . $name);
- if ($i + 1 < $j) {
- $seconds2 = $periods[$i + 1][0];
- $name2 = $periods[$i + 1][1];
- if ($count2 = floor( ( $since - $seconds * $count ) / $seconds2 ) != 0) {
- $print .= ($count2 == 1 ? ', 1 ' . $name2 : '' . ', ' . $count2 . ' ' . $name2);
- }
- }
- return $print;
- }
- function sd_tum($limit) {
- global $db;
- global $url;
- $q = $db->getir( 'SELECT id, hta, baslik FROM haberkat WHERE aktif = \'1\' ORDER BY sira' );
- if (!$q) {
- return false;
- }
- foreach ($q as $row) {
- echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" id="sd_table">
- <tr>
- <th>' . $row['baslik'] . '</th>
- </tr>';
- $q2 = $db->getir( 'SELECT hta, baslik, tarih FROM haber WHERE aktif = \'1\' AND onay = \'1\' and catid = \'' . $row['id'] . ( '' . '\' ORDER BY tarih DESC LIMIT ' . $limit ) );
- foreach ($q2 as $row2) {
- echo ' <tr>
- <td>' . $row2['tarih'] . '<a href="' . $url . $row2['hta'] . '.htm">' . $row2['baslik'] . '</a></td>
- </tr>
- <tr>';
- }
- echo '<td><a href="' . URL . $row['hta'] . '" style="float:right;">Bu kategorideki diğer haberler</a></td>
- </tr>
- </table>
- <br />
- ';
- }
- }
- function arsiv() {
- global $db;
- global $url;
- $gun = $_POST['gun'];
- $ay = $_POST['ay'];
- $yil = $_POST['yil'];
- $tarih = $yil . '-' . $ay . '-' . $gun;
- $q = $db->getir( '' . 'SELECT id, hta, baslik, (SELECT COUNT(*) FROM haber WHERE haber.catid=haberkat.id AND DATE_FORMAT(tarih,\'%Y-%m-%d\') = \'' . $tarih . '\') as toplamhaber FROM haberkat WHERE aktif = \'1\' AND parent = \'0\' ORDER BY sira' );
- if (!$q) {
- return false;
- }
- foreach ($q as $row) {
- if ($row['toplamhaber']) {
- echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" id="sd_table">
- <tr>
- <th>' . $row['baslik'] . '</th>
- </tr>';
- $q2 = $db->getir( 'SELECT id, hta, baslik, tarih FROM haber WHERE aktif = \'1\' and catid = \'' . $row['id'] . ( '' . '\' AND onay = \'1\' and DATE_FORMAT(tarih,\'%Y-%m-%d\') = \'' . $tarih . '\' ORDER BY tarih DESC' ) );
- foreach ($q2 as $row2) {
- echo ' <tr>
- <td>' . saat( $row2['tarih'] ) . '<a href="' . $url . $row2['hta'] . '-h' . $row2['id'] . '.html">' . $row2['baslik'] . '</a></td>
- </tr>
- <tr>';
- }
- echo '<td><a href="' . $url . $row['hta'] . '" style="float:right;">Bu kategorideki diğer haberler</a></td>
- </tr>
- </table>
- <br />
- ';
- continue;
- }
- $yok = 1;
- }
- }
- function arama($limit, $offset) {
- global $db;
- global $url;
- $arasana = temizle( $_POST['arasana'] );
- $aradim = temizle( $_POST['aradim'] );
- if (isset( $_GET['kelime'] )) {
- $arasana = $kelime = temizle( $_GET['kelime'] );
- }
- echo $arasana;
- $q = $db->getir( 'SELECT
- h.hta, h.baslik, DATE_FORMAT(h.tarih, \'%d.%m.%Y, %H:%i\') tarih
- FROM haber h
- WHERE h.aktif = \'1\' AND (h.baslik LIKE \'%' . $arasana . '%\') OR (h.keywords LIKE \'%' . $arasana . ( '' . '%\')
- ORDER BY h.tarih DESC
- LIMIT ' . $limit . ', ' . $offset . '
- ' ) );
- if ($q) {
- echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" id="sd_table">
- <tr>
- <th colspan="2">Arama Sonuçları (' . $s . ' sonuç)</th>
- </tr>';
- while ($row = $db->assoc( $q )) {
- echo ' <tr>
- <td><a href="' . $url . $row['hta'] . '.htm">' . $row['baslik'] . '</a></td><td align="right">' . $row['tarih'] . '</td>
- </tr>
- <tr>';
- }
- echo '
- </tr>
- </table>
- <br />
- ';
- return null;
- }
- echo 'Bir sonuç bulunamadı!';
- }
- ....................................................
- ..........................
- ..............
Add Comment
Please, Sign In to add comment