PhpNukeTurkiye.Com (F)  >> PNT Nuke ve Php-Nuke (F)  >> Php Nuke (F)
DSolu Görünüm İçin Tıklayın "Forum Başlıklarını Bağımsız Saydan çekmek"

gonlumungulu: Forum Başlıklarını Bağımsız Saydan çekmek (2017/04/14 - 19:39)

site.com/SonKonular/

index.php den veritabana baglanıp ordaki forumun son 5 baslıgını liste halinde çekmek istiyorum ve bunu ugrasmama ragmen bi türlü olmadı

Sonsuzluk: Re: Forum Başlıklarını Bağımsız Saydan çekmek (2017/04/16 - 00:16)

bu tarzda birşeymi diyorsun tam anlamadım açıkçası

http://phpnuketurkiye.com/demohaber.php

gonlumungulu: Re: Forum Başlıklarını Bağımsız Saydan çekmek (2017/04/16 - 14:06)

Evet bu sekılde bunu google amp ye uygulamak icin.

Sonsuzluk: Re: Forum Başlıklarını Bağımsız Saydan çekmek (2017/04/16 - 14:33)

<?php
//Bismillahirrahmanirrahim

require_once("mainfile.php");

global $prefix, $db;

$sor = $db->sql_query("SELECT * FROM ".$prefix."_bbtopics ORDER BY topic_id DESC LIMIT 10");
while ($yaz = $db->sql_fetchrow($sor)) {
$topic_title = $yaz['topic_title'];

echo"$topic_title <hr/>";

}

?>

gonlumungulu: Re: Forum Başlıklarını Bağımsız Saydan çekmek (2017/04/16 - 23:23)

Allah razı olsun . Ellerine saglık saol

Ekledi-- 2021-09-20, 19:33:24 --

Ekledi-- 2021-09-20, 19:35:51 --
X Zaman Önce” Yazıldı Fonksiyonu bir turlu her baslıgında altında ne yaptıysam yazdıramadım acaba nerde yanlıslık yapmıs olabilirim


<?



//Bismillahirrahmanirrahim

require_once("manali.php");



// When set to 1 then Forums permissions which View and/or Read are NOT set to 'ALL' will NOT be displayed in the center block
$HideViewReadOnly = 1;
// Show only 5 last new topics
$Last_New_Topics = 10;
// Icon that is displayed in Center Block in front of Topic

$border = 1;
$cellspacing = 0;


/* Total Amount of Topics */
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbtopics" );
$Amount_Of_Topics = $db->sql_numrows( $result );

/* Total Amount of Posts */
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbposts" );
$Amount_Of_Posts = $db->sql_numrows( $result );

/* Total Amount of Topic Views */
$Amount_Of_Topic_Views = 0;
$result = $db->sql_query( "SELECT topic_views FROM ".$prefix."_bbtopics" );
while( list( $topic_views ) = $db->sql_fetchrow( $result ) )
{
$Amount_Of_Topic_Views = $Amount_Of_Topic_Views + $topic_views;
}

/* Total Amount of Topic Replies */
$Amount_Of_Topic_Replies = 0;
$result = $db->sql_query( "SELECT topic_replies FROM ".$prefix."_bbtopics" );
while( list( $topic_replies ) = $db->sql_fetchrow( $result ) )
{
$Amount_Of_Topic_Replies = $Amount_Of_Topic_Replies + $topic_replies;
}

/* Total Amount of Members */
$result = $db->sql_query( "SELECT * FROM ".$user_prefix."_users" );
$Amount_Of_Members = $db->sql_numrows( $result ) - 1;

/* Last X New Topics */
$Count_Topics = 0;
$Topic_Buffer = "";
$result1 = $db->sql_query( "SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC" );
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = sql_fetch_row( $result1, $dbi ) )
{
$skip_display = 0;
if( $HideViewReadOnly == 1 )
{
$result5 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'" );
list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result5 );
if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
}

if( $topic_moved_id != 0 )
{
// Shadow Topic !!
$skip_display = 1;
}



if( $skip_display == 0 )
{
$Count_Topics += 1;
$result2 = $db->sql_query( "SELECT topic_id, poster_id, FROM_UNIXTIME( post_time,'%Y-%m-%d %H:%i:%s') as post_time FROM ".$prefix."_bbposts where post_id = '$topic_last_post_id'" );
list( $topic_id, $poster_id, $post_time ) = $db->sql_fetchrow( $result2 );



$content3 .= "<li><img src=\"images/blokresim/gul.gif\" border=\"0\" width=\"15\" height=\"14\" /><a href=\"modules.php?name=Forums&file=viewtopic&t=$topic_id\" title=\"$topic_title \">$topic_title..</a></br></li>";


}


if( $Last_New_Topics == $Count_Topics ) { break 1; }
}

function timeConvert ( $zaman ){
$zaman = strtotime($zaman);
$zaman_farki = time() - $zaman;
$saniye = $zaman_farki;
$dakika = round($zaman_farki/60);
$saat = round($zaman_farki/3600);
$gun = round($zaman_farki/86400);
$hafta = round($zaman_farki/604800);
$ay = round($zaman_farki/2419200);
$yil = round($zaman_farki/29030400);
if( $saniye < 60 ){
if ($saniye == 0){
return "az önce";
} else {
return $saniye .' saniye önce';
}
} else if ( $dakika < 60 ){
return $dakika .' dakika önce';
} else if ( $saat < 24 ){
return $saat.' saat önce';
} else if ( $gun < 7 ){
return $gun .' gün önce';
} else if ( $hafta < 4 ){
return $hafta.' hafta önce';
} else if ( $ay < 12 ){
return $ay .' ay önce';
} else {
return $yil.' yil önce';
}
}

// .. timeConvert fonksiyonu

$tarih = "$post_time";
echo timeConvert($tarih);


?>


<?php echo "$tarih , $post_time, $content3"; ?> Ekledi-- 2021-09-20, 19:45:05 --.....