MyBB Community Forums

Full Version: error by online today
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi
i installet plugin online today but shown column?why?
Modify the template for the plugin to have colspan="2" after <td.
(2009-04-07, 03:27 AM)Tom Loveric Wrote: [ -> ]Modify the template for the plugin to have colspan="2" after <td.
hi
what i put(colspan="2") in php cod below and ?
<?php
/**
 * MyBB 1.4
 * Copyright © 2008 Samuel
 */

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
	die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook("index_start", "onlinetoday_run");

function onlinetoday_info()
{
	return array(
		"name"			=> "Online Today",
		"description"	=> "Shows you who has been online in the last 24 Hours",
		"website"		=> "http://gally.x10hosting.com/mybb/",
		"author"		=> "Samuel",
		"authorsite"	=> "http://gally.x10hosting.com/mybb/",
		"version"		=> "1.1",
		"guid" 			=> "3fcc54ee559b73e0778e137eddcd6301",
		"compatibility" => "14*"
	);
}

function onlinetoday_activate()
{
	global $db, $mybb;
	
	$query = $db->simple_select("settinggroups", "COUNT(*) as rows");
	$rows = $db->fetch_field($query, "rows");
	
	$insertarray = array(
		'name' => 'onlinetoday', 
		'title' => 'Show Users Who Have Been online Today', 
		'description' => 'Options on the online today plugin', 
		'disporder' => $rows+1, 
		'isdefault' => 0
	);
	$db->insert_query("settinggroups", $insertarray);
	$group['gid'] = $db->insert_id();
	
	$insertarray = array(
		'name' => 'onlinetoday_active',
		'title' => 'Enable Show Users Who Have Been Online Today Plugin?',
		'description' => 'Enable Show Users Who Have Been online Today Plugin?',
		'optionscode' => 'onoff',
		'value' => 1,
		'disporder' => 0,
		'gid' => $group['gid']
	);
	$db->insert_query("settings", $insertarray);
	
	rebuild_settings();
	
	include MYBB_ROOT."/inc/adminfunctions_templates.php";
	
	find_replace_templatesets("index_boardstats", '#{\$whosonline}(\r?)\n#', "{\$whosonline}\n{\$online_today}\n");
	
	$insert_array = array(
		'title' => "online_today_index",
		'template' => "<tr>
	<td class=\"tcat\"><strong>{\$lang->whos_online_today}</strong></td>
</tr>
<tr>
	<td class=\"trow1\"><span class=\"smalltext\">{\$lang->online_note_today}<br />{\$onlinemembers}</span></td>
</tr>",
		'sid' => "-1",
		'dateline' => TIME_NOW
	);
	
	$db->insert_query("templates", $insert_array);
	
}

function onlinetoday_deactivate()
{
	global $db, $mybb;
	
	include MYBB_ROOT."/inc/adminfunctions_templates.php";
	
	find_replace_templatesets("index_boardstats", '#{\$online_today}(\r?)\n#', "", 0);
	
	$db->delete_query("templates", "title = 'online_today_index'");
	
	$db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN(
		'onlinetoday_active'
	)");
	
	$db->delete_query("settinggroups", "name = 'onlinetoday'");
	
	rebuild_settings();
}

function onlinetoday_run()
{
	global $db, $mybb, $templates, $theme, $lang, $online_today;
	
	$lang->load("onlinetoday");
	
	$online_today = '';
	if($mybb->settings['onlinetoday_active'] == "1")
	{
		$onlinedate = time() - 24*60*60;
		$query = $db->simple_select(
			"users", 
			"uid, username, usergroup, displaygroup",
			"lastactive > $onlinedate ORDER BY username ASC"
		);
		$comma = '';
		$onlinecount = 0;
		while($user = $db->fetch_array($query))
		{
			++$onlinecount;
			$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
			$user['profilelink'] = build_profile_link($user['username'], $user['uid']);
			eval("\$onlinemembers .= \"".$templates->get("index_whosonline_memberbit", 1, 0)."\";");
			$comma = ", ";
		}
		$memberword = ($onlinecount != 1) ? $lang->online_member_plural : $lang->online_member_singular;
		$lang->online_note_today = $lang->sprintf($lang->online_note_today, my_number_format($onlinecount), $memberword, 24);
		eval("\$online_today = \"".$templates->get("online_today_index")."\";");
	}

}

?>
If you PM me your forum URL, admin username+password I can fix it for you.
Why is this in MyBB Suggestions and Feedback? Shouldn't it be in the plugin forum?
(2009-04-07, 06:14 AM)Joshua Mayer Wrote: [ -> ]Why is this in MyBB Suggestions and Feedback? Shouldn't it be in the plugin forum?

Moved -
(2009-04-07, 05:33 PM)Ghazala_Wali Wrote: [ -> ]
(2009-04-07, 06:14 AM)Joshua Mayer Wrote: [ -> ]Why is this in MyBB Suggestions and Feedback? Shouldn't it be in the plugin forum?

Moved -

I think we can see that...
hi
finaly i do it
see it! www.azarfx.com/forum
regards
o good !
thanks for your assistense Smile