Title link list of all images without thumbnails Title link list of all images without thumbnails
 

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

Title link list of all images without thumbnails

Started by AK_CCM, June 22, 2006, 10:35:20 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

AK_CCM

Hello all,

I need an additional link list view without thumbnails of all pictures stored in our the gallery.

My first solution was the link list from fotofreek, which is already done. But this simple link list contains multiple entries per mushroom sort, for example:

QuoteCortinarius rubellus (Spitzgebuckelter Rauhkopf)
Cortinarius rubellus (Spitzgebuckelter Rauhkopf)
Cortinarius rubellus (Spitzgebuckelter Rauhkopf)

A better solution should be an unique entry and beyond the number of available pictures per mushroom sort e.g.

QuoteCortinarius rubellus (Spitzgebuckelter Rauhkopf) [3]

that links to a search with the strings "Cortinarius" AND "rubellus" AND "(Spitzgebuckelter" AND "Rauhkopf)" e.g.
thumbnails.php?album=search&type=full&search=Cortinarius+rubellus+(Spitzgebuckelter+Rauhkopf)

At the attached screenshot you can see an example of such a link list view.

I saw this feature on Fero Bednar's homepage. He wrote me, that a friend helps him to integrate this feature into CPG and he sents me the code of the function which is used for listing unique titles:

