How to use cpmfetch on a subdomain? How to use cpmfetch on a subdomain?
 

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

How to use cpmfetch on a subdomain?

Started by teamvtec, January 30, 2007, 10:46:35 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

teamvtec

Hi, i've been all over this board to figure out a solution for my problem but nothing seems to help so i turn to you gentlemen.
I've installed my forum and gallery both on subdomains with my home site being http://www.sirfanaticsholland.com
My SMF with TP forum is on:
http://forum.sirfanaticsholland.com but can also be accessed through: http://www.sirfanaticsholland.com/forum
The same goes for my coppermine gallery:
http://gallery.sirfanaticsholland.com and http://www.sirfanaticsholland.com/gallery

I have them both bridged and also call the gallery from an iframe with a custom action:  http://forum.sirfanaticsholland.com/index.php?action=gallery
I tried numerous things to get this to work but i just want to show some random pictures on the FORUM board index (in a PHP block)
I installed cpmfetch, ran cftest.php and all went well and saw 6 pictures:
http://www.sirfanaticsholland.com/gallery/cpmfetch/cftest.php

I then put this in a php block:
include "cpmfetch.php";
$objCpm = new cpm('/../forum.sirfanaticsholland.com');
$objCpm->cpm_viewRandomMedia (3,1);
$objCpm->cpm_viewLastAddedMedia (3,1);
$objCpm->cpm_close();


and then tried this:

include "cpmfetch.php";
$objCpm = new cpm();
$objCpm->cpm_viewRandomMedia (3,1);
$objCpm->cpm_viewLastAddedMedia (3,1);
$objCpm->cpm_close();


and this:

include "cpmfetch.php";
$objCpm = new cpm('./gallery');
$objCpm->cpm_viewRandomMedia (3,1);
$objCpm->cpm_viewLastAddedMedia (3,1);
$objCpm->cpm_close();


this:
echo '<div align="center">';
include "./cpmfetch/cpmfetch.php";
$objCpm = new cpm("/gallery");

$objCpm->cpm_unlock_private(); /* <--I've tried setting this to (true) but it gives me errors.*/

echo ' <div align="left">';
echo ' <b>Stats</b><br>';
$objCpm->cpm_formatStats("Albums: <b>%a</b> <br> Images: <b>%f</b> <br> Hits: <b>%v</b><br><br>");

echo '</div><div align="left"><b>Random Reference</b><br>';
$options = array( 'subtitle' => 'Name: <b>%t</b><br> Author: <b>%o</b> <br> Here since <b>%D</b> days <br>' , "imagestyle" => "test1");
$objCpm->cpm_viewRandomMediaFrom ( 1, 1, $source = "", $options);

$objCpm->cpm_close();
echo'<p><a href="http://www.sirfanaticsholland.com/gallery/index.php?cat=8"><u>Photo References</u></a></p></div></div>';


and tried the same using a php page called random_pic.php
http://www.sirfanaticsholland.com/gallery/cpmfetch/random_pic.php

and even tried the following code in a random_pic.php page i saved in the forum directory which i called from a HTML block 
<img src="http://www.sirfanaticsholland.com/forum/random_pic.php"/>
which worked by the way.

<?php
$gallery_path 
"../gallery"// no slash '/' at the end. Usually "../gallery"
$gallery_prefix "cpg135_"// cpg mysql tables prefix. Usually "cpg_"

$result mysql_query("SELECT filename,filepath,aid,pid,title FROM " $gallery_prefix "pictures
WHERE approved='YES'
AND (filename LIKE '%.jpg'
OR filename LIKE '%.jpeg'
OR filename LIKE '%.gif'
OR filename LIKE '%.png')
ORDER BY RAND() DESC LIMIT 1"
);
$row mysql_fetch_array($result);

mysql_free_result($result);

$filename 'thumb_' $row['filename'];
$filepath $row['filepath'];
$aid $row['aid'];
$pid $row['pid'];
$title $row['title'];

$result mysql_query("SELECT aid,title FROM " $gallery_prefix "albums
WHERE aid = " 
$aid);
$row mysql_fetch_array($result);

mysql_free_result($result);
$album $row['title'];

echo 
'<div align="center"><a href="' $gallery_path '/displayimage.php?pos=-' $pid .'"><img src="' $gallery_path '/albums/' $filepath $filename .'" border="0" title ="' $album ' - ' $title '"></a><br></div>';

