collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 448
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Steam Ingame/Online/Offline Status  (Read 11707 times)

0 Members and 1 Guest are viewing this topic.

Offline smirre

  • Newbie
  • Posts: 2
  • SMF Version: 2.0.6
  • SP Version: 2.3.5
Steam Ingame/Online/Offline Status
« on: January 12, 2014, 01:56:33 PM »
Hello!

I want a modification made for Steam-users on my website. I have an older version of
php-fusion addon that let me have this status on my old website, and its great to have.
So I wonder, is there someone out there who can help me on this one? I have a complete zip-file
of the addon for php-fusion but I´m not allowed to share it I belive. Just pm if you want to take
a look at the code if you are more interested in the code itself. The code below is my first code that
I used before I got the addon itself, and should work with a little changing in the code.

Here you have the code from my old "viewthread.php" in php-fusion.

Code: [Select]
   $result = dbquery(
      "SELECT p.forum_id, p.thread_id, p.post_id, p.post_message, p.post_showsig, p.post_smileys, p.post_author,
      p.post_datestamp, p.post_ip, p.post_ip_type, p.post_edituser, p.post_edittime, p.post_editreason,
      u.user_id, u.user_name, u.user_status, u.user_avatar, u.user_level, u.user_posts, u.user_groups, u.user_joined, u.user_steam,
      ".($user_field['user_sig'] ? " u.user_sig," : "").($user_field['user_web'] ? " u.user_web," : "")."
      u2.user_name AS edit_name, u2.user_status AS edit_status
      FROM ".DB_POSTS." p
      LEFT JOIN ".DB_USERS." u ON p.post_author = u.user_id
      LEFT JOIN ".DB_USERS." u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
      WHERE p.thread_id='".$_GET['thread_id']."' AND post_hidden='0'
      ORDER BY post_datestamp LIMIT ".$_GET['rowstart'].",$posts_per_page"
   );
   if (iMOD) { echo "<form name='mod_form' method='post' action='".FUSION_SELF."?thread_id=".$_GET['thread_id']."&amp;rowstart=".$_GET['rowstart']."'>\n"; }
   echo "<table cellpadding='0' cellspacing='1' width='100%' class='tbl-border forum_thread_table'>\n";
   $numrows = dbrows($result); $current_row = 1; $colorbox_rel = array(); $edit_reason = false;
   while ($data = dbarray($result)) {
      $message = $data['post_message'];
      if ($data['post_smileys']) { $message = parsesmileys($message); }
      if ($current_row == 1) {
         echo "<tr>\n<td colspan='2' class='tbl2 forum-caption'>\n<div style='float:right' class='small'>";
         if (iMEMBER && $settings['thread_notify']) {
            if (dbcount("(thread_id)", DB_THREAD_NOTIFY, "thread_id='".$_GET['thread_id']."' AND notify_user='".$userdata['user_id']."'")) {
               $result2 = dbquery("UPDATE ".DB_THREAD_NOTIFY." SET notify_datestamp='".time()."', notify_status='1' WHERE thread_id='".$_GET['thread_id']."' AND notify_user='".$userdata['user_id']."'");
               echo "<a href='postify.php?post=off&amp;forum_id=".$fdata['forum_id']."&amp;thread_id=".$_GET['thread_id']."'>".$locale['515']."</a>";
            } else {
               echo "<a href='postify.php?post=on&amp;forum_id=".$fdata['forum_id']."&amp;thread_id=".$_GET['thread_id']."'>".$locale['516']."</a>";
            }
         }
         echo "&nbsp;<a href='".BASEDIR."print.php?type=F&amp;thread=".$_GET['thread_id']."&amp;rowstart=".$_GET['rowstart']."'><img src='".get_image("printer")."' alt='".$locale['519']."' title='".$locale['519']."' style='border:0;vertical-align:middle' /></a></div>\n";
         add_to_title($locale['global_201'].$fdata['thread_subject']);
         echo "<div style='position:absolute' class='forum_thread_title'><!--forum_thread_title--><strong>".$fdata['thread_subject']."</strong></div>\n</td>\n</tr>\n";
      }
      echo "<!--forum_thread_prepost_".$current_row."-->\n";
      if ($current_row > 1) { echo "<tr>\n<td colspan='2' class='tbl1 forum_thread_post_space' style='height:10px'></td>\n</tr>\n"; }
      echo "<tr>\n<td class='tbl2 forum_thread_user_name' style='width:140px'><!--forum_thread_user_name-->".profile_link($data['user_id'], $data['user_name'], $data['user_status'])."</td>\n";
      echo "<td class='tbl2 forum_thread_post_date'>\n";
      echo "<div style='float:right' class='small'>";
      echo "<a href='#top'><img src='".get_image("up")."' alt='".$locale['541']."' title='".$locale['542']."' style='border:0;vertical-align:middle' /></a>\n";
      echo "&nbsp;<a href='#post_".$data['post_id']."' name='post_".$data['post_id']."' id='post_".$data['post_id']."'>#".($current_row+$_GET['rowstart'])."</a>";
      echo "&nbsp;<a href='".BASEDIR."print.php?type=F&amp;thread=".$_GET['thread_id']."&amp;post=".$data['post_id']."&amp;nr=".($current_row+$_GET['rowstart'])."'><img src='".get_image("printer")."' alt='".$locale['519a']."' title='".$locale['519a']."' style='border:0;vertical-align:middle' /></a></div>\n";
      echo "<div class='small'>".$locale['505'].showdate("forumdate", $data['post_datestamp'])."</div>\n";
      echo "</td>\n";
      echo "</tr>\n<tr>\n<td valign='top' class='tbl2 forum_thread_user_info' style='width:140px'>\n";
      if ($data['user_avatar'] && file_exists(IMAGES."avatars/".$data['user_avatar']) && $data['user_status']!=6 && $data['user_status']!=5) {
         echo "<img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$locale['567']."' /><br /><br />\n";
      } else {
         echo "<img src='".IMAGES."avatars/noavatar100.png' alt='".$locale['567']."' /><br /><br />\n";
      }
      echo "<span class='small'>";
      if ($data['user_level'] >= 102) {
         echo $settings['forum_ranks'] ? show_forum_rank($data['user_posts'], $data['user_level'], $data['user_groups']) : getuserlevel($data['user_level']);
      } else {
         $is_mod = false;
         foreach ($mod_groups as $mod_group) {
            if (!$is_mod && preg_match("(^\.{$mod_group}$|\.{$mod_group}\.|\.{$mod_group}$)", $data['user_groups'])) {
               $is_mod = true;
            }
         }
         if ($settings['forum_ranks']) {
            echo $is_mod ? show_forum_rank($data['user_posts'], 104, $data['user_groups']) : show_forum_rank($data['user_posts'], $data['user_level'], $data['user_groups']);
         } else {
            echo $is_mod ? $locale['userf1'] : getuserlevel($data['user_level']);
         }
      }
      echo "</span><br /><br />\n";
      echo "<!--forum_thread_user_info--><span class='small'><strong>".$locale['502']."</strong> ".$data['user_posts']."</span><br />\n";
      echo "<span class='small'><strong>".$locale['504']."</strong> ".showdate("shortdate", $data['user_joined'])."</span><br />\n";     
      //User Steam Community status start
      if ($data['user_steam']) {
         $id = "".$data['user_steam'].""; // Kollar upp STEAM ID som anv?ndaren fyllt i sin profil
         $xml = @simplexml_load_file("http://steamcommunity.com/profiles/".$id."/?xml=1");
      switch($xml->onlineState){
      case "online":
         echo "<strong>Steam:</strong> <span class=\"steam_on\"><a href='http://steamcommunity.com/profiles/".$data['user_steam']."/' target='_blank'><strong>Online</strong></a></span>";
      break;
     case "in-game":
         echo "<strong>Steam:</strong> <span class=\"steam_ing\"><a href='http://steamcommunity.com/profiles/".$data['user_steam']."/' target='_blank'><span style='color:#8bc53f;'><strong>".$xml->stateMessage."</strong></span></a></span>";
      break;
      default:
         echo "<strong>Steam:</strong> <span class=\"steam_off\"><a href='http://steamcommunity.com/profiles/".$data['user_steam']."/' target='_blank'><span style='color:#6f9fc8'><strong>Offline</strong></span></a></span>";
      break;
   }   
   
      echo "";
}
      else {
      echo "<strong>Steam:</strong> N/A";
}
      //User Steam Community status end



Code above generates the text in theese pictures, in the forum.
So, is it possible to make this directly in SMF too or can it be made as an addon instaed?
The last one should be easier for the most ppl I think?! I use vers. 2.0.6. :)

Many regards

Smirre

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Steam Ingame/Online/Offline Status
« Reply #1 on: January 24, 2014, 03:27:24 PM »
It is possible but needs time that I don't have at this time, unfortunately. However, if you could get that code working in any part of SMF, you can use the same code in a Custom PHP block. So maybe if you asked for help at simplemachines.org support forums, in SMF Coding Discussions board to make that code work in any part of SMF, you may find someone to help you with that.
And slowly, you come to realize... It's all as it should be...