case 'list': // List unique titles fero
if ($ALBUM_SET && $CURRENT_CAT_NAME) {
$album_name = $lang_meta_album_names['list'].' -
'. $CURRENT_CAT_NAME;
} else {
$album_name = $lang_meta_album_names['list'];
}
$result = db_query("SELECT COUNT(*) from
{$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET");
$nbEnr = mysql_fetch_array($result);
$count = $nbEnr[0];
mysql_free_result($result);

if($select_columns != '*') $select_columns .= ', title';

$result = db_query("SELECT $select_columns FROM
{$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $ALBUM_SET ORDER BY
title ASC $limit");
$rowset = db_fetch_rowset($result);
mysql_free_result($result);

if ($set_caption) foreach ($rowset as $key => $row){
if ($row['user_id']) {
    $user_link = '<br /><a href
="profile.php?uid='.$row['user_id'].'">'.$row['user_name'].'</a>';
} else {
$user_link = '';
}
$caption = "<span
class=\"thumb_caption\">".localised_date($row['ctime'],
$lastup_date_fmt).$user_link.'</span>';
$rowset[$key]['caption_text'] = $caption;
}
return $rowset;
break;


He wrote also that the code is stored in /include/functions and his link list view /list.php is a modified /thumbnails.php.

The problem are my minimal knowledge on how to integrate this feature into our CPG148 installation.

Could anyone help me please?

regards AK

Paver

The code you posted from Fero Bednar is not the code used to create a unique list.  That code merely creates the list and would include duplicates.  I assume his list.php would consolidate that list.  That code is also from Coppermine 1.3.x and would not run on 1.4.x.  Some modifications would have to be made to that code to run in 1.4.x.  As you said, he also replaced thumbnails.php with list.php.

However, you already have what you want on your site, except for consolidating duplicate listings and creating a new link for each listing, correct?  You have created a new file fotoindex.php with fotofreek's code and it does what you want?  Or do you want to do what Fero Bednar has done and replaced all album thumbnail listings with simple text listings?  Those are two different things entirely.

Please specify what precisely you want.

AK_CCM

Thanks for your fast response. I want to replace /fotoindex.php (fotofreek's code) with a solution such as Fero Bednar (similar you can see at the screenshot in my initial post), because a link list with consolidated multiple entries is more clearly, especially in the case of growing numbers of pictures which are stored under identical title in the gallery.

Paver

I understand that's what you want to do.  But what you want to do is merely a slight modification of fotofreek's code.  Fero Bednar has a completely different use for such a listing.  So I don't think you understand the difference. 

fotofreek: lists all photos in all albums in a "table of contents"-sort of listing.  As such, it works fine in a separate file that you link as desired on your site.

Fero Bednar: for each album, lists the photos in that album only - this replaces the traditional thumbnails listing in Coppermine.

It seems to me that you want to keep the way Coppermine lets you browse categories, albums, and photos.  All you want is a better table of contents page that gives a unique listing with a link to the search page for each.

Is that correct?

AK_CCM

Yes, I want to keep the way Coppermine of browsing categories, albums and photos.
Fero didn't replace the traditional way of browsing, he adds an alternative view with an extra file:

Original browsing (thumbnails.php):
http://www.wnp.sk/thumbnails.php?album=18

Alternative browsing (list.php = modified thumbnails.php)
http://www.wnp.sk/list.php?album=18

But you're right: Fero's solution lists only the pictures of one album - I need the titles of ALL images in the gallery. Therefor the modified thumbnails.php shows the entries in columns and split them to more pages. OK, the last benefit is irrelevant. But a list with 2 columns can save much mouse scrolling, this feature seems to be useful. I don't know, which way is easier to adapt.

And absolutely correct: All I want is a better table of contents page with 2 columns to reduce the length of the page that gives an unique listing and beyond each title the number of available photos (with identical title) with a link to the search page for each.

I hope it's now clear? Thanks for your patience.

AK_CCM

Now I've modified fotofreek's code to link to a search page:

search for:
echo "<tr><td><a href=\"displayimage.php?pos=-$row[pid]\" title=\"$row[title]\">$row[title]</a></td><td>$row[caption]</td><td>$row[keywords]</td></tr>";


replace with:
echo "<tr><td><a href=\"thumbnails.php?album=search&type=AND&search=$row[title]\" title=\"$row[title]\">$row[title]</a></td><td>$row[caption]</td><td>$row[keywords]</td></tr>";

These changes are easy. But how could I get an unique listing?

Any hint would be great!

AK_CCM

Hello all,

because of my tiny PHP and MySQL knowledge I give it up to modify the code for showing the number of available photos with identical title beyond each title. In another forum an user advise me to do the changes with COUNT() and GROUP BY, but I don't know how I am to program that.

But I found a solution of an unique title listing.

Search for:

$result = mysql_query("
SELECT pid, aid, title, caption, keywords
from {$CONFIG['TABLE_PICTURES']}
order by title
");


replace with:

$result = mysql_query("
SELECT DISTINCT title
from {$CONFIG['TABLE_PICTURES']}
order by title
");


Here you can see the modified list:
http://www.pilze-augsburg.de/galerie/fotoindex.php

Regards, AK

AK_CCM

Hello all,

I've got some another problems related to the title link list:

1.) Unapproved pictures are listed in the title link list.
For example the title link "Cortinarius humicola":
http://www.pilze-augsburg.de/galerie/fotoindex.php

2.) Furthermore I detected a bug in the search function, because it founds pictures without upload approval:
http://www.pilze-augsburg.de/galerie/thumbnails.php?album=search&type=AND&search=Cortinarius%20humicola

3.) The 3rd problem are the search results of specific mushrooms (e.g. "Cortinarius humicola") with internet explorer:
The browser ignores the search string after the blank "%20" which is the same as a search with the type "OR" instead of "AND".
Please take a look to the attached screenshot. What's wrong with the search-link?

Could anyone help me please?

Regards, AK

Stramm

your question 1+2 seem similar to me. Also provate galleries would be shown with your queries. You'd need to modify your query so these pictures get excluded. Coppermine's using a function for that and the result is saved in the variable $FORBIDDEN_SET_DATA, $FORBIDDEN_SET and $ALBUM_SET

search the code on how to use this

I tried the provided link and get exactly 8 results for IE and firefox. So that seems to work

AK_CCM

Quote from: Stramm on July 10, 2006, 09:05:13 AM
your question 1+2 seem similar to me. Also provate galleries would be shown with your queries. You'd need to modify your query so these pictures get excluded. Coppermine's using a function for that and the result is saved in the variable $FORBIDDEN_SET_DATA, $FORBIDDEN_SET and $ALBUM_SET

search the code on how to use this

I think I'll fall with the coding because of my bad PHP and MySQL knowledge. But I'll try it.

QuoteI tried the provided link and get exactly 8 results for IE and firefox. So that seems to work

Strange. My Firefox (version 1.5) results only 2 hits as well Opera (version 8.5). Only the Internet Explorer (version 6.0) shows 8 search results. ???

I want search results of the exact phrase. Please open the search page, fill in "Cortinarius humicola" and choose the search type "AND". The search results will contain 2 mushroom pictures of the specific mushroom "Cortinarius humicola". That's right. But with the results of the search link with thumbnails.php will contain all mushroom pictures which contains "Cortinarius". That's wrong, because I choose the search type "AND" instead of "OR":
http://www.pilze-augsburg.de/galerie/thumbnails.php?album=search&type=AND&search=Cortinarius%20humicola

I've got no idea, what's wrong with the search link. :-[


AK_CCM

I don't understand what's going on. Apart from that I need a search function for searching with the exact phrase in the title data records. The parameter "type=AND" seems to don't work.

Could you give me a hint to fix that please?

AK_CCM

Hello all,

sorry for reactivating this topic but the problem with the wrong search results exists anymore. I hope that anyone could help me to solve the error. In the meantime I could specify the error replicable:

If I klick on the search link e.g. "Cortinarius rubellus (Spitzgebuckelter Rauhkopf)" at the fotoindex.php, the search will list all pictures which contain the search string "cortinarius". The 11 hits consist 1 picture of Cortinarius humicola, 4 pics of Cortinarius orellanus, 3 pics of Cortinarius rubellus, 1 pic of Cortinarius semisanguineus and 2 pics of Leucocortinarius bulbiger. But the search results should only contain the pics of Cortinarius rubellus. Current our gallery contains 3 pics of Cortinarius rubellus.

Now it's going crazy. If I make a search with search.php and klick after that on the search link at fotoindex.php, the results are correct: e.g. 3 hits with all pics of Cortinarius rubellus. Now the other search links also work correct. I can't understand that. Sorry.

Does anyone have an explanation for this phenomenon?

Regards, Andreas