?>


The code above does work and gives me 1 random picture from the gallery but it's non clickable and i have no idea what to change to get more
http://forum.sirfanaticsholland.com/index.php?action=forum

Most of the time I keep getting this error no matter what i change:
Fatal error: Cannot instantiate non-existent class: cpm in /home/teamvtec/domains/sirfanaticsholland.com/public_html/forum/Sources/Load.php(1744) : eval()'d code(35) : eval()'d code on line 3

How do i set the cpmfetch up so it displays some pictures on the board index?
I really want to tackle this myself but i'm a begginer when it comes to php and such... sorry
Any help would be very welcome ;)

vuud

Quote from: teamvtec on January 30, 2007, 10:46:35 AM
How do i set the cpmfetch up so it displays some pictures on the board index?
I really want to tackle this myself but i'm a begginer when it comes to php and such... sorry
Any help would be very welcome ;)


What version of cpmfetch are you using?  It makes a difference in the part you are having a problem with.
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

teamvtec

Quote from: vuud on January 30, 2007, 04:28:24 PM

What version of cpmfetch are you using?  It makes a difference in the part you are having a problem with.


That is displayed here http://www.sirfanaticsholland.com/gallery/cpmfetch/cftest.php ;D
1.6.4

vuud

Quote from: teamvtec on January 31, 2007, 02:03:55 AM


Why is this double posted?  Is there something different between the two?
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

teamvtec

No there is not, I'm very sorry something must have gone wrong.
I didn't post anything today ???

Please delete the quoted post above.

Can you help me out with the problems i posted above?

Grtzz

vuud

Quote from: teamvtec on January 31, 2007, 06:07:20 PM
No there is not, I'm very sorry something must have gone wrong.
I didn't post anything today ???

Please delete the quoted post above.

Can you help me out with the problems i posted above?

Grtzz

Well, anytime you get the: Cannot instantiate non-existent class: cpm stuff that means your include statement failed:

include "cpmfetch.php";

The way that is written, it will only work if it is in the same directory as cpmfetch.php

include "./cpmfetch/cpmfetch.php";

This one would work if it was in the directory above the cpmfetch folder.

include "../../cpmfetch/cpmfetch.php";

The above would go up two directory levels, then down into the cpmfetch folder to look for it.


Now, when you are dealing with a portal or something then sometimes it is from where the portal is run...  so if your set up like so:

/gallery/cpmfetch/cpmfetch.php
/forum/index.php
/forum/templates/nuser/template.php

You include is going to be how? 

Thats right...
include "../gallery/cpmfetch/cpmfetch.php";

The path from the forum index.php or whatever executes.

Most times.

If you are bridged then you also have other issues to deal with... But get past this first... 

(The bridging problem  symptom is that you get very few, or no pictures back, with no errors)
















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

teamvtec

Thanks for replying ;)

Quote from: vuud on January 31, 2007, 06:59:14 PM
Now, when you are dealing with a portal or something then sometimes it is from where the portal is run...  so if your set up like so:

/gallery/cpmfetch/cpmfetch.php
/forum/index.php
/forum/templates/nuser/template.php
Check the picture attachement below... it shows my complete website ROOT.

/gallery/cpmfetch/cpmfetch.php
/forum/index.php
/forum/Themes/

Quote from: vuud on January 31, 2007, 06:59:14 PM
You include is going to be how? 

Thats right...
include "../gallery/cpmfetch/cpmfetch.php";

The path from the forum index.php or whatever executes.
Most times.
If you are bridged then you also have other issues to deal with... But get past this first... 
(The bridging problem  symptom is that you get very few, or no pictures back, with no errors)

I tried all of your explanations and played arround with different variations but still no luck, i even unbridged the gallery.

Got these errors when trying the following
echo '<div align="center">';
include "../gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm();

$objCpm->cpm_unlock_private(); /* <--I've tried setting this to (true) but it gives me errors.*/

echo ' <div align="left">';
echo ' <b>Stats</b><br>';
$objCpm->cpm_formatStats("Albums: <b>%a</b> <br> Images: <b>%f</b> <br> Hits: <b>%v</b><br><br>");

