Guest User

Untitled

a guest
Jul 8th, 2012
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.59 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function ayar($alan) {
  15. global $ayar;
  16.  
  17. return $ayar[$alan];
  18. }
  19.  
  20. function getPagingQuery($sql, $itemPerPage = 10) {
  21. if (( isset( $_GET['page'] ) && 0 < (int)$_GET['page'] )) {
  22. $page = (int)$_GET['page'];
  23. } else {
  24. $page = 1;
  25. }
  26.  
  27. $offset = ( $page - 1 ) * $itemPerPage;
  28. return $sql . ( '' . ' LIMIT ' . $offset . ', ' . $itemPerPage );
  29. }
  30.  
  31. function getPagingLink($sql, $itemPerPage = 10, $strGet = '', $sayfa, $son = false, $seo = false) {
  32. global $db;
  33.  
  34. $result = $db->sorgu( $sql );
  35. $pagingLink = '';
  36. $totalResults = $db->say( $result );
  37. $totalPages = ceil( $totalResults / $itemPerPage );
  38. $numLinks = 10;
  39.  
  40. if ($strGet) {
  41. if ($seo) {
  42. $strGet = '-' . $strGet;
  43. } else {
  44. $strGet = '&' . $strGet;
  45. }
  46. }
  47.  
  48.  
  49. if (1 < $totalPages) {
  50. if ($seo === false) {
  51. if (isset( $_GET[$sayfa] )) {
  52. $self = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
  53. $self .= '?' . $sayfa . '=' . $_GET[$sayfa] . '';
  54. } else {
  55. $self = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
  56. }
  57. } else {
  58. if (isset( $_GET[$sayfa] )) {
  59. $self = '' . $_GET[$sayfa] . '';
  60. }
  61. }
  62.  
  63.  
  64. if (( isset( $_GET['page'] ) && 0 < (int)$_GET['page'] )) {
  65. $pageNumber = (int)$_GET['page'];
  66. } else {
  67. $pageNumber = 1;
  68. }
  69.  
  70.  
  71. if ($_GET['page'] == 'r') {
  72. $pageNumber = 'r';
  73. }
  74.  
  75.  
  76. if (1 < $pageNumber) {
  77. $page = $pageNumber - 1;
  78.  
  79. if (1 < $page) {
  80. if ($seo != false) {
  81. $prev = '' . ' <a class="page_previous" href="' . $self . '-p' . $page . $strGet . '.html' . $son . '"><b>«</b></a> ';
  82. } else {
  83. $prev = '' . ' <a class="page_previous" href="' . $self . '&page=' . $page . $strGet . $son . '"><b>«</b></a> ';
  84. }
  85. } else {
  86. if ($seo != false) {
  87. $prev = '' . ' <a class="page_previous" href="' . $self . '-p' . $page . $strGet . '.html' . $son . '"><b>«</b></a> ';
  88. } else {
  89. $prev = '' . ' <a class="page_previous" href="' . $self . '&page=' . $page . $strGet . $son . '"><b>«</b></a> ';
  90. }
  91. }
  92. } else {
  93. $prev = '';
  94. $first = '';
  95. }
  96.  
  97.  
  98. if ($pageNumber < $totalPages) {
  99. $page = $pageNumber + 1;
  100.  
  101. if ($seo != false) {
  102. $next = '' . ' <a class="page_next" href="' . $self . '-p' . $page . $strGet . '.html' . $son . '"><b>»</b></a> ';
  103. } else {
  104. $next = '' . ' <a class="page_next" href="' . $self . '&page=' . $page . $strGet . $son . '"><b>»</b></a> ';
  105. }
  106. } else {
  107. $next = '';
  108. $last = '';
  109. }
  110.  
  111. $start = $pageNumber - $pageNumber % $numLinks + 1;
  112. $end = $start + $numLinks - 1;
  113. $end = min( $totalPages, $end );
  114. $pagingLink = array( );
  115. $page = $start;
  116.  
  117. while ($page <= $end) {
  118. if (( $page == $pageNumber && $pageNumber != 'r' )) {
  119. $pagingLink[] = '' . ' <a class="page_current">' . $pageNumber . '</a> ';
  120. } else {
  121. if ($page == 1) {
  122. if ($seo != false) {
  123. $pagingLink[] = '' . ' <a href="' . $self . '-p' . $page . $strGet . '.html' . $son . '">' . $page . '</a> ';
  124. } else {
  125. $pagingLink[] = '' . ' <a href="' . $self . '&' . $strGet . $son . '">' . $page . '</a> ';
  126. }
  127. } else {
  128. if ($seo != false) {
  129. $pagingLink[] = '' . ' <a href="' . $self . '-p' . $page . $strGet . '.html' . $son . '">' . $page . '</a> ';
  130. } else {
  131. $pagingLink[] = '' . ' <a href="' . $self . '&page=' . $page . $strGet . $son . '">' . $page . '</a> ';
  132. }
  133. }
  134. }
  135.  
  136.  
  137. if (( ( ( isset( $_GET['m'] ) && $_GET['m'] === 'album' ) && $page == 2 ) && banner( 34 ) )) {
  138. if ($_GET['page'] === 'r') {
  139. $pagingLink[] = '' . ' <a class="page_current" href="' . $self . '-pr' . $strGet . '-Reklam.html' . $son . '">R</a> ';
  140. } else {
  141. $pagingLink[] = '' . ' <a href="' . $self . '-pr' . $strGet . '-Reklam.html' . $son . '">R</a> ';
  142. }
  143. }
  144.  
  145. ++$page;
  146. }
  147.  
  148. $pagingLink = implode( '', $pagingLink );
  149. $pagingLink = $first . $prev . $pagingLink . $next . $last;
  150. }
  151.  
  152. return $pagingLink;
  153. }
  154.  
  155. function smtp_gonder($gonderici_adi, $gonderici_mail, $to, $konu, $message) {
  156. global $ayar;
  157. global $library_folder;
  158.  
  159. include( $library_folder . 'Smtp.php' );
  160. $smtp = new SMTP( $ayar['smtp_host'], 587, $ayar['smtp_user'], base64( $ayar['smtp_pass'], true ) );
  161.  
  162. if ($smtp->sendMail( $gonderici_adi, $gonderici_mail, $to, $konu, $message )) {
  163. return TRUE;
  164. }
  165.  
  166. unset( $smtp );
  167. }
  168.  
  169. function mail_gonder($gmail, $gadsoy, $gonmail, $konu, $mesaj) {
  170. $headers = 'MIME-Version: 1.0
  171. ';
  172. $headers .= 'Content-type: text/html; charset=iso-8859-9
  173. ';
  174. $headers .= 'X-Mailer: PHP
  175. ';
  176. $headers .= 'X-Sender: PHP
  177. ';
  178. $headers .= '' . 'From: ' . $gadsoy . '<' . $gonmail . '>
  179. ';
  180. $headers .= '' . 'Reply-To: ' . $gadsoy . '<' . $gonmail . '>
  181. ';
  182. $headers .= '' . 'Return-Path: ' . $godsoy . '<' . $gonmail . '>
  183. ';
  184. @mail( $gmail, $konu, $mesaj, $headers );
  185. }
  186.  
  187. function change_title($new_title) {
  188. $output = ob_get_contents( );
  189. ob_end_clean( );
  190. $output = preg_replace( '/<title>(.*?)<\/title>/', '' . '<title>' . $new_title . '</title>', $output );
  191. echo $output;
  192. }
  193.  
  194. function dynamic_meta($desc, $key, $title = false, $url = false, &$image = false) {
  195. $output = ob_get_contents( );
  196. ob_end_clean( );
  197. $description = tirnaksil( $desc );
  198. $keywords = tirnaksil( character_limiter( $key, 160 ) );
  199. $output = preg_replace( '/<title>(.*?)<\/title>/', '<title>' . $title . ' - ' . ayar( 'siteadi' ) . '</title>', $output );
  200. $output = preg_replace( '/<meta\s+name="description.*?>/si', '<meta name="description" content="' . $description . '" />', $output );
  201. $output = preg_replace( '/<meta\s+name="keywords.*?>/si', '<meta name="keywords" content="' . $keywords . '" />', $output );
  202. $output = preg_replace( '/<meta\s+property="og:title.*?>/si', '<meta property="og:title" content="' . tirnaksil( $title ) . '" />', $output );
  203. $output = preg_replace( '/<meta\s+property="og:url.*?>/si', '<meta property="og:url" content="' . $url . '" />', $output );
  204. $output = preg_replace( '/<meta\s+property="og:description.*?>/si', '<meta property="og:description" content="' . tirnaksil( $description ) . '" />', $output );
  205. $output = preg_replace( '/<meta\s+property="og:image.*?>/si', '<meta property="og:image" content="' . $image . '" />', $output );
  206. $output = preg_replace( '/<meta\s+property="fb:image.*?>/si', '<meta property="fb:image" content="' . $image . '" />', $output );
  207. $output = preg_replace( '/<link\s+rel="image_src.*?>/si', '<link rel="image_src" href="' . $image . '" />', $output );
  208. echo $output;
  209. }
  210.  
  211. function keywords_insert($keywords, $detailKeywords = FALSE) {
  212. $keywords = trim( $keywords );
  213. $keywords = preg_replace( '/\s\s+/', ' ', $keywords );
  214.  
  215. if ($detailKeywords === TRUE) {
  216. $keywords = str_replace( '.', '', $keywords );
  217. $keywords = str_replace( '-', '', $keywords );
  218. $keywords = str_replace( '_', '', $keywords );
  219. $keywords = str_replace( ':', '', $keywords );
  220. }
  221.  
  222. $keywords = str_replace( ',', '', $keywords );
  223. $keywords = str_replace( '/', '', $keywords );
  224. $keywords = str_replace( '\'', '', $keywords );
  225. $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', '!', '.', '?', '=', '-' );
  226. $words = explode( ' ', $keywords );
  227.  
  228. if (is_array( $words )) {
  229. $i = 0;
  230.  
  231. while ($i < sizeof( $words )) {
  232. if (in_array( $words[$i], $stop_words )) {
  233. unset( $words[$i] );
  234. }
  235.  
  236.  
  237. if (( $detailKeywords === TRUE && is_numeric( $words[$i] ) )) {
  238. unset( $words[$i] );
  239. }
  240.  
  241. ++$i;
  242. }
  243.  
  244. foreach ($words as $word) {
  245. $export[] = $word;
  246. }
  247. }
  248.  
  249.  
  250. if ($detailKeywords === TRUE) {
  251. return $export;
  252. }
  253.  
  254. $i = 0;
  255. $keys = '';
  256. foreach ($export as $key) {
  257. if (0 < $i) {
  258. $keys .= ', ';
  259. }
  260.  
  261. $keys .= $key;
  262. ++$i;
  263. }
  264.  
  265. return $keys;
  266. }
  267.  
  268. function keywords2link($detail, $keywords = array( )) {
  269. global $ayar;
  270.  
  271. if (is_array( $keywords )) {
  272. foreach ($keywords as $key) {
  273. $in_keys = '/' . $key . '/';
  274. $in[] = $in_keys;
  275. $out_keys = '<a href="' . $ayar['url'] . 'haberleri/' . urlencode( $key ) . '" title="' . $key . '" class="klink">' . $key . '</a>';
  276. $explode_key = explode( ' ', $key );
  277.  
  278. if ($explode_key) {
  279. foreach ($explode_key as $ek) {
  280. if (preg_match( '' . '#' . $ek . '#', $ayar['url'] )) {
  281. $out_keys = $key;
  282. continue;
  283. }
  284. }
  285. }
  286.  
  287. $out[] = $out_keys;
  288. }
  289. }
  290.  
  291. return preg_replace( $in, $out, $detail );
  292. }
  293.  
  294. function word_limiter($str, $limit = 100, $end_char = '...') {
  295. if (trim( $str ) == '') {
  296. return $str;
  297. }
  298.  
  299. preg_match( '/^\s*+(?:\S++\s*+){1,' . (int)$limit . '}/', $str, $matches );
  300.  
  301. if (strlen( $str ) == strlen( $matches[0] )) {
  302. $end_char = '';
  303. }
  304.  
  305. return rtrim( $matches[0] ) . $end_char;
  306. }
  307.  
  308. function character_limiter($str, $n = 500, $end_char = '...') {
  309. if (strlen( $str ) < $n) {
  310. return $str;
  311. }
  312.  
  313. $str = preg_replace( '/\s+/', ' ', str_replace( array( '
  314. ', '
  315. ', '
  316. ' ), ' ', $str ) );
  317.  
  318. if (strlen( $str ) <= $n) {
  319. return $str;
  320. }
  321.  
  322. $out = '';
  323. foreach (explode( ' ', trim( $str ) ) as $val) {
  324. $out .= $val . ' ';
  325.  
  326. if ($n <= strlen( $out )) {
  327. $out = trim( $out );
  328. return (strlen( $out ) == strlen( $str ) ? $out : $out . $end_char);
  329. }
  330. }
  331.  
  332. }
  333.  
  334. function tarih($tarih) {
  335. list( $yil, $ay, $gun ) = preg_split( '/[-\:\/ ]/', $tarih );
  336. $tarih = '' . $gun . '.' . $ay . '.' . $yil;
  337. return $tarih;
  338. }
  339.  
  340. function tarihsaat($tarih) {
  341. list( $yil, $ay, $gun, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
  342. $tarih = '' . $gun . '.' . $ay . '.' . $yil . ' ' . $saat . ':' . $dakika . ':' . $saniye;
  343. return $tarih;
  344. }
  345.  
  346. function tarihymd($tarih) {
  347. list( $yil, $ay, $gun, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
  348. $tarih = '' . $yil . '-' . $ay . '-' . $gun;
  349. return $tarih;
  350. }
  351.  
  352. function saat($tarih) {
  353. list( $yil, $ay, $gun, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
  354. return $tarih = '' . $saat . ':' . $dakika;
  355. }
  356.  
  357. function tarihsaat2($tarih) {
  358. list( $yil, $ay, $gun, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
  359. $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' );
  360. $tarih = '' . $gun . ' ' . $aylar[$ay] . ' ' . $yil . ', ' . $saat . ':' . $dakika;
  361. return $tarih;
  362. }
  363.  
  364. function tarihsaat3($tarih, $saat_gizle = FALSE) {
  365. list( $yil, $ay, $gun, $gunadi, $saat, $dakika, $saniye ) = preg_split( '/[-\:\/ ]/', $tarih );
  366. $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' );
  367. $gunler = array( 'Monday' => 'Pazartesi', 'Tuesday' => 'Salı', 'Wednesday' => 'Çarşamba', 'Thursday' => 'Perşembe', 'Friday' => 'Cuma', 'Saturday' => 'Cumartesi', 'Sunday' => 'Pazar' );
  368.  
  369. if ($gunler[$gunadi] != '') {
  370. $tarih = '' . $gun . ' ' . $aylar[$ay] . ' ' . $yil . ' ' . $gunler[$gunadi];
  371. } else {
  372. $tarih = '' . $gun . ' ' . $aylar[$ay] . ' ' . $yil;
  373. }
  374.  
  375.  
  376. if ($saat_gizle === FALSE) {
  377. if (( $saat && $dakika )) {
  378. $tarih .= ' ' . $saat . ':' . $dakika;
  379. }
  380. }
  381.  
  382. return $tarih;
  383. }
  384.  
  385. function gunler($gun) {
  386. $gunler = array( 'Monday' => 'Pazartesi', 'Tuesday' => 'Salı', 'Wednesday' => 'Çarşamba', 'Thursday' => 'Perşembe', 'Friday' => 'Cuma', 'Saturday' => 'Cumartesi', 'Sunday' => 'Pazar' );
  387. return $gunler[$gun];
  388. }
  389.  
  390. function utf82ascii($string) {
  391. $patterns[0] = '/Å' . chr( 158 ) . '/';
  392. $patterns[1] = '/ÅŸ/';
  393. $patterns[2] = '/Ä°/';
  394. $patterns[3] = '/ı/';
  395. $patterns[4] = '/Ä' . chr( 158 ) . '/';
  396. $patterns[5] = '/ÄŸ/';
  397. $patterns[6] = '/Ü/';
  398. $patterns[7] = '/ü/';
  399. $patterns[8] = '/Ö/';
  400. $patterns[9] = '/ö/';
  401. $patterns[10] = '/Ç/';
  402. $patterns[11] = '/ç/';
  403. $replacements[0] = 'Ş';
  404. $replacements[1] = 'ş';
  405. $replacements[2] = 'İ';
  406. $replacements[3] = 'ı';
  407. $replacements[4] = 'Ğ';
  408. $replacements[5] = 'ğ';
  409. $replacements[6] = 'Ü';
  410. $replacements[7] = 'ü';
  411. $replacements[8] = 'Ö';
  412. $replacements[9] = 'ö';
  413. $replacements[10] = 'Ç';
  414. $replacements[11] = 'ç';
  415. return preg_replace( $patterns, $replacements, $string );
  416. }
  417.  
  418. function suz($veri) {
  419. $habunu_bul = array( 'İ', 'Ş', ' ', 'Ü', 'Ç', 'Ğ', 'Ö', 'ı', 'ş', 'ü', 'ç', 'ğ', 'ö', '&#305;', '&#287;', '&#231;', '&#246;', '&#351;', '&#252;', '&#199;', '&#220;', '&#304;', '&#214;', '&#350;' );
  420. $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' );
  421. $veri = strtolower( str_replace( $habunu_bul, $habunu_yaz, $veri ) );
  422. $veri = str_replace( ' ', '-', $veri );
  423. $veri = str_replace( '\'', '', $veri );
  424. $veri = str_replace( '’', '', $veri );
  425. $veri = str_replace( '.', '', $veri );
  426. $veri = str_replace( '(', '', $veri );
  427. $veri = str_replace( ')', '', $veri );
  428. $veri = str_replace( '[', '', $veri );
  429. $veri = str_replace( '"', '', $veri );
  430. $veri = str_replace( '\\', '', $veri );
  431. $veri = str_replace( ']', '', $veri );
  432. $veri = str_replace( '&quot', '', $veri );
  433. $veri = str_replace( ':', '', $veri );
  434. $veri = str_replace( ';', '', $veri );
  435. $veri = str_replace( ',', '', $veri );
  436. $veri = str_replace( '&', '', $veri );
  437. $veri = str_replace( '&amp', '', $veri );
  438. $veri = str_replace( '*', '', $veri );
  439. $veri = str_replace( '%', '', $veri );
  440. $veri = str_replace( '/', '', $veri );
  441. $veri = str_replace( '+', '', $veri );
  442. $veri = str_replace( ( '' . '$' ), '', $veri );
  443. $veri = str_replace( '#', '', $veri );
  444. $veri = str_replace( '!', '', $veri );
  445. $veri = str_replace( '?', '', $veri );
  446. $veri = str_replace( '’', '', $veri );
  447. $veri = str_replace( '<', '', $veri );
  448. $veri = str_replace( '>', '', $veri );
  449. $veri = str_replace( '|', '', $veri );
  450. $veri = str_replace( '', '', $veri );
  451. $veri = str_replace( '=', '', $veri );
  452. $veri = str_replace( 'font-color', '', $veri );
  453. $veri = str_replace( 'font', '', $veri );
  454. $veri = str_replace( 'ff0000', '', $veri );
  455. $veri = str_replace( '0000ff', '', $veri );
  456. $veri = str_replace( 'blink', '', $veri );
  457. return $veri;
  458. }
  459.  
  460. function linkyap($veri, $ek, $id) {
  461. $suz = suz( $veri );
  462.  
  463. if ($ek === false) {
  464. $ayrac = '';
  465. $uzanti = '';
  466. $ek = '';
  467. $uzanti = '';
  468. $veri = '' . $id . '-' . $suz . '';
  469. } else {
  470. $ayrac = '-';
  471. $id = $id;
  472. $ek = $ek;
  473. $uzanti = '.html';
  474. $veri = '' . $suz . '' . $ayrac . '' . $ek . ',' . $id . '' . $uzanti . '';
  475. }
  476.  
  477. return $veri;
  478. }
  479.  
  480. function islembutonlari() {
  481. global $d;
  482. global $row;
  483.  
  484. echo '<input type="submit" name="save" id="save" value="Kaydet - Güncelle"/>
  485. ';
  486.  
  487. if (isset( $_GET['ID'] )) {
  488. echo '<input name="sil_buton" type="submit" value="Sil" id="sil_buton" onclick="return onay(\'' . $row['baslik'] . '\')"/>
  489. ';
  490. }
  491.  
  492. echo '<input name="geri_don" type="button" value="Geri Dön" onclick="git(\'?file=' . $d . '\');"/>
  493. ';
  494. }
  495.  
  496. function yukle($input, &$yol) {
  497. $izinli = array( 'swf', 'SWF', 'jpg', 'JPG', 'gif', 'GIF' );
  498. $dosya = $_FILES[$input];
  499. $yeni_isim = trim( strtolower( stripslashes( strtr( $dosya['name'], 'ÜŞÇİĞÖüöşçiğı?', 'USCIGOuoscigi_' ) ) ) );
  500. $yeni_isim = str_replace( ' ', '_', $yeni_isim );
  501.  
  502. if (file_exists( '' . $yol . '/' . $yeni_isim . '' )) {
  503. $dagit = explode( '.', $yeni_isim );
  504. $ismi = $dagit[0];
  505. $uzan = $dagit[1];
  506. $rast = rand( 1, 100000 );
  507. $yeni_isim = '' . $ismi . '_' . $rast . '.' . $uzan . '';
  508. $yeni_isim = strtolower( $yeni_isim );
  509. }
  510.  
  511. $uzanti = substr( $yeni_isim, 0 - 3, 3 );
  512.  
  513. if (( in_array( $uzanti, $izinli ) && $input )) {
  514. list( $width, $height, $type, $attr ) = getimagesize( $dosya['tmp_name'] );
  515. $resim_url = '' . $yol . '/' . $yeni_isim;
  516. $gonder = @move_uploaded_file( $dosya['tmp_name'], $resim_url );
  517. chmod( '' . $resim_url, 420 );
  518. } else {
  519. hata( 'Dosya Formatı Geçersiz' );
  520. }
  521.  
  522. return $yeni_isim;
  523. }
  524.  
  525. function limitle($Text, $Min, $Max) {
  526. if (strlen( $Text ) < $Min) {
  527. $Limit = $Min - strlen( $Text );
  528. } else {
  529. if ($Max <= strlen( $Text )) {
  530. $words = explode( ' ', $Text );
  531. $check = 1;
  532.  
  533. while ($Max <= strlen( $Text )) {
  534. $c = count( $words ) - $check;
  535. $Text = substr( $Text, 0, ( strlen( $words[$c] ) + 1 ) * ( 0 - 1 ) );
  536. ++$check;
  537. }
  538. }
  539. }
  540.  
  541. return $Text;
  542. }
  543.  
  544. function tirnaksil($veri, $special_chars = TRUE) {
  545. return ($special_chars === TRUE ? trim( htmlspecialchars( strip_tags( $veri ) ) ) : trim( str_replace( $sil, '', $veri ) ));
  546. }
  547.  
  548. function editor($input, $row, $w, $h) {
  549. global $ayar;
  550. global $system_dir;
  551.  
  552. $oFCKeditor = new FCKeditor( $input );
  553. $oFCKeditor->Config['CustomConfigurationsPath'] = 'myconfig.js';
  554. $oFCKeditor->Config['ProcessHTMLEntities'] = 'false';
  555. $oFCKeditor->Config['IncludeLatinEntities'] = 'false';
  556. $oFCKeditor->Config['IncludeGreekEntities'] = 'false';
  557. $oFCKeditor->Config['IgnoreEmptyParagraphValue'] = 'true';
  558. $oFCKeditor->Config['FillEmptyBlocks'] = 'false';
  559. $oFCKeditor->Config['EnterMode'] = 'br';
  560. $oFCKeditor->BasePath = $ayar['url'] . 'FCKeditor/';
  561. $oFCKeditor->Value = $row;
  562. $oFCKeditor->Width = $w;
  563. $oFCKeditor->Height = $h;
  564. $oFCKeditor->Create( );
  565. }
  566.  
  567. function editor2($input, $row, $w, $h) {
  568. global $ayar;
  569. global $system_dir;
  570.  
  571. $oFCKeditor = new FCKeditor( $input );
  572. $oFCKeditor->Config['CustomConfigurationsPath'] = 'myconfig2.js';
  573. $oFCKeditor->Config['ProcessHTMLEntities'] = 'false';
  574. $oFCKeditor->Config['IncludeLatinEntities'] = 'false';
  575. $oFCKeditor->Config['IncludeGreekEntities'] = 'false';
  576. $oFCKeditor->Config['IgnoreEmptyParagraphValue'] = 'true';
  577. $oFCKeditor->Config['FillEmptyBlocks'] = 'false';
  578. $oFCKeditor->BasePath = $ayar['url'] . 'FCKeditor/';
  579. $oFCKeditor->Value = $row;
  580. $oFCKeditor->Width = $w;
  581. $oFCKeditor->Height = $h;
  582. $oFCKeditor->Create( );
  583. }
  584.  
  585. function sirala($durum, $id, $sira, &$tablo) {
  586. global $db;
  587.  
  588. if ($durum === 'yukari') {
  589. $row = $db->tekcek( '' . 'SELECT id, sira FROM ' . $tablo . ' WHERE sira > ' . $sira . ' ORDER BY sira LIMIT 1 ' );
  590. $iiid = $row['id'];
  591. $ssira = $row['sira'];
  592. $db->sorgu( '' . 'UPDATE ' . $tablo . ' SET sira = \'' . $sira . '\' WHERE id = \'' . $iiid . '\' LIMIT 1' );
  593. $db->sorgu( '' . 'UPDATE ' . $tablo . ' SET sira = \'' . $ssira . '\' WHERE id = \'' . $id . '\' LIMIT 1' );
  594. return null;
  595. }
  596.  
  597.  
  598. if ($durum === 'asagi') {
  599. $row = $db->tekcek( '' . 'SELECT id, sira FROM ' . $tablo . ' WHERE sira < ' . $sira . ' ORDER BY sira DESC LIMIT 1 ' );
  600. $iiid = $row['id'];
  601. $ssira = $row['sira'];
  602. $db->sorgu( '' . 'UPDATE ' . $tablo . ' SET sira = \'' . $sira . '\' WHERE id = \'' . $iiid . '\' LIMIT 1' );
  603. $db->sorgu( '' . 'UPDATE ' . $tablo . ' SET sira = \'' . $ssira . '\' WHERE id = \'' . $id . '\' LIMIT 1' );
  604. }
  605.  
  606. }
  607.  
  608. function kategoriyolu($catid) {
  609. global $db;
  610.  
  611. $sonuc = '';
  612. $sql = $db->sorgu( 'SELECT * FROM haberkat WHERE id = \'' . $catid . '\'' );
  613. $current_category = $db->assoc( $sql );
  614. $ref = $catid;
  615.  
  616. while (!$last_category) {
  617. $n_parent_categories += 1;
  618. $sql = $db->sorgu( 'SELECT * FROM haberkat WHERE id = \'' . $ref . '\'' );
  619. $parent_categories[$n_parent_categories - 1] = $db->assoc( $sql );
  620.  
  621. if ($parent_categories[$n_parent_categories - 1]['parent'] == 0) {
  622. $last_category = true;
  623. continue;
  624. }
  625.  
  626. $ref = $parent_categories[$n_parent_categories - 1]['parent'];
  627. }
  628.  
  629.  
  630. if ($catid != 1) {
  631. $x = $n_parent_categories - 1;
  632.  
  633. while (1 <= $x) {
  634. if ($parent_categories[$x]['id'] == 1 & $l == 1) {
  635. } else {
  636. $sonuc .= url_title( $parent_categories[$x]['baslik'] ) . '/';
  637. }
  638.  
  639. --$x;
  640. }
  641.  
  642. $sonuc .= url_title( $current_category['baslik'] );
  643. }
  644.  
  645. return $sonuc;
  646. }
  647.  
  648. function rmanset_sayisi() {
  649. global $db;
  650.  
  651. $sayi = $db->tekcek( 'SELECT COUNT(id) AS sayi FROM haber WHERE rmanset = \'1\' AND aktif = \'1\' AND onay = \'1\'' );
  652.  
  653. if ($sayi['sayi'] <= 10) {
  654. return $sayi['sayi'] - 1;
  655. }
  656.  
  657. return 9;
  658. }
  659.  
  660. function rmanset_iframe(&$limit) {
  661. global $db;
  662. global $ayar;
  663. global $url;
  664.  
  665. $where = 'fmanset = \'1\' AND aktif = \'1\' AND onay = \'1\'';
  666. $q = $db->getir( '' . 'SELECT id, baslik, spot, resim, hresim, hta, tarih, renk, kalin, ziplat FROM haber WHERE ' . $where . ' ORDER BY tarih DESC LIMIT 15' );
  667.  
  668. if (!$q) {
  669. return false;
  670. }
  671.  
  672. $i = 1;
  673. foreach ($q as $row) {
  674. if ($row['resim'] === '') {
  675. $resim = $row['hresim'];
  676. } else {
  677. $resim = '' . URL . 'images/haberler/' . $row['resim'] . '';
  678. }
  679.  
  680. $baslik = baslik_stili( $row[renk], $row[kalin], $row[ziplat], $row['baslik'] );
  681. echo '<li>
  682. ';
  683. echo '<a href="' . $url . '' . $row['hta'] . '-h' . $row['id'] . '.html" target="_blank">
  684. ';
  685. echo '<img src="' . $resim . '" />
  686. ';
  687. echo '</a>
  688.  
  689. ';
  690. echo '<span>' . $baslik . '</span>
  691. ';
  692. echo '<p>' . strip_tags( $row['spot'] ) . ' <a href="' . $url . '' . $row['hta'] . '-h' . $row['id'] . '.html" class="devami" target="_blank">Devamını Oku</a></p>
  693. ';
  694. echo '<em>' . tarihsaat2( $row['tarih'] ) . '</em>
  695. ';
  696. echo '</li>';
  697. ++$i;
  698. }
  699.  
  700. echo '</li>';
  701. }
  702.  
  703. function kategori_to_id($kategori) {
  704. global $db;
  705.  
  706. $row = $db->tekcek( 'SELECT id FROM haberkat WHERE hta = \'' . $kategori . '\' LIMIT 1' );
  707. return $row['id'];
  708. }
  709.  
  710. function baslik_stili($renk, $kalin, $ziplat, $veri) {
  711. $baslik = $veri;
  712.  
  713. if ($renk) {
  714. $baslik = '<font style="color:' . $renk . '">' . $veri . '</font>';
  715. }
  716.  
  717.  
  718. if ($kalin) {
  719. $baslik = '<b>' . $veri . '</b>';
  720. }
  721.  
  722.  
  723. if ($ziplat) {
  724. $baslik = '<blink>' . $veri . '</blink>';
  725. }
  726.  
  727.  
  728. if (( $kalin && $ziplat )) {
  729. $baslik = '<b><blink>' . $veri . '</blink></b>';
  730. }
  731.  
  732.  
  733. if (( $kalin && $renk )) {
  734. $baslik = '<b><font style="color:' . $renk . '">' . $veri . '</font></b>';
  735. }
  736.  
  737.  
  738. if (( $ziplat && $renk )) {
  739. $baslik = '<blink><font style="color:' . $renk . '">' . $veri . '</font></blink>';
  740. }
  741.  
  742.  
  743. if (( ( $ziplat && $renk ) && $kalin )) {
  744. $baslik = '<b><blink><font style="color:' . $renk . '">' . $veri . '</font></blink></b>';
  745. }
  746.  
  747. return $baslik;
  748. }
  749.  
  750. function cokokunan($limit) {
  751. global $db;
  752.  
  753. $bugun = date( 'Y-m-d' );
  754. $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 ) );
  755.  
  756. if (!$q) {
  757. return false;
  758. }
  759.  
  760. foreach ($q as $row) {
  761. $baslik = baslik_stili( $row['renk'], $row['kalin'], $row['ziplat'], word_limiter( $row['baslik'], 5 ) );
  762. echo ' <li><a href="' . URL . $row['hta'] . '.htm">' . $baslik . '</a></li>
  763. ';
  764. }
  765.  
  766. }
  767.  
  768. function cokyorumlanan($limit) {
  769. global $db;
  770.  
  771. $bugun = date( 'Y-m-d' );
  772. $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 ) );
  773.  
  774. if (!$q) {
  775. return false;
  776. }
  777.  
  778. foreach ($q as $row) {
  779. $baslik = baslik_stili( $row['renk'], $row['kalin'], $row['ziplat'], word_limiter( $row['baslik'], 5 ) );
  780. echo ' <li><a href="' . URL . $row['hta'] . '.htm">' . $baslik . '</a></li>
  781. ';
  782. }
  783.  
  784. }
  785.  
  786. function ozelhaber($limit) {
  787. global $db;
  788. global $url;
  789.  
  790. $bugun = date( 'Y-m-d' );
  791. $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 );
  792.  
  793. if ($q) {
  794. $row_n = array( );
  795. foreach ($q as $row) {
  796. $link = $url . $row['hta'] . '-h' . $row['id'] . '.html';
  797. $row['baslik'] = baslik_stili( $row['renk'], $row['kalin'], $row['ziplat'], limitle( $row['baslik'], 0, 70 ) );
  798. $row['hta'] = $link;
  799. $row_n[] = $row;
  800. }
  801.  
  802. return $row_n;
  803. }
  804.  
  805. }
  806.  
  807. function ilancat() {
  808. global $db;
  809. global $ayar;
  810. global $url;
  811.  
  812. $q = $db->getir( 'SELECT id, baslik, hta FROM ilankat WHERE parent=\'0\' AND aktif = \'1\' ORDER BY sira' );
  813.  
  814. if ($q) {
  815. foreach ($q as $row) {
  816. echo '<div id="ilancat" class="esitle">
  817. ';
  818. echo '<a href="' . $ayar['url'] . 'seri-ilanlar/' . $row['hta'] . '-ilanlari" class="baslik">' . $row['baslik'] . '</a>';
  819. $q2 = $db->getir( 'SELECT id, baslik, hta FROM ilankat WHERE parent=\'' . $row['id'] . '\' AND aktif = \'1\' ORDER BY baslik' );
  820.  
  821. if ($q2) {
  822. foreach ($q2 as $row2) {
  823. $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' ) . '\') ' );
  824. echo '<a href="' . $url . 'seri-ilanlar/' . $row2['hta'] . '-ilanlari">' . $row2['baslik'] . ' <i>(' . $ilansayisi . ')</i></a>';
  825. }
  826. }
  827.  
  828. echo '</div>
  829.  
  830. ';
  831. }
  832. }
  833.  
  834. }
  835.  
  836. function sonilan_home($limit) {
  837. global $db;
  838. global $ayar;
  839. global $url;
  840.  
  841. $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 ) );
  842.  
  843. if ($q) {
  844. foreach ($q as $row) {
  845. if (( $row['resim'] === '' || !file_exists( $ayar['url'] . 'images/ilanlar/thumbs/' . $row['resim'] . '' ) )) {
  846. $resim = '' . ayar( 'url' ) . '/images/ilanlar/resimyok.jpg';
  847. } else {
  848. $resim = '' . ayar( 'url' ) . '/images/ilanlar/thumbs/' . $row['resim'] . '';
  849. }
  850.  
  851. echo '<div class="ilanlar">
  852. ';
  853. echo '<a href="' . $url . 'seri-ilanlar/' . $row['hta'] . '">
  854. ';
  855. echo '<img src="' . $resim . '" width="55" border="0"/>';
  856. echo '<b>' . $row['baslik'] . '</b><br>
  857. ';
  858.  
  859. if ($row['fiyat'] != 0) {
  860. echo 'Fiyat: ' . $row['fiyat'] . ' TL<br>';
  861. }
  862.  
  863.  
  864. if ($row['uid'] != 0) {
  865. echo 'Ekleyen: ' . $row['adsoyad'] . '<br>';
  866. }
  867.  
  868. echo '</a>
  869. ';
  870. echo '</div>
  871.  
  872. ';
  873. }
  874. }
  875.  
  876. }
  877.  
  878. function sektorler() {
  879. global $db;
  880. global $ayar;
  881. global $url;
  882.  
  883. $q = $db->getir( 'SELECT id, baslik, hta FROM firmakat WHERE parent=\'0\' AND aktif = \'1\' ORDER BY sira' );
  884.  
  885. if ($q) {
  886. foreach ($q as $row) {
  887. echo '<div id="ilancat" class="esitle">
  888. ';
  889. echo '<a href="' . $url . 'firma-rehberi/' . $row['hta'] . '-firmalari" class="baslik">' . $row['baslik'] . '</a>';
  890. $q2 = $db->getir( 'SELECT id, baslik, hta FROM firmakat WHERE parent=\'' . $row['id'] . '\' AND aktif = \'1\' ORDER BY baslik' );
  891.  
  892. if ($q2) {
  893. foreach ($q2 as $row2) {
  894. $firmasayisi = $db->sayac( 'firmalar', 'catid=\'' . $row2['id'] . '\' and aktif=\'1\'' );
  895. echo '<a href="' . $ayar['url'] . 'firma-rehberi/' . $row2['hta'] . '-firmalari">' . $row2['baslik'] . ' <i>(' . $firmasayisi . ')</i></a>';
  896. }
  897. }
  898.  
  899. echo '</div>
  900.  
  901. ';
  902. }
  903. }
  904.  
  905. }
  906.  
  907. function anamanset($limit, $sayfa) {
  908. global $db;
  909. global $ayar;
  910. global $seo_id;
  911. global $temam;
  912.  
  913. if ($ayar['haber_siralama']) {
  914. $order = 'sira DESC';
  915. } else {
  916. $order = 'tarih DESC';
  917. }
  918.  
  919.  
  920. if ($ayar['manset_tipi'] === 'numarali') {
  921. $numarali = TRUE;
  922. $sql_limit = $limit . ', 9';
  923. } else {
  924. $numarali = FALSE;
  925. $sql_limit = 10;
  926. }
  927.  
  928. $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 );
  929.  
  930. if (!$q) {
  931. return false;
  932. }
  933.  
  934. return $q;
  935. }
  936.  
  937. function anamanset_nav() {
  938. $row = array( );
  939. $i = 1;
  940.  
  941. while ($i <= 10) {
  942. if ($i === 1) {
  943. $row[$i]['a'] = 0;
  944. $row[$i]['class'] = ' page_current';
  945. } else {
  946. if ($i === 2) {
  947. $row[$i]['a'] = 9;
  948. $row[$i]['class'] = '';
  949. } else {
  950. if (2 < $i) {
  951. $row[$i]['a'] = 9 * $i;
  952. $row[$i]['class'] = '';
  953. }
  954. }
  955. }
  956.  
  957. ++$i;
  958. }
  959.  
  960. return $row;
  961. }
  962.  
  963. function gencyazar_sayi() {
  964. global $db;
  965.  
  966. $sq = $db->sorgu( '
  967. SELECT id,
  968. (SELECT COUNT(*) FROM makaleler WHERE makaleler.yid=yazarlar.id AND makaleler.aktif=\'1\') as sayi
  969. FROM yazarlar
  970. WHERE aktif = \'1\' AND yazartipi=\'6\'
  971. ' );
  972. $sayi = array( );
  973.  
  974. while ($r = $db->assoc( $sq )) {
  975. if ($r['sayi']) {
  976. $sayi[] = $r['sayi'];
  977. continue;
  978. }
  979. }
  980.  
  981. return $sayi;
  982. }
  983.  
  984. function sayfalarcat_block() {
  985. global $db;
  986.  
  987. $q = $db->getir( 'SELECT id, baslik, hta FROM icerik_icerik WHERE aktif = \'1\' ORDER BY sira' );
  988.  
  989. if (!$q) {
  990. return false;
  991. }
  992.  
  993. return $q;
  994. }
  995.  
  996. function sayfalar() {
  997. global $db;
  998. global $url;
  999.  
  1000. $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' );
  1001.  
  1002. if (!$q) {
  1003. return false;
  1004. }
  1005.  
  1006. foreach ($q as $row) {
  1007. echo '<div id="ilanpart">
  1008. ';
  1009. echo '<a href="' . $url . $row['hta'] . '-sk' . $row['id'] . '.html">
  1010. ';
  1011. echo '<b>' . $row['baslik'];
  1012.  
  1013. if ($row['kayit']) {
  1014. echo ' (' . $row['kayit'] . ')';
  1015. }
  1016.  
  1017. echo '</b>
  1018. ';
  1019. echo '</a>
  1020. ';
  1021. echo '</div>
  1022.  
  1023. ';
  1024. }
  1025.  
  1026. }
  1027.  
  1028. function sayfa($sayfa_id = false, $limit = false) {
  1029. global $db;
  1030.  
  1031. $where = '';
  1032.  
  1033. if ($sayfa_id) {
  1034. $where = ' AND id NOT IN(' . $sayfa_id . ')';
  1035. }
  1036.  
  1037. $q = $db->getir( '' . 'SELECT id, baslik, hta FROM icerik_icerik WHERE aktif = \'1\' ' . $where . ' ORDER BY sira' );
  1038.  
  1039. if (!$q) {
  1040. return false;
  1041. }
  1042.  
  1043. return $q;
  1044. }
  1045.  
  1046. function linkler($limit) {
  1047. global $db;
  1048.  
  1049. $q = $db->getir( 'SELECT baslik, url FROM linkler WHERE aktif = \'1\' ORDER BY baslik' );
  1050.  
  1051. if (!$q) {
  1052. return false;
  1053. }
  1054.  
  1055. foreach ($q as $row) {
  1056. echo ' <li><a href="' . $row['url'] . '" target="_blank">' . $row['baslik'] . '</a></li>';
  1057. }
  1058.  
  1059. }
  1060.  
  1061. function zamanonce($d) {
  1062. $ts = time( ) - strtotime( str_replace( '-', '/', $d ) );
  1063.  
  1064. if (31536000 < $ts) {
  1065. $val = round( $ts / 31536000, 0 ) . ' yıl';
  1066. } else {
  1067. if (2419200 < $ts) {
  1068. $val = round( $ts / 2419200, 0 ) . ' ay';
  1069. } else {
  1070. if (604800 < $ts) {
  1071. $val = round( $ts / 604800, 0 ) . ' hafta';
  1072. } else {
  1073. if (86400 < $ts) {
  1074. $val = round( $ts / 86400, 0 ) . ' gün';
  1075. } else {
  1076. if (3600 < $ts) {
  1077. $val = round( $ts / 3600, 0 ) . ' saat';
  1078. } else {
  1079. if (60 < $ts) {
  1080. $val = round( $ts / 60, 0 ) . ' dakika';
  1081. } else {
  1082. $val = $ts . ' saniye';
  1083. }
  1084. }
  1085. }
  1086. }
  1087. }
  1088. }
  1089.  
  1090. return $val;
  1091. }
  1092.  
  1093. function zamansonra(&$future) {
  1094. $future = strtotime( $future );
  1095. $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' ) );
  1096. $today = time( );
  1097. $since = $future - $today;
  1098. $countx = sizeof( $periods );
  1099. $i = 0;
  1100. $j = $countx;
  1101.  
  1102. while ($i < $j) {
  1103. $seconds = $periods[$i][0];
  1104. $name = $periods[$i][1];
  1105.  
  1106. if ($count = floor( $since / $seconds ) != 0) {
  1107. break;
  1108. }
  1109.  
  1110. ++$i;
  1111. }
  1112.  
  1113. $print = ($count == 1 ? '1 ' . $name : '' . $count . ' ' . $name);
  1114.  
  1115. if ($i + 1 < $j) {
  1116. $seconds2 = $periods[$i + 1][0];
  1117. $name2 = $periods[$i + 1][1];
  1118.  
  1119. if ($count2 = floor( ( $since - $seconds * $count ) / $seconds2 ) != 0) {
  1120. $print .= ($count2 == 1 ? ', 1 ' . $name2 : '' . ', ' . $count2 . ' ' . $name2);
  1121. }
  1122. }
  1123.  
  1124. return $print;
  1125. }
  1126.  
  1127. function sd_tum($limit) {
  1128. global $db;
  1129. global $url;
  1130.  
  1131. $q = $db->getir( 'SELECT id, hta, baslik FROM haberkat WHERE aktif = \'1\' ORDER BY sira' );
  1132.  
  1133. if (!$q) {
  1134. return false;
  1135. }
  1136.  
  1137. foreach ($q as $row) {
  1138. echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" id="sd_table">
  1139. <tr>
  1140. <th>' . $row['baslik'] . '</th>
  1141. </tr>';
  1142. $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 ) );
  1143. foreach ($q2 as $row2) {
  1144. echo ' <tr>
  1145. <td>' . $row2['tarih'] . '<a href="' . $url . $row2['hta'] . '.htm">' . $row2['baslik'] . '</a></td>
  1146. </tr>
  1147. <tr>';
  1148. }
  1149.  
  1150. echo '<td><a href="' . URL . $row['hta'] . '" style="float:right;">Bu kategorideki diğer haberler</a></td>
  1151. </tr>
  1152. </table>
  1153. <br />
  1154. ';
  1155. }
  1156.  
  1157. }
  1158.  
  1159. function arsiv() {
  1160. global $db;
  1161. global $url;
  1162.  
  1163. $gun = $_POST['gun'];
  1164. $ay = $_POST['ay'];
  1165. $yil = $_POST['yil'];
  1166. $tarih = $yil . '-' . $ay . '-' . $gun;
  1167. $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' );
  1168.  
  1169. if (!$q) {
  1170. return false;
  1171. }
  1172.  
  1173. foreach ($q as $row) {
  1174. if ($row['toplamhaber']) {
  1175. echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" id="sd_table">
  1176. <tr>
  1177. <th>' . $row['baslik'] . '</th>
  1178. </tr>';
  1179. $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' ) );
  1180. foreach ($q2 as $row2) {
  1181. echo ' <tr>
  1182. <td>' . saat( $row2['tarih'] ) . '<a href="' . $url . $row2['hta'] . '-h' . $row2['id'] . '.html">' . $row2['baslik'] . '</a></td>
  1183. </tr>
  1184. <tr>';
  1185. }
  1186.  
  1187. echo '<td><a href="' . $url . $row['hta'] . '" style="float:right;">Bu kategorideki diğer haberler</a></td>
  1188. </tr>
  1189. </table>
  1190. <br />
  1191. ';
  1192. continue;
  1193. }
  1194.  
  1195. $yok = 1;
  1196. }
  1197.  
  1198. }
  1199.  
  1200. function arama($limit, $offset) {
  1201. global $db;
  1202. global $url;
  1203.  
  1204. $arasana = temizle( $_POST['arasana'] );
  1205. $aradim = temizle( $_POST['aradim'] );
  1206.  
  1207. if (isset( $_GET['kelime'] )) {
  1208. $arasana = $kelime = temizle( $_GET['kelime'] );
  1209. }
  1210.  
  1211. echo $arasana;
  1212. $q = $db->getir( 'SELECT
  1213. h.hta, h.baslik, DATE_FORMAT(h.tarih, \'%d.%m.%Y, %H:%i\') tarih
  1214. FROM haber h
  1215. WHERE h.aktif = \'1\' AND (h.baslik LIKE \'%' . $arasana . '%\') OR (h.keywords LIKE \'%' . $arasana . ( '' . '%\')
  1216. ORDER BY h.tarih DESC
  1217. LIMIT ' . $limit . ', ' . $offset . '
  1218. ' ) );
  1219.  
  1220. if ($q) {
  1221. echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" id="sd_table">
  1222. <tr>
  1223. <th colspan="2">Arama Sonuçları (' . $s . ' sonuç)</th>
  1224. </tr>';
  1225.  
  1226. while ($row = $db->assoc( $q )) {
  1227. echo ' <tr>
  1228. <td><a href="' . $url . $row['hta'] . '.htm">' . $row['baslik'] . '</a></td><td align="right">' . $row['tarih'] . '</td>
  1229. </tr>
  1230. <tr>';
  1231. }
  1232.  
  1233. echo '
  1234. </tr>
  1235. </table>
  1236. <br />
  1237. ';
  1238. return null;
  1239. }
  1240.  
  1241. echo 'Bir sonuç bulunamadı!';
  1242. }
  1243. ....................................................
  1244. ..........................
  1245. ..............
Add Comment
Please, Sign In to add comment