4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 08, 2016, 01:02:54 AM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Modifications / Modifikationen
| |-+  Mods & Plugins (Releases & Support) (Moderators: mawenzi, Rembrandt)
| | |-+  [MOD] User online as Dropdown or List
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
This topic has not yet been rated!
Author Topic: [MOD] User online as Dropdown or List  (Read 14929 times)
Acidgod
4images Moderator
4images Guru
*****
Offline Offline

Posts: 2420

Thank You
-Given: 0
-Receive: 1

It's me?


View Profile WWW
« on: November 27, 2005, 03:35:11 AM »

Version 1:
Simple HTML Dropdown/Multiselect List.

code for the header.html
1
2
3
4
5
6
7
8
9
10
11
12
13
<script type="text/JavaScript">
<!--
function jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<style type="text/css">
<!--
.whosonline{ font-size: 9px; width:100%; border:1px black solid; color:#000000; margin:1px; }
-->
</style>

code for the session.php
search:
1
while ($row = $site_db->fetch_array($result)) {

replace with:
1
2
$user_online_list .= "<form name=\"whosonline\"><select name=\"whosonline\" size=\"3\" onchange=\"jumpMenu('parent',this,0)\" class=\"whosonline\">";
while ($row = $site_db->fetch_array($result)) {
if you remove the size it will show as a Dropdown!


search:
1
2
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
$user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;

replace with:
1
2
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&;".URL_USER_ID."=".$row['session_user_id'];
$user_online_list .= "<option value=\"".$site_sess->url($user_profile_link)."\">".$username."".$invisibleuser."</option>";


search:
1
$num_total_online = $num_registered_online + $num_guests_online;

replace with:
1
2
$user_online_list .= "</select></form>";
$num_total_online = $num_registered_online + $num_guests_online;



Version 2:
Advance List with Smilies or another Images in front of the Username.

code for the header.html
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
<script type="text/JavaScript">
<!--
function init_listbox_checkbox(el)
{
el.runtimeStyle.behavior="none";
if(window.navigator.userAgent.indexOf("MSIE 7")>=0){rerutn;};/*IE7 should be compatible with CSS2.0*/

if(el.id=="")
{
el.id = "listbox_label" + el.sourceIndex +Math.ceil (Math.random() * 10000 )
}

el.parentNode.htmlFor = el.id;

el.onpropertychange = function()
{
var span = this.parentNode.all.tags("span")[0];
span.className = this.checked?"checked":"";

}
el.parentNode.onmouseover = function(){this.className="hover";window.event.returnValue=false;window.event.cancelBubble=true;return false;}
el.parentNode.onmouseout = function(){this.className="";window.event.returnValue=false;window.event.cancelBubble=true;return false;}
}

function goToURL() { //v3.0
  var i, args=goToURL.arguments; document.returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
//-->
</script>
<style type="text/css">
<!--
/*Breite festlegen*/
form.whosonline{background:buttonface;width:100%;border:solid 0px #aaaaaa;}

/*Höhe festlegen*/
div.listbox {height:50px;margin:0px;}

/*Zeilenhöhe und Rahmen festlegen*/
div.listbox span{height:20px;padding:3px 3px 3px 3px;white-space:nowrap;display:block;cursor:hand;cursor:pointer;}

/* IE Hintergund&Schrift */
div.listbox label.hover{background-color:#EAEAEA;color:white;}

/* Nestcape Hintergund&Schrift */
div.listbox[id] label:hover{background-color:#EAEAEA;color:white;}

/*generic rules*/
div.listbox{background:white; font-size:12px; padding:0; list-style:none; overflow:auto; border:solid 1px #666666; scrollbar-face-color:#cccccc; scrollbar-highlight-color: #eeeeee; scrollbar-shadow-color: buttonface; scrollbar-3dlight-color: #aaaaaa; scrollbar-arrow-color: #ffffff; scrollbar-track-color: #eeeeee; scrollbar-darkshadow-color: #aaaaaa; }
div.listbox label input{float:left;}
div.listbox label{display:block;clear:both;}

/*For CSS3 ompatible browsers (ie:FireFox) */
div.listbox label input:not([Hedger]){display:none;_display:block;_float:left;_width:0;behavior:expression(void(init_listbox_checkbox(this)));}
div.listbox span:not([Hedger]){padding-left:22px;background:url({template_image_url}/user_online.png) left center no-repeat;border:solid 1px white;border-bottom-color:#f0f0f0;border-left:solid 0px #dedede;}

/*for IE*/
* html div.listbox label input{display:block;float:left;width:0;behavior:expression(void(init_listbox_checkbox(this)));}
* html div.listbox span{padding-left:22px;background:url({template_image_url}/user_online.png) left center no-repeat;border:solid 1px white;border-bottom-color:#f0f0f0;border-left:solid 0px #dedede;}

-->
</style>
You must change the Path to the images in the CSS Part to your own! (two times!) Also you can change the Layout in the CSS Part

search:
1
$result = $site_db->query($sql);

replace with:
1
2
3
$result = $site_db->query($sql);
$user_online_list .= "<form class=\"whosonline\"><div class=\"listbox\" id=\"foo\">";
$i="";


search:
1
2
3
4
5
if (!$is_invisible || $user_info['user_level'] == ADMIN) {
  $user_online_list .= ($user_online_list != "") ? ", " : "";
  $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$row['session_user_id'];
  $user_online_list .= "<a href=\"".$site_sess->url($user_profile_link)."\">".$username."</a>".$invisibleuser;
}

replace with:
1
2
3
4
5
if (!$is_invisible || $user_info['user_level'] == ADMIN) {
  $i++;
  $user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/", $row['session_user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$row['session_user_id'];
  $user_online_list .= "<label><input type=\"radio\"  name=\"ck[]\" value=\"".$i."\" onClick=\"goToURL('parent','".$site_sess->url($user_profile_link)."');return document.MM_returnValue\" /><span>".$username."</span> </label>";
}

search:
1
$num_total_online = $num_registered_online + $num_guests_online;

replace with:
1
2
$user_online_list .= "</select></form>";
$num_total_online = $num_registered_online + $num_guests_online;

I give no CSS/JavaScript Support for this Mod!
And i have tested it only with 1.7.1....

Don´t ask for a Demo try it out, i will go to sleep yet... (o:

And remember you must only install one and not both Versions!

Enjoy...
Logged

Nasser
Full Member
***
Offline Offline

Posts: 105

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #1 on: November 27, 2005, 10:28:57 AM »

I have a problem with the Online Users list

it shows only the registered users name
not the total # of visiters .. or who many guests
can you help please
Logged
Acidgod
4images Moderator
4images Guru
*****
Offline Offline

Posts: 2420

Thank You
-Given: 0
-Receive: 1

It's me?


View Profile WWW
« Reply #2 on: November 28, 2005, 11:02:43 AM »

I have a problem with the Online Users list

it shows only the registered users name
not the total # of visiters .. or who many guests
can you help please


And that is not a Problem with this Mod...
This Mod only replace the Userlist with a Dropdown or Selectlist and this has nothing to do with Guest, Visiters etc...
Logged

Nasser
Full Member
***
Offline Offline

Posts: 105

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #3 on: November 29, 2005, 03:04:50 PM »

I've just found the error !

I was trying to install [ [MOD] Most Ever Users Online v2 (23-01-2005)  ]

http://www.4homepages.de/forum/index.php?topic=7290.0

which didn't work with me and I forgot to find the error or why wasn't it working propebley

for some resons .. seems I changed some lines in the file [ sessions.php ] which were at the end of it :

 
1
2
3
4
5
6
7
$site_template->register_vars(array(
    "num_total_online" => $num_total_online,
    "num_invisible_online" => $num_invisible_online,
    "num_registered_online" => $num_registered_online,
    "num_guests_online" => $num_guests_online,
    "user_online_list" => $user_online_list
  ));

which should be after deep checking :

1
2
3
4
5
6
7
8
9
$site_template->register_vars(array(
    "num_total_online" => $num_total_online,
    "num_invisible_online" => $num_invisible_online,
    "num_registered_online" => $num_registered_online,
    "num_guests_online" => $num_guests_online,
    "user_online_list" => $user_online_list,
    "lang_user_online" => str_replace('{num_total_online}', $num_total_online, $lang['user_online']),
    "lang_user_online_detail" => str_replace(array('{num_registered_online}','{num_invisible_online}','{num_guests_online}'), array($num_registered_online,$num_invisible_online,$num_guests_online), $lang['user_online_detail']),
));
thought its so important to paste the fix for my problem here for the future need


Logged
PartyPix
Newbie
*
Offline Offline

Posts: 42

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #4 on: May 28, 2006, 07:14:11 PM »

Hi
The List allready run, but how can i make it so that after the Nickname stay the age and the sex ?

/// Select Box ///

Nick  sex   age

/// Select Box ///

Any Idee ?
Logged
PartyPix
Newbie
*
Offline Offline

Posts: 42

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #5 on: May 29, 2006, 02:50:13 PM »


Is it possible to show the list like so

sex age photo nick

???

exemple:

m 18 P test

or

w 16  test 

(without Photo)

and it were super if this can be sort like so

m 15 P test
m 18 P test3
m 18    test4
-----------------
w 16 P test5
w 17    test6
w 18 P test7


Is it possible ? Anyone a idee ? Please Help me ! It is very important !
Logged
PartyPix
Newbie
*
Offline Offline

Posts: 42

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #6 on: October 14, 2006, 04:05:26 PM »

Hi all

I have try all and all to make it so and now it gone but only the sex.

The useronlinelist looks like so at the moment:

m Partypix

My Question !

How i become the age from the Birthday Mod in this list ?

Please help me I wait a long time for this
Logged
Foto-Portal
Newbie
*
Offline Offline

Posts: 43

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #7 on: February 09, 2007, 10:01:45 AM »

Hallo,

wie kann das machen wenn ich die User die gerade online sind,
untereinander auflisten möchte und nicht nebeneinander?


like this:

flag user1  --> < / br >
flag user2  --> < / br >
flag user3  --> < / br >

and not:

flag user1, flag user2, flag user3

Danke und Gruß

------------------------------------------------



« Last Edit: February 10, 2007, 10:59:58 AM by Foto-Portal » Logged
trez
Hero Member
*****
Offline Offline

Posts: 613

Thank You
-Given: 12
-Receive: 26


View Profile WWW
« Reply #8 on: February 09, 2007, 11:46:59 PM »

like this?
http://www.zapomnime.com/useronline.php
Logged

Foto-Portal
Newbie
*
Offline Offline

Posts: 43

Thank You
-Given: 0
-Receive: 0


View Profile
« Reply #9 on: February 10, 2007, 10:59:03 AM »

@trez

no!
like it now is, only the users should listed among themselves!

bitte kann jemand es richtig übersetzen?

-> so wie es jetzt ist nur es sollen die Benutzer untereinander aufgelistet werden. ----->   < / br >
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.087 seconds with 19 queries.
Post your comments here