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: Show Image of Last Album Within Specific Category  (Read 7208 times)

0 Members and 1 Guest are viewing this topic.

capecodgal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 123
Show Image of Last Album Within Specific Category
« on: August 11, 2007, 06:00:36 pm »

I am getting better at this  ;D

I am using cpmfetch 2.0.0

I am trying to pull the last imges of albums updated within a specific category... so for example I have an "Appearances" category and within that category are more categories for the years (ex: 2007, 2006, and so on) then within the year category are the albums....

so this is what I have accomplished so far:

<?php
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$objCpm->cpm_viewLastAddedMediaFrom("cat=2,12,13,15,16,17,19:album=0",1,3);
$objCpm->cpm_close();
?>


The result is the last 3 images uploaded to any category within the appearances category. I want it to show 1 image per album within that category

So I understand when I said cat=2 that it didn't work because I have sub-categories and I had to add each sub-category id # so that made sense. Now I am guessing that my album=0 may be the problem because I am saying any album within those categories... I only want to see 1 image per last updated album updated within that category... any suggestions on how I can accomplish this? Or am i shooting for the impossible?

Thanks in advance for any direction you can give-
« Last Edit: September 14, 2007, 09:04:17 am by GauGau »
Logged

capecodgal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 123
Re: Show Image of Last Album Within Specific Category
« Reply #1 on: August 13, 2007, 05:24:30 pm »

So I have been playing with this a bit more and this one is similiar to what I am looking for but I wanted the images to go horizontal rather than vertical and the text under the image and this is all categories rather than a specific one....

<?php
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$options = array( 'windowtarget' => '_blank');
$objCpm->cpm_showCategoriesUpdatedOverLastDays(1,$options);
$objCpm->cpm_close();
?>


Here is the page I am testing on:

http://julianmcmahonfan.com/photos.php

(scroll down towards the bottom labeled Categories Updated Over X Days)

I want it to be able to look more like the top two (those are the example I posted in the first post)


Having the list go vertical just takes up so much space and I also noticed it seemed to duplicate the number of images in the second line of text
(ex: 11 new in 2004  11)

Just looking if anyone can point me in the right direction to accomplish this... the second example in this post is not a FROM function so I can't choose a specific cat or album.. but if I could get it to go across with the text under and the name of the album included it just might work.
Logged

capecodgal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 123
Re: Show Image of Last Album Within Specific Category
« Reply #2 on: August 18, 2007, 03:36:39 pm »

You guys can mark this solved  :)

I think I have figured out a work around as I am assuming that there is no specific function for this.

If anyone is interested here is the code I ended up using:

Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr><td class="h1">Latest Image Uploads</td></tr>
<tr><td class="side_content">

<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr><td width="27%" bgcolor="#CBD5D2"><center><a href="http://julianmcmahonfan.com/photos/index.php?cat=2">Public Appearances</a></center></td>
<td width="73%" bgcolor="#CBD5D2">
 <center>
<?php 
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$options = array( 'windowtarget' => '_blank''imagewidth' => '60',);
$objCpm->cpm_viewLastAddedMediaFrom("cat=2,12,13,15,16,17,19:album=0",1,2,$options); 
$objCpm->cpm_close(); 
?>

</center>
</td></tr></table>

<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr><td width="27%" bgcolor="#CEDCD8"><center> <a href="http://julianmcmahonfan.com/photos/index.php?cat=5"> Photoshoots</a> </center> </td>
<td width="73%" bgcolor="#CEDCD8">
<center>
<?php 
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$options = array( 'windowtarget' => '_blank''imagewidth' => '60');
$objCpm->cpm_viewLastAddedMediaFrom("cat=5:album=0",1,2,$options); 
$objCpm->cpm_close(); 
?>

</center>
</td></tr></table>

<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr><td width="27%" bgcolor="#CBD5D2"><center> <a href="http://julianmcmahonfan.com/photos/index.php?cat=45"> Candids</a> </center> </td>
<td width="73%" bgcolor="#CBD5D2">
<center>
<?php 
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$options = array( 'windowtarget' => '_blank''imagewidth' => '60');
$objCpm->cpm_viewLastAddedMediaFrom("cat=45:album=0",1,2,$options); 
$objCpm->cpm_close(); 
?>

</center>
</td></tr></table>

