4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Acidgod on November 27, 2005, 03:35:11 AM

Title: [MOD] User online as Dropdown or List
Post by: Acidgod on November 27, 2005, 03:35:11 AM
Version 1:
Simple HTML Dropdown/Multiselect List.

code for the header.html
Code: [Select]
<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:
Code: [Select]
while ($row = $site_db->fetch_array($result)) {
replace with:
Code: [Select]
$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:
Code: [Select]
$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:
Code: [Select]
$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:
Code: [Select]
$num_total_online = $num_registered_online + $num_guests_online;
replace with:
Code: [Select]
$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
Code: [Select]
<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:
Code: [Select]
$result = $site_db->query($sql);
replace with:
Code: [Select]
$result = $site_db->query($sql);
$user_online_list .= "<form class=\"whosonline\"><div class=\"listbox\" id=\"foo\">";
$i="";


search:
Code: [Select]
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:
Code: [Select]
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:
Code: [Select]
$num_total_online = $num_registered_online + $num_guests_online;
replace with:
Code: [Select]
$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...
Title: Re: [MOD] User online as Dropdown or List
Post by: Nasser 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
Title: Re: [MOD] User online as Dropdown or List
Post by: Acidgod 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...
Title: Re: [MOD] User online as Dropdown or List
Post by: Nasser 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 :

 
Code: [Select]
$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 :

Code: [Select]
$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


Title: Re: [MOD] User online as Dropdown or List
Post by: PartyPix 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 ?
Title: Re: [MOD] User online as Dropdown or List
Post by: PartyPix 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 !
Title: Re: [MOD] User online as Dropdown or List
Post by: PartyPix 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
Title: Re: [MOD] User online as Dropdown or List
Post by: Foto-Portal 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ß

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



Title: Re: [MOD] User online as Dropdown or List
Post by: trez on February 09, 2007, 11:46:59 PM
like this?
http://www.zapomnime.com/useronline.php (http://www.zapomnime.com/useronline.php)
Title: Re: [MOD] User online as Dropdown or List
Post by: Foto-Portal 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 >