forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 cpmFetch by vuud => Topic started by: vuud on June 03, 2005, 06:24:43 pm

Title: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud on June 03, 2005, 06:24:43 pm
http://cpmfetch.fistfullofcode.com - latest info, news, development versions, tips, etc
Also a sign up to my site for email notifications of new updates to cpmfetch.

This thread is dedicated to the issue surrounding using CpmFetch as a SSI (Server side include) on Apache.  I have no idea what they call it under IIS (Internet Infernal Services) on Windoze.  But the principle should be the same (maybe).

I plan on releasing a fully function cpmssi module in the future, but for now you easily accomplish the same effect other ways.

This is incredibly simple so I am sorry I did not post these solutions eariler

I will add in the information in the next posting...


Title: How to use CPMFETCH as a SSI
Post by: vuud on June 03, 2005, 06:42:53 pm
I just tried this and it works fine...

Here are some assumptions I use in this document, you can change them of course, but this will help you figure out which parts you can change.  You do not have to use these paths, please change them to whatever you want, just be consistent

Coppermine is installed into /cpg
CpmFetch has been installed into /cpmfetch
Your HTML page is in the root of the web site /
You create the new file in /cpmfetch

Here are the steps I went through:

1.  Get cpmfetch installed
A normal install, follow the directions.

2.  Make sure the cpmtest.php file is working
This is part of the directions, but thought it would be worth mentioning anyway

3.  Create a new file named randomimages.php file
The filename can be whatever you want, but must be .php

4.  Edit "randomimages.php" and add in the following code:

Code: [Select]

<?php 
include "./coppermine.php";
$objCpm = new cpm('/cpg');
$objCpm->cpm_viewLastAddedMedia(4,2); 
$objCpm->cpm_close(); 
?>



The cpm_viewLastAddedMedia can be altered to any of the function calls.  This is just my example.

Note:  The first and second lines will need to be edited to your specific installation.  The /cpg would be the same value you used to get cftest.php working.  The include is the path to where you installed the cpmfetch program.

5. Edit your HTML file
Include the following line (Apache users) where you want the HTML table to be inserted.

Code: [Select]

<!--#include virtual="/cpmfetch/ssitest.php" -->


6.  Tell the server its okay to execute SSI commands

Now you need to tell the server it is okay to execute commands inside the HTML.  This can be done a few ways.

* You can use .shtml on some servers instead of .html
* You can add a file named ".htaccess" with "XBitHack On" on it and change the permissions to execute (chmod 755)

Apache documentation for SSI can be found here:
http://httpd.apache.org/docs/howto/ssi.html

7.  Check it with your web browser...

It should work. 

If not, view the source... if you see <!--#include virtual="/cpmfetch/ssitest.php" --> in there still, then it means that your web server is not noticing it can execute.  Review step 6 and the apache documentation. 

If the #include is missing, then it means that your server is okay, your just not getting any pictures back.  Try executing the PHP file directly.

Please post comments or corrections... and if any IIS user wants to step up and note how to do it on IIS, that would be great!

Hope this helps

Vuud



Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: mustang_lex on June 07, 2005, 06:58:19 pm
I am sooo lost.  What do you put in the HTML document to pull up the randomimages.php we created earlier?

UPDATE: I got it to  work. I missed changing /cpg to mine /showcase . and it works now.

Where can I get different varibles (setup of thumbnails ect.)

also I found it slow to do. Is there a faster way.
my .htaccess has

Quote
Options +Includes
XBitHack on
chmod +x index2.html

Is there something different I should do
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud on June 08, 2005, 12:26:49 am
I am sooo lost.  What do you put in the HTML document to pull up the randomimages.php we created earlier?

UPDATE: I got it to  work. I missed changing /cpg to mine /showcase . and it works now.

Where can I get different varibles (setup of thumbnails ect.)

also I found it slow to do. Is there a faster way.
my .htaccess has

Quote
Options +Includes
XBitHack on
chmod +x index2.html

Is there something different I should do


You don't need the chmod in the .htaccess file...  You just need to do it to the file once...

I don't understand what you mean by "slow" and by "variables"?

