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

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 - (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 3 Guests are viewing this topic.

vuud

Quote from: pierse on March 07, 2005, 12:40:26 AM
I have been trying to re-create this:
Quote$objCpm->cpm_formatStats("Here is a percent sign %% There are
   %f files in %c categories containing %a albums,
   having served %v views and getting %n comments");
but I cannot get it to work.  I wanted to include this line in my template.php for my forum I use and I always get an error page that is standard for my portal.  (Tiny Portal (SMF)).  I do not know php code. so, please forgive me in advance. ;)

Is tiny portal (SMF) related to the SMF forums?  If so, I just installed SMF so I can actually try this.

What are the errors you are getting?  Does anything happen?

Also, what version of Coppermine fetch are you running? 
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


I was just wondering if it worked back to that version... If it does, then I will request this thread gets marked for 1.2 also... 

I've tested it with 1.4 beta and it worked alright (more testing when 1.4 goes final)

Vuud

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

Rodinou

From my part, I'm usign Coppermine 1.3 ... and the latest version of your mod available on your site ...

pierse

I am using version 1.0 of the fetch...  The error is a parsing error. 

vuud

#284
Once again its code freeze time. 

http://cpmfetch.fistfullofcode.com <- get it there

No real changes will be made between this and the 1.2 STABLE release.  Bug fixes and minor stuff only.

So please try this one...  Its better than the 1.0 stable... a few problems people have found are much better with the development versions, which is why I am going to put the 1.2 out before I am sure the RSS stuff is stable.

So PLEASE use this one instead of the stable.

Okay, the big change between this version and the last dev version is with two things:

* Randomization is better (thanks to M. Sidon)
* cfimageget is 100x better (complete re-write)
* Fix to the new ___from calls - bug in certain circumstances

The changes to cfimageget.php are pretty significant.  You can continue to run it exactly how you have been doing it, but that will require you to change line 25 (in version 1.1.4) from:

$ALLOW_DIRECT_ACCESS = false;

to

$ALLOW_DIRECT_ACCESS = true;

This was put in place since you may or may not want people able to just change the parameters and retrieve whatever.  If you do not want people to have this ability, leave it false and check the new file in there cfig_random.php for an example of making a single use file.  So you just call the file with no parameters instead of the old way.

Easier to look at, and you will see what I mean



Overall, since the last stable - these are the changes:
(1.1.4) - Release candiate for 2.0
Randomization improved in coppermine_dao calls
cfimageget.php completely redone
Bug fix to getRandomImageFrom and getLastImageFrom routines
(1.1.3) - Development release
Added subtitle option (same syntax as alttag) - to display subtitles in the grid layouts
Added cpm_showCategoriesUpdatedOverLastDays($numberOfDays,$options="")
Added cpm_viewLastCommentedImages - shows last commented images, provides subtitle access to comment
(1.1.2) - Development release
Added call to cpm_OverridePathToCoppermine($newpath_)
Added call to cpm_OverrideUrlToCoppermine($newpath_)
Bugfix for uninitialized variable in some situations
Second attempt at fixing the bug with being in the root
(1.1.1) - Development release
Bugfix for coppermine being installed in the root of a web server
setReturnType([print, html, resultset]) to have functions return rowsets, htmldata or print it
All functions recoded to support setReturnType as much as possible
Lots of internal changes to make extension easier (aka RSS Feeds)
Added a debug flag in case anything happens out there
Added in prototype for java popup window for imagelink=large / windowtarget = _blank
Included javascript file for providing pop method
(1.1.0) - Development release
Show user galleries when category 1 is asked for (category 1 = cid > 10000)
Internal opimizations
styles now standard across all functions
cpm_viewLastAddedMediaFrom( )
cpm_viewRandomMediaFrom( )
cpm_showAlbumsUpdatedOverLastDays( )


On a more personal note:
I would like to thank anyone who answered a question for anyone else in here since I put this up.  It makes things easier on me, and having that sort of occurance makes me want to continue with this project.  So thank you all very much.  In fact, people who answer questions would probably have a better chance of getting feature requests fullfilled ;D







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: pierse on March 07, 2005, 06:28:16 AM
I am using version 1.0 of the fetch...  The error is a parsing error. 

Hello,

A few things... first - I would recommend version 1.1.4 (or newest dev) instead of 1.0 - especially if you are doing something like putting it in a template.

Second, are you doing the $objCpm = new cpm('/photos'); and stuff before hand?  Can you post the parse error, or email me the template or give me any idea of where it is breaking?

I want to help, but version 1.0 and parse error is not enough info for me to give you a suggestion (except upgrade :D )

Talk to you soon







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

Arlo

I just upgraded to php5, and it seems to have completely broken cpmfetch, except for "cfimageget_classic.php"
I searched this thread, but didn't find any other mention of this. Ideas?

vuud

Quote from: Arlo on March 08, 2005, 07:03:44 AM
I just upgraded to php5, and it seems to have completely broken cpmfetch, except for "cfimageget_classic.php"
I searched this thread, but didn't find any other mention of this. Ideas?

I am not sure why it would break.  I did a lot of reading on PHP5 and its seemingly fantastic object support, but I am not sure why it would break this.  I am not saying I am surprised, its never been tested on PHP5.

PHP5 compatibility is definately something I will have - heck everytime I muddle with the objects in here I wish it was PHP5...  But I did not know that CPG was even supporting PHP5 yet.  If you want to message me the errors or something I would be interested in seeing it.  Like I said, I plan on support for it - but have not done anything with that yet

Thanks for the cheerful news ;)


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

