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: How to use cpmfetch on a subdomain?  (Read 28830 times)

0 Members and 1 Guest are viewing this topic.

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
How to use cpmfetch on a subdomain?
« on: January 30, 2007, 10:46:35 am »

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

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

and this:

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

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

Code: [Select]
<?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 ;)
« Last Edit: February 27, 2007, 05:47:21 pm by vuud »
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: How to use cpmfetch on a subdomain?
« Reply #1 on: January 30, 2007, 04:28:24 pm »

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

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #2 on: January 31, 2007, 02:02:56 am »


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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: How to use cpmfetch on a subdomain?
« Reply #3 on: January 31, 2007, 05:09:07 pm »



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

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #4 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
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: How to use cpmfetch on a subdomain?
« Reply #5 on: January 31, 2007, 06:59:14 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:

Code: [Select]
include "cpmfetch.php";
The way that is written, it will only work if it is in the same directory as cpmfetch.php

Code: [Select]
include "./cpmfetch/cpmfetch.php";
This one would work if it was in the directory above the cpmfetch folder.

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
















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

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #6 on: February 01, 2007, 02:01:44 am »

Thanks for replying ;)

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/

You include is going to be how? 

Thats right...
Code: [Select]
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
Code: [Select]
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
Logged

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #7 on: February 03, 2007, 02:28:03 am »

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: How to use cpmfetch on a subdomain?
« Reply #8 on: February 03, 2007, 06:57:50 pm »

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

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #9 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
Code: [Select]
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://forum.coppermine-gallery.net/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 :-[
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: How to use cpmfetch on a subdomain?
« Reply #10 on: February 04, 2007, 10:55:28 pm »

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
Code: [Select]
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://forum.coppermine-gallery.net/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



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

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #11 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:
Code: [Select]
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.
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: How to use cpmfetch on a subdomain?
« Reply #12 on: February 16, 2007, 05:55:35 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:
Code: [Select]
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...



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

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #13 on: February 22, 2007, 02:57:20 am »

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

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #14 on: February 22, 2007, 03:00:41 am »

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: How to use cpmfetch on a subdomain?
« Reply #15 on: February 22, 2007, 03:37:13 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?

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

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #16 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

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

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: How to use cpmfetch on a subdomain?
« Reply #17 on: February 22, 2007, 04:08:29 pm »

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

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



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

teamvtec

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: How to use cpmfetch on a subdomain?
« Reply #18 on: February 23, 2007, 01:19:09 am »

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 ;)
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: How to use cpmfetch on a subdomain?
« Reply #19 on: February 23, 2007, 02:16:31 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.

:)



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
Pages: [1] 2   Go Up
 

Page created in 0.057 seconds with 19 queries.