You are not logged in.

  • Login

Dear visitor, welcome to Coder Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Monday, May 9th 2011, 6:54pm

Blueimp User-Online Anzeige

Hallo zusammen,

ich suche für den Blueimp Ajax Chat eine "User-Online Anzeige" für eine einfache PHP Webseite.

Ich habe was für Joomla gefunden;:

PHP Quellcode

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
<?php
     $boldSetting = $params->get('boldy', 0);
     $chaturl = $params->get('urlchat');
     $fontca = $params->get('fontcoloradmin');
     $fontcu = $params->get('fontcoloruser');
     $message = $params->get('message');
     if ($boldy == 1) {
          $bb = "<b>";
          $be = "</b>";
     } else {
          $bb = "";
          $be = "";
     }
     $db =& JFactory::getDBO();
     $query = "SELECT * FROM ajax_chat_online";
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     $i		= 0;
	  $lists	= array();
	  echo JText::_( 'Utenti in Chat:');  
		foreach ( $rows as $row )     
     {
     $lists[$i]->userName = $row->userName;
     if ($row->userRole =='3'){
     echo JText::_( '<font color="'.$fontca.'">' . $bb .$lists[$i]->userName . $be . '</font>  ');  
     }
     else{
     echo JText::_( '<font color="'.$fontcu.'">' . $bb .$lists[$i]->userName . $be . '</font>  ');
	  }
 
	  $i++;
     }
     $content ="<p align=\"center\"><a href=".$chaturl." onclick=\"window.open(this.href,'Chat','resizable=yes,location=no,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,fullscreen=no,dependent=no,width=700,height=500,left=30,top=40,status'); return false\"><img src=\"../modules/mod_blueimpajaxchat_useronline/images/chat.png\" align=\"middle\"></a><a href=".$chaturl." onclick=\"window.open(this.href,'Chat','resizable=yes,location=no,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,fullscreen=no,dependent=no,width=700,height=500,left=30,top=40,status'); return false\">".$message."</a></p>";
     return $lists;
 
?>


Ich brauche das aber nur für eine einfache PHP Seite, kann mir da jemand helfen?

2

Saturday, May 14th 2011, 4:11pm

Hi,
so, wie ich das verstehe musst du die Online User einfach nur aus der Datenbank auslesen.
Die Lösung ist also: "SELECT * FROM ajax_chat_online"

Social bookmarks