Trying to create a WHO IS ONLINE standalone page but can't..

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
Andy D. Hajime
Registered User
Posts: 70
Joined: Fri May 13, 2005 6:03 am
Location: Neo Arcadia

Trying to create a WHO IS ONLINE standalone page but can't..

Post by Andy D. Hajime » Tue Mar 25, 2008 11:51 am

When we login to the ACP (admin control panel), there is a WHO IS ONLINE column at the bottom of index.php.

I'm trying to create a standalone page for that, but can't seem to work.

What I did is using the "Blank Admin Template" (eg: newfile.php), then copy the "haystack" function and paste it right after:

Code: Select all

require('./pagestart.' . $phpEx);
Next I scroll down to the index.php source and copied out the entire "Get users online information" section and "Guest users" section, paste it onto my newfile.php... the template name is change to newfile.tpl and that's about it. But when I run it, it don't works.

Any idea guys?
What is phpBB eNcore?
blog entry #001: phpBB eNcore - DSDexigns finest phpBB pre mods

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51874
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Brf » Tue Mar 25, 2008 11:52 am

There already is one.
Click on the "Who is Online" link at the bottom of your forum index.

Andy D. Hajime
Registered User
Posts: 70
Joined: Fri May 13, 2005 6:03 am
Location: Neo Arcadia

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Andy D. Hajime » Tue Mar 25, 2008 12:00 pm

Brf wrote:There already is one.
Click on the "Who is Online" link at the bottom of your forum index.
The one there does not shows ip as like the one in admin/index.php :(
What is phpBB eNcore?
blog entry #001: phpBB eNcore - DSDexigns finest phpBB pre mods

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51874
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Brf » Tue Mar 25, 2008 12:02 pm

Andy D. Hajime wrote: But when I run it, it don't works.
What does this mean?

Andy D. Hajime
Registered User
Posts: 70
Joined: Fri May 13, 2005 6:03 am
Location: Neo Arcadia

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Andy D. Hajime » Tue Mar 25, 2008 12:08 pm

Brf wrote:
Andy D. Hajime wrote: But when I run it, it don't works.
What does this mean?
blank screen. nothing. not even an error.
What is phpBB eNcore?
blog entry #001: phpBB eNcore - DSDexigns finest phpBB pre mods

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51874
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Brf » Tue Mar 25, 2008 12:10 pm

What is a "haystack" function?
What is in your newfile.tpl?

Andy D. Hajime
Registered User
Posts: 70
Joined: Fri May 13, 2005 6:03 am
Location: Neo Arcadia

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Andy D. Hajime » Tue Mar 25, 2008 12:15 pm

Brf wrote:What is a "haystack" function?

Code: Select all

function inarray($needle, $haystack)
{ 
	for($i = 0; $i < sizeof($haystack); $i++ )
	{ 
		if( $haystack[$i] == $needle )
		{ 
			return true; 
		} 
	} 
	return false; 
}
Brf wrote:What is in your newfile.tpl?

Code: Select all

<h1>{L_WHO_IS_ONLINE}</h1>

<table width="100%" cellpadding="4" cellspacing="1" border="0" class="BLOCKQUOTEc">
  <tr> 
	<th width="20%" height="25">&nbsp;{L_USERNAME}&nbsp;</th>
	<th width="20%" height="25">&nbsp;{L_STARTED}&nbsp;</th>
	<th width="20%">&nbsp;{L_LAST_UPDATE}&nbsp;</th>
	<th width="20%">&nbsp;{L_FORUM_LOCATION}&nbsp;</th>
	<th width="20%" height="25">&nbsp;{L_IP_ADDRESS}&nbsp;</th>
  </tr>
  <!-- BEGIN reg_user_row -->
  <tr> 
	<td width="20%">&nbsp;<a href="{reg_user_row.U_USER_PROFILE}">{reg_user_row.USERNAME}</a>&nbsp;</td>
	<td width="20%" align="center">&nbsp;{reg_user_row.STARTED}&nbsp;</td>
	<td width="20%" align="center" NOWRAP>&nbsp;{reg_user_row.LASTUPDATE}&nbsp;</td>
	<td width="20%">&nbsp;<a href="{reg_user_row.U_FORUM_LOCATION}">{reg_user_row.FORUM_LOCATION}</a>&nbsp;</td>
	<td width="20%">&nbsp;<a href="{reg_user_row.U_WHOIS_IP}">{reg_user_row.IP_ADDRESS}</a>&nbsp;</td>
  </tr>
  <!-- END reg_user_row -->

  <!-- BEGIN guest_user_row -->
  <tr> 
	<td width="20%">&nbsp;{guest_user_row.USERNAME}&nbsp;</td>
	<td width="20%" align="center">&nbsp;{guest_user_row.STARTED}&nbsp;</td>
	<td width="20%" align="center" NOWRAP>&nbsp;{guest_user_row.LASTUPDATE}&nbsp;</td>
	<td width="20%">&nbsp;<a href="{guest_user_row.U_FORUM_LOCATION}">{guest_user_row.FORUM_LOCATION}</a>&nbsp;</td>
	<td width="20%">&nbsp;<a href="{guest_user_row.U_WHOIS_IP}">{guest_user_row.IP_ADDRESS}</a>&nbsp;</td>
  </tr>
  <!-- END guest_user_row -->
</table>
What is phpBB eNcore?
blog entry #001: phpBB eNcore - DSDexigns finest phpBB pre mods

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51874
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Brf » Tue Mar 25, 2008 12:16 pm

Why are you redefining inarray(), when it is already part of php?

Andy D. Hajime
Registered User
Posts: 70
Joined: Fri May 13, 2005 6:03 am
Location: Neo Arcadia

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Andy D. Hajime » Tue Mar 25, 2008 12:20 pm

Cause this error ask me to,

Code: Select all

Fatal error: Call to undefined function inarray() in /home/phpbbe/domains/www.com/public_html/admin_networktool.php on line 235
What is phpBB eNcore?
blog entry #001: phpBB eNcore - DSDexigns finest phpBB pre mods

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51874
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Brf » Tue Mar 25, 2008 12:26 pm

Ah.... it should be in_array()

So admin_networktool.php is the name of your page? Does it show up properly in the lefthand admin menu?

Andy D. Hajime
Registered User
Posts: 70
Joined: Fri May 13, 2005 6:03 am
Location: Neo Arcadia

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Andy D. Hajime » Tue Mar 25, 2008 12:33 pm

Brf wrote:Ah.... it should be in_array()

So admin_networktool.php is the name of your page? Does it show up properly in the lefthand admin menu?
dude. it's getting off topic.
Show up properly or not, that i don't want to bother. I don't want the page to be pretty or ugly. My concern is to get the code working first, and right now, it is not. do you know why or not?
What is phpBB eNcore?
blog entry #001: phpBB eNcore - DSDexigns finest phpBB pre mods

Andy D. Hajime
Registered User
Posts: 70
Joined: Fri May 13, 2005 6:03 am
Location: Neo Arcadia

Re: Trying to create a WHO IS ONLINE standalone page but can't..

Post by Andy D. Hajime » Tue Mar 25, 2008 12:56 pm

Problem solved* :o
What is phpBB eNcore?
blog entry #001: phpBB eNcore - DSDexigns finest phpBB pre mods

Post Reply

Return to “[2.0.x] MOD Writers Discussion”