echo '</div><div align="left"><b>Random Reference</b><br>';
$options = array( 'subtitle' => 'Name: <b>%t</b><br> Author: <b>%o</b> <br> Here since <b>%D</b> days <br>' , "imagestyle" => "test1");
$objCpm->cpm_viewRandomMediaFrom ( 1, 1, $source = "", $options);

$objCpm->cpm_close();
echo'<p><a href="http://www.sirfanaticsholland.com/gallery/index.php?cat=8"><u>Photo References</u></a></p></div></div>';


Fatal error: Call to a member function on a non-object in /home/teamvtec/domains/sirfanaticsholland.com/public_html/gallery/cpmfetch/cpmfetch.php on line 213

I really hope to crack this baby... should help others to with the same problems

teamvtec

eeeeh sorry to bump this but i really need some help to crack this ;D

vuud

Quote from: teamvtec on February 03, 2007, 02:28:03 AM
eeeeh sorry to bump this but i really need some help to crack this ;D

Ah, I see.  You may have an issue with your web server not allowing you to go up...

Try getting it working on a test page on the main domain (the one with the gallery) first.
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

teamvtec

Damnit, been trying all kinds of bs to get it to work.
Here's a sum up of what i tried, dont really know if it makes any sense;

I got the random pictures working on the gallery side ;D
http://www.sirfanaticsholland.com/gallery/cpmfetch/random_pic.php

then.........

I put this into a php block within Tinyportal and tried to load it from the board index which is: http://forum.sirfanaticsholland.com/index.php
include "http://www.sirfanaticsholland.com/gallery/cpmfetch/random_pic.php";
$objCpm = new cpm();
$objCpm->cpm_viewRandomMedia (5,5);
$objCpm->cpm_viewLastAddedMedia (5,5);
$objCpm->cpm_close();


Then it showed me these picture rows:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F7742%2Fimage1av8.jpg&hash=9c4782d47abc31e7826375178aae396922c4c79d)
Look at the bottom left address field... it says http://forum.sirfanaticsholland.com/gallery/displayimage.php?pos=- while it should say http://www.sirfanaticsholland.com/gallery/displayimage.php?pos=- or http://gallery.sirfanaticsholland.com/displayimage.php?pos=-

Also tried this in a html block to call it as an image:

<p><img alt="" src="http://www.sirfanaticsholland.com/gallery/cpmfetch/random_pic.php" /></p>

Didn't work :-[

vuud

Quote from: teamvtec on February 04, 2007, 04:08:57 AM
Damnit, been trying all kinds of bs to get it to work.
Here's a sum up of what i tried, dont really know if it makes any sense;

I got the random pictures working on the gallery side ;D
http://www.sirfanaticsholland.com/gallery/cpmfetch/random_pic.php

then.........

I put this into a php block within Tinyportal and tried to load it from the board index which is: http://forum.sirfanaticsholland.com/index.php
include "http://www.sirfanaticsholland.com/gallery/cpmfetch/random_pic.php";
$objCpm = new cpm();
$objCpm->cpm_viewRandomMedia (5,5);
$objCpm->cpm_viewLastAddedMedia (5,5);
$objCpm->cpm_close();


Then it showed me these picture rows:
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fimg77.imageshack.us%2Fimg77%2F7742%2Fimage1av8.jpg&hash=9c4782d47abc31e7826375178aae396922c4c79d)
Look at the bottom left address field... it says http://forum.sirfanaticsholland.com/gallery/displayimage.php?pos=- while it should say http://www.sirfanaticsholland.com/gallery/displayimage.php?pos=- or http://gallery.sirfanaticsholland.com/displayimage.php?pos=-

Also tried this in a html block to call it as an image:

<p><img alt="" src="http://www.sirfanaticsholland.com/gallery/cpmfetch/random_pic.php" /></p>

Didn't work :-[


I miss my CRX.  Was nice, black and I was about to redo the front.  Then some idiot is a truck ran a red light and nailed me in the side.  Every window (except the windshield) pretty much exploded.  I was fine, but the car was pretty much DOA.

But anyway...

The second thing there will only work if you are returning ONLY image data... no HTML at all, no links, just pure imagedata.  Much like cfimageget does.  But that is only good for one image at a time. 

For the first part... is all that code in the tinyportal block, or is the include including the rest from the main site.  If not, what is in the main sites file (random_pic.php).

