Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

Is this possible in PHP (or other languages)

Status
Not open for further replies.
Joined
Jan 19, 2007
Posts
2,207
Reaction score
47
At the moment i can retrieve information from a DB and display it nicely in a vertical line of boxes (some boxes with extra information as needed).

I basically need a version of this with exactly the same information, but instead of a top-down list of divs (boxes), I need them to be displayed going around a circle (starting top centre, going clockwise).

Does anyone know if this is possible?
And how easy would it be? Any scripts?

It's already taken me ages to get the list pulling the appropriate info and displaying in a straight line.

Thanks for any help/direction.


Added: The number of divs displayed will be variable depending on what's in the DB. So I can't count on their being a certain number. Therefore the 'circle' would need to re-size in some way?!
 
Last edited:
You could do it in Javascript or Ajax (JS + PHP), but don't think PHP alone would produce nice of even elegant results.

You also have the issue of some of your time places being long and over writing others to consider.

You could look at Tag Cloud code for idea's on position, or clock face code in Javascript like http://www.dynamicdrive.com/dynamicindex6/analog.htm and then strip the code down and latch in PHP and you'd be away pretty quickly.

I can't think of an easy way tho.
 
Cheers Skinner - will take a look at the JS.

It's pretty tricky to accomplish what I wanted so may have to change my expectations.

Many thanks.
 
I don't know php so feel free to correct me!

Could you design a circle in html/css and put php calls in the relevant divs?
 
Whether you use JS, AJAX, PHP or anything else, the resulting output will need to be DIV's or other tags that you position with CSS (unless you output as a graphic).

If you use the item number in the ID of the DIV you could use a dynamically created style sheet to position the DIV's according to the number of results returned. If you have a known number of results you could cache a few common style sheets and just reference the desired CSS file.
 
I don't know php so feel free to correct me!
Could you design a circle in html/css and put php calls in the relevant divs?

This was originally my first thought. But the number of divs is variable based on query results. My final product needed to have divs within the divs that were spread around the circle too - so even more complicated and the circle would definitely need to be produced variably (in size).

Whether you use JS, AJAX, PHP or anything else, the resulting output will need to be DIV's or other tags that you position with CSS (unless you output as a graphic).

If you use the item number in the ID of the DIV you could use a dynamically created style sheet to position the DIV's according to the number of results returned. If you have a known number of results you could cache a few common style sheets and just reference the desired CSS file.

Yeah this is what I was thinking. Just too many variables for me to juggle given that I need the script to function with the results from each query that's sent (which always gives variable results):

The initial size of circle and position of main divs would depend on:
1. number of divs
2. size of each div (based on div content, and if there are 0-2 extra divs inside that div)

Divs could have a fixed width, but as they are positioned around around the circle, some of the corner positions would be adjusted for the fact they are on the 'left' side of the circle, or on the top or bottom, whereas those divs on the right would have a position where the top left corner of the div could be on the circumference.

I think I'm best to save this part for a future project. I'm just so happy that I am getting this to work perfectly (so far) in a linear (top-down) design.

Probably best to quit while I'm ahead!

Thanks for your help.
 
If you have a PHP file as the CSS file and pass the number of results returned you can then do the maths for the corner positions and output CSS rather than HTML. Just run the DB query before you start outputting the main HTML so you have the count saving a duplicated SQL query in the CSS PHP.
 
Status
Not open for further replies.

The Rule #1

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom