• [Source] Steam Signature SteamProfile clone
    73 replies, posted
[QUOTE=LiquidGame;23795955]The problem is that it is not 64 bit. I decided to go with 32 bit for my servers a while ago because of a PHP module one of my customers wanted to use that had issues with 64 bit. Changing to 64 bit would require way to much down time. Uglehs, I think your index.php in the new rar is the old one.[/QUOTE] Well no, with a proper math library it would support any size (as RAM allows of course).
Index.php that has STEAM ID -> community ID support and works on a 32 bit OS. [code] <form action="" method="post"> <input type="Submit" value="Submit" /><br /> User ID: <input type="text" name="userid" /> This is not your name, but your Steam Community ID.<br /> </form> <?php if($_POST){ require_once("config.php"); function friendid($id) { if(strpos(strtolower($id), 'team_')) { $steamid = $id; //STEAM_X:Y:Z $x = (int)substr($steamid, 6, 1); $y = (int)substr($steamid, 8, 1); $z = (int)substr($steamid, 10); //Let X,Y, and Z be defined by the Steam ID: STEAM_X:Y:Z //Let W be defined by the Steam Community ID: steamcommunity.com/profiles/W //<math>W = (Z \times 2) + 76561197960265728 + Y\,</math> $z2 = $z * 2; $z3 = $z2 + 7960265728; $z4 = $z3 + $y; //$result = array($x, $y, $z, $w, $z2, $z3, $z4); debug return "7656119".$z4; } else { return $id; } } $userid = friendid($_POST['userid']); function grabdata($url){ $data = file_get_contents($url); $content = html_entity_decode($data); return $content; } $grabbeddata = grabdata("http://steamcommunity.com/profiles/".$userid.""); $targetstring = "Failed loading profile data"; if(stristr($grabbeddata, $targetstring) == TRUE) { $grabbeddata = grabdata("http://steamcommunity.com/id/".$userid.""); } $v = '/steam:\/\/friends\/add\/(.+?)"/'; preg_match($v,$grabbeddata,$a); $newuserid = $a[1]; if($newuserid){ echo "<img src='$websiteurl$newuserid.png'>"; echo "<br /><b><font color=red>HTML</font></b><br />"; echo "<input type='text' value=\"<img src='$websiteurl$newuserid.png'>\" />"; echo "<br /><b><font color=red>BBCode</font></b><br />"; echo "<input type='text' value=\"[IMG]$websiteurl$newuserid.png[/IMG]\" />"; echo "<br /><b><font color=red>Direct Link</font></b><br />"; echo "<input type='text' value=\"$websiteurl$newuserid.png\" />"; }else{ echo "Unknown profile"; } } ?> [/code] Note: I don't take any credit.
[IMG]http://ugleh.com/sig/76561198011586405.png[/IMG] Could Garry embed something like this on our profiles?
He could, but I bet people would bug for last.fm, PSN, Xbox Live etc. support... You know.
I could probably make one for Gmod support, like tells you the hours uve been using gmod, and latest achievement, exc. [QUOTE=LiquidGame;23798764]Index.php that has STEAM ID -> community ID support and works on a 32 bit OS. Mine does, if you look at it. [/QUOTE] $userid = friendid($_POST['userid']); friendid() is determining if it is a SteamID or a CommumityID. Edit: saw It didnt overwrite, anyways yea updated once more.
Thanks for taking the time to do this Uglehs, I can't understand why everybody is giving you dumb ratings in the first post... Also the reason for your bad spelling ratings is this: [IMG]http://ugleh.com/ss/pzz5j4.png[/IMG] You misspelt "status" on the first line. EDIT: Also, how would one go about changing the time it takes to update?
[QUOTE=cdlink14;23803906]Thanks for taking the time to do this Uglehs, I can't understand why everybody is giving you dumb ratings in the first post... Also the reason for your bad spelling ratings is this: [IMG]http://ugleh.com/ss/pzz5j4.png[/IMG] You misspelt "status" on the first line. EDIT: Also, how would one go about changing the time it takes to update?[/QUOTE] :/ didn't see that mistype -.- Anyways in the config file you will see [code] $cachetime = 600; [/code] 600 is 10 minutes in seconds.
[QUOTE=cdlink14;23803906]Thanks for taking the time to do this Uglehs, I can't understand why everybody is giving you dumb ratings in the first post... Also the reason for your bad spelling ratings is this: [IMG]http://ugleh.com/ss/pzz5j4.png[/IMG] You misspelt "status" on the first line. EDIT: Also, how would one go about changing the time it takes to update?[/QUOTE] It's not really only that. The reason for the dumb ratings is spelling things like 'ill' and 'your' instead of "you're" et cetera, and using smileys on a forum. (Note: I haven't rated, just saying.)
If you wish, you can use this function I made for getting data from a profile. The function will take any of the 3 ways Steam has to identify you, the SteamID, Community ID, or the Custom URL. This function works perfectly well on 32-bit systems, and uses the BCMath Extension (which is included in php). This function works pretty well for me, and I haven't had any issues with it misidentifying the means of identification. Anyways, feel free to give it a try; [php]function getData($input) { $input = trim($input); if (preg_match("/^STEAM_[0-9]:[0-9]:[0-9]{1,}$/i", $input)) { $type = "sid"; } else { if (bccomp($input, '76561197960265728') == 1 && bccomp('90000000000000000', $input) == 1) $type = "profile"; else $type = "custom"; } switch($type) { case "sid": $steamid = explode(":", $input); $communityid = bcadd(bcadd(bcmul($steamid[2], 2), '76561197960265728'), $steamid[1]); $communityxml = file_get_contents('http://steamcommunity.com/profiles/'.$communityid.'?xml=1', r); $xdoc = new DomDocument; $xdoc->LoadXML($communityxml); return $xdoc; break; case "profile": $profile = trim($input); $communityxml = file_get_contents('http://steamcommunity.com/profiles/'.$profile.'?xml=1', r); $xdoc = new DomDocument; $xdoc->LoadXML($communityxml); return $xdoc; break; case "custom": $custom = trim($input); $communityxml = file_get_contents('http://steamcommunity.com/id/'.$custom.'?xml=1', r); $xdoc = new DomDocument; $xdoc->LoadXML($communityxml); return $xdoc; break; } return false; }[/php]
I have done some work similar on this a while back except I actually made a whole Class out of it. allowing users to display their currently achieved achievements for a game, useful for developers I guess they would execute something like so: steamStats->getAchievements($authURL, $game, 16); This would basically dump the users community url into the argument, the game they selected from the post and 16 represents the res of the image to use. both in 8, 16, 32, 64 sizes. It is then possible to dump the image url's returned from the getAchievements into an array and load them from there. Anyway if OP needs my advise or help with the particular project he/she is working on let me know, I intend to release my class file regardless of the demand but I think there was a project like you said that had done something similar already.
[QUOTE=deadeye536;23806935]If you wish, you can use this function I made for getting data from a profile. The function will take any of the 3 ways Steam has to identify you, the SteamID, Community ID, or the Custom URL. This function works perfectly well on 32-bit systems, and uses the BCMath Extension (which is included in php). This function works pretty well for me, and I haven't had any issues with it misidentifying the means of identification. Anyways, feel free to give it a try; [/QUOTE] Your code looks nice but I think that is all the info im going to be putting on the status sig for this. Also yea mine takes CommunityID, Custom ID, and Steam ID. and if you look threw the code I use CURL because file_get_contents can not redirect, but when you go to something like this steamcommunity/id/Ugleh you wont get anything, because it will redirect you to /profiles/ugleh. So i used Curl. Not only that, but Its been proven and tested that curl goes faster then file_get_content
[QUOTE=Uglehs;23807803]Your code looks nice but I think that is all the info im going to be putting on the status sig for this. Also yea mine takes CommunityID, Custom ID, and Steam ID. and if you look threw the code I use CURL because file_get_contents can not redirect, but when you go to something like this steamcommunity/id/Ugleh you wont get anything, because it will redirect you to /profiles/ugleh. So i used Curl. Not only that, but Its been proven and tested that curl goes faster then file_get_content[/QUOTE] When you use the ?xml=1, the Steam Community will not redirect you away from the page you are trying to get information from. Also, the Steam Community will redirect you to /id/ when you are using /profiles/. [url]http://steamcommunity.com/profiles/76561197989849793[/url] will turn into /id/deadeye536. At the time of writing that, I was doing most of my testing on a localhost, which didn't have Curl installed. Curl is certainly great to use, but it is not required as redirecting is not an issue.
yea np, i actually made the /profiles/ and /id/ mismatch, and didn't know about ?xml=1 because i was looking all over for it 0_0 now im going to have to recode it :/ p.s your function isn't working. [editline]09:21PM[/editline] So yea, an update is coming soon which supports SteamID, Custom ID, and Community ID in both the Index file and Sig.php file, so this will work [url]http://ugleh.com/sig/STEAM_0:0:22181024.png[/url] also, I am going to be using the xml page to parse the info and not the site like it is.. [editline]10:01PM[/editline] Ok everything is done, ive recoded it so it works with the xml site, and it might be an improvement for future progress. I wont be releasing till tomorrow morning.
Oh, hey, look. [img]http://z-dev.org/prj/sb/?id=andersonmat[/img]
To overcome the 32bit issue: [url]http://php.net/manual/en/book.bc.php[/url] [editline]11:28PM[/editline] [php]function s2c($steam_id) { $steam_id = preg_replace("/^STEAM_/i", "", $steam_id); if (preg_match("/^0:([0-1]):([0-9]+)$/", $steam_id, $m)) { $community_id = $m[2]; $community_id = bcmul($community_id, 2); $community_id = bcadd($community_id, "76561197960265728"); $community_id = bcadd($community_id, $m[1]); return $community_id; } else { throw new Exception("Invalid Steam ID"); } } [/php]
[QUOTE=Uglehs;23784261][code] $rest = substr("$newnumber2", -2); if ($rest == ".5"){ [/code][/QUOTE] :whoptc: [editline]07:33PM[/editline] [QUOTE=andersonmat;23810614]Oh, hey, look. [img]http://z-dev.org/prj/sb/?id=andersonmat[/img][/QUOTE] nice plug.
[QUOTE=andersonmat;23810614]Oh, hey, look. [img]http://z-dev.org/prj/sb/?id=andersonmat[/img][/QUOTE] star stands for steam rating but whats the badge on the far right mean? + I only am trying to clone SteamProfile's signature :/ but you gave me an idea -steals- [editline]03:26AM[/editline] Ok Update released, maybe final one. I thought last one was going to be final -.-. Now i see the one above me and im thinking of adding those in it or something :/ Ok so, here the update: Download: [url]http://www.multiupload.com/TUU3IH8FJ5[/url] [img]http://ugleh.com/ss/p9w95z.png[/img] Default Design page looks like this: (not functional) [url]http://ugleh.com/sig2/index.php[/url] (not functional)
[QUOTE=Uglehs;23815538]star stands for steam rating but whats the badge on the far right mean?[/QUOTE] It means that they In Good Standing by VAC, assuming you meant to say left. If not, the thing on the far right is their country, in this case, the United States flag.
[QUOTE=andersonmat;23810614]Oh, hey, look. [img]http://z-dev.org/prj/sb/?id=andersonmat[/img][/QUOTE] :iia:
Yeah it is rather interesting. I might put more time into this but I'm pretty busy working on Devinity and improving my hosting services, but I will still host it and keep it up to date.
-snip-
[QUOTE=game;23853757]Mirror. [url]http://www.zchr.tk/sig/[/url][/QUOTE] The file already has 7 mirrors from well known file hosting websites. I don't think a 8th one is really needed, but it's not my file, just a matter of my thoughts on it.
[QUOTE=deadeye536;23853978]The file already has 7 mirrors from well known file hosting websites. I don't think a 8th one is really needed, but it's not my file, just a matter of my thoughts on it.[/QUOTE] It's not the .rawr file, it's actual usable code. also, my servers are pretty reliable, imho
Never thought it was going to be as good as this, here is something else I was working with: works with cookies. [img]http://herp.in/cookie.php[/img]
I refresh it, but it still says 1 times.
[QUOTE=Ontarget910;23856994]I refresh it, but it still says 1 times.[/QUOTE] Works fine for me. Have you tried Ctrl + F5?
That's quite interesting. Works for me also in Google Chrome. Had to clear the cache on mine to test something, sorry.
I made a little countdown thing a while ago: [IMG]http://files.rewindstudios.com/Programming/PHP/ImageGen/countdown/index.php?date=15-09-2010GMT[/IMG] [url]http://files.rewindstudios.com/Programming/PHP/ImageGen/countdown/index.php[/url]
I updated my version a bit: [img]http://killersservers.co.uk/sig/76561197977393696.png[/img] Il post the source as soon as I can find a star that does not suck. I also changed it to actually read the XML rather than finding matching strings so imo it is easier to add things now. PS Yes, I know the position's are kind of bad but when I post the source maybe someone will improve it. Oh and I stopped people passing there shortcut URL to the sig.php file so it wont make anything but a community ID in the cache folder.
This is what I started. Never finished it though: [img]http://z-dev.org/prj/sb/?id=andersonmat&l[/img]
Sorry, you need to Log In to post a reply to this thread.