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 Tutorials
[TUT]How to Extend your client with HTML,PHP and JQuery
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="leenster" data-source="post: 140692" data-attributes="member: 10665"><p>Have you ever wanted to add some features to your client? Like a Bot shop or something like that?</p><p> </p><p>Well read this tutorial and you will know how to do it.</p><p> </p><p>First ill show you a screen shot:</p><p><img src="http://hubbahubba.no-ip.biz/downloads/extendswf.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p>The new box is completely draggable just like the other boxes in your swf.</p><p> </p><p> </p><p>I know.... pretty sweet huh?</p><p> </p><p>Ok lets see how its done (it's easy).</p><p> </p><p>What we are going to do is just overlay some stuff over your swf and to your visitors it will look like it is all part of the client.</p><p> </p><p>Ok lets get started.</p><p> </p><p>Make sure this parameter is in your list of parameter for your habbo.swf</p><p>[PHP]params["wmode"] = "transparent";[/PHP]</p><p> </p><p>First add these lines to your client. make sure it is before the </header> tag.</p><p>[PHP]</p><p><style></p><p>.menu</p><p>{</p><p>position:fixed;</p><p>bottom:45px;</p><p>left:15px;</p><p>z-index: 1005 !important;</p><p>color:#FFF;</p><p>cursor:pointer;</p><p>}</p><p>.button</p><p>{</p><p>float:left;</p><p>padding:3px;</p><p>margin-right:3px;</p><p>}</p><p>#addedcontent</p><p>{</p><p>position:fixed;</p><p>top:5px;</p><p>left:300px;</p><p>max-width:400px;</p><p>min-width:150px;</p><p>z-index: 1006 !important;</p><p>}</p><p>#b-header</p><p>{</p><p>cursor:default;</p><p>padding:5px;</p><p>text-align:center;</p><p>background-color:#568BA4;</p><p>font-size:13px;</p><p>font-weight:bold;</p><p>-moz-border-radius: 5px 5px 0px 0px;</p><p>border-radius: 5px 5px 0px 0px;</p><p>border:2px solid #66A2BE;</p><p>border-bottom: 1px solid #000;</p><p>height:19px;</p><p>line-height:19px;</p><p>}</p><p>#b-content</p><p>{</p><p>padding:5px;</p><p>background-color:#E9E9E1;</p><p>-moz-border-radius: 0px 0px 5px 5px;</p><p>border-radius: 0px 0px 5px 5px;</p><p>color:#000;</p><p>}</p><p>#close-button</p><p>{</p><p>position:absolute;</p><p>right:5px;</p><p>top:7px;</p><p>width:19px;</p><p>height:20px;</p><p>background-image:url('images/buttons/close.png');</p><p>background-repeat:no-repeat;</p><p>cursor:pointer;</p><p>background-position:right top;</p><p>}</p><p>#close-button:hover</p><p>{</p><p>background-repeat:no-repeat;</p><p> </p><p>background-position:left top;</p><p>}</p><p>@font-face</p><p>{</p><p>font-family: Ubuntu-C;</p><p>src: url('Ubuntu-C.ttf');</p><p>}</p><p> </p><p>body</p><p>{</p><p>font-size: 12px;</p><p>font-family:Ubuntu-C;</p><p>}</p><p></style></p><p> </p><p><link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/></p><p><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script></p><p><script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script></p><p> </p><p><script></p><p> $(document).ready(function() {</p><p> $("#addedcontent").draggable();</p><p>$("#addedcontent").hide();</p><p> });</p><p> function loadpage(page,title)</p><p> {</p><p>$("#b-header").html(title + '<div id="close-button" onclick="$(\'#addedcontent\').hide();"></div>');</p><p> </p><p>$('#b-content').load("addedcontent/"+page+".php", function()</p><p>{</p><p>$("#addedcontent").show();</p><p>});</p><p> }</p><p></script></p><p> </p><p>[/PHP]</p><p> </p><p> </p><p>Now after your <body> tag paste the following code.</p><p>[PHP]</p><p><div class="menu"></p><p><div class="button" onclick="loadpage('bots','Bot Creator');">Create Bot</div></p><p><div class="button" onclick="loadpage('coins','Buy Coins');">Buy Coins</div></p><p><div class="button" onclick="loadpage('badgeshop','Badge Shop');">Badge Shop</div></p><p></div></p><p><div id="addedcontent"></p><p><div id="b-header"></p><p>header</p><p> </p><p></div></p><p><div id="b-content"></p><p>content</p><p></div></p><p></div></p><p>[/PHP]</p><p> </p><p>Save this image <img src="http://hubbahubba.no-ip.biz/images/buttons/close.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> somewhere and adjust this css code to point to the right location.</p><p>[PHP]#close-button</p><p>{</p><p>position:absolute;</p><p>right:5px;</p><p>top:7px;</p><p>width:19px;</p><p>height:20px;</p><p>background-image:url('images/buttons/close.png');</p><p>background-repeat:no-repeat;</p><p>cursor:pointer;</p><p>background-position:right top;</p><p>}[/PHP]</p><p> </p><p>Download the Ubuntu font <a href="http://hubbahubba.no-ip.biz/downloads/Ubuntu-C.rar" target="_blank">here </a>and put it in the root of your site (or where ever you want it, just edit the css ).</p><p> </p><p>Also create a folder in your root called AddedContent. This is where the extra content will be stored.</p><p> </p><p> </p><p>Basically you are done.....</p><p> </p><p>To create content Just create a PHP file in your AddedContent folder. e.g. AddedContent/bots.php</p><p> </p><p>To create a link to your file just add a line like this</p><p>[PHP]</p><p><div class="button" onclick="loadpage('bots','Bot Creator');">Create Bot</div></p><p>[/PHP]</p><p>loadpage('bots <span style="color: #808080"><em>//this is the name of the PHP file, do not add .PHP//</em></span>','Bot Creator<span style="color: #808080"><em> //This is the title that will be shown in the header of the box//'</em></span>);</p><p> </p><p> </p><p>If you dont like the location of the menu bar then just edit the CSS:</p><p>[PHP]</p><p>.menu</p><p>{</p><p>position:fixed;</p><p>bottom:45px;</p><p>left:15px;</p><p>z-index: 1005 !important;</p><p>color:#FFF;</p><p>cursor:pointer;</p><p>}</p><p>[/PHP]</p><p> </p><p>If you want to edit the look of the buttons then edit this css:</p><p>[PHP].button</p><p>{</p><p>float:left;</p><p>padding:3px;</p><p>margin-right:3px;</p><p>}</p><p>[/PHP]</p><p> </p><p> </p><p> </p><p>If you make a form, for example then just use JQUERY to submit it.</p><p> </p><p> </p><p>Like this example:</p><p>[PHP]</p><p>$(function() { </p><p> $(".button").click(function() { </p><p> // validate and process form here </p><p>var dataString = 'name='+ name + '&id=' + id + '&look=' + look; //just an example</p><p>$.ajax({ </p><p>type: "POST", </p><p>url: "bin/process.php", </p><p>data: dataString, </p><p>success: function() { </p><p>//Completed hide the Box</p><p>$("#addedcontent").hide();</p><p>} </p><p>});</p><p> }); </p><p>});</p><p>[/PHP]</p><p> </p><p> </p><p> </p><p>Hopefully you guys will be nice enough to share your creations.</p></blockquote><p></p>
[QUOTE="leenster, post: 140692, member: 10665"] Have you ever wanted to add some features to your client? Like a Bot shop or something like that? Well read this tutorial and you will know how to do it. First ill show you a screen shot: [IMG]http://hubbahubba.no-ip.biz/downloads/extendswf.png[/IMG] The new box is completely draggable just like the other boxes in your swf. I know.... pretty sweet huh? Ok lets see how its done (it's easy). What we are going to do is just overlay some stuff over your swf and to your visitors it will look like it is all part of the client. Ok lets get started. Make sure this parameter is in your list of parameter for your habbo.swf [PHP]params["wmode"] = "transparent";[/PHP] First add these lines to your client. make sure it is before the </header> tag. [PHP] <style> .menu { position:fixed; bottom:45px; left:15px; z-index: 1005 !important; color:#FFF; cursor:pointer; } .button { float:left; padding:3px; margin-right:3px; } #addedcontent { position:fixed; top:5px; left:300px; max-width:400px; min-width:150px; z-index: 1006 !important; } #b-header { cursor:default; padding:5px; text-align:center; background-color:#568BA4; font-size:13px; font-weight:bold; -moz-border-radius: 5px 5px 0px 0px; border-radius: 5px 5px 0px 0px; border:2px solid #66A2BE; border-bottom: 1px solid #000; height:19px; line-height:19px; } #b-content { padding:5px; background-color:#E9E9E1; -moz-border-radius: 0px 0px 5px 5px; border-radius: 0px 0px 5px 5px; color:#000; } #close-button { position:absolute; right:5px; top:7px; width:19px; height:20px; background-image:url('images/buttons/close.png'); background-repeat:no-repeat; cursor:pointer; background-position:right top; } #close-button:hover { background-repeat:no-repeat; background-position:left top; } @font-face { font-family: Ubuntu-C; src: url('Ubuntu-C.ttf'); } body { font-size: 12px; font-family:Ubuntu-C; } </style> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <script> $(document).ready(function() { $("#addedcontent").draggable(); $("#addedcontent").hide(); }); function loadpage(page,title) { $("#b-header").html(title + '<div id="close-button" onclick="$(\'#addedcontent\').hide();"></div>'); $('#b-content').load("addedcontent/"+page+".php", function() { $("#addedcontent").show(); }); } </script> [/PHP] Now after your <body> tag paste the following code. [PHP] <div class="menu"> <div class="button" onclick="loadpage('bots','Bot Creator');">Create Bot</div> <div class="button" onclick="loadpage('coins','Buy Coins');">Buy Coins</div> <div class="button" onclick="loadpage('badgeshop','Badge Shop');">Badge Shop</div> </div> <div id="addedcontent"> <div id="b-header"> header </div> <div id="b-content"> content </div> </div> [/PHP] Save this image [IMG]http://hubbahubba.no-ip.biz/images/buttons/close.png[/IMG] somewhere and adjust this css code to point to the right location. [PHP]#close-button { position:absolute; right:5px; top:7px; width:19px; height:20px; background-image:url('images/buttons/close.png'); background-repeat:no-repeat; cursor:pointer; background-position:right top; }[/PHP] Download the Ubuntu font [URL='http://hubbahubba.no-ip.biz/downloads/Ubuntu-C.rar']here [/URL]and put it in the root of your site (or where ever you want it, just edit the css ). Also create a folder in your root called AddedContent. This is where the extra content will be stored. Basically you are done..... To create content Just create a PHP file in your AddedContent folder. e.g. AddedContent/bots.php To create a link to your file just add a line like this [PHP] <div class="button" onclick="loadpage('bots','Bot Creator');">Create Bot</div> [/PHP] loadpage('bots [COLOR=#808080][I]//this is the name of the PHP file, do not add .PHP//[/I][/COLOR]','Bot Creator[COLOR=#808080][I] //This is the title that will be shown in the header of the box//'[/I][/COLOR]); If you dont like the location of the menu bar then just edit the CSS: [PHP] .menu { position:fixed; bottom:45px; left:15px; z-index: 1005 !important; color:#FFF; cursor:pointer; } [/PHP] If you want to edit the look of the buttons then edit this css: [PHP].button { float:left; padding:3px; margin-right:3px; } [/PHP] If you make a form, for example then just use JQUERY to submit it. Like this example: [PHP] $(function() { $(".button").click(function() { // validate and process form here var dataString = 'name='+ name + '&id=' + id + '&look=' + look; //just an example $.ajax({ type: "POST", url: "bin/process.php", data: dataString, success: function() { //Completed hide the Box $("#addedcontent").hide(); } }); }); }); [/PHP] Hopefully you guys will be nice enough to share your creations. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Tutorials
[TUT]How to Extend your client with HTML,PHP and JQuery
Top