Hey,
I've just installed the CPMfetch and everythings working accept the fact that I don't wat the image title to show and that's exactly what it's doing no matter what I do to the code. I would like to know how to a: change the imageheight and width and b: how to show views only (no title).
My code now (example code)
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
I left the $option out since that doesn't work for me...
Any thoughts? Yes I read the manaul and I still don't get it...
Thanks!
Quote from: miloukuh on August 23, 2007, 02:06:40 PM
Hey,
I've just installed the CPMfetch and everythings working accept the fact that I don't wat the image title to show and that's exactly what it's doing no matter what I do to the code. I would like to know how to a: change the imageheight and width and b: how to show views only (no title).
My code now (example code)
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
I left the $option out since that doesn't work for me...
Any thoughts? Yes I read the manaul and I still don't get it...
Thanks!
Read the doc section on the "using the options array effectively"
I have read that part and this is the error I get when I use your example code:
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$options = array( 'subtitle' => 'Image {{pTitle}} is {{pFilesizeKB}} KB' , 'imagewidth' => '200', "tablestyle" => "cssfortables" );
$objCpm->viewRandomMediaFrom("",1,1,$options);
$objCpm->cpm_close();
?>
Error: Fatal error: Call to undefined method cpm::viewRandomMediaFrom() in /home/cameron/public_html/test.php on line 5
Quote from: miloukuh on August 24, 2007, 06:07:44 PM
I have read that part and this is the error I get when I use your example code:
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$options = array( 'subtitle' => 'Image {{pTitle}} is {{pFilesizeKB}} KB' , 'imagewidth' => '200', "tablestyle" => "cssfortables" );
$objCpm->viewRandomMediaFrom("",1,1,$options);
$objCpm->cpm_close();
?>
Error: Fatal error: Call to undefined method cpm::viewRandomMediaFrom() in /home/cameron/public_html/test.php on line 5
Apparently I have an error...
try replaceing
viewRandomMediaFrom
with
cpm_viewRandomMediaFrom
Let me know if that helps
Sorry about that
Okay now that works fine! But I only want the amount of views to show and I'd like to adjust imageheight and width. How do I do this?
Okay so now I got the height and width right. New problem: What's the right code to get the pHits to work? This is my code now:
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$options = array( 'pHits' => 'Views: {{pHits}}', 'imagewidth' => '45', 'imageheight' => '45');
$objCpm->cpm_viewLastAddedMedia(1, 4, $options);
$objCpm->cpm_close();
?>
Help please!
Quote from: miloukuh on August 26, 2007, 11:56:26 AM
Okay so now I got the height and width right. New problem: What's the right code to get the pHits to work? This is my code now:
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$options = array( 'pHits' => 'Views: {{pHits}}', 'imagewidth' => '45', 'imageheight' => '45');
$objCpm->cpm_viewLastAddedMedia(1, 4, $options);
$objCpm->cpm_close();
?>
Help please!
Read up on titles and subtitles... pHits will not do anything with what you are doing.