You can do anything the documentation says you can do...  just pick the function...
http://cpmfetch.fistfullofcode.com/projects/copperminefetch/docs.php

As for slow... you really only need to create the include file once, then you can use it anywhere on your web site.  If you still think that is slow, try coding up all the sql and formatting code and inserting that... I think you underestimate how much time this is saving you









Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: mustang_lex on June 08, 2005, 02:00:56 am
Ya it only happened once . Every other time it was fast. Thank you for the assistence. Its greatly appreciated!!!!
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud on June 08, 2005, 04:45:33 am
Ya it only happened once . Every other time it was fast. Thank you for the assistence. Its greatly appreciated!!!!

Well, thats good to know.  The delay would be one or more of the following things:

1. PHP Engine / Webserver is overloaded
2. Internet Congestion in getting the images
3. MySQL database slowing for some reason

None of which I can take credit for :)

Title: Thoughts on a time based picture changer
Post by: vuud on June 21, 2005, 05:47:45 am

Background: the concept of making a page randomly grab and change the image shown every x days was posed in a different thread.  Here are my thoughts on doing it.

I guess this would work for an SSI, or normal PHP page...

Here is what you would do in PHP either as an SSI Include or directly on your page

* Check for the existance of a data file in that directory
 file_exists ( string filename );

* If there is no file, or the date stamp on the file is older than x days:
stat ( string filename ) or fstat (file pointer)

* Grab the name of the image from CpmFetch
You will need to cpm_setReturnType("html") so you can grab it into a variable

* Write the name to a data file

* Use that name to show the image

* IF the file was within the date range

* Read the contents of the file, which is the image to be displayed

Yeah, thats it.  Crazy enough that it just might work.  Not sure why you would want to... but thats how, in a nutshell to do it...










Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: Gary B on November 26, 2005, 08:15:02 am
Ok I have the cftest.php working with no errors but I am not doing something right with getting it into an HTML page. I have the following in my randomimages.php file

<?php
include "./coppermine.php";
$objCpm = new cpm('/library');
$objCpm->cpm_viewLastAddedMedia(4,2);
$objCpm->cpm_close();
?>

Coopermine is installed in a folder called library cpmfetch is installed in a folder named cpmfetch

When I try and run the randomimages.php I get the following error messages:

Warning: main(./coppermine.php): failed to open stream: No such file or directory in public_html/cpmfetch/randomimages.php on line 2
Warning: main(./coppermine.php): failed to open stream: No such file or directory in public_html/cpmfetch/randomimages.php on line 2
Warning: main(): Failed opening './coppermine.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in public_html/cpmfetch/randomimages.php on line 2
Fatal error: Cannot instantiate non-existent class: cpm in public_html/cpmfetch/randomimages.php on line 3

I did remove two directories that seemed to show my account name for that area...but other than that this is what I see....

Help!

and Thanks!
Gary




Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud on November 26, 2005, 05:44:39 pm

According to what you told me, your:

include "./coppermine.php";

should really be

include "./cpmfetch/cpmfetch.php";

The ./ may need to be changed depending on where you are calling it from.  But you should be able to see your problem there.


Ok I have the cftest.php working with no errors but I am not doing something right with getting it into an HTML page. I have the following in my randomimages.php file

<?php
include "./coppermine.php";
$objCpm = new cpm('/library');
$objCpm->cpm_viewLastAddedMedia(4,2);
$objCpm->cpm_close();
?>

Coopermine is installed in a folder called library cpmfetch is installed in a folder named cpmfetch

When I try and run the randomimages.php I get the following error messages:

Warning: main(./coppermine.php): failed to open stream: No such file or directory in public_html/cpmfetch/randomimages.php on line 2
Warning: main(./coppermine.php): failed to open stream: No such file or directory in public_html/cpmfetch/randomimages.php on line 2
Warning: main(): Failed opening './coppermine.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in public_html/cpmfetch/randomimages.php on line 2
Fatal error: Cannot instantiate non-existent class: cpm in public_html/cpmfetch/randomimages.php on line 3

I did remove two directories that seemed to show my account name for that area...but other than that this is what I see....

Help!

