PDA

View Full Version : Online Users Glitch


Abronsyth
12-12-2011, 03:57 PM
This isn't major, but is quite the eye sore. It seems my online.php page is a bit messed up...this is version 1.2.4, the only edit to this portion was changing cash to bits.
http://www.iaza.com/work/111213C/iaza12238484876600.png

As you can see, it's a bit messed up XD Well, here's the online.php, notice anything that I can do to fix this little oops?
<?php

include("inc/bbcode.php");
include("inc/functions.php");

//***************//
// START SCRIPT //
//***************//

// Convert the BBCODE to HTML
$article_content = bbconvert($article_content);

// Convert line breaks to <br>
$article_content = nl2br($article_content);

//header("refresh:300");

$article_title = "Who's Online";
$article_content = "<div style='text-align:left;'>This page shows you all online users within the last 5 minutes. After 5 minutes of inactivity they will be marked as offline and will not be shown here</div><br /><hr /><br /><p><span style='color: red; margin-left: 3%;'>Username</span><span style='color: purple; margin-left: 8%;'>Nickname</span><span style='color: green; margin-left: 8%;'>Pets Owned</span><span style='color: blue;margin-left:10%;'>Bits</span><span style='color: orange;margin-left:12%;'>Gender</span><br /><hr /><br /><p>";

$sql3="SELECT ".$GLOBALS['prefix']."online.username, ".$GLOBALS['prefix']."users.money,".$GLOBALS['prefix']."users.nickname ,".$GLOBALS['prefix']."users.gender FROM ".$GLOBALS['prefix']."online, ".$prefix."users WHERE ".$GLOBALS['prefix']."online.username = ".$prefix."users.username AND ".$GLOBALS['prefix']."online.username!='Visitor' ORDER BY ".$GLOBALS['prefix']."online.username";
$result3=runquery($sql3);
$userarray = array();
while($row = mysql_fetch_array($result3))
{
if($row['username'] != "Visitor")
{
$userarray[] = $row['username'];


$article_content = $article_content."<a href='profile.php?user=".$row['username']."' class='onlinelist'><span class='onlinelistt'>".$row['username']."</span><span class='onlinelistn'>".$row['nickname']."</span><span class='onlinelistj'>".getadoptables()."</span><span class='onlinelistp'>".$row['money']."</span><span class='onlinelistg'>".$row['gender']."</span></a><br />";

}
}
$article_content = $article_content."</p></p><br /><hr /><br />";

$result = runquery("SELECT * FROM ".$GLOBALS['prefix']."online WHERE username = 'Visitor'");
$total = mysql_num_rows($result);

$article_content = $article_content."Total Visitors: ".$total;

function getadoptables()
{
global $prefix;
global $userarray;
global $row;
$res = runquery("SELECT COUNT(*) AS cnt FROM ".$GLOBALS['prefix']."owned_adoptables WHERE owner = '".$row['username']."'");
while($adopts = mysql_fetch_array($res))
{
$cnt = $adopts['cnt'];
}
return $cnt;
}

//***************//
// OUTPUT PAGE //
//***************//

echo showpage($article_title, $article_content, $date);

?>

Thanks for all!
Iris

Tequila
12-12-2011, 04:14 PM
It's a CSS error. :3

Just add in codes for the spans listed in your CSS file. :3

Inf3rnal
12-12-2011, 08:04 PM
I also does it in most themes. I've fixed this in my site. Basically the tables are code wrong and the data and headings are in separate tables and it gives it that unfortunate look.

I'll post a fix in a bit.

Alaric
12-13-2011, 08:20 AM
Same Problem ! :(

https://lh3.googleusercontent.com/-LN212CpyjQU/TuXFC-M-L8I/AAAAAAAAD-I/6KSKYGkCZCc/s912/Pokemon.png

Hall of Famer
12-13-2011, 12:53 PM
I see... It looks like only the css of online.php only works in elements theme. There should be an easy way to fix it, I will think of one soon.

Inf3rnal
12-13-2011, 05:39 PM
I've got a quick fix. Replacing the Div's with Tables. I know that tables are bane of the web but for information in table form it's the obvious choice.

I'll post it later tonight or tomorrow morning depending on when I can get some free time.

Hall of Famer
12-14-2011, 04:57 PM
Umm oddly enough, I tried both the Elements and Simple themes on my Mys v1.2.4 demo site, and they worked nicely. Are you using an older version of the script or possibly with a custom theme?

Abronsyth
12-14-2011, 05:16 PM
Using Inf3rnal's Midnight Rain theme, on version 1.2.4. It may be he made a small error somewhere in the CSS, I'll go through it again and see what the problem might be...

Hall of Famer
12-14-2011, 08:31 PM
I see, then I wouldnt call this a glitch myself. It is basically resulted from incompatibility of custom themes and official script.

SilverDragonTears
12-14-2011, 08:33 PM
This reminds me of the actual online glitch where a user is shown twice and the guest number HAS to be off. If this is inappropriate to bring up here, I apologize. Just thought about it and wondered if anyone had taken a look at it lately.

But on topic... If you just fix the css like Infernal said, it will look normal.

Hall of Famer
12-16-2011, 11:33 PM
Well this is apparently not a glitch, as the cause of the problem is that custom themes do not implement css for who's online script. I've included the css file for who's online script in this reply, you may do one of the followings to resolve the issue.

1. Create a new folder called css in your adoptables site root directory, and upload the file online.css to this folder. Then add this line for file inclusion inside script file online.php(around line 4 or 5):


include("css/online.css");


2. Copy paste the css content within the file online.php to your template's style.css sheet.

I'd strongly recommend the first approach since this is the way Mys v1.3.x is built, in which users can define additional css with ease.

Alaric
12-24-2011, 01:37 AM
I Understood Nuts ! :coloness:
Someone Explain Me What To Do!
I Am Sorry For Asking , But I Really Need Help!

Regards,
Alaric Rodrigues.
Mysidiaadoptables Member.

Hall of Famer
12-24-2011, 03:49 AM
Oh my badness, I forgot to upload the online.css file... Download the attachment from this post and upload it to a new folder in your adoptables home directory called 'css'. This should solve your problem.

Also please understand this is not a glitch with the official script. The custom themes designers did not copy/paste the css definition for whos online page from the default themes' css files, this is why the who's online page looks messed up.

Alaric
12-24-2011, 05:37 AM
Thank'x Once Again Hall Of Famer !

https://lh3.googleusercontent.com/-171ngw-8OPg/TvW5B8VKDFI/AAAAAAAAD_s/jlW7OifMLfk/s912/online.png

It Work's Fine Now!

Regards,
Alaric.
Mysidiaadoptables Member!