Hello all !
I want to do a blog reporting my photo works, easily and nicely with lot's of pictures from Coppermine galleries in messages.
I discovered WordPress (great !) and gave a try to CpmFetch (which i used in trhe past for webpages, here i installed v2.0.0).
Sooo, i want to add a script like this in a message (this shows image 973 reduced by 640px wide, with link to the album; myhost_root is of course to modify regarding your provider) ;
include "/myhost_root/airpassi/www/photos/cpmfetch/cpmfetch.php";
$objCpm = new cpm("/myhost_root/airpassi/www/photos/cpmfetch/cpmfetch_config.php");
$options = array('windowtarget' => '_blank',"imagesize"=>"large","imagewidth"=>"650","imagelink"=>"album","subtitle" => "<center> {{pHits}} Views</center>");
$objCpm->cpm_viewMediaByPid (973, $options);
$objCpm->cpm_close();
First problem, WordPress does not understand php.
This was easily solved in installing exec-php to WordPress !
Then, a try with the above script ... This works fine !
... but if i add a second message with the same (kind of) script, the second 'include' included in the second script is giving an error.
So, i need only one call to the include, before messages (with cpm calls) are shown.
I put the include line at the end of the header.php file, and removed the include line call from message's scripts. A try was successful ! GREAT !
So i now have plenty of ideas and CPMFetch will help me to solve them ! This is a really great extension !!!
To summarize ;
1st ; add the include reference in the header.php
2nd; create a message to see a reduced size picture (picture 973, 600px wide, with link to the album, and hits)
$objCpm = new cpm("/myhost_root/airpassi/www/photos/cpmfetch/cpmfetch_config.php");
$options = array('windowtarget' => '_blank',"imagesize"=>"large","imagewidth"=>"650","imagelink"=>"album","subtitle" => "<center> {{pHits}} Views</center>");
$objCpm->cpm_viewMediaByPid (973, $options);
$objCpm->cpm_close();
3rd; second message showing three defined thumbs (from image 973, 974, 975) in a small table (side by side) ; so a mix of html (for the table structure) and cpm calls is needed.
<table width="100%" border="0">
<tr>
<td>
<?
$objCpm = new cpm("/myhost_root/airpassi/www/photos/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewMediaByPid (973);
?>
</td>
<td>
<?
$objCpm->cpm_viewMediaByPid (974);
?>
</td>
<td>
<?
$objCpm->cpm_viewMediaByPid (975);
?>
</td>
</tr>
</table>
4th; need to see the 6 last added pictures ?
<?php
$objCpm = new cpm("/myhost_root/airpassi/www/photos/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(2,3);
$objCpm->cpm_close();
?>
And so on ...
I have to say understanding cpmfetch was not easy at the beginning (i am not a great coder) but it is really worth the effort !!!
For new users, read the manuals, try, try again ... this extension is AWESOME !!!
MANY thanks to the coders !!!
L@urent