This has propably been discussed before, but I tried to search it and I didn't find that good explanations, so I made my own and decided to share it with others :D
Tips
- To ease up setting this up, please install your coppermine to sub-directory called "gallery" under your tp installation. Other locations will do just fine also, but if you are not experienced with this, you might reach your goal easier by following instructions as they ask you to do. If you are a novice user, I suggest you test this first to brand new installation of smf and tp, by installing coppermine to gallery under root directory.
First, install cpmfetch to your coppermine installation.
What is cpmfetch?
It's a php utility to fetch media from coppermine so it can be displayed on locations outside coppermine. (for e.g. as a block in your tinyportal installation)
How to install it:
- Download it from http://cpmfetch.fistfullofcode.com/downloads/index.php (http://cpmfetch.fistfullofcode.com/downloads/index.php), latest version is okay (2.0 while writing this)
- Then extract it to somewhere and copy folder cpmfetch from package to coppermine's directory.
- Open your browser and point to your coppermine url+"/cpmfetch/install.php", something like this (it depends on the location of your coppermine installation)
http://localhost/gallery/cpmfetch/install.php
This would apply if your coppermine would be located on localhost under gallery..
- It should be installed if you see pictures fetched from your coppermine installation, if something went wrong, check what installer instructs you to do.
Okay, now you should have cpmfetch installed.
So, next we create blocks, use phpboxes.
Latest media
Title: Latest image
Content: echo '<center>'; include_once "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewLastAddedMedia(1,1);
$objCpm->cpm_close();
echo '</center>';
Random media
Title: Random image
Content: echo '<center>'; include_once "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
$objCpm->cpm_viewRandomMedia(1,1);
$objCpm->cpm_close();
echo '</center>';
parameters 1,1 tell how many pictures to display from gallery, first number is amount of columns and second is amount of rows..
That's all. If location of your coppermine is different, change these parts in both blocks:
echo '<center>'; include_once "./gallery/cpmfetch/cpmfetch.php";
$objCpm = new cpm("./gallery/cpmfetch/cpmfetch_config.php");
./gallery/ is supposed to be location of your coppermine installation. Remember that this is not supposed to be URL, this is supposed to be location on file-system of server. ( for e.g. c:/htdocs/coppermine or /var/www/htdocs/coppermine )
I posted an ugly screenshot of blocks to here too..
I just got this working. I'm pleased. Having the correct location was very important. Thanks for posting that distinction. I only wish that it showed the images with in a tiny portal center block when you click on them.
Before I was using an early code snipet to generate a random thumbnail in an html link which directed users to the gallery index with in an iframe using the code found here:
http://www.tinyportal.net/index.php?topic=5246.msg83008#msg83008
Quote from: JCphotog on June 28, 2007, 01:12:22 AM
I just got this working. I'm pleased. Having the correct location was very important. Thanks for posting that distinction. I only wish that it showed the images with in a tiny portal center block when you click on them.
Before I was using an early code snipet to generate a random thumbnail in an html link which directed users to the gallery index with in an iframe using the code found here:
http://www.tinyportal.net/index.php?topic=5246.msg83008#msg83008
You can make it to show images on a center block of tinyportal if you want to.
But you need to read guidance of cpmfetch and you need to have knowledge from PHP coding.. Maybe I someday will make that kind of block too when my work doesn't take all my time and if someone hasn't done that yet..
Glad you liked it.
fantastic!!!!! this was even easier then setting up the integration between coppermine and smf/tp!
is there any way to display the latest coppermine image in vertical layout instead of horizontal
You would have to edit the cpfetch file to do that.
Quote from: IchBinâ„¢ on July 05, 2007, 03:17:36 PM
You would have to edit the cpfetch file to do that.
You shouldn't need to.. Change the parameters, 1,1 in block means 1 block in vertical and 1 in horizontal, so 1,2 should show 2 images horizontally and 2,1 would show 2 images vertically if I remember it correctly.. Or did I mis-understand what this was about?
^that is what I am looking for, it is really work, thanks a lot jake. You are really great.
I tried this, sucessfully got the cpmfetch working, but it is showing this error when i try it in a phpbox
Fatal error: Cannot instantiate non-existent class: cpm in /home/pretende/public_html/testsmf/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 2
i copied and pasted the code from jake1981 for the random version, changing my path in both instances
any help greatly appreciated
thanks
jacci
Sounds to me like the include may have the wrong path if it can't find the class. Check your include path to make sure it is working right and set to the proper path.
Is there a way to also link back to the org image in CP from the thumb that's displayed in the block?
Quote from: dklassen on August 25, 2007, 02:17:05 AM
Is there a way to also link back to the org image in CP from the thumb that's displayed in the block?
Yes.
Quote from: jake1981 on September 05, 2007, 01:33:44 AM
Quote from: dklassen on August 25, 2007, 02:17:05 AM
Is there a way to also link back to the org image in CP from the thumb that's displayed in the block?
Yes.
Wow!.. that was.... Brilliant, Inspiring... *sniff* :'(
I'm touched..
Quote from: Zetan on September 05, 2007, 11:50:36 AM
Wow!.. that was.... Brilliant, Inspiring... *sniff* :'(
I'm touched..
Thanks, it's great that you appreciated my input. I already provided a solution that makes it possible to embed free open-source gallery in smf and I provided block to show thumbs from there in a block in tinyportal, what else do you need? Me to create a custom solution to fulfill everyone's needs? Really nice, I've made a second version of support files used in embedding process that work much better and even has some advanced options that change behaviour, unfortunately I was interested to provide some special features to it, so I won't be providing update or upgrade any time soon as it would need changes to theme to make them support these features.. And yes, new support files support multiple themes simultaneously and unfortunately it yet won't change theme used in cpg embedded, but it uses smf theme's css file so after all it could be compatible and provide a look of any SMF theme..
Anyway, what I earlierly provided can be thought as an inspiration or a startup for someone else's production
Me to modify it for every possible need that anyone here might need? Try to realize the fact that I already provided a simple solution to do this could inspire other people to create their own better versions.. And that's just it.
Thumbnails from cpg are provided with support of freely available cpmfetch library. It is not my product, I never have said anything that would make someone to think so, documentation about it is provided on their website or in a documentation in there, that's where I found about how to do this and it took 5 minutes for me to provide this solution, I don't remember website's address, but I'll give a tip: google. That'll give everyone a nice headstart especially now as I told that yes, it supports such feature, I just am not willing to study it's usage to provide this solution as copy-paste solution. And what comes to this feature, block I provided should link to original picture in gallery, atleast that way it works for me, it goes to gallery and displays that exact picture, and that's what I understood I was asked for, so "Yes" is correct answer. Check my sig if something still is not explained as everything has been expained as well as possible.
And if he meant something else by his question, here are rest of solutions:
Q: Can I make this block to work in that way that displayed image is being opened in fullsize/fullscreen in new window/tab/current window when it's been clicked
A:Yes you can, afaik, library supports such feature. How to do it? Go to their website and study and then create, library is complex, but using it has been made simple and easy. If you can read and can do even a simple block by yourself, you are capable to do this.
---
Q: Can I make picture to open in the "middle" frame on my tp when I click it without it forcing me to go to gallery?
A: Yes you can, but this is a bit more tricky, check first answer and then create new action to your index.php in boarddir that will handle showing of a picture in the middle frame, while there, you can also customize it a bit by setting a preset max width/height for image and so on, be creative..
---
Q: No, you still didn't understand what my point was, so..
A: Nevermind, you propably weren't asking for miracle, so I am pretty sure.. That library supports it and all you need to do is read the documentation about it and be creative. SMF is pretty simple and self-explanatory and you should easily be able to provide many kind of solutions for your needs.
And as you see.. Description of this board is very self-explanatory when it says:
this board is not for supportSo.. No support provided then :)
Better?