CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 16 CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 16
 

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]

Main Menu

CpmFetch 1.4 On... Displaying data and images from CPG on your website

Started by vuud, July 08, 2005, 06:43:10 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

willstein


cyprus07

Quote from: cyprus07 on September 28, 2005, 03:44:23 PM
Quote from: vuud on September 28, 2005, 04:08:05 AM


Read the quickstart
http://www.fistfullofcode.com/projects/copperminefetch/quickstart.php

Then if you are especially giddy, the documentation (the how to use stuff)



ok i did what you said and put it here http://www.poli-online.net/cpmfetch/cpmfetch.php

however how do i include it in the code where i want it to be displayed. and if it can be like they have done it here http://www.poliaektimisoara.ro/forum/index.php  so that instead of going acros it goes down, and displays the Latest image, then 3 of the last images in the last 3 albums





can anyone help me with this question above?

vuud

Quote from: lavashark.com on October 01, 2005, 12:14:57 AM
Quote from: lavashark.com on September 29, 2005, 07:26:38 AM
sleep my friend.
and let me know if there is anything i can do in return.

any luck?

And let this be a lesson to the rest of you... when I say something right before I go to sleep, I tend to forget about it.

Anyway, not sure if this is what you want, but I am sure this is what you are getting

Notes:

* Set the "album=33,18,2" to the ones you want included
* Set the $cnt=3 to the number of albums you have above
* The 100,100 will get the first 1000 photos.  The total must be more than that which would be added into the the last added album...

Anyway it stops processing as soon as it has 3 so you won't be parsing all 1000 results.

Nothing in here for linking, but you can add that in youself... you can peek at the top of cpmfetch_dao.php to see what names are available in the row... 


<?php
$objCpm->cpm_setReturnType("resultset");
$data = $objCpm->cpm_viewLastAddedMediaFrom(100, 100, "album=33,18,2");

$cnt = 3;  //Number of different albums to look for (set this to the number you added into the album= above)
$albumsfound = array();

foreach ($data as $row) {
   
   if (! in_array($row['pAid'],$albumsfound)) {
      $imagename = $objCpm->cpm->getImageToUse($row['pFilepath'], $row['pFilename'] ,"thumb_");
      print "<img src='$imagename'>";
      array_push($albumsfound,$row['pAid']);
      $cnt--;
      if ($cnt = 0) break;
   }
}

?>

Hope that gets you going... best of luck, rah rah, all that

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

willstein


vuud

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

zigzaggy

Hello,
Is there a way to make this work on a Joomla (Mambo) site?

vuud

Quote from: zigzaggy on October 04, 2005, 01:12:08 AM
Hello,
Is there a way to make this work on a Joomla (Mambo) site?


According to the thread actually related to that sort of thing.. it does.
http://forum.coppermine-gallery.net/index.php?topic=19528.0

(Mambo anyway, no idea what a Joomia site is)
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

Joachim Müller


willstein

I've been searching to display the date under the most recent pictures but havn't found anything.
Is it possible?

vuud

Quote from: lavashark.com on October 05, 2005, 06:19:50 PM
I've been searching to display the date under the most recent pictures but havn't found anything.
Is it possible?

http://www.fistfullofcode.com/projects/copperminefetch/manual/ch06s03.html

See the entries for %w or %W

You may, or may not also be interested in this:
cpm_setDateFormat($format)  on the following page
http://www.fistfullofcode.com/projects/copperminefetch/manual/ch07s02.html
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

willstein


willstein

Small note:


<?
include "../fetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
?>

<?
$objCpm->cpm_viewRandomMedia(1,2,$options);
?>

</td>
</tr>

<tr>
<td align="center" valign="middle"><?
$options = array( 'subtitle' => '%h views<br>%t', "tablestyle" => "lastaddedmedia" );
?>
</td>
</tr>


I tried to add the optios array in it's own cell to prevent a long title from disrupting the layout of the images, but it wouldn't display.
Any suggestions either in TD, or CSS as to prevent long title images from disrupting layouts?

Thanks.

vuud

Quote from: lavashark.com on October 05, 2005, 08:56:31 PM
Small note:


<?
include "../fetch/cpmfetch.php";
$objCpm = new cpm('/gallery');
?>

<?
$objCpm->cpm_viewRandomMedia(1,2,$options);
?>

</td>
</tr>

<tr>
<td align="center" valign="middle"><?
$options = array( 'subtitle' => '%h views<br>%t', "tablestyle" => "lastaddedmedia" );
?>
</td>
</tr>


I tried to add the optios array in it's own cell to prevent a long title from disrupting the layout of the images, but it wouldn't display.
Any suggestions either in TD, or CSS as to prevent long title images from disrupting layouts?

