Sponsor for PC Pals Forum

Author Topic: php advice needed  (Read 15078 times)

Offline Rik

  • Former Admin
  • *****
  • Posts: 26506
  • Ceud mille failte
Re: php advice needed
« Reply #15 on: January 22, 2010, 15:45 »
Good luck, Paul, it's way over my head.
Slainthe!

Rik

Offline sam

  • Administrator
  • *****
  • Posts: 19966
Re: php advice needed
« Reply #16 on: January 23, 2010, 04:02 »
I'll have another think tomorrow - I've been busy calibrating the Arecibo telescope all day and am now shattered.
- sam | @starrydude --

Offline Clive

  • Administrator
  • *****
  • Posts: 73669
  • Won Quiz of the Year 2015,2016,2017, 2020, 2021
Re: php advice needed
« Reply #17 on: January 23, 2010, 09:59 »
Will you have to return to Arecibo again this year? 

Offline Rik

  • Former Admin
  • *****
  • Posts: 26506
  • Ceud mille failte
Re: php advice needed
« Reply #18 on: January 23, 2010, 12:20 »
Is that something like 'Torna a Surriento ', Clive? ;)
Slainthe!

Rik

Offline Clive

  • Administrator
  • *****
  • Posts: 73669
  • Won Quiz of the Year 2015,2016,2017, 2020, 2021
Re: php advice needed
« Reply #19 on: January 23, 2010, 12:47 »
Yes, but sung with a Spanish accent.   ;D

Offline Rik

  • Former Admin
  • *****
  • Posts: 26506
  • Ceud mille failte
Re: php advice needed
« Reply #20 on: January 23, 2010, 12:50 »
Si. :)
Slainthe!

Rik

Offline Simon

  • Administrator
  • *****
  • Posts: 76533
  • First to score 7/7 in Quiz of The Week's News 2017
Re: php advice needed
« Reply #21 on: January 23, 2010, 13:00 »
you called?
Many thanks to all our members, who have made PC Pals such an outstanding success!   :thumb:

Offline Rik

  • Former Admin
  • *****
  • Posts: 26506
  • Ceud mille failte
Re: php advice needed
« Reply #22 on: January 23, 2010, 13:08 »
Close.  ;D
Slainthe!

Rik

Offline sam

  • Administrator
  • *****
  • Posts: 19966
Re: php advice needed
« Reply #23 on: January 23, 2010, 17:15 »
Will you have to return to Arecibo again this year? 

hopefully, not sure though
- sam | @starrydude --

Offline sam

  • Administrator
  • *****
  • Posts: 19966
Re: php advice needed
« Reply #24 on: January 24, 2010, 19:35 »
I've been thinking about this problem a bit more...

How about this:

Have an array of the dimensions of the overall image.

Then when you add an image to the array change the values of the array to something say -9. Then you have an idea of what positions are used up.

Each time you add an new image find all values that aren't -9 then take the first x,y location that fits for the image input (I guess you'd need to also hunt down the first one that matches the same dimensions). As the loop is left add -9 to it.. and so on for new images. You could do the inverse to remove images.

Then have a final loop that prints out the html code of the images at the correct array positions.

I'd like to try and write the code too but I don't really have the time at the moment. I think the above would work but I'm not entirely sure.

You could possibly also produce the image on a on the fly with imagemagik. Just figure out ħow you would stick the images together in gimp and follow the same procedure...
- sam | @starrydude --

Offline psp83

  • New Member
  • *
  • Posts: 23
Re: php advice needed
« Reply #25 on: January 31, 2010, 14:29 »
Thanks Sam.

I'll be trying something this week and will let you know how it goes, just been too busy to try it yet  :(

Offline psp83

  • New Member
  • *
  • Posts: 23
Re: php advice needed
« Reply #26 on: June 08, 2010, 12:49 »
I am pleased to say I think this problem is no more.

I'm working in "blocks" instead of pixels. So I have a db table thats 100x100 block, a 40x40px ad is a 4x4 block.

I have code that loops through vert & horz to check available blocks, if there is any then allocate the blocks with the ad id.

For display I can then take the first vert & horz number for each ad and use that to absolute position the ad on the page.

Offline Rik

  • Former Admin
  • *****
  • Posts: 26506
  • Ceud mille failte
Re: php advice needed
« Reply #27 on: June 08, 2010, 13:01 »
I understood every other word, Paul. ;)
Slainthe!

Rik

Offline Simon

  • Administrator
  • *****
  • Posts: 76533
  • First to score 7/7 in Quiz of The Week's News 2017
Re: php advice needed
« Reply #28 on: June 08, 2010, 13:05 »
I understood the first line.  :)
Many thanks to all our members, who have made PC Pals such an outstanding success!   :thumb:

Offline sam

  • Administrator
  • *****
  • Posts: 19966
Re: php advice needed
« Reply #29 on: June 08, 2010, 14:59 »
cool glad you got it working, if the page is public I'd love to take a look.
- sam | @starrydude --


Show unread posts since last visit.
Sponsor for PC Pals Forum