So I was working on the documentation, and realized there was a lot that was not really touched on lately...  I made a nice list of the basic functions you would use in cpmfetch and thought I would post it, just so people knew what was in there

The functions you can call can be divided into four groups by what they do.

Functions that return images

  • cpm_viewLastAddedMedia ($rows, $columns, [array $options = ""])
  • cpm_viewLastAddedMediaFromAlbum ( $rows,  $columns,  $albumid, [array $options = ""])
  • cpm_viewLastAddedMediaFromCategory ( $rows,  $columns,  $catid, [array $options = ""])
  • cpm_viewLastAddedMediaFrom ( $rows,  $columns,  $source, [array $options = ""])
  • cpm_viewRandomMedia ( $rows,  $columns, [array $options = ""])
  • cpm_viewRandomMediaFromAlbum ( $rows,  $columns,  $albumid, [array $options = ""])
  • cpm_viewRandomMediaFromCategory ( $rows,  $columns,  $catid, [array $options = ""])
  • cpm_viewRandomMediaFrom ( $rows,  $columns,  $source, [array $options = ""])

Functions that return textual statistics

  • cpm_formatStats ($format)
  • cpm_listMediaCount ()
  • cpm_getMediaCount ()
  • cpm_listMediaCountForAlbum ($albumid)
  • cpm_getMediaCountForAlbum ($albumid)

Functions that return gallery level images and text

  • cpm_listMediaAddedOverLastDays ($numberOfDays, [ array $options=""])
  • cpm_viewLastCommentedImages($rows,$columns, [ array $options=""])
  • cpm_showCategoriesUpdatedOverLastDays($numberOfDays,$options="")
  • cpm_showAlbumsUpdatedOverLastDays($numberOfDays,$options="")

Functions that control this program and its behavior

  • cpm ($urltocpm)
  • cpm_init ( Depreciated old constructor )
  • cpm_close ()
  • cpm_setFilter($filter)
  • cpm_setReturnType($type)
  • cpm_unlockPrivate($bool)
  • cpm_OverridePathToCoppermine($newpath_)
  • cpm_OverrideUrlToCoppermine($newpath_)
  • cpm_setDebugMode($bool)


Brief explanation of some of the above parameters

$albumid - is always the numerical id of the album
$catid - is always the numerical if of the category
$source - this is a new way of specifying albums and categories at the same time
$rows,$columns - the combination determine how many total to show and in what orientaion
$columns - how many columns of images to show
$options - this is an array of options (covered below)
$format - text to display interspersed with placeholders for variables

There are some real nifty new things in here... 
For example:

cpm_setReturnType($type)

$type can usually be:  html, print or resultset - resultset actually gives you back the mysql result set - so you can do whatever you want with it.  have a ball.  html and print do the same thing most times.

Another good one is the

