CpmFetch - (OLD/LOCKED) stats/thumbnails/randoms/etc from outside CPG - Page 22 CpmFetch - (OLD/LOCKED) stats/thumbnails/randoms/etc from outside CPG - Page 22
 

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]

Main Menu

CpmFetch - (OLD/LOCKED) stats/thumbnails/randoms/etc from outside CPG

Started by vuud, December 17, 2004, 10:19:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Texan78


vuud

Quote from: Texan78 on April 08, 2005, 10:52:24 PM
<img src="gallery"/cfimageget.php?album=7" />


my portal is http://www.texascampingforum.com/forum/portal.php


Your forums are php pages... I would recommend not doing the cfimageget and instead use the normal coppermine.php file...

see the quickstart on
http://cpmfetch.fistfullofcode.com

for a quick illustration of the code you would need to put in.

If you are intent on following this route...

1) Your path is clearly wrong in those tags.  the img tag src should be pointing at the cfimageget.php file

2) You need to open cfimageget.php and change two things at the top (one is the same sort of change you had to make to the cftest.php and the other allows you to query cfimageget.php directly.







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

Texan78

OK thanks for the advice. I'm just trying to take the easiet approach to display random pics on my portal. Dont wanna get real fancy at the moment. I used this code in mt portal.php and still got nothing.

<?php 
include "./CoppermineFetch/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>


vuud


Yeah, this is not really non-programmer super friendly.

You got the "/gallery" part right, but that include is probably not right for your installation.

Change the include "./CoppermineFetch/coppermine.php";

to the actual path to where the coppermine.php file is located.   So if the coppermine.php file is in the same directory as the forum, then it would be just:

include "./coppermine.php";

Or whereever... that should find it... the 2,2 will do a 2 x 2 grid of 4 images... if you want a different scheme just change the numbers...  its rows x columns.  So 4,1 would give you 4 photos ( 1 per row )











Quote from: Texan78 on April 08, 2005, 11:37:58 PM
OK thanks for the advice. I'm just trying to take the easiet approach to display random pics on my portal. Dont wanna get real fancy at the moment. I used this code in mt portal.php and still got nothing.

<?php 
include "./CoppermineFetch/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>


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

Texan78

Ok well i used this code and it worked, but it threw a ton or erros on my portal when i tried to replace the smartors  code with this one so it would display in the ezPortal

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


  My idea i had didnt work so back to the drawing board...LoL Thanks for your help and patience with me.

cdrake

Have you made it where you can include gif custom thumbnails yet?

vuud

Quote from: Texan78 on April 09, 2005, 12:55:28 AM
Ok well i used this code and it worked, but it threw a ton or erros on my portal when i tried to replace the smartors  code with this one so it would display in the ezPortal

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


  My idea i had didnt work so back to the drawing board...LoL Thanks for your help and patience with me.

I have no idea what smartors code is... although there is no reason why this should not work...
Try the way you were doing it before... with cfimageget




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

Texan78

How do i go about using that code and what do i have to change in order to use that one?

snork13

@vuud

I have the following code within my BoardIndex.template file in smf forum

echo '<div class="tborder"style="width: 180px;"><table border="0" width="180" cellspacing="1" cellpadding="5" style="table-layout: fixed;">
<tr>
<td class="catbg" width="100%" >ShoutBox</td>
</tr>
<tr>
<td class="windowbg2" width="100%" valign="middle" align="center" colspan="2"><div style="overflow: auto; width: 100%;">',smfshout(),'</div></td>
</tr>
<tr><td class="catbg" width="100%">Random Gallery Images</td></tr>
<tr><td width="100%" align="center">';
include "coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(6,1);
$objCpm->cpm_close();

echo'</td></tr>';


and while it does return 6 random photos in 1 row. I get an sql error showing on the bottom of the forum, i am running a bridge version of smf and coppermine. Any ideas? Is it the bridging?

2: mysql_query(): 8 is not a valid MySQL-Link resource
File: /home/phantasy/public_html/forum/Sources/Subs.php
Line: 232

Thanks,

snork13

vuud

Quote from: Texan78 on April 09, 2005, 02:28:15 AM
How do i go about using that code and what do i have to change in order to use that one?

1) Go back to using cfimageget.php in img src tags like you were doing...

