TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,027
  • Total Topics: 21,334
  • Online today: 519
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 330
  • Total: 330

Cant seem to figure out why this code "breks" blocks below it.

Started by MoreBloodWine, May 09, 2011, 04:03:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MoreBloodWine

Code From: http://www.eojmarket.com/xbox_and_psn_network_status/xbox-live-status.php

Code:
echo '
<style type="text/css">
#xbox-live-status-box {
width: 207px;
display: inline-block;
background-color: #FAFAFA;
border: 1px solid #E2E2E2;
padding: 7px;
/* text-align: center; */
}
.icon {
margin-right: 6px;
float: left;
}
.text {
position: absolute;
left: 50px;
color: #848589;
font-size: 10px;
float: right
}
.status-down {
color: #CD1C1C;
}
</style>
';

$data = file_get_contents('http://support.xbox.com/en-gb/Pages/xbox-live/xbox-live-status.aspx');
if (preg_match('~<div id="xbox-live-status-box">\s*(<div.*?</div>\s*)?(.*?)</div>~is', $data, $matches ) == 1) {
if (preg_match('~<img src="(.*?)".*/>~is', $matches[0], $img ) == 1) {
$status = str_replace($img[1], 'http://support.xbox.com' . $img[1], $matches[0]);
echo $status;
}
}


Issues: The code looks fine when you view the page it's located on. Now wether I use the code in the block itself or call the file as an include everyblog below the block this datas supposed to be shown in "breaks" and the content looks funny / misaligned.

Was hoping someone could help me figure this out so the end result in the blocks looks the same way it would as if you were just viewing the page itself with the code in question.

Ty.

Edit: Adding pic to show the block blending / content error. Like I said, wether or not I use the code directly in the block or call the file with the code as an include the outcomes the same but when you view the page with the code linked above everything appears "normal".
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

It could be because you're missing a semi-colon here:

float: right

MoreBloodWine

Don't know how I mised that bu thx and no, that wasnt it... still getting the weirdness seen in the pic with the block merging and part of the contents being raise / layed out over the horisontal scroll.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

You have a <center> tag in there somewhere that is not closed. When I look at the the output of your page, I can see it. Make sure you clear any of those tags from the blocks before you save them if they are there. They are likely added by the editor when saving sometimes.

MoreBloodWine

Quote from: IchBinâ,,¢ on May 10, 2011, 12:05:40 AM
You have a <center> tag in there somewhere that is not closed. When I look at the the output of your page, I can see it. Make sure you clear any of those tags from the blocks before you save them if they are there. They are likely added by the editor when saving sometimes.
Thats just the thing, I checked all my blocks and they all have closing centers for those opened. When I remove the xBox status block everything appears fine. It's just when I try to either use the code directly or call the file as an includde that it and the other blocks weird out.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

Well it has to be there somewhere. Not much we can do about it from here.

ZarPrime

It might help if you actually enabled the block on your actual site so that we could see it in action.

ZarPrime

MoreBloodWine

Quote from: ZarPrime on May 10, 2011, 04:09:02 AM
It might help if you actually enabled the block on your actual site so that we could see it in action.

ZarPrime
I only had it enabled to me but it's now viewable by all.

Code used in block:
require("/removed/public_html/xbox_and_psn_network_status/xbox-live-status.php");

Code from named file:
<?php  

echo '
<style type="text/css">
#xbox-live-status-box {
width: 206px;
display: inline-block;
background-color: #FAFAFA;
border: 1px solid #E2E2E2;
padding: 7px;
/* text-align: center; */
}
.icon {
margin-right: 6px;
float: left;
}
.text {
position: absolute;
left: 50px;
color: #848589;
font-size: 10px;
}
.status-down {
color: #CD1C1C;
}
.status-running {
color: #2CA243;
}
</style>
'
;

$data = file_get_contents('http://support.xbox.com/en-gb/Pages/xbox-live/xbox-live-status.aspx');
if (
preg_match('~<div id="xbox-live-status-box">\s*(<div.*?</div>\s*)?(.*?)</div>~is', $data, $matches ) == 1) {
if (preg_match('~<img src="(.*?)".*/>~is', $matches[0], $img ) == 1) {
$status = str_replace($img[1], 'http://support.xbox.com' . $img[1], $matches[0]);
echo $status;
}
}

?>


Edit: Page where it can be seem by itself without any apparent issuess.

http://www.eojmarket.com/xbox_and_psn_network_status/xbox-live-status.php
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

ZarPrime

Well, the only thing I see is the scrollbar.  Is that what you are talking about?  Changing the width in the css from 206px to 205px removes the horizontal scrollbar.  Turn the block back off so that I can see the difference.

ZarPrime

MoreBloodWine

Quote from: ZarPrime on May 10, 2011, 04:36:41 AM
Well, the only thing I see is the scrollbar.  Is that what you are talking about?  Changing the width in the css from 206px to 205px removes the horizontal scrollbar.  Turn the block back off so that I can see the difference.

ZarPrime
The difference is that the blocks below it dont seem to merge together when its off and that when its on they do and the text inside the block seems to wana try and go 3D by coming out.

See pic with active above and pic turned off below. Also, about the text... look closely at the pic above. Notice how the text pops out at ya.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

This website is proudly hosted on Crocweb Cloud Website Hosting.