Jump to content

Auto Determine Page Height?


cheezylu

Recommended Posts

This is probably a stupid question, but I'm curious to know if there is a way to automatically determine the height of each page?

 

I asking because I have a site with a main body column and a side column and hate it when there is blank space vertical on one side of the other just because the content of one of the columns is larger than the other.  I was hoping if there is a way to determine how tall the page is then I could create a PHP formula to include a certain number of content features along the side column based on the page height.  Perhaps there's a different way to do this... any ideas?

Link to comment
Share on other sites

I'm curious to know if there is a way to automatically determine the height of each page?

 

No there is not, and even if there was it would have nothing to do with php. PHP doesn't know what a page is, it just outputs strings that most people happen to format as html.

Link to comment
Share on other sites

Thanks!  It seems to be working great!

 

In case anyone is curious, this is what I have done...

 

<?php
$articleSize = strlen($article); // # of characters in the article
$featureSize = 650; // approx. # of article characters that equal the height of the average featured item
$featureEq = $articleSize/$featureSize;
$featureQty = round($featureEq); //# of features to post

$i=1;

while( $i <= $featureQty ){

echo "\<?php include 'feature$i.php' ?\><br/>";

$i++;
} //end of while
?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.