2) In a prior post to you I noted that you would have to edit the cfimageget.php file to do it... see that post for hints on the 2 lines you need to change

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

vuud

Quote from: snork13 on April 09, 2005, 04:53:24 AM
@vuud

I have the following code within my BoardIndex.template file in smf forum

echo '<div class="tborder"style="width: 180px;"><table border="0" width="180" cellspacing="1" cellpadding="5" style="table-layout: fixed;">
<tr>
<td class="catbg" width="100%" >ShoutBox</td>
</tr>
<tr>
<td class="windowbg2" width="100%" valign="middle" align="center" colspan="2"><div style="overflow: auto; width: 100%;">',smfshout(),'</div></td>
</tr>
<tr><td class="catbg" width="100%">Random Gallery Images</td></tr>
<tr><td width="100%" align="center">';
include "coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(6,1);
$objCpm->cpm_close();

echo'</td></tr>';


and while it does return 6 random photos in 1 row. I get an sql error showing on the bottom of the forum, i am running a bridge version of smf and coppermine. Any ideas? Is it the bridging?

2: mysql_query(): 8 is not a valid MySQL-Link resource
File: /home/phantasy/public_html/forum/Sources/Subs.php
Line: 232

Thanks,

snork13


It does not seem like it is a mysql error from my code...  if you comment out the cpmfetch stuff do you still get the error?  Strange



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

vuud

Quote from: cdrake on April 09, 2005, 01:37:06 AM
Have you made it where you can include gif custom thumbnails yet?

No, but I really really want to

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

Texan78

OK im not just real sure what to edit, but here is what i did edit:

require_once "coppermine_dao.php";

// CHANGE THIS TO TRUE IF PEOPLE ARE ALLOWED QUERIES THROUGH HERE
$ALLOW_DIRECT_ACCESS = false;