<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr><td width="27%" bgcolor="#CEDCD8"><center> <a href="http://julianmcmahonfan.com/photos/index.php?cat=3">Movies</a> </center></td>
<td width="73%" bgcolor="#CEDCD8">
<center>
<?php 
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$options = array( 'windowtarget' => '_blank''imagewidth' => '60');
$objCpm->cpm_viewLastAddedMediaFrom("cat=46,43,44:album=0",1,2,$options); 
$objCpm->cpm_close(); 
?>

</center>
</td></tr></table>


<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr><td width="27%" bgcolor="#CBD5D2"><center> <a href="http://julianmcmahonfan.com/photos/index.php?cat=4">Television</a> </center> </td>
<td width="73%" bgcolor="#CBD5D2">
<center>
<?php 
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$options = array( 'windowtarget' => '_blank''imagewidth' => '60');
$objCpm->cpm_viewLastAddedMediaFrom("cat=48,49,25,27,8,9,26,28:album=0",1,2,$options); 
$objCpm->cpm_close(); 
?>

</center>
</td></tr></table>

<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr><td width="27%" bgcolor="#CEDCD8"><center> <a href="http://julianmcmahonfan.com/photos/index.php?cat=6">Interviews</a> </center></td>
<td width="73%" bgcolor="#CEDCD8">
<center>
<?php 
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$options = array( 'windowtarget' => '_blank''imagewidth' => '60');
$objCpm->cpm_viewLastAddedMediaFrom("cat=6:album=0",1,2,$options); 
$objCpm->cpm_close(); 
?>

</center>
</td></tr></table>

<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr><td width="27%" bgcolor="#CBD5D2"><center> <a href="http://julianmcmahonfan.com/photos/index.php?cat=47">Magazine Scans</a> </center> </td>
<td width="73%" bgcolor="#CBD5D2">
<center>
<?php 
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$options = array( 'windowtarget' => '_blank''imagewidth' => '60');
$objCpm->cpm_viewLastAddedMediaFrom("cat=47:album=0",1,2,$options); 
$objCpm->cpm_close(); 
?>

</center>
</td></tr></table>
</tr></td></table>


End result is this:
www.julianmcmahonfan.com

(left column latest image uploads)  I ended up not using subtitles as the page got too cluttered
Logged

yazeft

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 34
Re: Show Image of Last Album Within Specific Category
« Reply #3 on: August 20, 2007, 07:53:54 am »

I'm using this:
Code: [Select]
$options = array( 'alttag' => '%t');
$objCpm -> cpm_viewRandomMediaFromAlbum(1,5,4,$options);

which works, but only displays images from ONE album (i.e. album "4")

I want to use this:
Code: [Select]
$options = array( 'alttag' => '%t');
$objCpm -> cpm_viewRandomMediaFromAlbum(1,5,4,6,8,$options);

but if i do then the "$options" don't work.. hmmm..?
Logged

antisa33

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 181
    • Free french kids coloring
Re: Show Image of Last Album Within Specific Category
« Reply #4 on: September 13, 2007, 07:58:14 pm »

Hello capecodgal

You site is very beautiful.

Please can you give the code to display your

"Latest Gallery Updates"

and where can i put it to have it on an other page (not on the index)

Thanks!!
Logged

capecodgal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 123
Re: Show Image of Last Album Within Specific Category
« Reply #5 on: September 27, 2007, 06:38:56 pm »

Hello capecodgal

You site is very beautiful.

Please can you give the code to display your

"Latest Gallery Updates"

and where can i put it to have it on an other page (not on the index)

Thanks!!




Alright here is the code that I used but my coppermine is in a folder called photos so change the code to apply to your path. My site is coded in php so I can easily add this to any page on the site; I guess for you to add it to a different page just paste this in there and adjust as needed; update the text if needed and change the classes to fit your coding..... also the number 7 is how many days to list so change that to fit your site also if you update less frequently try 30 days


Code: [Select]
<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr><td class="h1"><center> Latest Gallery Updates </center></td></tr>
<tr><td class="h2"><center>Posted by Site Staff</center></td></tr>
<tr><td class="table_content">
<center>
<p>
Welcome, <b>Guest</b>. Please  <a href="/photos/login.php?referer=index.php" target="_blank">Login</a> or <a href="/photos/register.php" target="_blank">Register</a>. <br>
<?php 
include_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm('./photos/cpmfetch/cpmfetch_config.php');
$options = array( 'windowtarget' => '_blank');
$objCpm->cpm_listMediaAddedOverLastDays(7,$options);
$objCpm->cpm_close(); 
?>

</center>
</tr></td></table>

Enjoy!
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 15 queries.