with modifications to just one line of code CPM fetch will work with 1.5.x. I'm already using it on a site of mine.
Start a thread regarding cpmfetch and I'll post the details.
'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
Bear in mind that VUUD is working on a new improved version specifically for the 1.5.x line of Coppermine. This is what I am using now to continue using his excellent tool.
Open install.php and find the line (around 61 )Code: [Select]'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
and replace withCode: [Select]'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
That is for the benefit of others who may need this tool. Once again you have neglected to post your link. Please try not to forget in future.
I can confirm this. It's the first code that you must put into the install.php file
Bear in mind that VUUD is working on a new improved version specifically for the 1.5.x line of Coppermine.
Phill, Can you check these lines of code you posted, I think you have them the wrong way around. I edited the file as described and then installed. It installed but no images were showing. I then replaced the code with the one in your top line and all works fine.
Link to test site, www.cctestsite.info
Thanks for your help. ;)
Bear in mind that VUUD is working on a new improved version specifically for the 1.5.x line of Coppermine. This is what I am using now to continue using his excellent tool.
Open install.php and find the line (around 61 )Code: [Select]'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
and replace withCode: [Select]'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
That is for the benefit of others who may need this tool. Once again you have neglected to post your link. Please try not to forget in future.
echo '<div id="cpmfetch">';chdir("../gallery/cpmfetch/");
include "cpmfetch.php"; $objCpm = new cpm();
$options = array("subtitle" => "<center>{{pTitle}} <br> <center> <FONT color=#1A5EFF size=2>Image By</FONT></STRONG> {{pOwner_name}} <br>{{pHits}} Views <center> <FONT color=#3399FF size=2>Comments</FONT></STRONG> {{pComCount}} </center>");
$objCpm->cpm_viewLastAddedMedia(3,4,$options);$objCpm->cpm_close();chdir("../../");
echo '<a href="http://cctestsite.info/gallery/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more latest images</b></u></a>';
if ($context['user']['is_logged'])
if ($context['user']['is_logged'])
{
$thecat = 10000 + $context['user']['id'];
echo ' •
<a href="http://cctestsite.info/gallery/index.php?cat='. $thecat .'" alt="My Gallery"><u><b>My Gallery</b></u></a>';
}
Bear in mind that VUUD is working on a new improved version specifically for the 1.5.x line of Coppermine. This is what I am using now to continue using his excellent tool.
Open install.php and find the line (around 61 )Code: [Select]'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
and replace withCode: [Select]'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
That is for the benefit of others who may need this tool. Once again you have neglected to post your link. Please try not to forget in future.
Unknown column 'p.owner_name' in 'field list'
SELECT p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb, u.user_lastvisit AS uUser_lastvisit,u.user_regdate AS uUser_regdate,u.user_email AS uUser_email,u.user_profile1 AS uUser_profile1,u.user_profile2 AS uUser_profile2,u.user_profile3 AS uUser_profile3,u.user_profile4 AS uUser_profile4,u.user_profile5 AS uUser_profile5,u.user_profile6 AS uUser_profile6, a.aid AS aAid, a.title AS aTitle, a.description AS aDescription, a.visibility as aVisibility, a.pos as aPos, a.category as aCategory, a.thumb as aThumb, a.keyword as aKeyword FROM cpg_pictures AS p LEFT JOIN cpg_users AS u ON p.owner_id = u.user_id LEFT JOIN cpg_albums AS a ON p.aid = a.aid LEFT JOIN cpg_categories AS c ON a.category = c.cid WHERE 1 AND p.approved='YES' AND ((a.visibility = 0 OR a.visibility IS NULL) AND (a.alb_password IS NULL OR a.alb_password = "")) ORDER BY p.ctime DESC LIMIT 0,3
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in /home/enchongd/public_html/photos/cpmfetch/cpmfetch_dao.php on line 1260
Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in /home/enchongd/public_html/photos/cpmfetch/cpmfetch_dao.php on line 1264
'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
Warning: split() [function.split]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CDT/-5.0/DST' instead in /home/cpharris/public_html/photos/cpmfetch/install.php on line 312
I keep getting this error still.
it the code where it has a 1, 4 ... change it to a 3
http://cpmfetch.fistfullofcode.com/docs/stable_basic/index.html
echo '<div id="cpmfetch">';chdir("../gallery/cpmfetch/");include "cpmfetch.php"; $objCpm = new cpm();$options = array("imageheight"=>"80","subtitle" => "<center>{{pTitle}} <br> <center> <FONT color=#1A5EFF size=2>Image By</FONT></STRONG> {{pOwner_name}} <br>{{pHits}} Views <center> <FONT color=#3399FF size=2>Comments</FONT></STRONG> {{pComCount}} </center>");$objCpm->cpm_viewLastAddedMedia(4,4,$options);$objCpm->cpm_close();chdir("../../");echo '<a href="http://cameracraniums.com/gallery/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more latest images</b></u></a>';
if ($context['user']['is_logged'])
if ($context['user']['is_logged'])
{
$thecat = 10000 + $context['user']['id'];
echo ' •
<a href="http://cameracraniums.com/gallery/index.php?cat='. $thecat .'" alt="My Gallery"><u><b>My Gallery</b></u></a>';
}
echo '<div id="cpmfetch">';chdir("../gallery/cpmfetch/");include "cpmfetch.php"; $objCpm = new cpm();$options = array("subtitle" => "<center>{{pTitle}} <br>{{pHits}} Views <center> </center>");$objCpm->cpm_viewLastAddedMedia(4,4,$options);$objCpm->cpm_close();chdir("../../");echo '<a href="http://cameracraniums.com/gallery/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more latest images</b></u></a>';
if ($context['user']['is_logged'])
if ($context['user']['is_logged'])
{
$thecat = 10000 + $context['user']['id'];
echo ' •
<a href="http://cameracraniums.com/gallery/index.php?cat='. $thecat .'" alt="My Gallery"><u><b>My Gallery</b></u></a>';
}
Bear in mind that VUUD is working on a new improved version specifically for the 1.5.x line of Coppermine. This is what I am using now to continue using his excellent tool.
Open install.php and find the line (around 61 )Code: [Select]'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
and replace withCode: [Select]'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
That is for the benefit of others who may need this tool. Once again you have neglected to post your link. Please try not to forget in future.
Download the cpmfetch plugin, and unzip it on your pc. Inside you'll see a cpmfetch folder, inside that you'll see the install.php file. That's the one you need to edit. Then upload just that cpmfetch folder (with its contents) to your server in the coppermine directory.
Anyone worked out how to get the "owners name" and "comment count" to work with 1.5.8?
I have cpmfetch working (as per 1st page of this topic) and pulling thumbs into a php block on my home page, but I've had to edit the code. Now it shows image title, and number of views only.
Unknown column 'p.owner_name' in 'field list'
SELECT p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb, a.aid AS aAid, a.title AS aTitle, a.description AS aDescription, a.visibility as aVisibility, a.pos as aPos, a.category as aCategory, a.thumb as aThumb, a.keyword as aKeyword FROM cpg14x_pictures AS p LEFT JOIN cpg14x_albums AS a ON p.aid = a.aid LEFT JOIN cpg14x_categories AS c ON a.category = c.cid WHERE 1 AND p.approved='YES' AND ((a.visibility = 0 OR a.visibility IS NULL) AND (a.alb_password IS NULL OR a.alb_password = "")) ORDER BY p.ctime DESC LIMIT 0,4
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/mysite/public_html/cpg/cpmfetch/cpmfetch_dao.php on line 1260
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/mysite/public_html/cpg/cpmfetch/cpmfetch_dao.php on line 1264
'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_name AS pOwner_name, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
'cfSQLPictureSelect' => 'p.filepath AS pFilepath, p.filename AS pFilename, p.aid AS pAid, p.filesize AS pFilesize, p.title AS pTitle, p.caption AS pCaption, p.owner_id as pOwnerId, p.ctime AS pCtime, p.hits AS pHits, p.pid AS pPid, p.pic_rating AS pPic_Rating, p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, p.user1 as pUser1, p.user2 as pUser2, p.user3 as pUser3, p.user4 as pUser4, c.cid as cCid, c.name as cName, c.description as cDescription, c.pos as cPos, c.parent as cParent, c.thumb as cThumb',
<?phpPlease note: Unless you are running this code from the same directory as the cpmfetch_config.php file, you need to alter that path so it can be found. The same goes for the include statement.
include "./cpmfetch.php";
$objCpm = new cpm("./cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
Warning: include_once(./gallery/cpmfetch/cpmfetch.php) [function.include-once]: failed to open stream: No such file or directory in /home/candyswa/public_html/gallery/recentpix.php on line 44
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
<?php
include "./testgallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./testgallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
<?php
include "./cpmfetch.php";
$objCpm = new cpm("./cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("./cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
Syntax error in block code. Please check the code.
Fatal error: Class 'cpm' not found in /home/eita932/public_html/smftest/Sources/PortalBlocks.php(3561) : eval()'d code on line 2
That was it, lurkalot ;D - it was perfect.
Thank you a billion times!
#cpmfetch table {
width: 100%;
}
#cpmfetch td {
width: 25%;
}
#cpmfetch {
text-align: center;
}
echo '<div id="cpmfetch">';chdir("../cpg15x/cpmfetch/");include "cpmfetch.php"; $objCpm = new cpm();$options = array("subtitle" => "<center>{{pTitle}} <br>{{pHits}} Views <center> </center>");$objCpm->cpm_viewRandomMedia(1,4,$options);$objCpm->cpm_close();chdir("../../");echo '<a href="http://bestregion.net/cpg15x/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more random images</b></u></a>';
if ($context['user']['is_logged'])
if ($context['user']['is_logged'])
{
$thecat = 10000 + $context['user']['id'];
echo ' •
<a href="http://bestregion.net/cpg15x/index.php?cat='. $thecat .'" alt="My Gallery"><u><b>My Gallery</b></u></a>';
}
thumbnails.php?album=lastup
has to be changed tothumbnails.php?album=random
to access the "random" meta album.
My question is if this (bold) should be changed? Just ask because for me as total stranger to coding might look as short for "latest uploaded/updated":
/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more random images</b></u></a>'
Just asking :)
/**
* RELEASE VERSION: 1.6.3
*
* This is the installation program for CpmFetch.
*
* Usage: Call this file from a web browser and follow the instructions
*
*/
I am using coppermine 1.5.22 andthe only download of CPMfetch that I can find is 1.63
A haa I was having a blind moment thanks for that.
I must say the docs are really impressive, the only thing is on the download it might be worth updating that line 61 with the working code for 1.5
Thanks again and sorry for my post I just seemed to be over looking it somehow.
Cheers
Ian
Well... think I solved my problem... I went back to what I was running with the 1.4.x galleries - which appears to be a higher version of CPMFETCH than what is available here - 2.1.1 vs 2.0.0.
I did need to change line 61 of install.php to change the reference to p.owner_name as described in earlier post - and then all was well again.
I'll look for my original download of 2.1.1 in case someone else needs it.
Greg
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$options = array('windowtarget' => '_blank',"imageheight"=>'30',"imagewidth"=>'30');
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
<div style="position:absolute; left:157px; top:568px; width:651px;">
Hi guys
installed this a few times in the past so im not sure why im having trouble with it.
My gallery thumbs are too big for the space i want them to show up on my main page. I tried to use the resize code but they are not resizing and i dont understand why!
Heres the code i currently have:Code: [Select]<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$options = array('windowtarget' => '_blank',"imageheight"=>'30',"imagewidth"=>'30');
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
the thumbs at the moments are 120 pixels which are way too big for what i need, i need at least half that size.
A quick question ;
I've got CPMFetch running nicely, displaying six random images from the gallery on my (myBB 1.6) forum, (all bridging working fine) but how do I tweak the information that is displayed below each picture? I'm sure that there's just a line I need to change somewhere - essentially, all I want displayed is the image title (not description, owner name etc, number of views, etc). I'm a bit of a newb to this PHP game - I've had a look through the cpmfetch.php file, but can't see anything obvious that needs to be changed.
Any help grateully appreciated!
Matt
Southsea UK
Forum - http://fhd-forums.orgfree.com/forums/index.php
CPGallery - http://fhd-forums.orgfree.com/gallery/index.php
function htmlTagTD($contents, $row) {
$htmlOut = '<td';
if (array_key_exists('cellstyle',$this->styleHash))
$htmlOut .= " {$this->styleHash['cellstyle']}";
// jcr - added check if row is null to avoid PHP warnings by server - $row != "" and
if ($row != "" and array_key_exists('cpmCellCssId',$row)) $htmlOut .= " id='{$row['cpmCellCssId']}'";
$htmlOut .= $this->getOptionAttributes("cellattributes");
//jcr - cancel this out and expand it - $htmlOut .= '>' . $contents . '</td>' . "\n";
//jcr - add title below thumb if requested - i.e. 'showtitle' is in options
if ((array_key_exists('showtitle',$this->optionHash)) and (array_key_exists('cpmAlttag',$row))) {
$htmlOut .= '>' . $contents . "\n" . $row['cpmAlttag'] . '</td>' . "\n";
} else {
$htmlOut .= '>' . $contents . '</td>' . "\n";
}
return $htmlOut;
/*
$htmlOut = '<td';
if (array_key_exists('cellstyle',$this->styleHash)) $htmlOut .= " {$this->styleHash['cellstyle']}";
if ($extraAttributes != "") $htmlOut .= " " . $extraAttributes;
$htmlOut .= $this->getOptionAttributes("cellattributes");
$htmlOut .= '>' . $contents . '</td>' . "\n";
return $htmlOut;
*/
}
include "../client-system-albums/cpmfetch/cpmfetch.php";
$objCpm = new cpm("../client-system-albums/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_unlock_private(true);
$options=array(imagesize => "thumb", imagelink => "large", imagewidth => "128", imageheight => "128", windowtarget => "_blank", "alttag" => "{{pTitle}}", "tablestyle" => "center-css-table");
$objCpm->cpm_viewLastAddedMediaFrom ("album=152",20,5,$options);
echo '<div class="clr"></div>';
echo "<p> </p>";
echo "<p> </p>";
echo "<p> </p>";
echo "<div class='h2h1-custom7'><h2>Absolare Leather Options</h2></div>";
$options=array(imagesize => "thumb", imagelink => "large", imagewidth => "128", imageheight => "128", windowtarget => "_blank", "alttag" => "{{pTitle}}", "tablestyle" => "center-css-table", "showtitle" => "true", "cellstyle" => "center-text");
$objCpm->cpm_viewLastAddedMediaFrom ("album=153",20,5,$options);
$objCpm->cpm_close();
$objCpm->cpm_viewRandomMedia
that method needs to be supported by the CPMFetch object. As I never used CPMFetch, I don't know if it will work. Maybe someone else can check or test that.
include_once "$cpg_rel/cpmfetch/cpmfetch.php";
$objCpm = new cpm("$cpg_rel/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewRandomMedia($rows, $columns, $options);
$objCpm->cpm_close();
Hello,You didn't say what software you are using for your 'Block'.. I assume either a portal or CMS...
it works fine for me, but can i center the Picture in a Block?
Since CPMFetch is invoked outside of Coppermine - you will need to edit the relevant style sheet used on the page you are displaying the pics...How it appears on your page will be controlled by that page's CSS...
error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);after
<?php include "../gallery/cpmfetch/cpmfetch.php";on the first instance of cpmfetch on the page.
Strict Standards: Declaration of cpm::debugPrint() should be compatible with cpm_dao::debugPrint() in /home/runninga/danica-patrick.co.uk/gallery/cpmfetch/cpmfetch.php on line 50
Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50633 Library:50552 in /home/runninga/danica-patrick.co.uk/gallery/cpmfetch/cpmfetch_dao.php on line 1196
Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50633 Library:50552 in /home/runninga/danica-patrick.co.uk/gallery/cpmfetch/install.php on line 236
CpmFetch Install Script version 2.0.0
do=install
path=
force=true
Command install issued to script
* * BEGIN SERVER SETTINGS * *
SERVER HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/
webp,*/*;q=0.8
SERVER HTTP_ACCEPT_ENCODING: gzip, deflate, sdch
SERVER HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
SERVER HTTP_CONNECTION: keep-alive
SERVER HTTP_COOKIE: 6c766cc85b647a61e007c9ccec825642=5682cb1e213cd02836d9729933c
39b66; PHPSESSID=5db5ee5bc0da308490e9d28c1089ffe3; cpg15x_data=YTozOntzOjI6IklEI
jtzOjMyOiI5OGZiYjdkZWIyMGMwNjVhODY2NzA5MWE0N2Y2NzY3YiI7czoyOiJhbSI7aToxO3M6NDoib
GFuZyI7czo3OiJlbmdsaXNoIjt9
SERVER HTTP_HOST: danica-patrick.co.uk
SERVER HTTP_REFERER: http://danica-patrick.co.uk/gallery/cpmfetch/install.php
SERVER HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/53
7.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36
SERVER HTTP_UPGRADE_INSECURE_REQUESTS: 1
SERVER DOCUMENT_ROOT: /home/runninga/danica-patrick.co.uk
SERVER REMOTE_ADDR: 81.99.65.121
SERVER REMOTE_PORT: 61867
SERVER SERVER_ADDR: 185.116.212.70
SERVER SERVER_NAME: danica-patrick.co.uk
SERVER SERVER_ADMIN: webmaster@danica-patrick.runningandstrength.com
SERVER SERVER_PORT: 80
SERVER REQUEST_URI: /gallery/cpmfetch/install.php?do=install&force=true
SERVER SCRIPT_FILENAME: /home/runninga/danica-patrick.co.uk/gallery/cpmfetch/ins
tall.php
SERVER QUERY_STRING: do=install&force=true
SERVER SCRIPT_URI: http://danica-patrick.co.uk/gallery/cpmfetch/install.php
SERVER SCRIPT_URL: /gallery/cpmfetch/install.php
SERVER SCRIPT_NAME: /gallery/cpmfetch/install.php
SERVER SERVER_PROTOCOL: HTTP/1.1
SERVER SERVER_SOFTWARE: LiteSpeed
SERVER REQUEST_METHOD: GET
SERVER X-LSCACHE: 1
SERVER PHP_SELF: /gallery/cpmfetch/install.php
SERVER REQUEST_TIME_FLOAT: 1493132849.16
SERVER REQUEST_TIME: 1493132849
SERVER argv: Array
SERVER argc: 1
* * END SERVER SETTINGS * *
Found config file at ../include/config.inc.php
Found init file at ../include/init.inc.php
force set, skipping version checks
Opening config file at ../include/config.inc.php
Retrieving config from database
* * BEGIN CPG CONFIG TABLE * *
CONFIG: admin_activation: 0
CONFIG: albums_per_page: 12
CONFIG: album_list_cols: 1
CONFIG: album_sort_order: pa
CONFIG: album_uploads_default: NO
CONFIG: alb_desc_thumb: 1
CONFIG: alb_list_thumb_size: 50
CONFIG: allowed_doc_types: doc/txt/rtf/pdf/xls/pps/ppt/zip/gz/mdb
CONFIG: allowed_img_types: jpeg/jpg/png/gif
CONFIG: allowed_mov_types: asf/asx/mpg/mpeg/wmv/swf/avi/mov
CONFIG: allowed_snd_types: mp3/midi/mid/wma/wav/ogg
CONFIG: allow_duplicate_emails_addr: 0
CONFIG: allow_email_change: 0
CONFIG: allow_guests_enter_file_details: 0
CONFIG: allow_memberlist: 0
CONFIG: allow_private_albums: 1
CONFIG: allow_unlogged_access: 3
CONFIG: allow_user_account_delete: 0
CONFIG: allow_user_album_keyword: 0
CONFIG: allow_user_edit_after_cat_close: 0
CONFIG: allow_user_move_album: 0
CONFIG: allow_user_registration: 0
CONFIG: allow_user_upload_choice: 1
CONFIG: auto_resize: 1
CONFIG: batch_add_hide_existing_files: 0
CONFIG: batch_proc_limit: 2
CONFIG: bridge_enable: 0
CONFIG: browse_batch_add: 1
CONFIG: browse_by_date: 0
CONFIG: caption_in_thumbview: 1
CONFIG: categories_alpha_sort: 0
CONFIG: charset: utf-8
CONFIG: clickable_keyword_search: 1
CONFIG: comments_anon_pfx: Guest_
CONFIG: comments_per_page: 20
CONFIG: comments_sort_descending: 0
CONFIG: comment_akismet_api_key:
CONFIG: comment_akismet_counter: 0
CONFIG: comment_akismet_enable: 0
CONFIG: comment_akismet_group: 0
CONFIG: comment_approval: 0
CONFIG: comment_captcha: 1
CONFIG: comment_placeholder: 1
CONFIG: comment_promote_registration: 0
CONFIG: comment_user_edit: 1
CONFIG: contact_form_guest_email_field: 2
CONFIG: contact_form_guest_enable: 0
CONFIG: contact_form_guest_name_field: 2
CONFIG: contact_form_registered_enable: 1
CONFIG: contact_form_sender_email: 1
CONFIG: contact_form_subject_content: Coppermine gallery contact form
CONFIG: contact_form_subject_field: 0
CONFIG: cookies_need_consent: 0
CONFIG: cookie_name: cpg15x
CONFIG: cookie_path: /
CONFIG: count_admin_hits: 0
CONFIG: count_album_hits: 1
CONFIG: count_file_hits: 1
CONFIG: custom_footer_path:
CONFIG: custom_header_path:
CONFIG: custom_lnk_name:
CONFIG: custom_lnk_url:
CONFIG: custom_sortorder_thumbs: 1
CONFIG: debug_mode: 0
CONFIG: debug_notice: 0
CONFIG: default_dir_mode: 0755
CONFIG: default_file_mode: 0644
CONFIG: default_sort_order: na
CONFIG: disable_comment_flood_protect: 0
CONFIG: display_comment_approval_only: 0
CONFIG: display_comment_count: 0
CONFIG: display_coppermine_news: 0
CONFIG: display_filename: 0
CONFIG: display_film_strip: 1
CONFIG: display_pic_info: 0
CONFIG: display_redirection_page: 0
CONFIG: display_reset_boxes_in_config: 0
CONFIG: display_sidebar_guest: 1
CONFIG: display_sidebar_user: 1
CONFIG: display_stats_on_index: 1
CONFIG: display_thumbnail_rating: 0
CONFIG: display_thumbs_batch_add: 1
CONFIG: display_uploader: 0
CONFIG: display_xp_publish_link: 0
CONFIG: ecards_more_pic_target: http://www.danicapatrick.uk/gallery/
CONFIG: ecard_flash: 0
CONFIG: editpics_ignore_newer_than: 0
CONFIG: email_comment_notification: 0
CONFIG: enable_encrypted_alb_passwords: 1
CONFIG: enable_encrypted_passwords: 1
CONFIG: enable_help: 1
CONFIG: enable_menu_icons: 2
CONFIG: enable_plugins: 1
CONFIG: enable_smilies: 1
CONFIG: enable_thumb_watermark: 1
CONFIG: enable_unsharp: 0
CONFIG: enable_watermark: 0
CONFIG: enable_zipdownload: 0
CONFIG: filter_bad_words: 0
CONFIG: first_level: 0
CONFIG: forbiden_fname_char: $/\\:*?"'<>|` &#@
CONFIG: form_token_lifetime: 900
CONFIG: fullpath: albums/
CONFIG: fullsize_padding_x: 5
CONFIG: fullsize_padding_y: 3
CONFIG: gallery_admin_email: debrag@danicapatrick.uk
CONFIG: gallery_description: Welcome to the Danica Patrick UK gallery where you
will find photos from various projects Danica has done.
CONFIG: gallery_name: Gallery
CONFIG: global_registration_pw:
CONFIG: guest_token_cleanup: 1433454599
CONFIG: hit_details: 0
CONFIG: home_target: index.php
CONFIG: impath:
CONFIG: im_options: -antialias
CONFIG: jpeg_qual: 80
CONFIG: keep_votes_time: 30
CONFIG: keyword_separator: ;
CONFIG: lang: english
CONFIG: language_autodetect: 1
CONFIG: link_last_upload: 0
CONFIG: link_pic_count: 1
CONFIG: login_expiry: 10
CONFIG: login_method: username
CONFIG: login_threshold: 5
CONFIG: log_ecards: 0
CONFIG: log_mode: 0
CONFIG: main_page_layout: breadcrumb/catlist/alblist/random,2/lastup,2
CONFIG: main_table_width: 85%
CONFIG: make_intermediate: 1
CONFIG: max_com_lines: 10
CONFIG: max_com_size: 512
CONFIG: max_com_wlength: 38
CONFIG: max_film_strip_items: 5
CONFIG: max_img_desc_length: 512
CONFIG: max_tabs: 12
CONFIG: max_upl_size: 1024
CONFIG: max_upl_width_height: 2048
CONFIG: media_autostart: 1
CONFIG: min_votes_for_rating: 1
CONFIG: normal_pfx: normal_
CONFIG: offline: 0
CONFIG: old_style_rating: 0
CONFIG: only_empty_albums: 0
CONFIG: orig_pfx: orig_
CONFIG: performance_page_generation_time: 0
CONFIG: performance_page_query_count: 0
CONFIG: performance_page_query_time: 0
CONFIG: performance_timestamp: 0
CONFIG: personal_album_on_registration: 0
CONFIG: picinfo_movie_download_link: 1
CONFIG: picture_table_width: 100%
CONFIG: picture_use: thumb
CONFIG: picture_width: 400
CONFIG: purge_expired_bans: 1
CONFIG: rate_own_files: 0
CONFIG: rating_stars_amount: 5
CONFIG: read_exif_data: 0
CONFIG: read_iptc_data: 0
CONFIG: reduce_watermark: 0
CONFIG: registration_captcha: 0
CONFIG: reg_notify_admin_email: 0
CONFIG: reg_requires_valid_email: 1
CONFIG: report_post: 0
CONFIG: session_cleanup: 1493027867
CONFIG: show_bbcode_help: 1
CONFIG: show_private: 0
CONFIG: show_which_exif: |0|0|0|0|0|0|0|0|1|0|1|1|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|
1|0|0|0|1|1|0|0|0|0|1|0|0|0|1|0|0|1|1|0|0|0|0|0|1|0|1|1
CONFIG: silly_safe_mode: 0
CONFIG: site_token: b5bec738cb93c9dfd710db0f0ee8169c
CONFIG: slideshow_hits: 1
CONFIG: slideshow_interval: 5000
CONFIG: smtp_host:
CONFIG: smtp_password:
CONFIG: smtp_username:
CONFIG: subcat_level: 1
CONFIG: tabs_dropdown: 1
CONFIG: theme: water_drop
CONFIG: thumbcols: 4
CONFIG: thumbnail_to_fullsize: 0
CONFIG: thumbrows: 3
CONFIG: thumb_height: 100
CONFIG: thumb_method: im
CONFIG: thumb_pfx: thumb_
CONFIG: thumb_use: ex
CONFIG: thumb_width: 100
CONFIG: time_offset: 0
CONFIG: transparent_overlay: 0
CONFIG: unsharp_amount: 120
CONFIG: unsharp_radius: 0.5
CONFIG: unsharp_threshold: 3
CONFIG: upload_create_album_directory: 0
CONFIG: upload_mechanism: swfupload
CONFIG: upl_notify_admin_email: 0
CONFIG: userpics: userpics/
CONFIG: users_can_edit_pics: 0
CONFIG: user_field1_name:
CONFIG: user_field2_name:
CONFIG: user_field3_name:
CONFIG: user_field4_name:
CONFIG: user_manager_hide_file_stats: 0
CONFIG: user_profile1_name: Location
CONFIG: user_profile2_name: Interests
CONFIG: user_profile3_name: Website
CONFIG: user_profile4_name: Occupation
CONFIG: user_profile5_name:
CONFIG: user_profile6_name: Biography
CONFIG: user_registration_disclaimer: 1
CONFIG: views_in_thumbview: 1
CONFIG: vote_details: 0
CONFIG: watermark_file: images/watermark.png
CONFIG: watermark_transparency: 40
CONFIG: watermark_transparency_featherx: 0
CONFIG: watermark_transparency_feathery: 0
CONFIG: where_put_watermark: southeast
CONFIG: which_files_to_watermark: both
* * END CPG CONFIG TABLE * *
* * BEGIN CPG BRIDGE TABLE * *
BRIDGE: cookie_prefix:
BRIDGE: full_forum_url:
BRIDGE: recovery_logon_failures: 0
BRIDGE: recovery_logon_timestamp:
BRIDGE: relative_path_to_config_file:
BRIDGE: short_name:
BRIDGE: use_post_based_groups:
* * END CPG BRIDGE TABLE * *
Closed database connection
Opening init file at ../include/init.inc.php
Reading init file at ../include/init.inc.php
InitFile: CPG Version 1.5.40
Closing init file
* * Generating Dynamic Defaults * *
filesystem_path_to_cpg:/home/runninga/danica-patrick.co.uk/gallery/
domain_name:danica-patrick.co.uk
cpg_album_url:http://www.danicapatrick.uk/gallery/albums/
cpg_url:http://www.danicapatrick.uk/gallery/
* * Assigning bridged settings * *
Bridge_enable: 0
Bridge_short_name:
Bridging is not enabled in CPG
Opening cpmfetch config file: cpmfetch_config.php
Writing cpmfetch config file cpmfetch_config.php
Completed writing config file
Producing output screen and exiting
What version of coppermine are you trying to install this too? What is your PHP version? We require a bit more information.
Also please be aware that Vuud, who developed this plugin, has not visited this site in quite some time.
I have coppermine version 1.5.46 and php version 5.4.45
Strict Standards: Declaration of cpm::debugPrint() should be compatible with cpm_dao::debugPrint() in /home/runninga/danica-patrick.co.uk/gallery/cpmfetch/cpmfetch.php on line 50
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/runninga/danica-patrick.co.uk/gallery/cpmfetch/cpmfetch_dao.php on line 1277
Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50634 Library:50552 in /home/runninga/danica-patrick.co.uk/gallery/cpmfetch/cpmfetch_dao.php on line 1277
Strict Standards: Only variables should be assigned by reference in /home/runninga/danica-patrick.co.uk/gallery/cpmfetch/cpmfetch.php on line 419
Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50633 Library:50552 in /home/runninga/danica-patrick.co.uk/wp-content/plugins/wp-cpg-widget/cpg_database.php on line 158
If there is evidence that it is in use a lot out there, I would be willing to take on updating it for PHP 7 (as well as CPG 1.6).I believe it is still in active use... I know I use it a lot.
Recently moved host for all my sites, and have using cpmfetch 2.0 0 from the first post in this topic since it was posted. Now using a Higher php version I've noticed my error log filling up I think anything running php 5.4 and up will now run into problems with this cpmfetch add on because of deprecated code. Here's the error generated on every page load,Lurkalot - changing your error reporting to no notices should stop the logs from filling... Anytime there is a deprecated function you will start to get these. I'd expect the same from CPG 1.5 - as it uses mysql calls as well. (Maybe CPMFETCH is changing the error reporting? I'd have to look closer...)
8192: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
File: /home/cxxxxxxx/public_html/gallery/cpmfetch/cpmfetch_dao.php
Line: 1196
I'm assuming version 2.1.1 will have the same problem.
Okay .. I'll dedicate some time in the very near future to update it to modern PHP/CPG.
Find updated version (2.2) above in original post.
Just noticed with this version, the number of views and the title's are missing from the thumbs. and clicking on a thumbnail takes me to the album instead of the image.I did nothing to change how it functions. Perhaps there were differences in function between 2.0.0 and 2.1.1?
2007-04-17 22:31 wbchmuraWould have to look - but I'm sure he maintained the ability to use as you were...
* .: Added in support for linking to albums, categories, image
sizes. Also added in css_id template options
echo '<div id="cpmfetch">';chdir("../gallery/cpmfetch/");include "cpmfetch.php";
$objCpm = new cpm();$options = array("subtitle" => "<center>{{pTitle}} <br>{{pHits}} Views </center>");
$objCpm->cpm_viewLastAddedMedia(4,4,$options);
$objCpm->cpm_close();chdir("../../");
echo '<br><a href="http://cctestsite.info/gallery/thumbnails.php?album=lastup&cat=0?action=gallery"><u><b>View more latest images</b></u></a>';
if ($context['user']['is_logged'])
if ($context['user']['is_logged'])
{
$thecat = 10000 + $context['user']['id'];
echo ' * <a href="http://cctestsite.info/gallery/index.php?cat='. $thecat .'" alt="My Gallery"><u><b>My Gallery</b></u></a>';
}
echo '</div>';
How extensive were the changes to 2.1.1 to make it compatible with PHP7/CPG 1.6?I won't be involved with two versions. I'll add 'subtitle' support to the version I already updated (2.2).
Maybe we do a 2.0.1 and a 2.1.2 - one from each - until someone has time to put more work into it??
Well ... it seems the 'subtitle' feature was not completed/implemented after some other structure changes in 2.1.1.
Where to go from here? It wasn't my intent to get involved in the functionality/features of CPMfetch .. only to make it compatible with modern PHP, etc. In looking over 2.0.0 and 2.1.1 ... they both need a LOT of work.
In my opinion 2.0.0 should have been the one updated
Find version 2.0.1 in original post.
( removed 2.2 )
Any way to make cpmfetch work responsively? I'm testing in our new Tinyportal Responsive version, in a center block. Everything else seems to resize and stack, but not the latest images block, it just cuts it off and add a scrollbar.I expect that would be mostly a CSS implementation - and CPMFETCH allows passing an 'options' array with classes to assign to various html entities:
(Options) Entries that change the HTML tags output
tableheadstyle
tablestyle
tableheadstyle
rowstyle
cellstyle
linkstyle
imagestyle
//Example #1
$options = array( 'option_name' => 'option_value' , 'option_name' => 'option_value' );
$objCpm->viewRandomMediaFrom("",1,1,$options);
//Example #3 Real world example
$options = array("tablestyle" => "cssfortables" );
$objCpm->viewRandomMediaFrom("",1,1,$options);
I apologize for the trouble...Don't believe this is directly supported - the intent being to show a few pics - and link to the gallery if they want to see more/all...
It works, With complete path /var/www/vhosts/....
Another question please:
how to insert the contents of an entire album, respecting the same order of the photos in this album as in coppermine?
I only found the commands for LastAddedMedia and RandomMediaFrom
Thanks!
$objCpm->cpm_viewRandomMediaFrom("album= 323",999, 3, $options);
Code setted on 999 to take all the photos from album 323.First of all, thank you for your answer.
I'm using CPMFetch 2.0.0
Yes, should be what I'm looking for!
I'm testing CPMFetch in this page:
http://www.rotabili.ferrovie.it/schede/ - main page with random thumbnails from Coppermine
http://www.rotabili.ferrovie.it/schede/fs/locoele/fs-e402006-045.php - one of the technical sheets. After the table, all the pictures (random) about this locomotive from mine Coppermine album. I would be happy to have the photos of the locomotives in numerical order (E.402.010, E.402.011, E.402.017, ecc.)!Code: [Select]$objCpm->cpm_viewRandomMediaFrom("album= 323",999, 3, $options);
Code setted on 999 to take all the photos from album 323.
Thanks!
/**
* GMC Addition:
* http://forum.coppermine-gallery.net/index.php/topic,65412.msg384710.html#msg384710
*
* Displays sorted images from specific album or category
*
* This will generate a table and populate it with sorted media from the combination of
* categories and albums specified and style it based on entries in the style hash.
* The number of photos returned matches the number of rows multiplied by the number of columns.
* Supports the setReturnType option.
*
* @param int $rows The number of rows desired in the output
* @param int $columns The number of columns desired in the output
* @param int $sources The sources you want to draw from ("cat=1,4,5:album=6,7,8")
* @param array $options Optional, Configuration options
* @tutorial explainations.optionsarray.pkg
* @tutorial explainations.sourcetag.pkg
*
* @todo allow for media to be specified / filtered - jpg, mp3, etc
*/
function cpm_viewMediaFrom($source,$rows, $columns, $options="") {
$this->loadOptions($options);
$resultset = $this->getImageFrom ($source, $rows*$columns);
$this->addDescriptionsToResultSet($resultset);
$retval = "";
switch ($this->returntype) {
case ('resultset'):
$retval = $resultset;
break;
case ('html'):
$retval = $this->createTable($resultset,$rows,$columns);
break;
case ('print'):
default:
print $this->createTable($resultset,$rows,$columns);
}
$this->clearOptions();
return ($retval);
}
/**
* GMC Addition:
* http://forum.coppermine-gallery.net/index.php/topic,65412.msg384710.html#msg384710
*
* Returns a 'sorted' image from a category in cpm
* Sort order from CPG config at time of CPMFETCH install
* Available options:
* ("ta") - Title ascending
* ("td") - Title descending
* ("na") - Name ascending
* ("nd") - Name descending
* ("da") - Date ascending
* ("dd") - Date descending
* ("pa") - Position ascending
* ("pd") - Position descending
*
* @access private
*/
function getImageFrom ($source, $count) {
global $config_cpgSettings;
$resultset = array();
if (is_numeric($count)) {
$sourceSql = $this->makeSourceSql($source);
switch($config_cpgSettings['default_sort_order']) {
case 'ta':
$orderby = "title";
break;
case 'td':
$orderby = "title DESC";
break;
case 'na':
$orderby = "filename";
break;
case 'nd':
$orderby = "filename DESC";
break;
case 'da':
$orderby = "ctime";
break;
case 'dd':
$orderby = "ctime DESC";
break;
case 'pa':
$orderby = "position";
break;
case 'pd':
$orderby = "position DESC";
break;
default:
$orderby = "filename";
break;
}
if ($sourceSql != "") $sourceSql = " AND " . $sourceSql;
$sqlcode = "SELECT {$this->sqlPostSelect} " . $this->sqlSelect . " FROM "
. $this->sqlTableSelect
. " WHERE 1 "
. $this->sqlUserDataLink
. " AND p.approved='YES' "
. $this->filetypefilter . " "
. $this->privacyfilter . $sourceSql
. " ORDER BY $orderby) LIMIT $count";
$resultset = $this->dbExecuteSql($sqlcode);
$this->addPathInfo($resultset);
} //end if
elseif ($this->cfg['cfDebugMode'] == 'true'){
debugPrint("Non numeric count submitted");
}
return($resultset);
} //end function
$objCpm->cpm_viewMediaFrom("album= 323",999, 3, $options);
Runs on: Tested on coppermine 1.3.2,
* HTML: Generates XHTML (as far as I can tell)
* PHP: Tested on version 4
* RELEASE VERSION 2.0.0
*
* @version $Revision: 1.12 $
* @package cpmfetch
/**
*
* @access private
*/
function clearOptions( ) {
$this->optionHash = array();
$this->styleHash = array();
}
/**
* GMC Addition:
* http://forum.coppermine-gallery.net/index.php/topic,65412.msg384710.html#msg384710
*
* Displays sorted images from specific album or category
*
* This will generate a table and populate it with sorted media from the combination of
* categories and albums specified and style it based on entries in the style hash.
* The number of photos returned matches the number of rows multiplied by the number of columns.
* Supports the setReturnType option.
*
* @param int $rows The number of rows desired in the output
* @param int $columns The number of columns desired in the output
* @param int $sources The sources you want to draw from ("cat=1,4,5:album=6,7,8")
* @param array $options Optional, Configuration options
* @tutorial explainations.optionsarray.pkg
* @tutorial explainations.sourcetag.pkg
*
* @todo allow for media to be specified / filtered - jpg, mp3, etc
*/
function cpm_viewMediaFrom($source,$rows, $columns, $options="") {
$this->loadOptions($options);
$resultset = $this->getImageFrom ($source, $rows*$columns);
$this->addDescriptionsToResultSet($resultset);
$retval = "";
switch ($this->returntype) {
case ('resultset'):
$retval = $resultset;
break;
case ('html'):
$retval = $this->createTable($resultset,$rows,$columns);
break;
case ('print'):
default:
print $this->createTable($resultset,$rows,$columns);
}
$this->clearOptions();
return ($retval);
}
} // end class
?>
/**
*
* @access private
*/
function getRandomSeed() {
return microtime()*1000000;
}
/**
* GMC Addition:
* http://forum.coppermine-gallery.net/index.php/topic,65412.msg384710.html#msg384710
*
* Returns a 'sorted' image from a category in cpm
* Sort order from CPG config at time of CPMFETCH install
* Available options:
* ("ta") - Title ascending
* ("td") - Title descending
* ("na") - Name ascending
* ("nd") - Name descending
* ("da") - Date ascending
* ("dd") - Date descending
* ("pa") - Position ascending
* ("pd") - Position descending
*
* @access private
*/
function getImageFrom ($source, $count) {
global $config_cpgSettings;
$resultset = array();
if (is_numeric($count)) {
$sourceSql = $this->makeSourceSql($source);
switch($config_cpgSettings['default_sort_order']) {
case 'ta':
$orderby = "title";
break;
case 'td':
$orderby = "title DESC";
break;
case 'na':
$orderby = "filename";
break;
case 'nd':
$orderby = "filename DESC";
break;
case 'da':
$orderby = "ctime";
break;
case 'dd':
$orderby = "ctime DESC";
break;
case 'pa':
$orderby = "position";
break;
case 'pd':
$orderby = "position DESC";
break;
default:
$orderby = "filename";
break;
}
if ($sourceSql != "") $sourceSql = " AND " . $sourceSql;
$sqlcode = "SELECT {$this->sqlPostSelect} " . $this->sqlSelect . " FROM "
. $this->sqlTableSelect
. " WHERE 1 "
. $this->sqlUserDataLink
. " AND p.approved='YES' "
. $this->filetypefilter . " "
. $this->privacyfilter . $sourceSql
. " ORDER BY $orderby) LIMIT $count";
$resultset = $this->dbExecuteSql($sqlcode);
$this->addPathInfo($resultset);
} //end if
elseif ($this->cfg['cfDebugMode'] == 'true'){
debugPrint("Non numeric count submitted");
}
return($resultset);
} //end function
} //END OF CLASS
?>
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,1);
$objCpm->cpm_close();
?>
...CPMFetch provides ability to pass many 'options' parameters to format the displayed pictures as you would like - and adding information... Take a look at the documentation provided with the plugin (in the cpmfetch/docs/basic directory.) If you don't have it loaded - you can view it here: http://greggallery.gmcdesign.com/cpmfetch/docs/basic/ (http://greggallery.gmcdesign.com/cpmfetch/docs/basic/)
One thing I don't now how to solved:
Everything works fine but the thumbnail in module shows from left side (check image from attachments)
I would like to show images to center not from lef side.
BTW is there a chance to show some info below thumbnails something like title this image and autor?
<?php
include "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$options = array( "tablestyle" => "csstable", "subtitle" => "File name is: {{pFilename}});
$objCpm->cpm_viewLastAddedMedia(1,1, $options);
$objCpm->cpm_close();
?>
return microtime(true)*1000000;
You can try changing that line to:Code: [Select]return microtime(true)*1000000;
can someone please re-upload the code changes in install.php I'm just seeing scroll bars . (https://www.programs-gulf.com/games/)Make sure you are using version 2.0.1 of CPMfetch.
include_once "../cpg/cpmfetch/cpmfetch.php";
$objCpm = new cpm("../cpg/cpmfetch/cpmfetch_config.php");
$options = array( 'imageheight' => '120' );
$objCpm->cpm_viewRandomMediaFrom("cat=4,6, 12",1, 8, $options);
$objCpm->cpm_close();