|
 |
|
 |
08-19-2004, 09:28 AM
|
#1 (permalink)
|
|
Regular Contributor
Join Date: Apr 2004
Location: Orange County, CA
Posts: 125
|
Adjust physical output size dynamically
I'm not even sure if this is possible, but if someone could point me in the right direction . . .
I have a fairly basic output script which grabs different items at different times of the day from a MySQL database. I am experimenting with a new design which is, unfortunately size critical as regards to the graphics. In other words, if I have an output such as this, where the dotted lines are graphic elements in a table:
-------------
Output1
Output2
Output3
Output4
Output5
Output6
-------------
Then when one of the outputs is more than one line (and some of them have to be) my graphic lines get broken, like this:
---------
Output1 ----
Output2 &
others
Output3
Output4 &
others
Output5
Output6 ----
---------
Is it possible to use PHP to measure a screen position by coordinates, so that if I exceed a certain position the script will dynamically eliminate Output 5 and 6, or whatever? Does this make sense?
Again, any thoughts, even a "are you crazy? you can't do that!" are appreciated.
|
|
|
08-19-2004, 10:35 AM
|
#2 (permalink)
|
|
$_['Your_Mom'];
Join Date: May 2002
Location: Santee
Posts: 627
|
it is not possible for PHP to see where elements are on a page.
perhaps if you post a link to what you are referring to we can help you out with a different solution?
|
|
|
08-19-2004, 10:41 AM
|
#3 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,505
|
well i know you're crazy anyway .. but why can't you use a 1600x1px image for the dotted line and just make it a css or table cell background?
__________________
Mike
|
|
|
08-19-2004, 11:11 AM
|
#4 (permalink)
|
|
$_['Your_Mom'];
Join Date: May 2002
Location: Santee
Posts: 627
|
that is exactly why i suggested posting the site 
|
|
|
08-19-2004, 11:20 AM
|
#5 (permalink)
|
|
Regular Contributor
Join Date: Apr 2004
Location: Orange County, CA
Posts: 125
|
Unfortunately, I can't, due to my employer's privacy rules. I've tried to create a graphic that would explain it better, and I've posted it on my own site, however:
http://www.metazai.com/screenshot.gif
Is it possible to tell MySQL to pull, say, only 3 or 4 elements when what is depicted here happens?
|
|
|
08-20-2004, 01:49 PM
|
#6 (permalink)
|
|
Newbie
Join Date: Jun 2002
Location: Denmark
Posts: 1,721
|
Quote:
Originally posted by metazai
Is it possible to tell MySQL to pull, say, only 3 or 4 elements when what is depicted here happens?
|
look at LIMIT
|
|
|
08-20-2004, 01:56 PM
|
#7 (permalink)
|
|
Regular Contributor
Join Date: Apr 2004
Location: Orange County, CA
Posts: 125
|
not quite what I need . . .
Yes, I know that LIMIT would be very helpful in selecting only a certain number of items . . . what I need here, though, is help in determining the number to use for LIMIT based on how far down the list extends, which is variable throughout the day.
|
|
|
08-21-2004, 09:02 AM
|
#8 (permalink)
|
|
Senior Grasshopper
Join Date: Jun 2003
Location: FL
Posts: 317
|
Maybe get a count of your current rows then decide on the slice you need.
Code:
select count(*) as n_count from table
where foo = 'bar'
So depending on what n_count comes back as you determine where you want to limit the next query.
If you can, try caching the n_count var (session var / etc.) for as long as it seems sensible.
-r
|
|
|
08-24-2004, 10:15 AM
|
#9 (permalink)
|
|
Regular Contributor
Join Date: Apr 2004
Location: Orange County, CA
Posts: 125
|
hmm . . .
A slightly modified version of this last advice is going to work, I think.
THanks.
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 02:16 AM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|