CpmFetch - Using CpmFetch on HTML pages via SSI - Page 2 CpmFetch - Using CpmFetch on HTML pages via SSI - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

CpmFetch - Using CpmFetch on HTML pages via SSI

Started by vuud, June 03, 2005, 06:24:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mottaguedes

I did go through the docs. :(

I'll start all over again.
MottaGuedes

Hesch2000

Hallo,
i use cpmFetch on my page www.senne24.de and my problem: i have a Frampage.
On the home.html i do iframes with follow code:

<iframe src="http://www.senne24.de/_php/cpm-117.php"
framespacing="0" frameborder="no" scrolling="no" width="100%"
height="100%"></iframe>


The cpm-117.php has following code:

<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm('/_php/fotoalbumtest');
$objCpm->cpm_viewRandomMediaFromAlbum(1,1,120,$styleguide,);

$objCpm->cpm_close();
?>


I see the random - no problem - but when i click on the random-photo - the link open not a new window. The link open the album in the little iframe-window.
What must i do - can someone help?



vuud

Quote from: Hesch2000 on May 28, 2006, 11:48:50 PM
Hallo,
i use cpmFetch on my page www.senne24.de and my problem: i have a Frampage.
On the home.html i do iframes with follow code:

<iframe src="http://www.senne24.de/_php/cpm-117.php"
framespacing="0" frameborder="no" scrolling="no" width="100%"
height="100%"></iframe>


The cpm-117.php has following code:

<?php
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm('/_php/fotoalbumtest');
$objCpm->cpm_viewRandomMediaFromAlbum(1,1,120,$styleguide,);

$objCpm->cpm_close();
?>


I see the random - no problem - but when i click on the random-photo - the link open not a new window. The link open the album in the little iframe-window.
What must i do - can someone help?


You need to tell cpmfetch to target the parent window I think...

Try adding an "windowtarget" => "_parent" to an options array you pass to it. 

http://www.fistfullofcode.com/projects/copperminefetch/manual/ch06s04.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

jr1001

Quote from: mottaguedes on May 20, 2006, 02:42:03 PM
I did go through the docs. :(

I'll start all over again.

The Releasenote has a snippet about having to comment out a line and uncommenting another in the cpmfetch_dao.php file. I had the same problem until I closely re-re-re-read the file. It's not in plain sight (formatting) so you have to read closely. The line numbers are off too. The readme refers to lines 54 and 59 which may have been from an earlier version. In release 1.6.2 the rows to edit in the cpmfetch_dao.php file are 57 and 61.

If you're using the most current version change those rows to this and it will work:

Quote
// This is for CPG versions prior to 1.4
/* var $sqlPictureAlbumSelect = ' 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, a.title AS aTitle, a.description AS aDescription, p.pid AS pPid, p.pic_rating AS pPic_Rating,  p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, u.user_lastvisit AS uUser_lastvisit, u.user_regdate AS uUser_regdate, u.user_email AS uUser_email, u.user_website AS uUser_website, u.user_location AS uUser_location, u.user_interests AS uUser_interest, u.user_occupation AS uUser_occupation';
*/

// This is for CPG v 1.4.1 beta 1
var $sqlPictureAlbumSelect = ' 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, a.title AS aTitle, a.description AS aDescription, p.pid AS pPid, p.pic_rating AS pPic_Rating,  p.votes AS pVotes, p.pwidth AS pWidth, p.pheight AS pHeight, u.user_lastvisit AS uUser_lastvisit, u.user_regdate AS uUser_regdate, u.user_email AS uUser_email';

Hesch2000

Hallo,
i have read as goog as possible.
In the cpmfetch.php i have search the imagelink
I do on "none" but it is alway a linkfukction.  (line 1336)
function htmlTagAHREF($target, $contents, $extraAttributes="") {

$htmlOut = '<a';

if ( ( (array_key_exists('imagelink',$this->optionHash))
&& $this->optionHash['imagelink'] == 'none')
&& array_key_exists('windowtarget',$this->optionHash ) )
{

if ($this->optionHash['windowtarget'] == '_parent' ) {
$htmlOut .= " href=\"javascript:cmfshowpic('$target','')\" ";

} elseif ($this->optionHash['windowtarget'] == '_blank-cfshow') {

$htmlOut .= " href=\"javascript:void(window.open('cfshow.php?pic=$target','cpmFetch','width=825,height=625,toolbars=0,scrollbars=1,resizable=1'));\"";


} elseif ($this->optionHash['windowtarget'] == '_parent') {
$htmlOut .= " href=\"$target\" target=\"_parent\" ";

} else {
$htmlOut .= " href=\"$target\" target=\"{$this->optionHash['windowtarget']}\"  ";
}


Than a search windowtarget and change all to _parent.
} // handling less than full size photos
else {

if (array_key_exists('windowtarget',$this->optionHash)) $htmlOut .= ' target="' . $this->optionHash['windowtarget'] . '"';
$htmlOut .= " href=\"$target\" ";

}


But i have the same problem.

It is ok, when i have only changing photos and no link.

This i dont find:
Option Array control entries

imagelink => "none" or "album" or "large"
windowtarget => "_blank" or "_parent" or "_blank-js" or "_blank-cfshow"


imagelink - [none|album|large]
What type of image to link to when the image is clicked. None indicates no link will be provided.

windowtarget - [_blank | _parent| _blank-js | _blank-cfshow ...]

Have someone a tip? (easy enlish)

bitbob

i have the same problem with Hesch2000, i use Iframe code,but the random images can only show in the Framed window! can anyone any idea to catch out the result in a html page?

vuud

Quote from: bitbob on August 16, 2006, 09:04:09 PM
i have the same problem with Hesch2000, i use Iframe code,but the random images can only show in the Framed window! can anyone any idea to catch out the result in a html page?

You understood Hensch2000?

Lang barriers aside, have you tried the windowtarget thing I mentioned to him?

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

bitbob

i can not understand what you said.
Quote"windowtarget" => "_parent"
What dou mean? Should i edit the file cpmfetch.php and change all the terms 'windowtarget' to '_parent'?
can you tell me in more details what i should edit. Many thanks.

vuud

Quote from: bitbob on August 17, 2006, 09:57:00 PM
i can not understand what you said. What dou mean? Should i edit the file cpmfetch.php and change all the terms 'windowtarget' to '_parent'?
can you tell me in more details what i should edit. Many thanks.

Read these two pages...
http://www.fistfullofcode.com/projects/copperminefetch/manual/ch06.html
http://www.fistfullofcode.com/projects/copperminefetch/manual/ch06s04.html

And there is nothing in the cpmfetch.php file you should be touching. 

Thanks!
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

bitbob

so i see, i should write the php file in this format:
$styleguide = array(
"linkstyle" => "photoclip",
"alttag" => "views: %h",
"subtitle" => "views: %h",
"imagestyle" => "photoclip",
"imagesize" => ''thumb'',
                          ''windowtarget'' => "_parent");

$objCpm->cpm_setReturnType('print');
$data = $objCpm->cpm_viewRandomMostViewedMediaFrom ("", 1, 5, $styleguide);


thans

vuud

Quote from: bitbob on August 18, 2006, 04:09:14 PM
so i see, i should write the php file in this format:
$styleguide = array(
"linkstyle" => "photoclip",
"alttag" => "views: %h",
"subtitle" => "views: %h",
"imagestyle" => "photoclip",
"imagesize" => ''thumb'',
                          ''windowtarget'' => "_parent");

$objCpm->cpm_setReturnType('print');
$data = $objCpm->cpm_viewRandomMostViewedMediaFrom ("", 1, 5, $styleguide);


thans



Aiside from the wierd double single quotes you have around windowtarget, yeah it looks right.

you want '   not ' '
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

bitbob

fully edited as follows:

<?php 
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/album");
$styleguide = array(
"linkstyle" => "photoclip",
"alttag" => "views: %h",
"subtitle" => "views: %h",
"imagestyle" => "photoclip",
"imagesize" => "thumb"
        "windowtarget" 
=> "_parent" );

$objCpm->cpm_setReturnType('print');
$data $objCpm->cpm_viewRandomMostViewedMediaFrom (""16$styleguide);
$objCpm->cpm_close();
?>


it works very good now! thanks to vuud!