Jump to content
Sign in to follow this  
DJkikisa

Primitīvs pēdējās foruma tēmas skripts.

Recommended Posts

<?php
/* Norādam ceļu uz galveno foruma mapi*/
require $_SERVER['DOCUMENT_ROOT'].'/init.php';
$limit = 5; /* Noregulējam cik tēmas izvada */
$topics	= \IPS\Db::i()->select( '*', 'forums_topics',NULL,'tid desc', $limit  );
foreach( $topics as $row  )
{?>
<p><a href="<?php echo\IPS\Settings::i()->base_url.'topic/'.$row['tid'].'-'.$row['title_seo'];?>"><?php echo $row['title'] ;?></a>
<p>Tēmu uzsāka:<img src="<?php echo \IPS\Member::load( $row['starter_id'] )->get_photo();?>" width="25px">
<a href="<?php echo\IPS\Settings::i()->base_url.'profile/'.$row['starter_id'].'-'.$row['starter_name'];?>"><?php echo $row['starter_name'] ;?></a>
<p>Pēdejo postu veica: <img src="<?php echo \IPS\Member::load( $row['last_poster_id'] )->get_photo();?>" width="25px"> 
<a href="<?php echo\IPS\Settings::i()->base_url.'profile/'.$row['last_poster_id'].'-'.$row['last_poster_name'];?>"><?php echo $row['last_poster_name'] ;?></a>
<p>Tēmas skatijumi : <?php echo $row['views'] ;?>
<p>Ieraksti tēmā : <?php echo $row['posts'] ;?>
<p>Uzsākšanas datums: <?php echo date("Y-m-d H:i:s",$row['start_date']);?>
</p>
<?php } ?>

Demo: https://wam.lv/skripti/ipblasttopics.php

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×