Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Title link list of all images without thumbnails  (Read 6508 times)

0 Members and 1 Guest are viewing this topic.

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Title link list of all images without thumbnails
« on: June 22, 2006, 10:35:20 pm »

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:

Quote
Cortinarius 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.

Quote
Cortinarius 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:

Code: [Select]
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
« Last Edit: June 22, 2006, 11:11:36 pm by AK_CCM »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Title link list of all images without thumbnails
« Reply #1 on: June 22, 2006, 11:51:42 pm »

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.
Logged

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Re: Title link list of all images without thumbnails
« Reply #2 on: June 23, 2006, 12:44:49 am »

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.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: Title link list of all images without thumbnails
« Reply #3 on: June 23, 2006, 12:51:15 am »

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?
Logged

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Re: Title link list of all images without thumbnails
« Reply #4 on: June 23, 2006, 01:42:08 am »

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.
Logged

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Re: Title link list of all images without thumbnails
« Reply #5 on: June 25, 2006, 07:29:57 am »

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

search for:
Code: [Select]
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:
Code: [Select]
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!
Logged

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Re: Title link list of all images without thumbnails
« Reply #6 on: July 06, 2006, 09:11:06 pm »

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:

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

replace with:

Code: [Select]
$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
Logged

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Problems with the title link list and the search function
« Reply #7 on: July 10, 2006, 08:46:24 am »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Title link list of all images without thumbnails
« Reply #8 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 tried the provided link and get exactly 8 results for IE and firefox. So that seems to work

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Re: Title link list of all images without thumbnails
« Reply #9 on: July 10, 2006, 09:45:29 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.

Quote
I 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. :-[
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Re: Title link list of all images without thumbnails
« Reply #11 on: July 10, 2006, 12:23:40 pm »

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?
Logged

AK_CCM

  • Coppermine regular visitor
  • **
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 63
  • Mushroom Hobby Photograph
    • Ent◊l◊ma.de – Rötlinge, Wiesenpilze und andere Schwammerln
Re: Title link list of all images without thumbnails
« Reply #12 on: March 25, 2007, 08:27:16 pm »

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
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 21 queries.