and Thanks!
Gary





Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: Gary B on November 26, 2005, 07:04:16 pm
Thanks!! Because of your help I have a random image now displaying. I know I read it somewhere but how do I change the size of the thumbnail displayed to the intermediate photo or normal photo and also how to get rid of he border?

Thanks so very much!
Gary
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud on November 26, 2005, 08:01:17 pm
Thanks!! Because of your help I have a random image now displaying. I know I read it somewhere but how do I change the size of the thumbnail displayed to the intermediate photo or normal photo and also how to get rid of he border?

Thanks so very much!
Gary

All that is handled through the options array:

http://www.fistfullofcode.com/projects/copperminefetch/manual/ch06.html

The border is set by your browser but can be overridden through HTML CSS stuff.  This example does not do that, but does some neat stuff with the borders and you can probably use it as a starting point to remove the borders all together.

http://www.fistfullofcode.com/projects/copperminefetch/tips.php

Hope this helps
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: Gary B on November 27, 2005, 03:21:55 am
Ok so I am impaired with PHP...but I am trying to learn...

I have the following saved as test1.css saved in the cpmfetch folder

<style type="text/css">
.test1 {  border-style:none }
</style>

I have the following saved as randomimages.php in the same cpmfetch folder

<?php
include "cpmfetch.php";
$objCpm = new cpm('/library');
$objCpm->cpm_viewRandomMedia(4,1,array("tablestyle" => "test1","imagestyle" => "test1"));
$objCpm->cpm_close();
?>

So far I can not get it to see the css file....and I still have borders...also can you tell me what line I need to add to get it to display the intermediate sized photos?


WAIT...I just figured out the display size....the following seems to display a random image of 200px wide...

<?php
include "cpmfetch.php";
$objCpm = new cpm('/library');
$objCpm->cpm_viewRandomMedia(1,1,array("tablestyle" => "test1",'imagewidth' => '200',"imagestyle" => "test1","imagesize" => "int"));
$objCpm->cpm_close();
?>


I guess all I need to figure out now is still how to rid myself of the borders.
Thank you once again!
Gary

Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud on November 27, 2005, 05:18:22 am

Well, the imagewidth does not select an image that is 200px wide, but instead instructs the browser to render them at 200px wide.  Browsers are not as bad as they used to be at that (the first web browsers out were awful at that).

As for the CSS, you still need to tell your web page to load that CSS file.  I am not sure if you did that...

Something like this:
<link rel="stylesheet" type="text/css" href="http://....whatever ure here...." />

The css entries into cpmfetch just tells cpmfetch what to include as the class statement.

Hopefully that fixes you.

Vuud



Ok so I am impaired with PHP...but I am trying to learn...

I have the following saved as test1.css saved in the cpmfetch folder

<style type="text/css">
.test1 {  border-style:none }
</style>

I have the following saved as randomimages.php in the same cpmfetch folder

<?php
include "cpmfetch.php";
$objCpm = new cpm('/library');
$objCpm->cpm_viewRandomMedia(4,1,array("tablestyle" => "test1","imagestyle" => "test1"));
$objCpm->cpm_close();
?>

So far I can not get it to see the css file....and I still have borders...also can you tell me what line I need to add to get it to display the intermediate sized photos?


WAIT...I just figured out the display size....the following seems to display a random image of 200px wide...

<?php
include "cpmfetch.php";
$objCpm = new cpm('/library');
$objCpm->cpm_viewRandomMedia(1,1,array("tablestyle" => "test1",'imagewidth' => '200',"imagestyle" => "test1","imagesize" => "int"));
$objCpm->cpm_close();
?>


I guess all I need to figure out now is still how to rid myself of the borders.
Thank you once again!
Gary


Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: Gary B on December 12, 2005, 12:11:11 am
Ok so I never got the style sheet info to work...all I want to do is to have the text displayed as Arial 10pt. Here is the code I am using so far...can I just add some sort of font tag to this code to make it arial 10?

Code: [Select]
<?php 
include "cpmfetch.php";
$objCpm = new cpm('/library');
$objCpm->cpm_viewRandomMedia(1,1,array("tablestyle" => "test1","subtitle" =>"This photo is from the %a album","imagesize" => "thumb","imagestyle" => "test1"));
$objCpm->cpm_close(); 
?>

