TinyPortal

Development => Block Codes => Topic started by: wdm2005 on August 18, 2008, 04:25:01 AM

Title: [Block] users in arcade
Post by: wdm2005 on August 18, 2008, 04:25:01 AM
this is part of somthing a hack im working on for smf arcade see a demo on the foru m info center


http://sleepy-arcade.ath.cx/dev/index.php?action=forum

and here
at bottom

http://sleepy-arcade.ath.cx/dev/index.php?action=arcade


see a demo of the tp block here
http://www.ridersplace.net/home/
left hand side users in arcade

right to the snippet lol

put this code in a php block

global $scripturl, $txt, $context, $db_prefix,$settings;
// heres the bullits duck lol
    $bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
   //its ok now bullits have flown by stand up again lol
               require("SSI.php");
               $online = ssi_whosOnline('array');
      foreach($online['users'] as $user){
 

   $result = db_query("
      SELECT url
      FROM {$db_prefix}log_online
      WHERE ID_MEMBER = {$user['id']}",__FILE__, __LINE__);
     
      $checkit = mysql_fetch_assoc($result);
      $data = @unserialize($checkit['url']);
         if(isset($data['action']) && $data['action'] == 'arcade')      echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];  echo ' ';
      }

unset($data);


can be added to forum info center aswell or tp stats block

specil thanks to jeza for helping me wth it

Title: Re: [Block] users in arcade
Post by: Final60 on August 26, 2008, 02:31:05 AM
Works great
thanks! :)
Title: Re: [Block] users in arcade
Post by: Bluto on September 20, 2008, 09:20:52 PM
Hmm...I get this showing in the block.
SMF 1.1.6
TP 1.0.5
Fatal error: Cannot redeclare ssi_shutdown()
(previously declared in /home/.xxx/xxx/ga.ga-squad.com/SSI.php:196)
in /home/.xxx/xxx/ga.ga-squad.com/SSI.php on line 198
Title: Re: [Block] users in arcade
Post by: G6Cad on September 20, 2008, 09:34:41 PM
Check the line you get the error from in the file and remove the duplicate strings
Title: Re: [Block] users in arcade
Post by: Bluto on September 20, 2008, 11:09:12 PM
rgr, thanx
Title: Re: [Block] users in arcade
Post by: wdm2005 on September 21, 2008, 12:11:25 AM
did you sort this ?
Title: Re: [Block] users in arcade
Post by: Bluto on September 21, 2008, 01:23:04 PM
No. I just now got back to it.
Here's the code from the error:
// This shuts down the SSI and shows the footer.
function ssi_shutdown()
{
if (!isset($_GET['ssi_function']) || $_GET['ssi_function'] != 'shutdown')
template_footer();
}


I removed the second instance of the function, I thought was a duplicate
|| $_GET['ssi_function'] But that didn't change anything. Same error.
And I looked, but didn't find that code repeated elsewhere.
File attached.
I don't really have to have this though, so no rush or big deal for me. Just though it would be nice to have. I don't want to clog this thread up with my error.
SMF 1.1.6
TP 1.0.5
Thanx wdm2005, I appreciate the response.
Title: Re: [Block] users in arcade
Post by: G6Cad on September 21, 2008, 01:36:16 PM
Make it look like this

// This shuts down the SSI and shows the footer.
function ssi_shutdown()
{
   if (!isset($_GET['ssi_function']) || $_GET['ssi_function']  != 'shutdown')
      template_footer();
}
Title: Re: [Block] users in arcade
Post by: Bluto on September 21, 2008, 01:44:45 PM
OK, I copy and pasted the code exactly as you have it.
Then I get this error:
Parse error: syntax error, unexpected T_IS_NOT_EQUAL, expecting ',' or ')' in /home/.xxx/xxx/ga.ga-squad.com/SSI.php on line 196
Instead of the home page.
Title: Re: [Block] users in arcade
Post by: G6Cad on September 21, 2008, 02:07:39 PM
Looking closer at your file, you seem to have a ton of mods installed.

You have to check the mods you have installed and see what mod changes the ssi.php file, and manually go though the code from these mods and see if any of them have duplicate entrys in the file.
Title: Re: [Block] users in arcade
Post by: Bluto on September 21, 2008, 02:14:54 PM
OK, will do G6.
I appreciate the help, but dread the task. :)
Title: Re: [Block] users in arcade
Post by: G6Cad on September 21, 2008, 02:20:27 PM
The task is not really that hard.
If you use the parser on SMF and in their mod site, you can check the mods easy and see if they touch the file and if they do, what code they add or change
Title: Re: [Block] users in arcade
Post by: wdm2005 on September 28, 2008, 09:09:24 AM
@bluto try this code if you didnt get it working

global $scripturl, $txt, $context, $db_prefix,$settings;
// heres the bullits duck lol
    $bullet2 = '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" border="0" style="margin:0 2px 0 0;" />';
   //its ok now bullits have flown by stand up again lol
               
               $online = ssi_whosOnline('array');
      foreach($online['users'] as $user){
 

   $result = db_query("
      SELECT url
      FROM {$db_prefix}log_online
      WHERE ID_MEMBER = {$user['id']}",__FILE__, __LINE__);
     
      $checkit = mysql_fetch_assoc($result);
      $data = @unserialize($checkit['url']);
         if(isset($data['action']) && $data['action'] == 'arcade')      echo $bullet2 , $user['hidden'] ? '<i>' . $user['link'] . '</i>' : $user['link'];  echo ' ';
      }

unset($data);

Title: Re: [Block] users in arcade
Post by: Bluto on September 29, 2008, 02:20:27 AM
That works, thanks WDM. Much appreciated.
Now, if you could make it that easy for who's in Flashchat, I'd be forever indebted.LOL.
Title: Re: [Block] users in arcade
Post by: IchBin on September 29, 2008, 02:37:15 AM
Bluto, did you look at the other flashchat code snippets we have here?
Title: Re: [Block] users in arcade
Post by: Bluto on September 29, 2008, 02:54:53 AM
No ICH, I've been trying to implement the Flashchat integration mod, with no success. If I rebuild the forum, I'll put that one in right after TP.
But I will have a look and see what you have, if it's a snippet, it has to be easier.
Thanks IchBin
Title: Re: [Block] users in arcade
Post by: Bluto on September 29, 2008, 01:08:10 PM
Found what I needed, thanks Ich.
Title: Re: [Block] users in arcade
Post by: wdm2005 on September 29, 2008, 08:00:17 PM
Quote from: Bluto on September 29, 2008, 02:20:27 AM
That works, thanks WDM. Much appreciated.
Now, if you could make it that easy for who's in Flashchat, I'd be forever indebted.LOL.

all i done was remove the ssi call
require("SSI.php");