forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: Ataru on November 09, 2007, 07:24:44 pm

Title: How to style with CSS?
Post by: Ataru on November 09, 2007, 07:24:44 pm
Hello,
Just wondering how I might go about styling my pics with CSS.  I've tried placing the following code inside a table that was styled so that images would have a 1px solid black border with a 5px margin, but no luck:

Code: [Select]
<?php
$objCpm 
= new cpm("./images/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,5);
$objCpm->cpm_close();
?>

I've looked through the code and I think I need to set up a CSS stylesheet that somehow links to the following code in cpmfetch.php:

Code: [Select]
function cpm_viewLastAddedMedia($rows, $columns, $options="") {
$this->loadOptions($options);
//$resultset = $this->getLastAddedMedia($rows*$columns);
$resultset = $this->getLastAddedMediaFrom("",$rows*$columns);
$this->addDescriptionsToResultSet($resultset);
$retval = "";
switch ($this->returntype) {
case ('resultset'):
$retval = $resultset;
break;
case ('html'):
$retval = $this->createTable($resultset,$rows,$columns);
break;
case ('print'):
default:
print $this->createTable($resultset,$rows,$columns);
}

$this->clearOptions();
return ($retval);
}

But I'm not sure how to go about that, so could I get some help?
Thanks!
Title: Re: How to style with CSS?
Post by: Nibbler on November 09, 2007, 08:44:02 pm
CSS does not 'link' to PHP code.

If you gave the table a class of mytable then your CSS would be as follows:

Code: [Select]
.mytable img {
      border: 1px solid #000;
      margin: 5px;
}

Posting a link to your site is almost mandatory for questions such as yours.
Title: Re: How to style with CSS?
Post by: Ataru on November 10, 2007, 05:08:02 pm
CSS does not 'link' to PHP code.

If you gave the table a class of mytable then your CSS would be as follows:

Code: [Select]
.mytable img {
      border: 1px solid #000;
      margin: 5px;
}

Posting a link to your site is almost mandatory for questions such as yours.

*ehem*   :-[  Oops.  That would explain it.  I was using:

.mytable image {
      border: 1px solid #000;
      margin: 5px;
}

And I had only set the <td> to the mytable (or in my case, latest_images) class.

The link to my site:  http://www.creaturefeature.info
There you can see cpmfetch working perfectly.  Thanks!   :)