CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 49 CpmFetch 1.4 On... Displaying data and images from CPG on your website - Page 49
 

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

CpmFetch 1.4 On... Displaying data and images from CPG on your website

Started by vuud, July 08, 2005, 06:43:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vuud

Quote from: twofer on August 01, 2006, 08:06:23 PM
I'm bridging it to SMF and I did comment out line 54 and uncomment 59 but I'm still having this problem.

I placed the cpmfetch folder in the root so it's /cpmfetch.

The line 54/59 thing, while definately necessary, does not affect bridging.  How many SMF users do you have?
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

twofer

Quote from: vuud on August 01, 2006, 08:10:26 PM
The line 54/59 thing, while definately necessary, does not affect bridging.  How many SMF users do you have?


About 18....not all that many.

vuud

Quote from: twofer on August 01, 2006, 08:16:12 PM
About 18....not all that many.

The easiest thing may be to go into cpg and create 18 users... Names and stuff do not matter, they just need to have entries in the cpg users table.

A more permanent solution for the bridging is in the works.
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

twofer

hey thanks that worked! it might not be the prettiest solution but it works.

vuud

Quote from: twofer on August 01, 2006, 08:49:48 PM
hey thanks that worked! it might not be the prettiest solution but it works.

Yeah, as long as the "id" of the SMF person adding the picture has an equivalent in the cpg user table, it can grab the photo.

Like I said, fixes on the way.

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

David McKim

Im still learning php, so I am a tad bit n00bish. However I am in dire need, I have read through most of the FAQ and I uploaded the cpmfetch folder. I ran the test and I got only one error...

Error Test: "75   DOCUMENT_ROOT is not a good match   BAD"

Actual Error: "Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/content/m/c/k/mckimds/html/cpmfetch/cpmfetch_dao.php on line 710"



I did not see any images in the test most likely due to this error. I am still confused on what is needed and where to run this mod properly. Im deeply sorry for my currently poor php skills. However my website needs this feature badly. I am willing to give someone temporary ftp access if it is needed.

I would love to get support through aim, this post, or you can pm me.

Please help me out here, I have spent days trying to find a way to do this and then I stumbled upon this thread. I would really appreciate it if someone out there could give me their time to help me learn what to do to get this running properly.

Thank you for reading my post,

-David

vuud

Quote from: David McKim on August 04, 2006, 05:12:59 AM
Error Test: "75   DOCUMENT_ROOT is not a good match   BAD"

This means the path to the script and the document root do not match.  Resolve the problem below, see if it starts working anyway.  If not, please PM or post the link to the cftest.php page.

Quote
Actual Error: "Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/content/m/c/k/mckimds/html/cpmfetch/cpmfetch_dao.php on line 710"

The way to fix this is listed in the release_notes file that came in the download.  Look for the note about the cpg 1.4 beta thingee.  Still applies to the current 1.4.x releases.


Your welcome
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

David McKim

Is it a bad thing that my test file shows that one bad error on test 75, how do I fix that? http://www.garbagewars.com/cpmfetch/cftest.php

Where would I put for example this code?

Code:

<?
php $objCpm->cpm_viewLastAddedMedia(1,2)
?>


I am guessing that I would put this code on the page I want it displayed, aka the http://www.garbagewars.com/includes/left_sidebar.php

But is this the only thing I include in this include to make it show? What else must I include in this php file in order for the above code to work and to show everything properly?

(basically anything I put in the left_sidebar.php include shows up on the left side of my website.)


-D

vuud

Quote from: David McKim on August 04, 2006, 05:11:53 PM
Is it a bad thing that my test file shows that one bad error on test 75, how do I fix that? http://www.garbagewars.com/cpmfetch/cftest.php

Where would I put for example this code?

Code:

<?
php $objCpm->cpm_viewLastAddedMedia(1,2)
?>


I am guessing that I would put this code on the page I want it displayed, aka the http://www.garbagewars.com/includes/left_sidebar.php

But is this the only thing I include in this include to make it show? What else must I include in this php file in order for the above code to work and to show everything properly?

(basically anything I put in the left_sidebar.php include shows up on the left side of my website.)


-D

Look at the quickstart example on the web site... you need the stuff to "create" the cpmfetch object and close it.  Basically its only a couple of lines and part of it just shows picutres, so you should be able to figure out which one to replace.

Ignore the error - I think it will be okay.


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

David McKim

Quote from: vuud on August 04, 2006, 05:19:07 PM
Look at the quickstart example on the web site... you need the stuff to "create" the cpmfetch object and close it.  Basically its only a couple of lines and part of it just shows picutres, so you should be able to figure out which one to replace.

Ignore the error - I think it will be okay.




I am sorry I didn't state this prior, but I have already done all that. I don't mean to be rude, but I would really appreciate some help here rather than a point into a direction.

From what I have gathered I should just be able to put this following code into anywhere on my ./includes/left_sidebar.php page and it should work properly...


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



Well it doesn't work, I get errors such as...
http://www.garbagewars.com/

Nibbler

Quotephp $objCpm->cpm_viewLastAddedMedia(3,1);

That doesn't make sense, remove the 'php'.

David McKim

Quote from: Nibbler on August 04, 2006, 06:54:36 PM
That doesn't make sense, remove the 'php'.

