Jump to content

ERR_CONTENT_DECODING_FAILED


VizionDev

Recommended Posts

Hello,

Have quite the issue at the moment however only specific to Mac users. The downside is, ALL Mac users

I have a page with a Manual PHP block that loads specific data based on the package(s) bought.

However this is only visible to non-Mac users

ERR_CONTENT_DECODING_FAILED

I disabled Apache mod_deflate, but no change

Any one know what I can do?

 

Link to comment
Share on other sites

Make sure you're not outputting anything directly to the browser, i.e. echo/print/var_dump etc.

I am outputting a fair amount of html markup in a block? To be precise, I'm pulling properties from a database to display them in a table.

Is this not possible? I'm kind of lost.

Minus the MySQL connection this is exactly what is in the block (I'm not using the <?php opener of course

$MemberID = \IPS\Member::loggedIn()->member_id;
$TimeNow = time();
$Package = false;

$st = $IPBSql->prepare("SELECT ps_name,ps_item_id FROM nexus_purchases WHERE ps_expire > ? AND ps_member = ?");
$st->bind_param('ii', $TimeNow, $MemberID);
$st->bind_result($Name, $ItemID);
$st->execute();

if ($st->fetch()) {
	$st->close();

	switch ($ItemID) {
		case 7: {
			$Package = "Bronze";
			$st = $MainSql->query("SELECT * FROM tblProperties WHERE UNIX_TIMESTAMP() > (Added + (86400*2)) ORDER BY PropertyID DESC");
			$Data = array();
			while ($tmp = $st->fetch_array(MYSQLI_ASSOC)) $Data[] = $tmp;
		}
		break;
		
		case 8: {
			$Package = "Silver";
			$st = $MainSql->query("SELECT * FROM tblProperties WHERE UNIX_TIMESTAMP() > (Added + 86400) ORDER BY PropertyID DESC");
			$Data = array();
			while ($tmp = $st->fetch_array(MYSQLI_ASSOC)) $Data[] = $tmp;
		}
		break;
		
		case 9: {
			$Package = "Gold";
			$st = $MainSql->query("SELECT * FROM tblProperties ORDER BY PropertyID DESC");
			$Data = array();
			while ($tmp = $st->fetch_array(MYSQLI_ASSOC)) $Data[] = $tmp;
		}
		break;
		
		default: {
			$Package = false; 
			$st = $MainSql->query("SELECT * FROM tblProperties WHERE UNIX_TIMESTAMP() > (Added + (86400*7)) ORDER BY PropertyID DESC");
			$Data = array();
			while ($tmp = $st->fetch_array(MYSQLI_ASSOC)) $Data[] = $tmp;
		}
		break;
	}
}
else
{
  $st->close();
}
?>
<div id='membershipType'>
	<? if ($Package == 'Gold') { ?>
	You have the <span class='gold-member'>Gold</span> Membership
	<p>You will see new properties before anyone else does!</p>
	<? } elseif ($Package == 'Silver') { ?>
	You have the <span class='silver-member'>Silver</span> Membership
	<p>You will see new properties one day after Gold does!</p>
	<? } elseif ($Package == 'Bronze') { ?>
	You have the <span class='bronze-member'>Bronze</span> Membership
	<p>You will see new properties one day after Silver does!</p>
	<? } else { ?>
	You are a <span>FREE</span> member.
	<p>Upgrade your membership to see new properties first!</p>
	
	<? } ?>
</div>
<div class="ipsBox">
	<h2 class="ipsType_sectionTitle ipsType_reset">Properties</h2>
	<div class='p10'>
		<table class='ipsTable'>
			<thead>
				<tr>
					<th>Alias</th>
					<th>Location</th>
					<th>Size</th>
					<th>Date Added</th>
				</tr>
			</thead>
		<? foreach ($Data as $Property) { ?>
			<tr>
				<td><a href='/properties/view/?PropertyID=<?=$Property['PropertyID']?>'><?=$Property['Alias']?></a></td>
				<td><?=$Property['City'] .", ". $Property['State']?></td>
				<td><?=number_format($Property['LandSize'])?> acres</td>
				<td>Added <?=date('M d \'y', $Property['Added'])?></td>
			</tr>
		<? } ?>
		</table>
	</div>
</div>
<link href='//cdn.datatables.net/1.10.7/css/jquery.dataTables.min.css' type='text/css' rel='stylesheet'/>
<script src='//code.jquery.com/jquery-1.11.1.min.js'></script>
<script src='//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js'></script>
<script>
$('table').dataTable();
</script>
<?

 

Link to comment
Share on other sites

  • 2 weeks later...

Make sure you're not outputting anything directly to the browser, i.e. echo/print/var_dump etc.

Extremely lost here mate,

What use are PHP blocks if you can't output anything from them, they're also eval'd so you can't carry through any variables whatsoever.

What am I doing wrong? 

Please also see this documentation: https://www.invisionpower.com/support/guides/_/ips-community-suite-apps/ip-cont/raw-php-in-ipcontent-r282

Although outdated like everything is, this explicitly states that print works fine.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...