Jump to content
Sign in to follow this  
DJkikisa

Primitīvs online lietotāju scripts

Recommended Posts

<?php
/* Norādam ceļu uz galveno foruma mapi*/
require $_SERVER['DOCUMENT_ROOT'].'/init.php';

$users = \IPS\Session\Store::i()->getOnlineUsers( 10, 'desc', NULL, NULL, TRUE );
$biedri = 0;
foreach( $users as $row ){?>
<p>
	<a href="<?php echo \IPS\Settings::i()->base_url.'profile/'.$row['member_id'].'-'.$row['seo_name'];?>">
		<img src="<?php echo \IPS\Member::load( $row['member_id'] )->get_photo();?>" width="25px">
			<?php echo $row['member_name'];?>
	</a>
</p>
<?php $biedri++;} ?>
Kopā online: <?php echo $biedri;?> Biedri.

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

Share this post


Link to post
Share on other sites
43 minutes ago, CMNTS said:

Forši, ka šādas lietas paliek vienkāršākas un īsāks kods jālieto.

Kā būtu, ja vajadzētu izvilkt status, kā pieņemsim http://prntscr.com/mg1heu un http://prntscr.com/mg1hk6 ?

To ir ērtāk un ātrāk izdarīt ir manuāli uzrakstot DB queries, nekā no IPB source koda izvilkt.
Bet nu rekur ir no IPB source koda izvelkot: 

 

Share this post


Link to post
Share on other sites
26 minutes ago, DJkikisa said:

To ir ērtāk un ātrāk izdarīt ir manuāli uzrakstot DB queries, nekā no IPB source koda izvilkt.
Bet nu rekur ir no IPB source koda izvelkot: 

 

Paldies, galīgi neieraudzīju šo postu "Skripti" sadaļā... Laikam acis beidzot pierē būs jāpaņem. 😶

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.

Guest
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  

×