Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: putting CpmFetch array elements into an html table  (Read 5142 times)

0 Members and 1 Guest are viewing this topic.

therightpic

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
    • TheRightPic
putting CpmFetch array elements into an html table
« on: August 24, 2007, 06:19:22 pm »

Hi,

I have this page:

www.therightpic.com

If you look at the bottom of the page I have a list of my albums.  I am using the following code to display this:

<?php
  $albumsCpm = new cpm("./cpg1.4.11/cpmfetch/cpmfetch_config.php");
$options = array("imageattributes" => array("height" => "90", "width"=>"120"));
    $albumsCpm->cpm_showAlbumsUpdatedOverLastDays("365", $options);

?>

I want to put each album listing and thumbnail from the array that this uses into a table cell.  In other words, I want to make this pretty, formatted into a nice table with a single (or maybe double) column and each album listing in its own cell on its own row.  Is this possible?  I have been fiddling with PHP arrays and reading the documentation but I can't figure it out.

I know I can use html tables or CSS to format this but how do I get each element in its own cell?
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: putting CpmFetch array elements into an html table
« Reply #1 on: August 24, 2007, 06:51:01 pm »

Hi,

I have this page:

www.therightpic.com

If you look at the bottom of the page I have a list of my albums.  I am using the following code to display this:

<?php
  $albumsCpm = new cpm("./cpg1.4.11/cpmfetch/cpmfetch_config.php");
$options = array("imageattributes" => array("height" => "90", "width"=>"120"));
    $albumsCpm->cpm_showAlbumsUpdatedOverLastDays("365", $options);

?>

I want to put each album listing and thumbnail from the array that this uses into a table cell.  In other words, I want to make this pretty, formatted into a nice table with a single (or maybe double) column and each album listing in its own cell on its own row.  Is this possible?  I have been fiddling with PHP arrays and reading the documentation but I can't figure it out.

I know I can use html tables or CSS to format this but how do I get each element in its own cell?


I am thinking at this point you may be best getting back the data from cpmfetch and creating the table yourself - that gives you the most control.  Will require some basic PHP experience
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

therightpic

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 14
    • TheRightPic
Re: putting CpmFetch array elements into an html table
« Reply #2 on: August 24, 2007, 07:23:00 pm »

Vuud,

Thanks for replying.  I have enjoyed playing around with CPMFetch and incorporating parts of it into my site.  It is very useful.  Thank you for taking the time to create it.

So, what you are saying is that instead of using your built in function "cpm_showAlbumsUpdatedOverLastDays" that I should just use the CPMFetch database connection and query for my albums and then feed the results into a dynamic html table?

Am I understanding you correctly?


Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.