Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums

Go Back   Code Forums > Application and Web Development > PHP

Reply
 
LinkBack Thread Tools Display Modes
Old 08-19-2004, 10:28 AM   #1 (permalink)
metazai
Regular Contributor
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 151
metazai is on a distinguished road
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.
metazai is offline   Reply With Quote
Old 08-19-2004, 11:35 AM   #2 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
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?
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 08-19-2004, 11:41 AM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,706
sde is on a distinguished road
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
sde is offline   Reply With Quote
Old 08-19-2004, 12:11 PM   #4 (permalink)
Admin
$_['Your_Mom'];
 
Admin's Avatar
 
Join Date: May 2002
Location: Santee
Posts: 627
Admin is on a distinguished road
that is exactly why i suggested posting the site
__________________


Urban Clothing
Admin is offline   Reply With Quote
Old 08-19-2004, 12:20 PM   #5 (permalink)
metazai
Regular Contributor
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 151
metazai is on a distinguished road
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?
metazai is offline   Reply With Quote
Old 08-20-2004, 02:49 PM   #6 (permalink)
redhead
Super Moderator
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,878
redhead is on a distinguished road
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
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is online now   Reply With Quote
Old 08-20-2004, 02:56 PM   #7 (permalink)
metazai
Regular Contributor
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 151
metazai is on a distinguished road
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.
metazai is offline   Reply With Quote
Old 08-21-2004, 10:02 AM   #8 (permalink)
idx
Senior Grasshopper
 
idx's Avatar
 
Join Date: Jun 2003
Location: FL
Posts: 317
idx is on a distinguished road
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
idx is offline   Reply With Quote
Old 08-24-2004, 11:15 AM   #9 (permalink)
metazai
Regular Contributor
 
Join Date: Apr 2004
Location: Orange County, CA
Posts: 151
metazai is on a distinguished road
hmm . . .

A slightly modified version of this last advice is going to work, I think.

THanks.
metazai is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 12:49 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting