Advanced search  

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]

Pages: 1 [2]   Go Down

Author Topic: CpmFetch - Using CpmFetch on HTML pages via SSI  (Read 37024 times)

0 Members and 1 Guest are viewing this topic.

mottaguedes

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 12
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #20 on: May 20, 2006, 02:42:03 pm »

I did go through the docs. :(

I'll start all over again.
Logged
MottaGuedes

Hesch2000

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #21 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:

Code: [Select]
<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:

Code: [Select]
<?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?


Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #22 on: May 30, 2006, 08:04:10 am »

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:

Code: [Select]
<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:

Code: [Select]
<?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






Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #23 on: June 05, 2006, 10:41:37 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';
Logged

Hesch2000

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #24 on: June 06, 2006, 10:09:00 pm »

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)
Code: [Select]
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.
Code: [Select]
} // 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)
Logged

bitbob

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #25 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?
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #26 on: August 17, 2006, 12:29:13 am »

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?

Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #27 on: August 17, 2006, 09:57:00 pm »

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.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #28 on: August 17, 2006, 10:06:10 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!
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #29 on: August 18, 2006, 04:09:14 pm »

so i see, i should write the php file in this format:
Code: [Select]
$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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #30 on: August 18, 2006, 04:17:04 pm »

so i see, i should write the php file in this format:
Code: [Select]
$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 ' '
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: CpmFetch - Using CpmFetch on HTML pages via SSI
« Reply #31 on: August 18, 2006, 04:20:24 pm »

fully edited as follows:

Code: [Select]
<?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!
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.022 seconds with 22 queries.