Thanks for your help and patience!
Gary
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: yuvalr on January 16, 2006, 09:18:23 am
I am sure I am very close to make it work but something is missing.
all I want is to display some pictures in my html pages.
i have done the following:
Installed cpfetch, checked that the cpmtest.php is working, created the  randomimages.php, and  checked that this is also working.
the next step is a bit unclear - i have created a new file and inserted the line as described:
<!--#include virtual="./gallery/cpmfetch/ssitest.php" -->
where gallery is my coppermine dir and cpmfetch is of course  my cpmfetch dir.

 i want to add the ".htaccess" but I doubt my ISP will give me permission .
saving  the file as  .shtml lead to the following result:
Error processing SSI file

Please help

 

Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud on January 20, 2006, 09:41:04 pm
I am sure I am very close to make it work but something is missing.
all I want is to display some pictures in my html pages.
i have done the following:
Installed cpfetch, checked that the cpmtest.php is working, created the  randomimages.php, and  checked that this is also working.
the next step is a bit unclear - i have created a new file and inserted the line as described:
<!--#include virtual="./gallery/cpmfetch/ssitest.php" -->
where gallery is my coppermine dir and cpmfetch is of course  my cpmfetch dir.

 i want to add the ".htaccess" but I doubt my ISP will give me permission .
saving  the file as  .shtml lead to the following result:
Error processing SSI file

Please help


I'd check the error logs... or your access log file if they log to there...

Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: radmofo on February 03, 2006, 02:25:59 am
Hello I can't seem to find a better place to put this question so I hope here is OK. I have installed some of your code and it's visible on my SITE (http://www.robbinsfamilysite.com) and it works great! There is only one thing that is strange, it will not pull random (or any) images from albums above number 25. If I force it to ViewRandomImageFrom (1,1,"album=26") or 27 28 etc I get nothing however 1-25 work perfect. I have racked my head on the wall long enough, any suggestions?

Kevin
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: iblazed on April 30, 2006, 12:45:28 am
I have troubleshooted countless hours trying to get this to work and I feel like I almost have it. I got the cpmtest.php working. Also created randomimages.php, and that is also working.
I inserted the line <!--#include virtual="photos/cpmfetch/randomimages.php" -->
in my html file where I want the pictures to show up but instead of pictures I get this
cpm_viewLastAddedMedia(4,2); $objCpm->cpm_close();?>

Here is the code in my randomimages.php
<?php
include "./cpmfetch.php";
$objCpm = new cpm('/photos');
$objCpm->cpm_viewLastAddedMedia(4,2);
$objCpm->cpm_close();?>

I also edited the .htaccess file as needed.
Any help would be appreciated as I am at a loss here. Thanks
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: mottaguedes on May 19, 2006, 11:46:40 pm
Hi everyone!

I installed cpmfetch and got to pass all the tests BUT!, I am not seeing the little grid with images.
Instead I get the following messge:


Quote
Trying to display some images:

Your installation seems correct so far, you should see a small grid of thumbnails from your gallery

Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/fetiche/public_html/dressing4pleasure/cpmfetch/cpmfetch_dao.php on line 710

I've been looking hard in Cpmfetch documentation but with no luck.
Can anyone shed some light please?

Thanks!!!
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud on May 20, 2006, 12:19:56 am
Hi everyone!

I installed cpmfetch and got to pass all the tests BUT!, I am not seeing the little grid with images.
Instead I get the following messge:


I've been looking hard in Cpmfetch documentation but with no luck.
Can anyone shed some light please?

Thanks!!!

Oh my.  That does not sound good.  Maybe the README that came with it can help...

vuud

Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: mottaguedes on May 20, 2006, 02:42:03 pm
I did go through the docs. :(

I'll start all over again.
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: 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:

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?


Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud 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






Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: jr1001 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';
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: Hesch2000 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)
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: 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?
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud 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?

Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: bitbob 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.
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud 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!
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: bitbob 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
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: vuud 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 ' '
Title: Re: CpmFetch - Using CpmFetch on HTML pages via SSI
Post by: bitbob 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!