Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[PlusEMU][Addon] User's avatar in alert
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Core" data-source="post: 392671" data-attributes="member: 72270"><p>Alternative to this method you could always just save the users figure in the notifications folder and use that as a reference but it can also be done using a rewrite rule so that the image is updated when the user changes there looks.</p><p></p><p>How it works,</p><p>It will use a rewrite rule which filters for /fig/<strong>{data}</strong>.png in the notifications folder. In return meaning that you can use $"fig/{Session.GetHabbo().Look}" as the image argument for RoomNotificationComposer. To set it up, it's really easy.</p><p></p><p>Go to your c_images folder and create an .htaccess file (if using apachie, you will need a web.config for iis). The inside this file put;</p><p>[code]</p><p>RewriteEngine On</p><p>RewriteRule ^notifications/fig/([A-Za-z0-9-\.]+).png(|/)$ notifications/user.php?fig=$1[/code]</p><p></p><p>The reason I have put the rule in c_images as I wrote several scripts for this is because released swfs are cluttered with things that aren't needed. So I just wiped the entire c_images and wrote a 404 handler which requests file from habbo if it doesn't exist; that way not using large swfs. However, you could alternatively put it in the notifications folder but just remove the notifications/ from the rule. This script was wrote for the notifications only but can easily be modified if you wish to do the same as me<img src="/styles/default/xenforo/smilies/emojione/tongue.png" class="smilie" loading="lazy" alt=":p" title="Stick Out Tongue :p" data-shortname=":p" />.</p><p></p><p>Now you have rule set up, you want to create a file called user.php in c_images/notifications. Inside the file put the following</p><p>[code]</p><p><?php</p><p> </p><p> if(!isset($_GET["fig"]) || empty($_GET["fig"])) {</p><p> echo "No fig request";</p><p> exit;</p><p> }</p><p> </p><p> $ch = curl_init("https://www.habbo.com.br/habbo-imaging/avatarimage?hb=img&figure={$_GET["fig"]}&action=wav&direction=2&head_direction=3&size=m");</p><p> </p><p> curl_setopt_array($ch, array(</p><p> CURLOPT_RETURNTRANSFER => true,</p><p> CURLOPT_HEADER => false,</p><p> CURLOPT_FOLLOWLOCATION => true,</p><p> CURLOPT_ENCODING => "",</p><p> CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36",</p><p> CURLOPT_AUTOREFERER => true,</p><p> CURLOPT_SSL_VERIFYPEER => false</p><p> ));</p><p> </p><p> $content = curl_exec($ch);</p><p> $type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);</p><p> </p><p> curl_close($ch);</p><p> </p><p> if(!isset($content) || empty($content) || strpos($content, 'Not Found') !== false) {</p><p> echo "Not found!";</p><p> exit;</p><p> }</p><p> </p><p> header("Content-Type: {$type}");</p><p> </p><p> echo $content;</p><p>?></p><p>[/code]</p><p></p><p>And, finally. Sending the new image to the client (this just goes where ever you want to send it...);</p><p></p><p>[code]Session.SendMessage(new RoomNotificationComposer("Title Example", "Content Example", $"fig/{Session.GetHabbo().Look}");[/code]</p><p></p><p></p><p>You may need to add reference to the namespace for RoomNotificationComposer. Here is how;</p><p>Add the following to the top of the file...</p><p>[code]using Plus.Communication.Packets.Outgoing.Rooms.Notifications;[/code]</p></blockquote><p></p>
[QUOTE="Core, post: 392671, member: 72270"] Alternative to this method you could always just save the users figure in the notifications folder and use that as a reference but it can also be done using a rewrite rule so that the image is updated when the user changes there looks. How it works, It will use a rewrite rule which filters for /fig/[B]{data}[/B].png in the notifications folder. In return meaning that you can use $"fig/{Session.GetHabbo().Look}" as the image argument for RoomNotificationComposer. To set it up, it's really easy. Go to your c_images folder and create an .htaccess file (if using apachie, you will need a web.config for iis). The inside this file put; [code] RewriteEngine On RewriteRule ^notifications/fig/([A-Za-z0-9-\.]+).png(|/)$ notifications/user.php?fig=$1[/code] The reason I have put the rule in c_images as I wrote several scripts for this is because released swfs are cluttered with things that aren't needed. So I just wiped the entire c_images and wrote a 404 handler which requests file from habbo if it doesn't exist; that way not using large swfs. However, you could alternatively put it in the notifications folder but just remove the notifications/ from the rule. This script was wrote for the notifications only but can easily be modified if you wish to do the same as me:p. Now you have rule set up, you want to create a file called user.php in c_images/notifications. Inside the file put the following [code] <?php if(!isset($_GET["fig"]) || empty($_GET["fig"])) { echo "No fig request"; exit; } $ch = curl_init("https://www.habbo.com.br/habbo-imaging/avatarimage?hb=img&figure={$_GET["fig"]}&action=wav&direction=2&head_direction=3&size=m"); curl_setopt_array($ch, array( CURLOPT_RETURNTRANSFER => true, CURLOPT_HEADER => false, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36", CURLOPT_AUTOREFERER => true, CURLOPT_SSL_VERIFYPEER => false )); $content = curl_exec($ch); $type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE); curl_close($ch); if(!isset($content) || empty($content) || strpos($content, 'Not Found') !== false) { echo "Not found!"; exit; } header("Content-Type: {$type}"); echo $content; ?> [/code] And, finally. Sending the new image to the client (this just goes where ever you want to send it...); [code]Session.SendMessage(new RoomNotificationComposer("Title Example", "Content Example", $"fig/{Session.GetHabbo().Look}");[/code] You may need to add reference to the namespace for RoomNotificationComposer. Here is how; Add the following to the top of the file... [code]using Plus.Communication.Packets.Outgoing.Rooms.Notifications;[/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Releases
Server Releases
[PlusEMU][Addon] User's avatar in alert
Top