How to define images as "frontpage highlights" ? How to define images as "frontpage highlights" ?
 

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

How to define images as "frontpage highlights" ?

Started by radianation, March 22, 2009, 07:25:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

radianation

I have a coppermine gallery that I want to feed images into a custom module on my homepage. It will first be pulling from the last uploads functionality, but I would like to take it a step further and selectively define images to be included in this last uploads list. So, for example - I upload 10 images to the site. Right now, all 10 would be eligible to be displayed in the last uploads feature. I would like to modify the file data for the 10 images and selectively flag 4 of the 10 that should be showcased. Now it will search through the last uploads (by date) and only pull from the 4 flagged.

I can create this feature if it doesn't already exist. I've not seen it so far in my searches, but I wanted to check here first. Perhaps there is another way to achieve this without hacking the system? Maybe I can use a custom keyword field as the check? If the keyword exists or says "highlight" I will pull from it? Any help is appreciated.

Joachim Müller

So basically you're trying to display content taken from Coppermine on non-coppermine-driven pages? That's what we call content syndication - there's an entire mod board dedicated to mods that deal with that sort of hacks. The devs team recommends using cpmFetch. To flag particular records, you'd have to add database fields and come up with corresponding user interface code, which will require some skills. This is a bit beyond what you can expect from regular support. As a workaround, you might (ab)use the keyword feature - that's what I do on my personal gallery: I use keywords that nobody would enter to create "meta-albums" that I can search for. Assigning a keyword like "Holiday2009AprilFranceParisChampsElysees" to 8 out of 10 pics in an album will give you the power to use that as meta album (search result).

radianation

I ended up using the keyword feature and wrote some custom PHP code that dips into the coppermine and displays the most recent 4 items tagged with the specific keyword in user4 column. Works like a charm.

Fabricio Ferrero

If you are agree you could share it attaching the file to your next post or creating a new topic explaining what you did and a mod would move to the Mod's and Hacks sub-boards.
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

radianation

Yes, and I have actually experienced a bug with my fix that has been posted before on this site but I can't seem to locate the solution.

In your configuration setup a custom description field (user1 - user4). Then tag your images that you want to be highlights in the properties with a special keyword in the user description you enabled. I am using user4 and the keyword is "yes" ... So now I construct a string:

http://www.yoururl.com/coppermine/thumbnails.php?album=search&search=yes

The problem I have is that if a user has not previously searched the forum and checked the box for the user4 field to include it in searches then Coppermine returns no results.

My custom code for a homepage module works kind of like this (Joomla using modphp):

$database->setQuery("SELECT * FROM cpg140_pictures WHERE user4='yes' '' ORDER BY ctime DESC");

Then I just spit out the results in a little module, showing thumbnails and titles and making them clickable to go right into the gallery.

I have tried to figure out a URL to construct that includes user4 by default to no avail, and I've tried to hack the associated search files without success (yet) to make user4 a default field to search when getting a string from the URL. Any help is appreciated and then I can polish up this post and make it a hack thread.


radianation

Ok, in order to make the URL search work I made the following change on the search.init.inc

if (!isset($USER['search']['params'])){
        $USER['search']['params']['title'] = $USER['search']['params']['caption'] = $USER['search']['params']['keywords'] = $USER['search']['params']['filename'] = 1;
}


to

if (!isset($USER['search']['params'])){
        $USER['search']['params']['title'] = $USER['search']['params']['caption'] = $USER['search']['params']['keywords'] = $USER['search']['params']['filename'] = $USER['search']['params']['user4'] = 1;
}