Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: return an array -or some type of list (<ul> <li> etc)  (Read 6032 times)

0 Members and 1 Guest are viewing this topic.

amyg

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
return an array -or some type of list (<ul> <li> etc)
« on: June 17, 2007, 11:12:27 pm »


CPMfetch + CPG seems to be a great solution for a gallery project I'm working on. (So - THANKS Vuud!)
Thanks to the documentation and helpful posts on this board - I've been able to figure out how to pull what I need from my Coppermine install  onto a webpage.
My issue is that I need the images to be list items rather than tables. ( I do understand how to add css classes to the <tr> and <td> tags - but I really need them to be <ul> and <li> tags.
From what I've figure out, my best bet is to use cpmfetch to return an array.
I gather that I need to use cpm::$returntype and print_r - but I can't seem to make it work. (maybe there's a better solution - rss?)

I'd be most appreciative if someone could point me in the right direction  - I have to image that I'm not the only designer that needs the images to be list items rather than tables.
Thanks in advance.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: return an array -or some type of list (<ul> <li> etc)
« Reply #1 on: June 18, 2007, 10:56:08 pm »

CPMfetch + CPG seems to be a great solution for a gallery project I'm working on. (So - THANKS Vuud!)
Thanks to the documentation and helpful posts on this board - I've been able to figure out how to pull what I need from my Coppermine install  onto a webpage.
My issue is that I need the images to be list items rather than tables. ( I do understand how to add css classes to the <tr> and <td> tags - but I really need them to be <ul> and <li> tags.
From what I've figure out, my best bet is to use cpmfetch to return an array.
I gather that I need to use cpm::$returntype and print_r - but I can't seem to make it work. (maybe there's a better solution - rss?)

I'd be most appreciative if someone could point me in the right direction  - I have to image that I'm not the only designer that needs the images to be list items rather than tables.
Thanks in advance.


Yes, you are on the right track.

What you want to do is set the returntype to resultset 

The print_r just dumps the array, it makes it easy to see what you are working with - so its useful to see what you are getting back, but not useful for building your list.

You want to do a foreach over the array (see php.net) and print out all your <LI> stuff that way.

If you get stuck, post the code you have and maybe someone will poke it with a sharp object or something

Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: return an array -or some type of list (<ul> <li> etc)
« Reply #2 on: June 18, 2007, 10:57:02 pm »

I'd be most appreciative if someone could point me in the right direction  - I have to image that I'm not the only designer that needs the images to be list items rather than tables.

Actually, AFAIK, you are.  :D
Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

amyg

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: return an array -or some type of list (<ul> <li> etc)
« Reply #3 on: June 18, 2007, 11:42:21 pm »

Thanks, I'll give it a shot - hopefully, I can make this work, but I suspect that I'm going to have to go another direction (other than CPG)

I do know that there are other designers who don't use coppermine specifically due to the tables  - as we like to design with css rather than tables. (layout of course, not DB tables - those we need ;)
I had hoped to use CPG to make file management easier for my client, and I thought this might work...
I love the amount of control that cpmFetch gives me in all the other areas - if only I could get those <ul> and <li> tags.

Thanks again for your help

Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: return an array -or some type of list (<ul> <li> etc)
« Reply #4 on: June 19, 2007, 03:50:02 am »

Thanks, I'll give it a shot - hopefully, I can make this work, but I suspect that I'm going to have to go another direction (other than CPG)

I do know that there are other designers who don't use coppermine specifically due to the tables  - as we like to design with css rather than tables. (layout of course, not DB tables - those we need ;)
I had hoped to use CPG to make file management easier for my client, and I thought this might work...
I love the amount of control that cpmFetch gives me in all the other areas - if only I could get those <ul> and <li> tags.

Thanks again for your help

I actually do that quite a bit for clients of mine (http://www.explosivo.com).  Its a great thought.  I've done everything from pure CSS layouts to hybrids and integration of other stuff.

The whole header at http://cpmfetch.fistfullofcode.com/ is css layout.  And on the body of the page, its html tables in a css layout design.

It's actually on my long list of things to do, provide different outputs.   I would say a lot of designer do like CSS, but from my experience only about half of them really embrace it.  Others get pithy over the "tiny little things" :)   At least the two guys that work for me are that way.  Funny that the biggest push to use CSS is from clients who are not sure why they want that - but its the cutting edge of technology and my cousins, friends, roommates, ex-girlfriends adopted simian told them it was a must for a web site. ;)

Anyway, bigger parts like this I tend to wait until I have a customer that is willing to pay for the development and allow the code to go back to the community.  Either that, or when I myself develop a need for it.  I know about enough CSS to make the cpmfetch site, and some dynamic rendering for AJAX and such, but not enough to make good decisions on how a css layout would work best.

If you learn the littleist bit of php, you can make it output whatever you want.

Vuud





Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

amyg

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: return an array -or some type of list (<ul> <li> etc)
« Reply #5 on: June 19, 2007, 11:02:12 pm »

Yep - there's a lot to learn!
There are so many reasons to move beyond tables for layout - but that's another discussion ;-)
For my current project - I'm sticking with Photostack (pure css layout and very simple templating system.)
I will be keeping my eye on this project though and perhaps when I have a bit more time to figure out how to ditch the tables, I'll come back.
-Or maybe when I can budget a php developer in - I'll look you up.

Thanks again for all your work on this project.
best of luck to you
a
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: return an array -or some type of list (<ul> <li> etc)
« Reply #6 on: June 20, 2007, 04:07:04 am »

Yep - there's a lot to learn!
There are so many reasons to move beyond tables for layout - but that's another discussion ;-)
For my current project - I'm sticking with Photostack (pure css layout and very simple templating system.)
I will be keeping my eye on this project though and perhaps when I have a bit more time to figure out how to ditch the tables, I'll come back.
-Or maybe when I can budget a php developer in - I'll look you up.

Thanks again for all your work on this project.
best of luck to you
a

Okay.  Like I said, its on my wish list - but I barely have time to get the stuff that really needs to be done here done.

If you try it and run into problems, post here and I can help.

Bye for now

Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 19 queries.