cpm_viewRandomMediaFrom  and cpm_viewLastAddedMediaFrom calls
These accept a source string:

Here is a hint  $source = "cat=1,2,3:album=27"

Well more later

Vuud
:P
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

Arlo

I've sent you a message with some details...I hope there's a solution, "_classic" stinks, my users can't click them to get to the gallery!
Quote
:-\\

Quote from: vuud on March 08, 2005, 07:12:42 AM
Quote from: Arlo on March 08, 2005, 07:03:44 AM
I just upgraded to php5, and it seems to have completely broken cpmfetch, except for "cfimageget_classic.php"
I searched this thread, but didn't find any other mention of this. Ideas?

I am not sure why it would break.  I did a lot of reading on PHP5 and its seemingly fantastic object support, but I am not sure why it would break this.  I am not saying I am surprised, its never been tested on PHP5.

PHP5 compatibility is definately something I will have - heck everytime I muddle with the objects in here I wish it was PHP5...  But I did not know that CPG was even supporting PHP5 yet.  If you want to message me the errors or something I would be interested in seeing it.  Like I said, I plan on support for it - but have not done anything with that yet

Thanks for the cheerful news ;)




vuud

Quote from: Arlo on March 08, 2005, 01:32:34 PM
I've sent you a message with some details...I hope there's a solution, "_classic" stinks, my users can't click them to get to the gallery!
Quote
:-\\

Quote from: vuud on March 08, 2005, 07:12:42 AM
Quote from: Arlo on March 08, 2005, 07:03:44 AM
I just upgraded to php5, and it seems to have completely broken cpmfetch, except for "cfimageget_classic.php"
I searched this thread, but didn't find any other mention of this. Ideas?

I am not sure why it would break.  I did a lot of reading on PHP5 and its seemingly fantastic object support, but I am not sure why it would break this.  I am not saying I am surprised, its never been tested on PHP5.

PHP5 compatibility is definately something I will have - heck everytime I muddle with the objects in here I wish it was PHP5...  But I did not know that CPG was even supporting PHP5 yet.  If you want to message me the errors or something I would be interested in seeing it.  Like I said, I plan on support for it - but have not done anything with that yet

Thanks for the cheerful news ;)

cfimageget and cfimageget_classic will never ever allow you to get clickable links...  thats the main coppermine.php that gives that sort of thing.  Classic is really bad compared to the new cfimageget.php functionality.

Will check the message :)


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

Arlo

Quote from: vuud on March 08, 2005, 04:50:58 PM
cfimageget and cfimageget_classic will never ever allow you to get clickable links...  thats the main coppermine.php that gives that sort of thing.  Classic is really bad compared to the new cfimageget.php functionality.

Will check the message :)

Yeah, the only reason I went to imageget was because coppermine.php broke.

vuud

Arlo was nice enough to test a fix for PHP5 for me...  Here it is in case anyone else is sitting around waiting for it... Mind you this only applies to version 1.1.4 (but could be applied to older ones).  Version 1.1.5+ will have this done already

In coppermine.php comment out the following lines:
line 100:  $this=""
line 131:  $this=""

if you want to play with the new cfimageget then comment out (in cfimageget.php)
line 147: $this=""


So AFAIK, this is now PHP5 compatible

:D

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

pierse

Well I upgraded to the latest dev release.... and now I get nothing.  the cftest.php works fine.  I no longer get my random image which I got to work previously, now it doesn't work at all.  :(  I do not get any errors.  just a blank page.  where I had the random thumbnail now I get a small rectangle.  (inserted into a block using the *img* tag). I'm new to php and do not know the code that well.  I only got the thumbnail to work after hours of messing around and I suppose by chance it worked. 

yes...tiny portal is SMF. ;)

vuud

Quote from: pierse on March 09, 2005, 08:28:07 PM
Well I upgraded to the latest dev release.... and now I get nothing.  the cftest.php works fine.  I no longer get my random image which I got to work previously, now it doesn't work at all.  :(  I do not get any errors.  just a blank page.  where I had the random thumbnail now I get a small rectangle.  (inserted into a block using the *img* tag). I'm new to php and do not know the code that well.  I only got the thumbnail to work after hours of messing around and I suppose by chance it worked. 

yes...tiny portal is SMF. ;)

