MyBB Community Forums

Full Version: Latest threads/posts on your site
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
Thank you! Worked for me, after I realized I have to edit the path also in the MyBBLatest.class.php file, and not just in the actual page where I put the code. Now I just need to tweak the css to make it look nicer.
thanks a lot
i have a question.
i want use this in my site example:www.site.com
but my forum is in te sub domain example:www.forum.exsmple.com
can i use this??!
subdomains are mostly associated with specified directory which you need to use in configuration.
I made reuse of the portal code for the latest threads, all i used was this

<?php
   echo "{$threadlist}";
  ?>

and remember to include this at the top

  
<? php
    $forumpath = './'; //enter your forum path
    chdir($forumpath);
    define("IN_MYBB", 1);
    require './global.php';
    require_once MYBB_ROOT."inc/class_parser.php";  
  ?>
So using this could you get the total amount of users and newest user with changing this slighlty?
If you can, could you please explain how.
This code works but only shows the last 10 threads. for example, 50 threads have been sent to the forum, this code only between 40 and 50 shows that yarn. The new messages have been sent out of this thread is jumping him.

   <?php
include("inc/config.php");
 
@mysql_connect($config['database']['hostname'],$config['database']['username'],$config['database']['password']) or die(mysql_error());
@mysql_select_db($config['database']['database']);
// son x konu
$konu_sayisi = '10';
// sorgu
$sorgu = @mysql_query("SELECT * FROM `".$config['database']['table_prefix']."posts` WHERE `replyto` = '0' ORDER BY `pid` DESC LIMIT 0,$konu_sayisi");
$sonuc_sayisi = @mysql_num_rows($sorgu);
// eger $konu_sayisi ndan az konu varsa
if($sonuc_sayisi < $konu_sayisi) {
$sorgu = @mysql_query("SELECT * FROM `".$config['database']['table_prefix']."posts` WHERE `replyto` = '0' ORDER BY `pid` DESC LIMIT 0,$sonuc_sayisi");
}
 
// sonuclari goster
echo"<h3>Son $konu_sayisi konu</h3>";
while($satir = mysql_fetch_assoc($sorgu)) {
// $satir['subject'] => konu basligi
// $satir['message'] => konu icerigi ama bb_code halinde
echo "> <a href='showthread.php?tid=".$satir['tid']."'>".$satir['subject']."</a><br />\n";
}
?> 
i don't understand what you mean.
<?php
include("inc/config.php");
 
@mysql_connect($config['database']['hostname'],$config['database']['username'],$config['database']['password']) or die(mysql_error());
@mysql_select_db($config['database']['database']);
// son x konu
$konu_sayisi = '10';
// sorgu
$sorgu = @mysql_query("SELECT * FROM `".$config['database']['table_prefix']."posts` WHERE `replyto` = '0' ORDER BY `pid` DESC LIMIT 0,$konu_sayisi");
$sonuc_sayisi = @mysql_num_rows($sorgu);
// eger $konu_sayisi ndan az konu varsa
if($sonuc_sayisi < $konu_sayisi) {
$sorgu = @mysql_query("SELECT * FROM `".$config['database']['table_prefix']."posts` WHERE `replyto` = '0' ORDER BY `pid` DESC LIMIT 0,$sonuc_sayisi");
}
 
// sonuclari goster
echo"<h3>Son $konu_sayisi konu</h3>";
while($satir = mysql_fetch_assoc($sorgu)) {
// $satir['subject'] => konu basligi
// $satir['message'] => konu icerigi ama bb_code halinde
echo "> <a href='showthread.php?tid=".$satir['tid']."'>".$satir['subject']."</a><br />\n";
}
?>
this code show only the last 10 threads. but new answers to old thread does not show.
still i don't understand you. it shows a specified number of posts/threads written lastly. what's wrong?
wrong new answers to old thread does not show.
shows that only the last 10 threads. I want to show new replies to the topic
Pages: 1 2 3 4 5 6 7