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 ;)
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.
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
Quote from: teamvtec on January 31, 2007, 02:03:55 AM
Why is this double posted? Is there something different between the two?
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
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)
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
eeeeh sorry to bump this but i really need some help to crack this ;D
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.
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 :-[
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
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.
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...
Hi Vuud, i just installed the 1.9.9 version.
Please let us continue our search for the problem ;D
Sorry... read your post about v1.9.10... upgraded once again.
Let's continue ;)
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?
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?
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.
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 ;)
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.
:)
Ok, that worked ;D the urls are now correct (see attachement) and when i click them i go directly to the pictures but it still doesn't show any thumbs.
I use this in a php block:
include "http://gallery.sirfanaticsholland.com/cpmfetch/random_pic.php";
I think i have to change something in my random_pic.php file, my guess is it's the include:
<?php
include "cpmfetch.php";
$objCpm = new cpm();
$objCpm->cpm_viewRandomMedia (3,1);
$objCpm->cpm_viewLastAddedMedia (3,1);
$objCpm->cpm_close();
?>
You can't include() using an URL, use a path.
Quote from: teamvtec on February 23, 2007, 03:21:08 AM
Ok, that worked ;D the urls are now correct (see attachement) and when i click them i go directly to the pictures but it still doesn't show any thumbs.
I use this in a php block:
include "http://gallery.sirfanaticsholland.com/cpmfetch/random_pic.php";
I think i have to change something in my random_pic.php file, my guess is it's the include:
<?php
include "cpmfetch.php";
$objCpm = new cpm();
$objCpm->cpm_viewRandomMedia (3,1);
$objCpm->cpm_viewLastAddedMedia (3,1);
$objCpm->cpm_close();
?>
What is the actual image source tag looking like? Right click on the broken image and do properties...
Quote from: Nibbler on February 23, 2007, 03:24:45 AM
You can't include() using an URL, use a path.
AFAIK unless the default PHP settings are changed you can.
Its a setting called "URL fopen wrappers".
Although I would agree that a path would be more optimal, I don't think it would solve the problem - he is getting data back.
Quote from: vuud on February 23, 2007, 06:08:33 AM
What is the actual image source tag looking like? Right click on the broken image and do properties...
Hmmm that's strange, it says forum. instead of gallery. ??? http://forum.sirfanaticsholland.com/albums/userpics/10004/thumb_new2.JPG
Quote from: teamvtec on February 23, 2007, 09:56:04 AM
Hmmm that's strange, it says forum. instead of gallery. ??? http://forum.sirfanaticsholland.com/albums/userpics/10004/thumb_new2.JPG
Whoops. Something I thought I changed in the code was not changed. Of course it only happens in this particular situation. I will fix it tonight and post a new release and let you know.
Can't hardly wait ;D, thanks for your time
Quote from: teamvtec on February 23, 2007, 11:06:01 PM
Can't hardly wait ;D, thanks for your time
Hey,
Finally got to check it. Found out that my code was right. but i forgot another setting in the cpmfetch_config.dao you need to change:
Make sure these three entries correctly references the domain the gallery is on:
If not, uncomment, then correct them.
// Your sites domain name
// $cfg['domain_name'] = 'cpg.localhost.com';
// Full URL to your CPG gallerys album directory
// $cfg['cpg_album_url'] = 'http://cpg.localhost.com/albums/';
// Full URL to your CPG gallery
// $cfg['cpg_url'] = 'http://cpg.localhost.com/';
I am not sure this is it, can you look at the source for the page that is doing the link and make sure its okay? Not the properties, but an actual view source?
Thanks
This topic is solved ;D
I had some settings wrong in the config file.
corrected it and it worked!
Please click link: http://forum.sirfanaticsholland.com/index.php
// Your sites domain name
$config_overrides['domain_name'] = 'http://gallery.sirfanaticsholland.com';
// Full URL to your CPG gallerys album directory
$config_overrides['cpg_album_url'] = 'http://gallery.sirfanaticsholland.com/albums/';
// Full URL to your CPG gallery
$config_overrides['cpg_url'] = 'http://gallery.sirfanaticsholland.com/';
Many thanks for all of your time invested in this matter Vuud ;)
Quote from: teamvtec on February 27, 2007, 05:37:28 PM
This topic is solved ;D
I had some settings wrong in the config file.
corrected it and it worked!
Please click link: http://forum.sirfanaticsholland.com/index.php
// Your sites domain name
$config_overrides['domain_name'] = 'http://gallery.sirfanaticsholland.com';
// Full URL to your CPG gallerys album directory
$config_overrides['cpg_album_url'] = 'http://gallery.sirfanaticsholland.com/albums/';
// Full URL to your CPG gallery
$config_overrides['cpg_url'] = 'http://gallery.sirfanaticsholland.com/';
Many thanks for all of your time invested in this matter Vuud ;)
Fantastic! thank you also, fixed some bugs that would not have been found until someone else tried this...
Vuud
I know this is a old posting but its the closest one I could find to my situation.
I am running coppermine as a subdomain of my site I installed cpmfetch 2.0 in my subdomain folder and installed sucessfully. However using the code(s) provided after the installation in my TP portal in a php box nothing happens?? I assume it has something to do with the path to the include but I can not make it happen no matter what I try :-\
<?php
include "./photogallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./photogallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,4);
$objCpm->cpm_close();
?>
Locking. Start a thread of your own, posting the code you use and the needed links (see sticky thread).