if ($ALLOW_DIRECT_ACCESS && substr($_SERVER['SCRIPT_FILENAME'],-14) == "cfimageget.php") {

// This one you need to adjust unless your galler is at http://www.texascampingforum/gallery
// If you installed right to the root of your web site, just use a /
$urltocpm = "/gallery/";

// If no cmd= is submitted, it will do this:
$default_command = "random";

// This would allow for non-public photos to be shown if set to FALSE
$do_not_show_private = true;

// Change these only if you know what you are doing... its determines how your photos are named
$thumbnailprefix='thumb_';
$intermedprefix='normal_';
$fullsizeprefix='';

$cpmfetch = new cfimageget($urltocpm);

// $cpmfetch->setAllowedTypes(array(".jpg",".gif",".png",".bmp"));




here is how the call is, i dont know if this is correct, if it is its not working

<img src="/gallery/cfimageget.php">


Im sooooo close now. I actually have a block built for my portal that will work with this code if i can get it working.

vuud


Change this to true
$ALLOW_DIRECT_ACCESS = true;



Quote from: Texan78 on April 09, 2005, 07:24:08 AM
OK im not just real sure what to edit, but here is what i did edit:

require_once "coppermine_dao.php";

// CHANGE THIS TO TRUE IF PEOPLE ARE ALLOWED QUERIES THROUGH HERE
$ALLOW_DIRECT_ACCESS = false;

if ($ALLOW_DIRECT_AC




CESS && substr($_SERVER['SCRIPT_FILENAME'],-14) == "cfimageget.php") {

// This one you need to adjust unless your galler is at http://www.texascampingforum/gallery
// If you installed right to the root of your web site, just use a /
$urltocpm = "/gallery/";

// If no cmd= is submitted, it will do this:
$default_command = "random";

// This would allow for non-public photos to be shown if set to FALSE
$do_not_show_private = true;

// Change these only if you know what you are doing... its determines how your photos are named
$thumbnailprefix='thumb_';
$intermedprefix='normal_';
$fullsizeprefix='';

$cpmfetch = new cfimageget($urltocpm);

// $cpmfetch->setAllowedTypes(array(".jpg",".gif",".png",".bmp"));




here is how the call is, i dont know if this is correct, if it is its not working

<img src="/gallery/cfimageget.php">


Im sooooo close now. I actually have a block built for my portal that will work with this code if i can get it working.
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

jaslow

Quote from: vuud on April 08, 2005, 08:19:07 PM
Quote from: jaslow on April 08, 2005, 09:47:55 AM
hi im sorry but im a real real idiot.. im not very pro in php
wat i want to do is to add the last 4 images into my invision2.0 board.
ive installed ur mod and tried the cftest.php and my thumbnails now.

but i dono what to do now.. how do i add the code into invision so tht it can display the images?  


many thanks.


I don't know invision at all, but if you can edit the templates, you can probably do something by just adding in the php code

http://cpmfetch.fistfullofcode.com/projects/copperminefetch/quickstart.php

Instead of the call thats there though...  use one of the last image ones shown in

http://cpmfetch.fistfullofcode.com/php-lib/showexternal.php?url=http://www.fistfullofcode.com/projects/copperminefetch/docs/readme.html






ok how about this.. how do i add into part of an existing php page?
coz the code below is meant to insert in a blank php page.

<?php 
include "./CoppermineFetch/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>


vuud

Quote from: jaslow on April 09, 2005, 09:54:11 AM
ok how about this.. how do i add into part of an existing php page?
coz the code below is meant to insert in a blank php page.

<?php 
include "./CoppermineFetch/coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(3,3);
$objCpm->cpm_close();
?>



No, that code can go into any page...   And if it is the only thing in a file, it will not generate a valid html page

it does not create anything besides a table to hold the images.  I use it on my site by inserting it directly into existing pages that do other things.  make sure you change /gallery to wherever your CPG is...  Also, the include has to get to where you installed the cpmfetch stuff.





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

Texan78

Ok i changed it to true and still nothing

is this correct <img src="/gallery/cfimageget.php">


i have a real good feeling that its wrong.

snork13

Quote from: vuud on April 09, 2005, 06:47:56 AM
Quote from: snork13 on April 09, 2005, 04:53:24 AM
@vuud

I have the following code within my BoardIndex.template file in smf forum

echo '<div class="tborder"style="width: 180px;"><table border="0" width="180" cellspacing="1" cellpadding="5" style="table-layout: fixed;">
<tr>
<td class="catbg" width="100%" >ShoutBox</td>
</tr>
<tr>
<td class="windowbg2" width="100%" valign="middle" align="center" colspan="2"><div style="overflow: auto; width: 100%;">',smfshout(),'</div></td>
</tr>
<tr><td class="catbg" width="100%">Random Gallery Images</td></tr>
<tr><td width="100%" align="center">';
include "coppermine.php";
$objCpm = new cpm("/gallery");
$objCpm->cpm_viewRandomMedia(6,1);
$objCpm->cpm_close();

echo'</td></tr>';


and while it does return 6 random photos in 1 row. I get an sql error showing on the bottom of the forum, i am running a bridge version of smf and coppermine. Any ideas? Is it the bridging?

2: mysql_query(): 8 is not a valid MySQL-Link resource
File: /home/phantasy/public_html/forum/Sources/Subs.php
Line: 232

Thanks,

snork13


It does not seem like it is a mysql error from my code...  if you comment out the cpmfetch stuff do you still get the error?  Strange





If I comment out the code, I DO NOT get the error. Strange for sure. Any ideas?

here is the lines of code from Subs.php

   $ret = &mysql_query($db_string, $db_connection);
if ($ret === false)
$ret = db_error($db_string, $file, $line);


snork13

kegobeer

You do know that certain functions in SMF conflict with Coppermine, right?  Most likely CpmFetch, which is probably use to the Coppermine database functions, is now using SMF's database functions, which are different and require different parameters.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

snork13

Quote from: kegobeer on April 09, 2005, 05:38:00 PM
You do know that certain functions in SMF conflict with Coppermine, right?  Most likely CpmFetch, which is probably use to the Coppermine database functions, is now using SMF's database functions, which are different and require different parameters.

this is what i thought, :-[  oh well..I wish I had the time and the knowledge to make it work with the forum. I will have to take a closer look at the parameters.

thanks