Okay, so this is being done in a tiny portal template?

Can you post the actual code you used here... are you using cfimageget.php?  If you are, you need to go into the file and enable direct access (instructions are in the file)?

One of the changes to cfimageget.php is that while it can start to support greater functionality, it had to become more secure.  So by default direct access ships as being off.





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

Joachim Müller

Quote from: pierse on March 09, 2005, 08:28:07 PM
Well I upgraded to the latest dev release
If you're refing to the coppermine devel version: there's no such thing as a dev release - it's a snapshot of the devel version that is available for experienced users who want to check out the new features. The downloadable file refered to on the 1.4 bugs board is quite old, make sure you have the most recent files from the devel branch of the cvs. Also you have to understand that the devel version comes with absolutely no support at all, so you're basically on your own.
If you're refering to the devel version of CoppermineFetch, please ignore this posting.

Joachim

n704fn

Quote from: pierse on March 09, 2005, 08:28:07 PM
Well I upgraded to the latest dev release.... and now I get nothing.  the cftest.php works fine.  I no longer get my random image which I got to work previously, now it doesn't work at all.  :(  I do not get any errors.  just a blank page.  where I had the random thumbnail now I get a small rectangle.  (inserted into a block using the *img* tag). I'm new to php and do not know the code that well.  I only got the thumbnail to work after hours of messing around and I suppose by chance it worked.  

yes...tiny portal is SMF. ;)

I too lost cfimageget functionality after upgrading.  I can still fetch photos to my other pages, but not using the new cfimageget or cfimageget_classic, which is strange, because I've compared files and they appear to be identical.  Once I replace the older files it works fine.  Not using any portal.

Mark
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.thechouinards.com%2Fcfetch%2Fcfig_random.php&hash=562ee9e4ceefcfa4cca83d45f784b926a8235733)

pierse

 I get no errors I only get nothingness. To test the cfimageget.php I would point my browser to http://www.mysite.com/gallery/cpmfetch/cfimageget.php and it loads nothing.  No errors. No image.

Since you are using the SMF Tiny Portal, when you go into the TPAdmin, you can add blocks.  I had a block that had a random thumbnail in it, using the img tag. 
Quote*img src="http://www.mysite.com/gallery/cpmfetch/cfimageget.php?size=thumb&album=1"*
.   (since update it doesn't work)  I was wanting to add under the random thumbnail, the gallery stats. 

I am using cpmfetch 1.1.4 dev.

vuud

Quote from: pierse on March 10, 2005, 03:09:20 PM
I get no errors I only get nothingness. To test the cfimageget.php I would point my browser to http://www.mysite.com/gallery/cpmfetch/cfimageget.php and it loads nothing.  No errors. No image.

Since you are using the SMF Tiny Portal, when you go into the TPAdmin, you can add blocks.  I had a block that had a random thumbnail in it, using the img tag. 
Quote*img src="http://www.mysite.com/gallery/cpmfetch/cfimageget.php?size=thumb&album=1"*
.   (since update it doesn't work)  I was wanting to add under the random thumbnail, the gallery stats. 

I am using cpmfetch 1.1.4 dev.

Since you did not mention it, I have to assume you missed it in my above posting (which in retrospect should have had more !!!!!!).  This is very important and I cannot help you if you do not check this.  So do this.  Now.  Make sure.

Open cfimageget.php in an editor and look near the top (around line 28 in version 1.1.4)

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


If use see it and it still looks like that, change it to this:


$ALLOW_DIRECT_ACCESS = true;


Until you do this, cfimageget.php is doing exactly what it should do.  The new alternative way is to create your own file to call it, as shown in the cfig_random.php file (basically its just settings you use, instead of a long URL to set categories and stuff).

Hope this helps you


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: n704fn on March 10, 2005, 09:21:07 AM
I too lost cfimageget functionality after upgrading.  I can still fetch photos to my other pages, but not using the new cfimageget or cfimageget_classic, which is strange, because I've compared files and they appear to be identical.  Once I replace the older files it works fine.  Not using any portal.
Mark

Mark,
See my post to pierse above...  the cfimageget.php file has changed and by default direct access as it was before is disabled.  Very easy to enable though.

Sorry for any confusion,

Bill
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