-
Notifications
You must be signed in to change notification settings - Fork 3
/
profile-grupos.php
1131 lines (1041 loc) · 50.7 KB
/
profile-grupos.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?
include("global.php");
// Definimos la ID de la pagina \\
$menu_id = "home";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<style type="text/css">
.profiles {
color: #FFF;
}
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<base href="<?=$config['cms_base'];?>" />
<link href="images/css/header.css" rel="stylesheet" type="text/css" />
<link href="images/css/me.css" rel="stylesheet" type="text/css" />
<? $is_exist = mysql_query("Select * from `users` where username = '".mysql_real_escape_string($_GET['name'])."' ");
if(mysql_num_rows($is_exist)){
$drt = mysql_fetch_array($is_exist);
$prname = "Perfil de ".$drt['username'];
}else{ $prname = "Perfil no encontrado"; } ?>
<title><?=$config['cms_name']; ?> - <? echo $prname; ?></title>
<style type="text/css">
td,th {
font-family: verdana;
font-size: 11px;
}
.title_menu {
color: #FFF;
}
body {
margin-top: 0px;
background-image: url(images/backgrounds/bg_fi_vw.png);
background-position:top;
background-color: #A8E3F9;
background-repeat:repeat-x;
}
.submenu {
color: #FFF;
}
.submenu_on {
color: #000;
}
.rellall { color: #F00;
}
.nick_pltb {
font-size: 9px;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
</style>
<base href="<?=$config['cms_base'];?>" />
</head>
<body><? include("top.php"); ?>
<br><br>
<? $is_exist = mysql_query("Select * from `users` where username = '".mysql_real_escape_string($_GET['name'])."' ");
if(mysql_num_rows($is_exist)){
$drt = mysql_fetch_array($is_exist);
if($drt['profile'] == "0"){
if($drt['username'] == $_SESSION['username']){ $access = true; }else{ $access = false; }
}elseif($drt['profile'] == "1"){
$ch = mysql_query("Select * from `messenger_friendships` where user_one_id = '".$sys->UserInfo($username,"id")."' and user_two_id = '".$drt['id']."' ");
if(mysql_num_rows($ch) || $drt['username'] == $_SESSION['username']){ $access = true; }else{ $access = false; }
}elseif($dt['profile'] == "2"){ $access = true; }else{ $access = true; }
if($access == true){
?>
<table width="929" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="929" height="71" align="center" style="border:1px solid #000; border-radius:3px 3px 3px 3px; background-color:#FFF;"><table width="928" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="929"><table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="gallery/box/homes.png"><table width="928" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="918"><?php
$allow_guests = true;
require_once('includes/core.php');
if(isset($_GET['tag']) || isset($_GET['name']) || isset($_POST['name'])){
if(isset($_GET['tag'])){
$searchname = FilterText($_GET['tag']);
} else if(isset($_GET['name'])){
$searchname = FilterText($_GET['name']);
} else if(isset($_POST['name'])){
$searchname = FilterText($_POST['name']);
} else {
$error = true;
}
$user_sql = mysql_query("SELECT * FROM users WHERE username = '".$searchname."' LIMIT 1") or die(mysql_error());
$user_exists = mysql_num_rows($user_sql);
if($user_exists == "1"){
$error = false;
$user_row = mysql_fetch_assoc($user_sql);
$pagename = "User Profile - ".$user_row['username']."";
if($user_row['rank'] == "6"){
$drank = "Administrator";
} else if($user_row['rank'] == "5"){
$drank = "Moderator";
} else if($user_row['rank'] == "4"){
$drank = "Staff member";
} else if($user_row['rank'] < 4){
$drank = "member";
}
} else {
$error = true;
}
} else if(isset($_GET['tagid']) || isset($_GET['id']) || isset($_POST['id'])){
if(isset($_GET['tagid'])){
$searchid = FilterText($_GET['tagid']);
} else if(isset($_GET['id'])){
$searchid = FilterText($_GET['id']);
} else if(isset($_POST['id'])){
$searchid = FilterText($_POST['id']);
} else {
$error = true;
}
$user_sql = mysql_query("SELECT * FROM users WHERE id = '".$searchid."' LIMIT 1") or die(mysql_error());
$user_exists = mysql_num_rows($user_sql);
if($user_exists == "1"){
$error = false;
$user_row = mysql_fetch_assoc($user_sql);
$pagename = "User Profile - ".$user_row['username']."";
if($user_row['rank'] == "6"){
$drank = "Administrator";
} else if($user_row['rank'] == "5"){
$drank = "Moderator";
} else if($user_row['rank'] == "4"){
$drank = "Staff member";
} else if($user_row['rank'] < 4){
$drank = "member";
}
} else {
$error = true;
}
} else {
$error = true;
}
if(isset($_GET['do']) && $_GET['do'] == "edit" && $logged_in){
if($user_row['username'] == $name){
$edit_mode = true;
mysql_query("UPDATE cms_homes_group_linker SET active = '0' WHERE userid = '".$my_id."' LIMIT 1") or die(mysql_error());
} else {
echo'<script language="JavaScript" type="text/javascript">
var pagina="./home/'.$user_row['username'].'"
function redireccionar()
{
location.href=pagina
}
setTimeout ("redireccionar()", 0);
</script>';
exit;
$edit_mode = false;
}
} else {
$edit_mode = false;
}
if(!$error){
$body_id = "viewmode";
if($edit_mode){
$body_id = "editmode";
}
} else {
$body_id = "home";
}
if($searchname == $rawname && $logged_in){
$pageid = "myprofile";
} else {
$pageid = "profile";
}
$bg_fetch = mysql_query("SELECT data FROM cms_homes_stickers WHERE type = '4' AND userid = '".$user_row['id']."' AND groupid = '-1' LIMIT 1");
$bg_exists = mysql_num_rows($bg_fetch);
if($bg_exists < 1){ // if there's no background override for this user set it to the standard
$bg = "b_bg_pattern_abstract2";
} else {
$bg = mysql_fetch_array($bg_fetch);
$bg = "b_" . $bg[0];
}
if(!$error){
include('templates/community/hsubheader.php');
include('templates/community/header.php');
?>
<table width="100%" height="49" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="916"><div class="box-tabs-container box-tabs-left clearfix">
<?php if($user_row['username'] == $name && $edit_mode !== true){ ?>
<a href="home/<?php echo FilterText($name); ?>/edit" id="edit-button" class="new-button dark-button edit-icon" style="float:left"><b><span></span>Editar</b><i></i></a>
<?php } ?>
<h2 class="page-owner"><?php echo $user_row['username']; ?></h2>
</div>
<?php if($edit_mode == true){ ?>
<div id="top-toolbar" class="clearfix">
<ul>
<li><a href="#" id="inventory-button">Inventario</a></li>
<li><a href="#" id="webstore-button">Catalogo</a></li>
</ul>
<form action="#" method="get" style="width: 50%;">
<a id="cancel-button" class="new-button red-button cancel-icon" href="#"><b><span></span>Cancelar</b><i></i></a> <a id="save-button" class="new-button green-button save-icon" href="#"><b><span></span>Guardar</b><i></i></a>
</form>
</div>
<?php } ?></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div id="mypage-bg" class="<?php echo $bg; ?>">
<div id="playground-outer">
<div id="playground">
<?php
$get_em = mysql_query("SELECT id,type,x,y,z,data,skin,subtype,var FROM cms_homes_stickers WHERE userid = '".$user_row['id']."' AND groupid = '-1' AND type < 4 LIMIT 200") or die(mysql_error());
$_SESSION['profile_id'] = $user_row['id'];
while ($row = mysql_fetch_array($get_em, MYSQL_NUM)) {
switch($row[1]){
default: $type = "sticker"; break;
case 1: $type = "sticker"; break;
case 2: $type = "widget"; break;
case 3: $type = "stickie"; break;
case 4: $type = "ignore"; break;
}
if($edit_mode == true){
$edit = "\n<img src=\"./web-gallery/images/myhabbo/icon_edit.gif\" width=\"19\" height=\"18\" class=\"edit-button\" id=\"" . $type . "-" . $row[0] . "-edit\" />
<script language=\"JavaScript\" type=\"text/javascript\">
Event.observe(\"".$type."-".$row[0]."-edit\", \"click\", function(e) { openEditmenu(e, ".$row[0].", \"".$type."\", \"".$type."-".$row[0]."-edit\"); }, false);
</script>\n";
} else {
$edit = " ";
}
// old check
if($user_row['rank'] > 5){
$content = bbcode_format(nl2br(HoloText($row[5])));
} else {
$content = bbcode_format(nl2br(HoloText($row[5])));
}
if($type == "stickie"){
printf("<div class=\"movable stickie n_skin_%s-c\" style=\" left: %spx; top: %spx; z-index: %s;\" id=\"stickie-%s\">
<div class=\"n_skin_%s\" >
<div class=\"stickie-header\">
<h3>%s</h3>
<div class=\"clear\"></div>
</div>
<div class=\"stickie-body\">
<div class=\"stickie-content\">
<div class=\"stickie-markup\">%s</div>
<div class=\"stickie-footer\">
</div>
</div>
</div>
</div>
</div>",$row[6],$row[2],$row[3],$row[4],$row[0],$row[6],$edit,$content);
} elseif($type == "sticker"){
printf("<div class=\"movable sticker s_%s\" style=\"left: %spx; top: %spx; z-index: %s\" id=\"sticker-%s\">\n%s\n</div>", $row[5], $row[2], $row[3], $row[4], $row[0], $edit);
} elseif($type == "widget"){
switch($row[7]){
case 1: $subtype = "Profilewidget"; break;
case 2: $subtype = "GroupsWidget"; break;
case 3: $subtype = "RoomsWidget"; break;
case 4: $subtype = "GuestbookWidget"; break;
case 5: $subtype = "FriendsWidget"; break;
case 6: $subtype = "TraxPlayerWidget"; break;
case 7: $subtype = "HighScoresWidget"; break;
case 8: $subtype = "BadgesWidget";
}
if($subtype == "GroupsWidget"){
$groups = mysql_evaluate("SELECT COUNT(*) FROM groups_memberships WHERE userid = '".$user_row['id']."' AND is_pending = '0' LIMIT 1");
echo "<div class=\"movable widget GroupsWidget\" id=\"widget-".$row[0]."\" style=\" left: ".$row[2]."px; top: ".$row[3]."px; z-index: ".$row[4].";\">
<div class=\"w_skin_".$row[6]."\">
<div class=\"widget-corner\" id=\"widget-".$row[0]."-handle\">
<div class=\"widget-headline\"><h3><span class=\"header-left\"> </span><span class=\"header-middle\">Mis grupos (<span id=\"groups-list-size\">".$groups."</span>)</span><span class=\"header-right\">".$edit."</span></h3>
</div>
</div>
<div class=\"widget-body\">
<div class=\"widget-content\">
<div class=\"groups-list-container\">
<ul class=\"groups-list\">";
$get_groups = mysql_query("SELECT * FROM groups_memberships WHERE userid = '".$user_row['id']."' AND is_pending = '0'") or die(mysql_error());
while($membership_row = mysql_fetch_assoc($get_groups)){
$get_groupdata = mysql_query("SELECT * FROM groups_details WHERE id = '".$membership_row['groupid']."' LIMIT 1") or die(mysql_error());
$grouprow = mysql_fetch_assoc($get_groupdata);
echo " <li title=\"".$grouprow['name']."\" id=\"groups-list-".$row[0]."-".$grouprow['id']."\">
<div class=\"groups-list-icon\"><a href=\"groups/".$grouprow['id']."/id\"><img src='./habbo-imaging/badge?badge=".$grouprow['badge']."'/></a></div>
<div class=\"groups-list-open\"></div>
<h4>
<a href=\"groups/".$membership_row['groupid']."/id\">".$grouprow['name']."</a>
</h4>
<p>
Grupo creado:<br />";
if($membership_row['is_current'] == 1){ echo "<div class=\"favourite-group\" title=\"Favourite\"></div>\n"; }
if($membership_row['member_rank'] > 1 && $grouprow['ownerid'] !== $user_row['id']){ echo "<div class=\"admin-group\" title=\"Administrador\"></div>\n"; }
if($grouprow['ownerid'] == $user_row['id'] && $membership_row['member_rank'] > 1){ echo "<div class=\"owned-group\" title=\"Dueño\"></div>\n"; }
echo "<b>".date("d/m/y", $grouprow['created'])."</b>
</p>
<div class=\"clear\"></div>
</li>";
}
echo "</ul></div>
<div class=\"groups-list-loading\"><div><a href=\"#\" class=\"groups-loading-close\"></a></div><div class=\"clear\"></div><p style=\"text-align:center\"><img src=\"./web-gallery/images/progress_bubbles.gif\" alt=\"\" width=\"29\" height=\"6\" /></p></div>
<div class=\"groups-list-info\"></div>
<div class=\"clear\"></div>
</div>
</div>
</div>
</div>
<script type=\"text/javascript\">
document.observe(\"dom:loaded\", function() {
new GroupsWidget('".$user_row['id']."', '".$row[0]."');
});
</script>";
} elseif($subtype == "Profilewidget"){
$found_profile = true;
$info = mysql_query("SELECT * FROM users WHERE username = '".$searchname."' LIMIT 1") or die(mysql_error());
$userdata = mysql_fetch_assoc($info);
$valid = mysql_num_rows($info);
if($valid > 0){
echo "<div class=\"movable widget ProfileWidget\" id=\"widget-".$row[0]."\" style=\" left: ".$row[2]."px; top: ".$row[3]."px; z-index: ".$row[4].";\">
<div class=\"w_skin_".$row[6]."\">
<div class=\"widget-corner\" id=\"widget-".$row[0]."-handle\">
<div class=\"widget-headline\"><h3>" . $edit . "
<span class=\"header-left\"> </span><span class=\"header-middle\">Mi usuario</span><span class=\"header-right\"> </span></h3>
</div>
</div>
<div class=\"widget-body\">
<div class=\"widget-content\">
<div class=\"profile-info\">
<div class=\"name\" style=\"float: left\">
<span class=\"name-text\">".$userdata['username']."</span>
</div>
<br class=\"clear\" />";
if($userdata['online'] == "1"){ echo "<img alt=\"online\" src=\"./web-gallery/images/myhabbo/habbo_online_anim_big.gif\" />"; } else { echo "<img alt=\"offline\" src=\"./web-gallery/images/myhabbo/habbo_offline_big.gif\" />"; }
echo "<div class=\"birthday text\">
<strong> Registrado el:</strong>
</div>
<div class=\"birthday date\">
".date("d/m/y", $userdata['account_created'])."
</div>
<div>";
echo "
</div>
</div>
<div class=\"profile-figure\">
<img alt=\"".$userdata['username']."\" src=\"http://www.habbo.es/habbo-imaging/avatarimage?figure=".$userdata['look']."&size=b&direction=4&head_direction=4&gesture=sml\" />
</div>";
if($userdata['id'] != $my_id && $logged_in == true){
$sql = mysql_query("SELECT * FROM messenger_friendships WHERE user_one_id = '".$my_id."' AND user_two_id = '".$userdata['id']."'");
$rows = mysql_num_rows($sql);
if($rows < 1){
?>
<div class="profile-friend-request clearfix"> <a href="./myhabbo/friends_add.php?id=<?php echo $userdata['id']; ?>" class="new-button" id="add-friend" style="float: left"><b>Añadir como amigo</b><i></i></a></div>
<?php } }
echo "<br clear=\"all\" style=\"display: block; height: 1px;\"/>
<div id=\"profile-tags-panel\" style=\"border-top-width: 1px;border-top-style: dashed;border-top-color: black;\">
<div id=\"profile-tag-list\">
<div id=\"profile-tags-container\">\n";
$get_tags = mysql_query("SELECT * FROM users_tags WHERE user_id = '".$userdata['id']."' ORDER BY id LIMIT 20") or die(mysql_error());
$rows = mysql_num_rows($get_tags);
$num = mysql_num_rows($get_tags);
if($num > 0){
if($userdata['id'] == $my_id && $logged_in){
while ($row1 = mysql_fetch_assoc($get_tags)){
printf(" <span class=\"tag-search-rowholder\">
<a href=\"#\" class=\"tag-search-link tag-search-link-%s\"
>%s</a><img border=\"0\" class=\"tag-delete-link tag-delete-link-%s\" onMouseOver=\"this.src='./web-gallery/images/buttons/tags/tag_button_delete_hi.gif'\" onMouseOut=\"this.src='./web-gallery/images/buttons/tags/tag_button_delete.gif'\" src=\"./web-gallery/images/buttons/tags/tag_button_delete.gif\"
/></span>", $row1['tag'], $row1['tag'], $row1['tag'], $row1['tag']);
}
} elseif($logged_in){
while ($row1 = mysql_fetch_assoc($get_tags)){
printf(" <span class=\"tag-search-rowholder\">
<a href=\"#\" class=\"tag-search-link tag-search-link-%s\"
>%s</a><img border=\"0\" class=\"tag-add-link tag-add-link-%s\" onMouseOver=\"this.src='./web-gallery/images/buttons/tags/tag_button_add_hi.gif'\" onMouseOut=\"this.src='./web-gallery/images/buttons/tags/tag_button_add.gif'\" src=\"./web-gallery/images/buttons/tags/tag_button_add.gif\"
/></span>", $row1['tag'], $row1['tag'], $row1['tag'], $row1['tag']);
}
} else {
while ($row1 = mysql_fetch_assoc($get_tags)){
printf(" <span class=\"tag-search-rowholder\">
<a href=\"#\" class=\"tag-search-link tag-search-link-%s\"
>%s</a></span>", $row1['tag'], $row1['tag'], $row1['tag'], $row1['tag']);
}
}
} else {
echo "No tienes tags.";
}
echo "\n <img id=\"tag-img-added\" border=\"0\" src=\"./web-gallery/images/buttons/tags/tag_button_added.gif\" style=\"display:none\"/>
</div>
<script type=\"text/javascript\">
document.observe(\"dom:loaded\", function() {
TagHelper.setTexts({
buttonText: \"OK\",
tagLimitText: \"Hay un limite de 20 tags\"
});
});
</script>
</div>
<div id=\"profile-tags-status-field\">
<div style=\"display: block;\">
<div class=\"content-red\">
<div class=\"content-red-body\">
<span id=\"tag-limit-message\"><img src=\"./web-gallery/images/register/icon_error.gif\"/> Hay un limite de 20 tags</span>
<span id=\"tag-invalid-message\"><img src=\"./web-gallery/images/register/icon_error.gif\"/> Tag invalido.</span>
</div>
</div>
<div class=\"content-red-bottom\">
<div class=\"content-red-bottom-body\"></div>
</div>
</div>
</div>";
if($userdata['id'] == $my_id){
echo "<div class=\"profile-add-tag\">
<input type=\"text\" id=\"profile-add-tag-input\" maxlength=\"30\"/><br clear=\"all\"/>
<a href=\"#\" class=\"new-button\" style=\"float:left;margin:5px 0 0 0;\" id=\"profile-add-tag\"><b>Añadir tag</b><i></i></a>
</div>";
}
echo "</div>
<script type=\"text/javascript\">
document.observe(\"dom:loaded\", function() {
new ProfileWidget('".$userdata['id']."', '".$userdata['id']."', {
headerText: \"�Estas seguro?\",
messageText: \"¿Estas seguro que quieres añadir como amigo a <strong\>".$userdata['username']."</strong\>? El deberá aceptar tu petición.\",
buttonText: \"OK\",
cancelButtonText: \"Cancelar\"
});
});
</script>
<div class=\"clear\"></div>
</div>
</div>
</div></div>";
}
} elseif($subtype == "GuestbookWidget"){
$sql = mysql_query("SELECT * FROM cms_guestbook WHERE widget_id = '".$row['0']."' ORDER BY id DESC");
$count = mysql_num_rows($sql);
$status = "public";
?>
<div class="movable widget GuestbookWidget" id="widget-<?php echo $row['0']; ?>" style=" left: <?php echo $row['2']; ?>px; top: <?php echo $row['3']; ?>px; z-index: <?php echo $row['4']; ?>;">
<div class="w_skin_<?php echo $row['6']; ?>">
<div class="widget-corner" id="widget-<?php echo $row['0']; ?>-handle">
<div class="widget-headline">
<h3> <?php echo $edit; ?> <span class="header-left"> </span><span class="header-middle">Mi libro de visitas(<span id="guestbook-size"><?php echo $count; ?></span>) <span id="guestbook-type" class="<?php echo $status; ?>"><img src="./web-gallery/images/groups/status_exclusive.gif" title="Friends only" alt="Friends only"/></span></span><span class="header-right"> </span></h3>
</div>
</div>
<div class="widget-body">
<div class="widget-content">
<div id="guestbook-wrapper" class="gb-public">
<ul class="guestbook-entries" id="guestbook-entry-container">
<?php if($count == 0){ ?>
<div id="guestbook-empty-notes">Este es tu libro de visitas. Actualmente está vacío, pero puedes invitar a tus amigos para que añaden un mensaje un mensaje en tu libro.</div>
<?php } else { ?>
<?php
$i = 0;
while ($row1 = mysql_fetch_assoc($sql)) {
$i++;
$userrow = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '".$row1['userid']."' LIMIT 1"));
if($my_id == $row1['userid']){
$owneronly = "<img src=\"./web-gallery/images/myhabbo/buttons/delete_entry_button.gif\" id=\"gbentry-delete-".$row1['id']."\" class=\"gbentry-delete\" style=\"cursor:pointer\" alt=\"\"/><br/>";
} elseif($user_row['id'] == $my_id) {
$owneronly = "<img src=\"./web-gallery/images/myhabbo/buttons/delete_entry_button.gif\" id=\"gbentry-delete-".$row1['id']."\" class=\"gbentry-delete\" style=\"cursor:pointer\" alt=\"\"/><br/>";
} else {
$owneronly = "";
}
if($row1['online'] == "1"){ $useronline = "online"; } else { $useronline = "offline"; }
printf(" <li id=\"guestbook-entry-%s\" class=\"guestbook-entry\">
<div class=\"guestbook-author\">
<img title=\"%s\" src=\"http://www.habbo.es/habbo-imaging/avatarimage?figure=".$userrow['look']."&direction=2&head_direction=2&gesture=sml&size=s\" alt=\"%s\" title=\"%s\"/>
</div>
<div class=\"guestbook-actions\">
$owneronly
</div>
<div class=\"guestbook-message\">
<div class=\"%s\">
<strong> <a href=\"./home/%s\">%s</a></strong>
</div>
<p><br />
%s</p>
</div>
<div class=\"guestbook-cleaner\"> </div>
<div class=\"guestbook-entry-footer metadata\">".$row1['time']."</div>
</li>",$row1['id'], $userrow['look'], $userrow['username'], $userrow['username'], $useronline, $userrow['username'], $userrow['username'], HoloText($row1['message'],false ,true), $userrow['time']);
}
} ?>
</ul>
</div>
<?php if($edit_mode == false){ ?>
<? if(LOGGED_IN){ ?> <div class="guestbook-toolbar clearfix"> <a href="#" class="new-button envelope-icon" id="guestbook-open-dialog"> <b><span></span>Añadir nuevo</b><i></i></a></div><? } ?>
<?php } ?>
<script type="text/javascript">
document.observe("dom:loaded", function() {
var gb<?php echo $row['0']; ?> = new GuestbookWidget('17570', '<?php echo $row['0']; ?>', 500);
var editmenuSection = $('guestbook-privacy-options');
if (editmenuSection) {
gb<?php echo $row['0']; ?>.updateOptionsList('public');
}
});
</script>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php
} elseif($subtype == "HighScoresWidget"){
?>
<div class="movable widget HighScoresWidget" id="widget-<?php echo $row['0']; ?>" style=" left: <?php echo $row['2']; ?>px; top: <?php echo $row['3']; ?>px; z-index: <?php echo $row['4']; ?>;">
<div class="w_skin_<?php echo $row['6']; ?>">
<div class="widget-corner" id="widget-<?php echo $row['0']; ?>-handle">
<div class="widget-headline">
<h3><?php echo $edit; ?><span class="header-left"> </span><span class="header-middle">HIGH SCORES</span><span class="header-right"> </span></h3>
</div>
</div>
<div class="widget-body">
<div class="widget-content">
<?php
$bbsql = mysql_query("SELECT * FROM users WHERE id = '".$user_row['id']."' LIMIT 1");
$bbrow = mysql_fetch_assoc($bbsql);
if($bbrow['bb_playedgames'] == "0"){
echo "You have not played any games yet.";
}else{ ?>
<table>
<tr colspan="2">
<th>Battle Ball</a></th>
</tr>
<tr>
<td>Games played</td>
<td><?php echo $bbrow['bb_playedgames']; ?></td>
</tr>
<tr>
<td>Total score</td>
<td><?php echo $bbrow['bb_totalpoints']; ?></td>
</tr>
</table>
<?php } ?>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php
} elseif($subtype == "FriendsWidget"){
$sql = mysql_query("SELECT * FROM messenger_friendships WHERE user_one_id = '".$user_row['id']."' ");
$count = mysql_num_rows($sql);
?>
<div class="movable widget FriendsWidget" id="widget-<?php echo $row['0']; ?>" style=" left: <?php echo $row['2']; ?>px; top: <?php echo $row['3']; ?>px; z-index: <?php echo $row['4']; ?>;">
<div class="w_skin_<?php echo $row['6']; ?>">
<div class="widget-corner" id="widget-<?php echo $row['0']; ?>-handle">
<div class="widget-headline">
<h3><?php echo $edit; ?><span class="header-left"> </span><span class="header-middle">Mis amigos (<?php echo $count; ?>)</span><span class="header-right"> </span></h3>
</div>
</div>
<div class="widget-body">
<div class="widget-content">
<div id="avatar-list-search">
<input type="text" style="float:left;" id="avatarlist-search-string"/>
<a class="new-button" style="float:left;" id="avatarlist-search-button"><b>Buscar</b><i></i></a></div>
<br clear="all"/>
<div id="avatarlist-content">
<?php
$bypass = true;
$widgetid = $row['0'];
$user = $user_row['id'];
include('./myhabbo/avatarlist_friendsearchpaging.php');
?>
<script type="text/javascript">
document.observe("dom:loaded", function() {
window.widget<?php echo $row['0']; ?> = new FriendsWidget('<?php echo $user_row['id']; ?>', '<?php echo $row['0']; ?>');
});
</script>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php
} elseif($subtype == "TraxPlayerWidget"){ ?>
<div class="movable widget TraxPlayerWidget" id="widget-<?php echo $row['0']; ?>" style=" left: <?php echo $row['2']; ?>px; top: <?php echo $row['3']; ?>px; z-index: <?php echo $row['4']; ?>;">
<div class="w_skin_<?php echo $row['6']; ?>">
<div class="widget-corner" id="widget-<?php echo $row['0']; ?>-handle">
<div class="widget-headline">
<h3><?php echo $edit; ?><span class="header-left"> </span><span class="header-middle">TRAXPLAYER</span><span class="header-right"> </span></h3>
</div>
</div>
<div class="widget-body">
<div class="widget-content">
<?php
if($row['8'] == ""){ $songselected = false; }else{ $songselected = true; }
if($edit_mode == true){ ?>
<div id="traxplayer-content" style="text-align: center;"> <img src="./web-gallery/images/traxplayer/player.png"/></div>
<div id="edit-menu-trax-select-temp" style="display:none">
<select name="trax-select-options-temp" id="trax-select-options-temp">
<option value="">- Choose song -</option>
<?php
$mysql = mysql_query("SELECT * FROM furniture WHERE ownerid = '".$user_row['id']."'");
$i = 0;
while($machinerow = mysql_fetch_assoc($mysql)){
$i++;
$sql = mysql_query("SELECT * FROM soundmachine_songs WHERE machineid = '".$machinerow['id']."'");
$n = 0;
while($songrow = mysql_fetch_assoc($sql)){
$n++;
if($songrow['id'] <> ""){ echo " <option value=\"".$songrow['id']."\">".trim(nl2br(HoloText($songrow['title'])))."</option>\n"; }
}
} ?>
</select>
</div>
<?php }elseif($songselected == false){ ?>
You do not have a selected Trax song.
<?php }else{
$sql1 = mysql_query("SELECT * FROM soundmachine_songs WHERE id = '".$row['8']."' LIMIT 1");
$songrow1 = mysql_fetch_assoc($sql); ?>
<div id="traxplayer-content" style="text-align:center;"></div>
<embed type="application/x-shockwave-flash"
src="<?php echo $path; ?>web-gallery/flash/traxplayer/traxplayer.swf" name="traxplayer" quality="high"
base="<?php echo $path; ?>web-gallery/flash/traxplayer/" allowscriptaccess="always" menu="false"
wmode="transparent" flashvars="songUrl=<?php echo $path; ?>myhabbo/trax_song.php?songId=<?php echo $row['8']; ?>&sampleUrl=http://images.habbohotel.com/dcr/hof_furni//mp3/" height="66" width="210" />
</embed>
<?php } ?>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php } elseif($subtype == "BadgesWidget"){
$sql = mysql_query("SELECT * FROM user_badges WHERE user_id = '".$user_row['id']."' ORDER BY badge_id ASC");
$count = mysql_num_rows($sql);
?>
<div class="movable widget BadgesWidget" id="widget-<?php echo $row['0']; ?>" style=" left: <?php echo $row['2']; ?>px; top: <?php echo $row['3']; ?>px; z-index: <?php echo $row['4']; ?>;">
<div class="w_skin_<?php echo $row['6']; ?>">
<div class="widget-corner" id="widget-<?php echo $row['0']; ?>-handle">
<div class="widget-headline"><h3><?php echo $edit; ?><span class="header-left"> </span><span class="header-middle">Placas y Recompensas</span><span class="header-right"> </span></h3>
</div>
</div>
<div class="widget-body">
<div class="widget-content">
<div id="badgelist-content">
<?php if($count == 0){ echo "No hay placas disponibles.";
} else {
$bypass1 = true;
$widgetid = $row['0'];
include('./habblet/myhabbo_badgelist_badgepaging.php');
} ?>
<script type="text/javascript">
document.observe("dom:loaded", function() {
window.badgesWidget<?php echo $row['0']; ?> = new BadgesWidget('<?php echo $user_row['id']; ?>', '<?php echo $row['0']; ?>');
});
</script>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<?php
}
}
}
if($found_profile !== true){
$info = mysql_query("SELECT * FROM users WHERE username = '".$searchname."' LIMIT 1") or die(mysql_error());
$userdata = mysql_fetch_assoc($info);
$valid = mysql_num_rows($info);
if($valid > 0){
mysql_query("INSERT INTO cms_homes_stickers (userid,type,subtype,x,y,z,skin) VALUES ('".$userdata['id']."','2','1','25','25','5','defaultskin')") or die(mysql_error());
?>
<div class="movable widget FriendsWidget" id="widget-<?php echo $row['0']; ?>" style=" left: <?php echo $row['2']; ?>px; top: <?php echo $row['3']; ?>px; z-index: <?php echo $row['4']; ?>;"> <?php echo "<div class=\"w_skin_defaultskin\">
<div class=\"widget-corner\" id=\"widget-".$row['id']."-handle\">
<div class=\"widget-headline\"><h3>" . $edit . "
<span class=\"header-left\"> </span><span class=\"header-middle\">Mi usuario</span><span class=\"header-right\"> </span></h3>
</div>
</div>
<div class=\"widget-body\">
<div class=\"widget-content\">
<div class=\"profile-info\">
<div class=\"name\" style=\"float: left\">
<span class=\"name-text\">".$userdata['username']."</span>
</div>
<br class=\"clear\" />";
if($userdata['online'] == "1"){ echo "<img alt=\"online\" src=\"./web-gallery/images/myhabbo/habbo_online_anim.gif\" />"; } else { echo "<img alt=\"offline\" src=\"./web-gallery/images/myhabbo/habbo_offline.gif\" />"; }
echo "<div class=\"birthday text\">
<strong>Registrado el:</strong>
</div>
<div class=\"birthday date\">
".date("d/m/y", $userdata['account_created'])."
</div>
<div>";
echo "
</div>
</div>
<div class=\"profile-figure\">
<img alt=\"".$userdata['username']."\" src=\"http://www.habbo.es/habbo-imaging/avatarimage?figure=".$userdata['look']."&size=b&direction=4&head_direction=4&gesture=sml\" />
</div>
<br clear=\"all\" style=\"display: block; height: 1px\"/>
<div id=\"profile-tags-panel\">
<div id=\"profile-tag-list\">
<div id=\"profile-tags-container\">\n";
$get_tags = mysql_query("SELECT * FROM users_tags WHERE user_id= '".$userdata['id']."' ORDER BY id LIMIT 20") or die(mysql_error());
$rows = mysql_num_rows($get_tags);
$num = mysql_num_rows($get_tags);
if($num > 0){
if($userdata['id'] == $my_id && $logged_in){
while ($row = mysql_fetch_assoc($get_tags)){
printf(" <span class=\"tag-search-rowholder\">
<a href=\"#\" class=\"tag-search-link tag-search-link-%s\"
>%s</a><img border=\"0\" class=\"tag-delete-link tag-delete-link-%s\" onMouseOver=\"this.src='./web-gallery/images/buttons/tags/tag_button_delete_hi.gif'\" onMouseOut=\"this.src='./web-gallery/images/buttons/tags/tag_button_delete.gif'\" src=\"./web-gallery/images/buttons/tags/tag_button_delete.gif\"
/></span>", $row['tag'], $row['tag'], $row['tag'], $row['tag']);
}
} elseif($logged_in){
while ($row = mysql_fetch_assoc($get_tags)){
printf(" <span class=\"tag-search-rowholder\">
<a href=\"#\" class=\"tag-search-link tag-search-link-%s\"
>%s</a><img border=\"0\" class=\"tag-add-link tag-add-link-%s\" onMouseOver=\"this.src='./web-gallery/images/buttons/tags/tag_button_add_hi.gif'\" onMouseOut=\"this.src='./web-gallery/images/buttons/tags/tag_button_add.gif'\" src=\"./web-gallery/images/buttons/tags/tag_button_add.gif\"
/></span>", $row['tag'], $row['tag'], $row['tag'], $row['tag']);
}
} else {
while ($row = mysql_fetch_assoc($get_tags)){
printf(" <span class=\"tag-search-rowholder\">
<a href=\"#\" class=\"tag-search-link tag-search-link-%s\"
>%s</a></span>", $row['tag'], $row['tag'], $row['tag'], $row['tag']);
}
}
} else {
echo "No tienes tags.";
}
echo "\n <img id=\"tag-img-added\" border=\"0\" src=\"./web-gallery/images/buttons/tags/tag_button_added.gif\" style=\"display:none\"/>
</div>
<script type=\"text/javascript\">
document.observe(\"dom:loaded\", function() {
TagHelper.setTexts({
buttonText: \"OK\",
tagLimitText: \"Hay un limite de 20 tags\"
});
});
</script>
</div>
<div id=\"profile-tags-status-field\">
<div style=\"display: block;\">
<div class=\"content-red\">
<div class=\"content-red-body\">
<span id=\"tag-limit-message\"><img src=\"./web-gallery/images/register/icon_error.gif\"/> Hay un limite de 20 tags</span>
<span id=\"tag-invalid-message\"><img src=\"./web-gallery/images/register/icon_error.gif\"/> Tag inválido.</span>
</div>
</div>
<div class=\"content-red-bottom\">
<div class=\"content-red-bottom-body\"></div>
</div>
</div>
</div>";
if($userdata['id'] == $my_id){
echo "<div class=\"profile-add-tag\">
<input type=\"text\" id=\"profile-add-tag-input\" maxlength=\"30\"/><br clear=\"all\"/>
<a href=\"#\" class=\"new-button\" style=\"float:left;margin:5px 0 0 0;\" id=\"profile-add-tag\"><b>Añadir tag</b><i></i></a>
</div>";
}
echo "</div>
<script type=\"text/javascript\">
document.observe(\"dom:loaded\", function() {
new ProfileWidget('21063711', '21063711', {
headerText: \"�Estas seguro?\",
messageText: \"¿Estas seguro que deseas añadir como amigo a <strong\>".$userdata['username']."</strong\>? El deberá aceptar tu petición\",
buttonText: \"OK\",
cancelButtonText: \"Cancel\"
});
});
</script>
<div class=\"clear\"></div>
</div>
</div>
</div></div>";
}
}
?></div>
</div>
<div id="mypage-ad">
<div class="habblet ">
<div class="ad-container"></div>
</div>
</div>
</div>
</div>
</div>
<script language="JavaScript" type="text/javascript">
initEditToolbar();
initMovableItems();
document.observe("dom:loaded", initDraggableDialogs);
</script>
<div id="edit-save" style="display:none;"></div>
</div>
</div>
</div>
<div id="edit-menu" class="menu">
<div class="menu-header">
<div class="menu-exit" id="edit-menu-exit"><img src="./web-gallery/images/dialogs/menu-exit.gif" alt="" width="11" height="11" /></div>
<h3>Cambiar</h3>
</div>
<div class="menu-body">
<div class="menu-content">
<form action="#" onSubmit="return false;">
<div id="edit-menu-skins">
<select name="edit-menu-skins-select" id="edit-menu-skins-select">
<option value="1" id="edit-menu-skins-select-defaultskin">Por defecto</option>
<option value="6" id="edit-menu-skins-select-goldenskin">Dorado</option>
<option value="3" id="edit-menu-skins-select-metalskin">metal</option>
<option value="5" id="edit-menu-skins-select-notepadskin">Libreta</option>
<option value="2" id="edit-menu-skins-select-speechbubbleskin">Blocadillo de diálogo</option>
<option value="4" id="edit-menu-skins-select-noteitskin">Nota</option>
<?php if($user_rank >= 6){ ?>
<option value="9" id="edit-menu-skins-select-nakedskin">Transparente</option>
<?php } ?>
</select>
</div>
<div id="edit-menu-stickie">
<p>Si borras esta nota no podrás volver a ponerla.</p>
</div>
<div id="rating-edit-menu">
<input type="button" id="ratings-reset-link"
value="Reset rating" />
</div>
<div id="highscorelist-edit-menu" style="display:none">
<select name="highscorelist-game" id="highscorelist-game">
<option value="">Select game</option>
<option value="1">Battle Ball: Rebound!</option>
<option value="2">SnowStorm</option>
<option value="0">Wobble Squabble</option>
</select>
</div>
<div id="edit-menu-remove-group-warning">
<p>Esta etiqueta es de otro usurio. Si lo borras, aparecerá en su inventario.</p>
</div>
<!--<div id="edit-menu-gb-availability">
<select id="guestbook-privacy-options">
<option value="private">Alleen vrienden kunnen posten</option>
<option value="public">Iedereen kan posten</option>
</select>
</div>-->
<div id="edit-menu-trax-select">
<select name="trax-select-options" id="trax-select-options">
</select>
</div>
<div id="edit-menu-remove">
<input type="button" id="edit-menu-remove-button" value="Eliminar" />
</div>
</form>
<div class="clear"></div>
</div>
</div>
<div class="menu-bottom"></div>
</div>
<script language="JavaScript" type="text/javascript">
Event.observe(window, "resize", function() { if (editmenuOpen) closeEditmenu(); }, false);
Event.observe(document, "click", function() { if (editmenuOpen) closeEditmenu(); }, false);
Event.observe("edit-menu", "click", Event.stop, false);
Event.observe("edit-menu-exit", "click", function() { closeEditmenu(); }, false);
Event.observe("edit-menu-remove-button", "click", handleEditRemove, false);
Event.observe("edit-menu-skins-select", "click", Event.stop, false);
Event.observe("edit-menu-skins-select", "change", handleEditSkinChange, false);
Event.observe("guestbook-privacy-options", "click", Event.stop, false);
Event.observe("guestbook-privacy-options", "change", handleGuestbookPrivacySettings, false);
Event.observe("trax-select-options", "click", Event.stop, false);
Event.observe("trax-select-options", "change", handleTraxplayerTrackChange, false);
</script>
<div class="cbb topdialog" id="guestbook-form-dialog">
<h2 class="title dialog-handle">Escribir un mensaje</h2>
<a class="topdialog-exit" href="#" id="guestbook-form-dialog-exit">X</a>
<div class="topdialog-body" id="guestbook-form-dialog-body">
<div id="guestbook-form-tab">
<form method="post" id="guestbook-form">
<p> El mensaje puede tener un máximo de 200 carácteres
<input type="hidden" name="ownerId" value="<?php echo $user_row['id']; ?>" />
</p>
<div>
<textarea cols="15" rows="5" name="message" id="guestbook-message"></textarea>
<script type="text/javascript">
bbcodeToolbar = new Control.TextArea.ToolBar.BBCode("guestbook-message");
bbcodeToolbar.toolbar.toolbar.id = "bbcode_toolbar";
var colors = { "red" : ["#d80000", "Rojo"],
"orange" : ["#fe6301", "Naranja"],
"yellow" : ["#ffce00", "Amarillo"],
"green" : ["#6cc800", "Verde"],
"cyan" : ["#00c6c4", "Cyan"],
"blue" : ["#0070d7", "Azul"],
"gray" : ["#828282", "Gris"],
"black" : ["#000000", "Negro"]
};
bbcodeToolbar.addColorSelect("Color", colors, true);
</script>
</div>
<div class="guestbook-toolbar clearfix"> <a href="#" class="new-button" id="guestbook-form-cancel"><b>Publicar</b><i></i></a> <a href="#" class="new-button" id="guestbook-form-preview"><b>Previa</b><i></i></a></div>
</form>
</div>
<div id="guestbook-preview-tab"> </div>
</div>
</div>
<div class="cbb topdialog" id="guestbook-delete-dialog">
<h2 class="title dialog-handle">Eliminar mensaje</h2>
<a class="topdialog-exit" href="#" id="guestbook-delete-dialog-exit">X</a>
<div class="topdialog-body" id="guestbook-delete-dialog-body">
<form method="post" id="guestbook-delete-form">
<input type="hidden" name="entryId" id="guestbook-delete-id" value="" />
<p>¿Estas seguro que deseas eliminar este mensaje?</p>
<p> <a href="#" id="guestbook-delete-cancel" class="new-button"><b>Cancelar</b><i></i></a> <a href="#" id="guestbook-delete" class="new-button"><b>Borrar</b><i></i></a></p>
</form>
</div>
<script type="text/javascript">
HabboView.run();