Jump to content
php.lv forumi

IPB online


Puika1

Recommended Posts

Pievieno tabulā ibf_members lauku ko_dara

un liec šo kodu

switch($_GET['lapa'])
{
               case 'news':
               include_once("news.php");
               $ko_dara = "Lasa jaunumus";
               mysql_query("UPDATE ibf_members SET ko_dara = '".mysql_real_escape_string($ko_dara)."' WHERE id = '".$_COOKIE['member_id']."'") or die(mysql_error());
               break;
default:
include_once('index.php');
break;
}
$delay = time()-300;
$sql = mysql_query("SELECT * FROM ibf_members WHERE last_activity(hz, kaads tur bija) <= '".$delay."'") or die(mysql_error());
if(mysql_num_rows($sql) != 0){
while($o = mysql_fetch_array($sql)){
echo "
<img src='/grupas/".$o['group'].".png' /> <a href='/f/?showuser=".$o['id']."'>".$o['username']."</a><br/>".$o['ko_dara']."<hr/>
";
}
}else{
echo "nav neviena onlainā";
}

Link to comment
Share on other sites

mazliet tiku skaidriba,bet problema

Man izskatas sadi

post-3594-1268596210,42_thumb.png

Bet gribetos sadi

post-3594-1268596214,88_thumb.gif

 

Kas pa problemu reku fragmens no css

 

}
* {
margin: 0;
padding: 0;
}


.online_members {
list-style: none;
padding-right: 5px;

}

.online_members li {
line-height: 140%;
padding: 2px 20px;
padding-right: 5px;
}

.online_members img {
float: left;
}

.online_members .admin { /* admin group style */
font-weight: bold; /* add icon as background image or anything you want */
}

.online_members .time, .online_members .location {
color: #aaa;
}

.board_data {
list-style: none;
}

.board_data li {
padding: 1px 0;
}

.board_data span {
}

/*--Forums Online----*/



.online_members .gfdsf {
background: url("root.gif") no-repeat 0 0;
}


.online_members .time, .online_members .location {
color: #aaa;
}

.board_data {
list-style: none;
}

.board_data li {
padding: 1px 0;
}

.board_data span {
font-weight: none;
}

Link to comment
Share on other sites

Ja lieku <1 "viens vai vairāk par viens uzmet error"

 

Error:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/lockerz/public_html/scripts/online/class_ipb_online.php on line 97

 

Error rinda kas jaapskata:

if(mysql_num_rows($res) < 1) return $this;
	$groups = $avatars = $members = array();
	$count = (object)array(
		'members' => 0,
		'guests' => 0
	);

 

Un ja es atstāju 0 tad man rāda tādus lietotājus kas jau pirms kādas stundas vai vairāk ir bijuši tikai iekšā! :(

Link to comment
Share on other sites

Tas ir laikam šis

mysql_num_rows($res) < 1)

ja ir mazāks par < 1 tad izvada datus bet ja lielāks tad error! :)

 

Un ko tad lai es tur rakstu lai man cilvēkus nerādītu pēc 1min kad viņi ir pametuši forumu!

Edited by Snaip3Rs
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...