Ejemplo n.º 1
0
global $scripturl, $db_prefix, $user_info, $txt;
global $modSettings;
global $smcFunc, $boarddir;
require_once $boarddir . '/SSI.php';
$show_buddies = !empty($user_info['buddies']);
$return = array();
//Ultimate Portal use SMF Cache data... UP it's the best, only "UP", can create this feature
if (!empty($ultimateportalSettings['up_reduce_site_overload'])) {
    if (cache_get_data('bk_online', 120) === NULL) {
        $return = ssi_logOnline('array');
        cache_put_data('bk_online', $return, 120);
    } else {
        $return = cache_get_data('bk_online', 120);
    }
} else {
    $return = ssi_logOnline('array');
}
//Start Table
echo '<table  width="100%" border="0" cellspacing="1" cellpadding="2" style="margin-top:3px;">';
echo '
				<tr>
					<td align="left">
						<img src="', $settings['default_images_url'], '/ultimate-portal/download/menu.png" alt="" />&nbsp;' . $return['total_users'] . '&nbsp;<strong>' . $txt['ultport_users_online'] . '</strong>
					</td>
				</tr>';
echo '
                <tr>
					<td align="left">				
						<img src="', $settings['default_images_url'], '/ultimate-portal/download/menu.png" alt="" />&nbsp;' . $return['num_users'] . '&nbsp;' . ($return['num_users'] == 1 ? $txt['user'] : $txt['users']) . '
					</td>
				</tr>
 /**
  * Short description
  *
  * Long description
  *
  * @param
  * @return
  */
 protected function log_online()
 {
     try {
         $this->loadSSI();
     } catch (Exception $e) {
         throw new \Exception($e->getMessage());
     }
     if ('echo' == $this->output_method) {
         ob_start();
         ssi_logOnline($this->output_method);
         $this->data = ob_get_contents();
         ob_end_clean();
     } else {
         $this->data = ssi_logOnline($this->output_method);
     }
 }
function template_homepage_sample1_php()
{
    global $txt;
    $topics = ssi_recentTopics(8, null, null, 'array');
    foreach ($topics as $topic) {
        echo '
			<li><a href="', $topic['href'], '">', $topic['subject'], '</a> ', $txt['by'], ' ', $topic['poster']['link'], '</li>';
    }
    unset($topics);
    echo '

		</ul><br />

		<h3>Online Users</h3>';
    ssi_logOnline();
    echo '
	</div>

	<div id="content">';
    ssi_welcome();
    echo '
		<br /><br />

		<h2>News</h2>';
    ssi_boardNews();
    echo '
	</div>';
}
Ejemplo n.º 4
0
flush();
?>

		<hr />

			<h3>Who's Online Function: &lt;?php ssi_whosOnline(); ?&gt;</h3>
			<?php 
ssi_whosOnline();
flush();
?>

		<hr />

			<h3>Log Online Presence + Who's Online Function: &lt;?php ssi_logOnline(); ?&gt;</h3>
			<?php 
ssi_logOnline();
flush();
?>

		<hr />

			<h3>Welcome Function: &lt;?php ssi_welcome(); ?&gt;</h3>
			<?php 
ssi_welcome();
flush();
?>

		<hr />

			<h3>News Function: &lt;?php ssi_news(); ?&gt;</h3>
			<?php