Hello,
Today I propose a ubercms addons (based on HoloCMS) ...
This search system user.
See screenshot:
http://img4.hostingpics.net/pics/306...archscreen.png
Code:in /inc/tpl/
add the file comp-habbosearch.tpl and inside put:
<div class="habblet-container ">
<div class="cb clearfix default "><div class="bt"><div></div></div><div class="i1"><div class="i2"><div class="i3">
<div class="box-tabs-container clearfix">
<h2>Colas</h2>
<ul class="box-tabs">
<li class="selected" id="tab-0-5-1"><a href="#">Rechercher des Colas</a><span class="tab-spacer"></span></li>
</ul>
</div>
<div id="tab-0-5-1-content">
<div class="habblet-content-info">
<a name="habbo-search">Ecris ici la 1ère lettre d'un nom pour chercher d'autres Colas.</a>
</div>
<div style="display: none;" id="habbo-search-error-container"><div class="rounded-container"><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px 4px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(238, 107, 122);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(231, 40, 62);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(227, 8, 33);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div></div></div></div><div style="margin: 0px 2px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(238, 105, 121);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 1, 27);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(233, 64, 83);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(238, 105, 121);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 1, 27);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(238, 107, 122);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(231, 40, 62);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(227, 8, 33);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div></div><div class="rounded-red rounded-done" id="habbo-search-error"></div><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(227, 8, 33);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(231, 40, 62);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(238, 107, 122);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 1, 27);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(238, 105, 121);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(233, 64, 83);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div></div><div style="margin: 0px 2px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(238, 105, 121);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 1, 27);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div></div></div><div style="margin: 0px 4px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(238, 107, 122);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(231, 40, 62);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(227, 8, 33);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(226, 0, 26);"></div></div></div></div></div></div></div></div>
<br clear="all">
<div id="avatar-habblet-list-search">
<input type="text" id="avatar-habblet-search-string">
<a class="new-button" id="avatar-habblet-search-button" href="#"><b>Chercher</b><i></i></a>
</div>
<br clear="all">
<div id="avatar-habblet-content">
<div class="habblet-list-container" id="avatar-habblet-list-container">
<ul class="habblet-list">
</ul>
</div>
<script type="text/javascript">
L10N.put("habblet.search.error.search_string_too_long", "Le mot-clé est trop long. La longueur maximum est de 30 caractères.");
L10N.put("habblet.search.error.search_string_too_short", "Le mot-clé est trop court. 2 caractères requis");
L10N.put("habblet.search.add_friend.title", "Ajouter à ta liste d'amis");
new HabboSearchHabblet(2, 30);
</script>
</div>
<script type="text/javascript">
Rounder.addCorners($("habbo-search-error"), 8, 8);
</script> </div>
</div></div></div><div class="bb"><div></div></div></div>
</div>
Code:in me.php, after "$tpl->AddGeneric('comp-minimail');"
Add : $tpl->AddGeneric('comp-habbosearch');
Code:in the main directory add "habbosearchcontent.php"
and inside, add:
<?php
require_once "global.php";
// #########################################################################
function IsEven($intNumber)
{
if($intNumber % 2 == 1){
return true;
} else {
return false;
}
}
// OTHER
$i = date('i');
if(isset($_POST['pageNumber'])) {
$page = $_POST['pageNumber'];
}else{
$page = 1;
}
if(isset($_POST['searchString'])) {
$search = filter($_POST['searchString']);
$sql = mysql_query("SELECT username,look,id,last_online,motto FROM users WHERE username LIKE '%$search%' ORDER BY username ASC");
$count = mysql_num_rows($sql);
$pages = ceil($count / 10);
if($page == null){ $page = 1; }
$limit = 10;
$offset = $page - 1;
$offset = $offset * 10;
$sql = mysql_query("SELECT username,look,id,last_online,motto FROM users WHERE username LIKE '%$search%' ORDER BY username ASC LIMIT $limit OFFSET $offset");
if(mysql_num_rows($sql) > 0) {
echo '<ul class="habblet-list">';
while($row = mysql_fetch_assoc($sql)) {
$i++;
if(IsEven($i)){
$even = "odd";
} else {
$even = "even";
} ?>
<li class="<?php echo $even; ?> offline" homeurl="/home/<?php echo ($row['username']); ?>" style="background-image: url(http://www.habbo.com/habbo-imaging/avatarimage?figure=<?php echo $row['look']; ?>&direction=2&head_direction=2&gesture=sml&size=s)">
<div class="item">
<b><?php echo ($row['username']); ?></b><br /><?php echo ($row['motto']); ?>
</div>
<div class="lastlogin">
<b>Dernière connexion</b><br />
<span title="<?php echo $row['last_online']; ?>"><?php echo $row['last_online']; ?></span>
</div>
<div class="tools">
<a href="#" class="add" avatarid="<?php echo $row['id']; ?>" title="Ajouter <?php echo ($row['username']); ?> à ta liste d'amis"></a>
</div>
<div class="clear"></div>
</li>
<?php } ?>
<div id="habblet-paging-avatar-habblet-list-container">
<p id="avatar-habblet-list-container-list-paging" class="paging-navigation">
<?php if($page > 1) { ?><a href="#" class="avatar-habblet-list-container-list-paging-link" id="avatar-habblet-list-container-list-previous">«</a><?php } else { ?><span class="disabled">«</span><?php } ?>
<?php
$i = 0;
$n = $pages;
while ($i <> $n){
$i++;
if ($i < $page + 8){
if($i == $page){ echo "<span class=\"current\">".$i."</span>\n";
} else {
if ($i + 4 >= $page && $page + 4 >= $i){
echo "<a href=\"#\" class=\"avatar-habblet-list-container-list-paging-link\" id=\"avatar-habblet-list-container-list-page-".$i."\">".$i."</a>\n";
}
}
}
}
?>
<?php if($page < $pages) { ?><a href="#" class="avatar-habblet-list-container-list-paging-link" id="avatar-habblet-list-container-list-next">»</a><?php }else{ ?><span class="disabled">»</span><?php } ?>
</p>
<input type="hidden" id="avatar-habblet-list-container-pageNumber" value="<?php echo $page; ?>"/>
<input type="hidden" id="avatar-habblet-list-container-totalPages" value="<?php echo $pages; ?>"/>
</div>
<?php
}else{
echo "<div class=\"box-content\">
Cola not found. Please make sure you have typed his or her name correctly and try again. <br>
</div>";
}
}
?>
Code:and finally, in the. htaccess, add:
RewriteRule ^habblet/habbosearchcontent(|/)$ /habbosearchcontent.php