Thanks.


The $options has to preceed the call, otherwise it cannot work.


$options = array( 'subtitle' => '%h views<br>%t', "tablestyle" => "lastaddedmedia" );
$objCpm->cpm_viewRandomMedia(1,2,$options);

The $options is not a command but a variable.

To illustrate, you could have also written it like so:


$objCpm->cpm_viewRandomMedia(1,2,array( 'subtitle' => '%h views<br>%t', "tablestyle" => "lastaddedmedia" ));


As for long titles, I can't think of anything off the bat... they should wrap, but that won't help you with larger words.

How long are they?
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

willstein

yeah i figured the options array had to be introduced before it was called.
the titles? see they're not neccessarily long, but if theyre longer (in width) than the picture, it pushes the picture up (disrupting my beautiful alignment).

i guess i could find a way to make the picture stay put in the tabe and any text under it to just extend the length of the table.

vuud

Quote from: lavashark.com on October 05, 2005, 09:47:08 PM
yeah i figured the options array had to be introduced before it was called.
the titles? see they're not neccessarily long, but if theyre longer (in width) than the picture, it pushes the picture up (disrupting my beautiful alignment).

i guess i could find a way to make the picture stay put in the tabe and any text under it to just extend the length of the table.

What if you set the cells to valign top?  Either by css or by sending it through as an option...

there is an undocumented entry for options called "cellattributes"  you can send that through with 'cellattributes'=>'valign='top"'

Its only undocumented because I keep forgetting to document them.  They also exist for rows, tables, etc.

Sigh - there is just never enough time


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

willstein

Quote from: vuud on October 05, 2005, 10:08:37 PM
Sigh - there is just never enough time

amen.

yeah thats what i'm trying to do now. tried in the table, and .css. ill get it eventually.
check out the screenshot, it will show you what i mean.

willstein

I've tried EVERYTHING.

I'm pretty sure it's on fetch side.
Any ideas?

vuud

Quote from: lavashark.com on October 06, 2005, 02:20:02 AM
I've tried EVERYTHING.

I'm pretty sure it's on fetch side.
Any ideas?

Okay, post some code here...  I'm sure its do able

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

willstein

I hope you don't make me look like an idiot.
<table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="75%"><table width="100%" height="200" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td><table width="100%" height="200" border="0" cellpadding="0" cellspacing="0" class="orangeborder">
                            <tr>
                              <td height="23" colspan="2" background="../images/STFHotNews_bg.gif"><img src="../images/pg.gif" width="114" height="23"></td>
                              <td width="284" height="23" background="../images/STFHotNews_bg.gif"><div align="right"><img src="../images/STFHotNews_r.gif" width="3" height="23"></div></td>
                            </tr>
                            <tr>
                              <td colspan="2" valign="top"><div align="center">
                                <p><strong>Random Photo
                                  Generator! <br>
                                    <a href="javascript:location.reload()" target="_self">Generate
                                Again</a></strong>
                                </p>
                                <table width="100" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td valign="top"><div align="center">
                                        <?
include "../fetch/cpmfetch.php";
$objCpm = new cpm('/gallery');

                                     
$options = array( 'subtitle' => '%h views<br>%t', "tablestyle" => "lastaddedmedia" );
                                     
$objCpm->cpm_viewRandomMedia(1,2,$options);
?>
                                    </div></td>
                                  </tr>
                                </table>
                              </div></td>
                              <td width="50%" valign="top"><div align="center">
                                <p><br>
                                  <strong> <img src="../images/new.gif" width="19" height="9" border="0"> Most
                                Recent Pictures:<br>
                                  </strong>
                                  <?


$options = array( 'subtitle' => '%w', "tablestyle" => "lastaddedmedia" ); ?>
                                  <? $objCpm->cpm_viewLastAddedMedia(1,2,$options);
$objCpm->cpm_close();
?>
                                </p>
                                </div></td>
                            </tr>
                           
                        </table></td>
                      </tr>
                  </table></td>
                </tr>
              </table>

vuud

Quote from: lavashark.com on October 06, 2005, 04:46:09 AM
I hope you don't make me look like an idiot.

Your example is great, but did not include any CSS which is how you are trying to solve the problem.

Try this just for fun, and let me know what happens.  I gave you the wrong syntax before on the undocumented call

The contents of the cellattributes has to be an array of things to add.  Try this, send a Snippet of the generated code if it does not work.

                         
$options = array( 'subtitle' => '%h views<br>%t',  "cellattributes"=>array("valign"=>"'top"));
$objCpm->cpm_viewRandomMedia(1,2,$options);



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