Multiple fetches with Cuteness Multiple fetches with Cuteness
 

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

Multiple fetches with Cuteness

Started by OckGal, October 27, 2007, 08:19:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

OckGal

I've seriously been searching for over two hours and haven't a solution, though I've ran into SIMILAR things.

I installed the latest version of Coppermine, installed cpmFetch, works fine.

I'll be using Cuteness for my news on my main page. I'm using php extensions. My main page....

-php include for the site's header
-table stuff for layout
-php include for cuteness code
-closing table stuff for layout
-php include for site's footer

I'm not too bright when it comes to php stuff but it's been working fine. Then I needed to add the php include for the gallery. Just using one works, but I want to be able to have....

Update 1
GALLERY THUMBS 1

Update 2
GALLERY THUMBS 2

etc.

I haven't tried yet, but will the php include for the gallery thumbs work putting them into a Cutenews entry? I mean I've seen people do it on their sites so I know there's a way. I tried (without Cutenews; just on the index page) to use the php include_once where you put the bit at the top, then the bits in the centre to fetch and then the closing tag at the end of the page but every time I do that it gives me an error (nothing else on the page) that says there's an unexpected '<' on line whatever. That would be the start of the php include_once tag so I don't know why it's making a fuss.

<?php include('header.txt'); ?>
<?php    // This is at the top of your page
  
include_once "./cpg/cpmfetch/cpmfetch.php";  // Line 1
  
$objCpm = new cpm("./cpg/cpmfetch/cpmfetch_config.php"); // Line 2

<!---content starts--->
<
tr><td class="middletitle">&raquo;TITLE</td></tr>
<
tr><td class="middlejustify">
<
center>

TEXT TEXT TEXT TEXT 1

// Here is a spot that you want to have the newest image.
  
$options = array(?subtitle? => ?{{pFilename}}?); // Line 3
  
$objCpm->cpm_viewLastAddedMedia(11$options);  // Line 4

TEXT TEXT TEXT TEXT 2

// Here is a spot you want the 8 random images with no subtitle from category 1
  
$objCpm->cpm_viewRandomMediaFrom(?cat=1?, 24);  // Line 5

TEXT TEXT TEXT TEXT 3


</center>


// Here is the bottom of the page, lets close things up
  
$objCpm->cpm_close();  // Line 6
?>


</td></tr></table></div>
<?php include('footer.txt'); ?>

OckGal

Good grief. I meant CuteNEWS. Now I'll never be taken seriously, lol!

I've been messing around with the code and managed to sorta get it so I can use two different fetches but if I put anything between the code bits, it says invalid stuff. And apparently Cutenews doesn't let you use the php include tag? It's just coming out all code. I've seen it done on other sites so either they're linking thumbs by hand or using some way I have no idea about.

If anyone uses Cutenews with Coppermine, I'd love to hear how you do it. I've googled and still can't find anything. Looked on Cutenews.com and got close but nothing.

capecodgal

well this probably isn't the "correct way" as I am by no means a coding guru but if the php will not appear via your cute news post then why not embed a iframe and call the php file to load?

what I mean is say for example create a php file called update.php and within that file place your cpmfetch php code then call that page to load via an frame (or similiar) from cute news?

I think this would work as the cpmfetch is loading within its own php file  ;D

capecodgal

and I'll add if you are using multiple installs of cpmfetch (i.e. video gallery and photo gallery) then I had to recall the same file from 1 install to get it to work (took me forrrrrrrever to fin d the answer- some one finally showed me and the light bulb went on lol)



anyways here is how I got 2 installs to work




<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr><td class="h1">Latest Video Uploads</td></tr>
<tr><td class="h2">
<center>

<?php
 
require_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./videos/cpmfetch/cpmfetch_config.php");
$options = array( 'imagesize' => 'thumb');
$objCpm->cpm_setfilter($filter ".jpg");
$objCpm->cpm_viewLastAddedMedia(2,1,$options,$filter);
$objCpm->cpm_close();
?>

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

<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr><td class="h1">Latest Image Uploads</td></tr>
<tr><td class="h2">
<center>

<?php
 
require_once "./photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./photos/cpmfetch/cpmfetch_config.php");
$options = array( 'imagesize' => 'thumb');
$objCpm->cpm_setfilter($filter ".jpg");
$objCpm->cpm_viewLastAddedMedia(2,1,$options,$filter);
$objCpm->cpm_close();
?>

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


OckGal

It worked! Thank you so much! Only thing is, when I scroll up or down on my page, the area with the iFrame kinda wiggles up and down as I'm scrolling. I noticed it doing it on my tagboard as well (which is also using an iFrame) and it only happens in FireFox. I can't seem to find any info about that. Grr.