If the paths look right, except for the domain name, I think we can call an override function.  Your using the old cpmfetch right?  I think actually, the dev versions do all this automagically for you.

Lemme know - if you are able to get image data (like you said), the final solution can't be that far away



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

teamvtec

Thanks for replying Vuud and sorry for my delay in doing so.
Ahhhh fellow Honda enthusiast ;D
I'm sorry to hear your CRX is no more... man what is it with people and red lights :(


This code is out into a center block displayed on http://www.sirfanaticsholland.com/forum/index.php:
include "http://www.sirfanaticsholland.com/gallery/cpmfetch/random_pic.php";
$objCpm = new cpm();
$objCpm->cpm_viewRandomMedia (5,5);
$objCpm->cpm_viewLastAddedMedia (5,5);
$objCpm->cpm_close();


The include includes the random_pic.php situated in the cpmfetch dir

I'm using the old version yes that is correct, v1.6.4


I really want this to be solved.... :-\ i can give you access to ftp or whatever you need ok? just ask.

vuud

Quote from: teamvtec on February 16, 2007, 01:06:14 AM
Thanks for replying Vuud and sorry for my delay in doing so.
Ahhhh fellow Honda enthusiast ;D
I'm sorry to hear your CRX is no more... man what is it with people and red lights :(


This code is out into a center block displayed on http://www.sirfanaticsholland.com/forum/index.php:
include "http://www.sirfanaticsholland.com/gallery/cpmfetch/random_pic.php";
$objCpm = new cpm();
$objCpm->cpm_viewRandomMedia (5,5);
$objCpm->cpm_viewLastAddedMedia (5,5);
$objCpm->cpm_close();


The include includes the random_pic.php situated in the cpmfetch dir

I'm using the old version yes that is correct, v1.6.4


I really want this to be solved.... :-\ i can give you access to ftp or whatever you need ok? just ask.

Okay, wait for version 1.9.9 to come out (tomorrow I think) in the dev versions... Upgrade to that.  Read the included file for how to install and what is different.

1.6.4 is going away and will not be supported in the very very near future.

We can do things a lot easier in 1.9.x...



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

teamvtec

Hi Vuud, i just installed the 1.9.9 version.
Please let us continue our search for the problem ;D

teamvtec

Sorry... read your post about v1.9.10... upgraded once again.
Let's continue ;)

vuud

Quote from: teamvtec on February 22, 2007, 03:00:41 AM
Sorry... read your post about v1.9.10... upgraded once again.
Let's continue ;)

Yay!  Another beta tester  :D

Anyway, where do you end up running the new version?

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

teamvtec

All went well... it showed me a row of 4 images taken from the gallery.
Then when i run the

include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,4);
  $objCpm->cpm_close();


All previous problems stay the same.....I think we're back at square one.... :-\
Do you need the debug information given on the install page?

vuud

Quote from: teamvtec on February 22, 2007, 01:52:18 PM
All went well... it showed me a row of 4 images taken from the gallery.
Then when i run the

include "./gallery/cpmfetch/cpmfetch.php";
  $objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,4);
  $objCpm->cpm_close();


All previous problems stay the same.....I think we're back at square one.... :-\
Do you need the debug information given on the install page?

Okay, this is where the image url is saying forum...  ?

Yes, if you can PM me a link to the install.php or send me the contents of the cpmfetch_config.php file - either one.



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

teamvtec

Quote from: vuud on February 22, 2007, 04:08:29 PM
Okay, this is where the image url is saying forum...  ?

Yes, if you can PM me a link to the install.php or send me the contents of the cpmfetch_config.php file - either one.





Yes, that is correct.

I sent you both the link and contents of the file, check your PM ;)

vuud

Quote from: teamvtec on February 23, 2007, 01:19:09 AM
Yes, that is correct.

I sent you both the link and contents of the file, check your PM ;)

Okay, here is a problem.  I read the e-card target, since its always pointed at something.  Yours does not.

So anyway, open the cpmfetch_config.php file, look for:

// Full URL to your CPG gallery
//  $config_overrides['cpg_url'] = '/';

And change it to

// Full URL to your CPG gallery
$config_overrides['cpg_url'] = 'http://www.sirfanaticsholland.com/gallery';

Save it and see what happens.  Oh, then let me know.

:)



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