Jump to content
Sign in to follow this  

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

Recommended Posts

/* 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']);?>
<?php } ?>

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

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this