XD your correct, however even after making the change; it's still not working  :'(
http://www.garbagewars.com/

David McKim

Sorry I forgot to include, here is my entire ./include/left_sidebar.php


<?php
if( !defined('IN_SITE') )
{
exit;
}
?>


<div id="left-col">
<div class="block-container">
<div class="block-header" align="center">
<img src="./images/site/buttons/forums.png" alt="" />
</div>

<div class="block-content" align="center">
<a href="http://www.garbagewars.com/forums/">
<img src="http://www.garbagewars.com/images/site/ad/forum-ad.png" alt="" /></a> </div>
</div>



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



<div class="block-container" align="center">
<div class="block-header">
<img src="./images/site/buttons/affiliates.png" alt="" />
</div>
<!-- GWP Site -->
                <!-- Copyright (c) 2006 GarbageWars Productions. All rights reserved. -->
                <!-- http://www.garbagewars.com -->
<div class="block-content" align="center">
<a href="http://www.megamanflash.com"><img src="http://www.garbagewars.com/images/site/affiliates/megamanflash.gif" alt="" /></a> </div>
</div>

<div class="block-container" align="center">
<div class="block-header">
<img src="./images/site/buttons/linkus.png" alt="" />
</div>

<div class="block-content" align="center">
<a href="http://www.garbagewars.com"><img src="http://www.garbagewars.com/images/site/banners/88x31/GWP/gwp.gif" alt="" border="0" /></a> </div>
</div>
</div>

Nibbler

OK, now put the semi colon back at the end of the line so that it looks like this:

$objCpm->cpm_viewLastAddedMedia(3,1);

David McKim

Quote from: Nibbler on August 04, 2006, 07:30:16 PM
OK, now put the semi colon back at the end of the line so that it looks like this:

$objCpm->cpm_viewLastAddedMedia(3,1);

XD a bad copy and paste, thanks for noticing.

I now get this error though, but this time it's not the whole page error its just where the image should be.

"Unknown column 'u.user_website' in 'field list'
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/content/m/c/k/mckimds/html/cpmfetch/cpmfetch_dao.php on line 710"

I went to line 710 on _dao to check what was there and I see this...
These are lines 703-715
/**
* Takes a MySql result set and converts it to an assoc array
*
*/
function covertResultsetToArray($resultset) {
$resultarray = array();

while ($row = mysql_fetch_assoc($resultset)) {
    array_push ($resultarray,$row);
}

return ($resultarray);
}

Nibbler

You already got an answer to that one.

Quote from: vuud on August 04, 2006, 07:06:44 AM
The way to fix this is listed in the release_notes file that came in the download.  Look for the note about the cpg 1.4 beta thingee.  Still applies to the current 1.4.x releases.

David McKim

Note: I am using cpm fetch ver. 1.6.2

XD ok so I read through the release notes and I commented line 54, however it says to uncomment line 59, but I have no line 59; it's just blank @_@

Also how do I check what version of coppermine I currently have installed? I have a feeling this may be why I am having problems...

The error can be viewed here > http://www.garbagewars.com/

cpmfetch_dao.php code lines 81-102

   if (array_key_exists("DOCUMENT_ROOT",$_SERVER )) {
$this->fullpathtocpm = $_SERVER['DOCUMENT_ROOT'] . $this->partialUrltocpm;
} elseif (ini_get("doc_root") != "" ) {
$this->fullpathtocpm = ini_get('doc_root') . $this->partialUrltocpm;
} else {
$this->fullpathtocpm = $this->partialUrltocpm;
}

$this->OverridePathToAlbums($this->fullpathtocpm . "/albums", $this->partialUrltocpm . "/albums");


$this->setPrivateLockOn(true);
$this->dateFormatString = $this->defaultDateFormatString;

$this->sqlPictureSourceSelect = " " . $database_table_prefix . "pictures as p, " . $database_table_prefix . "albums as a, "
. $database_table_prefix . "users AS u ";
}

// Cleans up the object when we are done
function destroy ( ) {
$this->dbDisconnect();
}

Nibbler

You have 1.4.8, viewable on your config page and in the HTML output. Browse back througfh this thread, your issue has already been explained  numerous times to numerous people.

David McKim

Quote from: Nibbler on August 04, 2006, 11:35:37 PM
You have 1.4.8, viewable on your config page and in the HTML output. Browse back througfh this thread, your issue has already been explained  numerous times to numerous people.

Yes I have read through the release notes. I did the instructions to temporarly get cpm fetch working until he makes a permanent fix. As stated in my previous post, are you saying that if I am still getting errors then it can not be fixed until this new permanent fix has been created?

Like I stated above, it tells me in the release notes to uncomment line 59, but line 59 is blank, however after reading through perhaps he was off by one line or my file just happened to contain this info on line 60 because that is where I noticed the commented beta.

I uncommented them, now no errors show... except now nothing at all shows on my site's page, (no images from my gallery) it is as if I never added any code for cpm fetch... Why isn't my images showing? They are defined properly now and I am getting no errors. Do I just have to wait until a new cpm fetch version is made to fix this?

vuud

Quote from: David McKim on August 05, 2006, 12:11:57 AM
Yes I have read through the release notes. I did the instructions to temporarly get cpm fetch working until he makes a permanent fix. As stated in my previous post, are you saying that if I am still getting errors then it can not be fixed until this new permanent fix has been created?

No, what you did fixes it.

Quote
Like I stated above, it tells me in the release notes to uncomment line 59, but line 59 is blank, however after reading through perhaps he was off by one line or my file just happened to contain this info on line 60 because that is where I noticed the commented beta.

Yep, horrible error on my part.  It was line 59 in the previous release.   Good catch, and your right - its line 61.

Quote
I uncommented them, now no errors show... except now nothing at all shows on my site's page, (no images from my gallery) it is as if I never added any code for cpm fetch... Why isn't my images showing? They are defined properly now and I am getting no errors. Do I just have to wait until a new cpm fetch version is made to fix this?

Well, that is progress anyway. 


This should be the code you are using...


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




Now, if you are bridged with phpBB then you have a whole 'nother problem that will cause you even more grief, but will cause me considerably less since I will know what is wrong.





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