Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: One page with a textlink to each photo  (Read 22565 times)

0 Members and 1 Guest are viewing this topic.

fotofreek

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 23
    • http://www.victorbos.nl/
One page with a textlink to each photo
« on: March 09, 2004, 10:31:37 am »

As sort of a 'table of contents' it would be nice to have one page that has links to each photo that is in the database. Because thumbnails would load too slow, textlinks would do like:
<a href="#URL to single photo page#>#photo-title#</a>
Is this done before?
If not, I am willing to do some work myself. I am a programmer, but not in PHP  :(  so some hints to create a link like this would be great.

fotofreek
« Last Edit: May 05, 2006, 04:59:37 pm by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
One page with a textlink to each photo
« Reply #1 on: March 10, 2004, 12:31:45 am »

this hasn't been done yet; your work'd be appreciated. Take a look at the existing code, should give you an idea how to accomplish this...

GauGau
Logged

fotofreek

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 23
    • http://www.victorbos.nl/
One page with a textlink to each photo
« Reply #2 on: March 10, 2004, 08:19:23 am »

I already have it running; it took me less than an hour without having any PHP knowledge before. CPG is so well designed and programmed that it is quite easy to find the examples needed to build new functionality!
You can see it running:

http://www.victorbos.nl/photoindex.php

One of the reasons I wanted this is to make it easy for google to index all photos and their descriptions and keywords, so I added both to the table.

Here is the code:
Code: [Select]
<?php 
define
('IN_COPPERMINE'true);

require(
'include/init.inc.php');
pageheader(Fotoindex);

// Select all photos
$result mysql_query("SELECT a.pid, a.aid, a.title, a.caption, a.keywords, b.title atitle from {$CONFIG['TABLE_PICTURES']} a, {$CONFIG['TABLE_ALBUMS']} b where a.aid = b.aid order by a.aid, a.pid desc");
if (!
mysql_num_rows($result)) cpg_die(ERROR$lang_errors['non_exist_ap']);

$p_aid = -;

// Result to table
starttable("100%"Fotoindex3);

   while (
$row mysql_fetch_array($result)) 
        { 
                if (
$row[aid] != $p_aid) {
                  echo 
"<tr><td class=\"tableh2\" colspan = \"3\">$row[atitle]</td></tr>" ;
            }
            
// weer geef de data 
            
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>"
       
$p_aid $row[aid] ;
    } ; 
// while
                
endtable();
pagefooter();
?>

greets,

fotofreek
« Last Edit: September 19, 2004, 05:22:46 pm by Casper »
Logged

fotofreek

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 23
    • http://www.victorbos.nl/
One page with a textlink to each photo
« Reply #3 on: March 18, 2004, 01:17:07 pm »

Updated the code above today, to fix a potential problem with the links.

fotofreek.
Logged

kaitou

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
One page with a textlink to each photo
« Reply #4 on: March 18, 2004, 07:39:34 pm »

Heh, thats a cool mod.. my only problem is that with 27,000 pics, even text links take a little time to load  :D  :D
Wonder if it could be split up into pages?

(heh and as an aside, would be interesting if there was some way of making more of the gallery more search engine friendly..  A lot of spiders don't bother with something.php?id=4 and something.php?id=5, which is annoying)
Logged
(http://www.tuxedomask.com/sig/sigbox.jpg)

DefenceTalk.com

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 230
    • http://www.defencetalk.com
Re: One page with a textlink to each photo
« Reply #5 on: September 07, 2004, 05:57:09 pm »

I've got this mod running here:

http://www.defencetalk.com/pictures/photoindex.php

How can I also have ALBUM names linked as well?

Thanks!
Logged
(http://www.defencetalk.com/pictures/signature_cpg.php)

JJ Photo

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 36
Re: One page with a textlink to each photo
« Reply #6 on: October 01, 2004, 04:15:43 am »

Great! Works for me.  Thank you.
Logged

snork13

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 260
  • Internet! Is that thing still around?
    • Gallery
Re: One page with a textlink to each photo
« Reply #7 on: October 01, 2004, 05:56:17 am »

Nice work for a programmer ;) working great, would be better if I actually named all the fotos :-\\

snork13

http://gallery.snork13.net/fotoindex.php
Logged

will

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 263
Re: One page with a textlink to each photo
« Reply #8 on: July 10, 2006, 01:48:11 pm »

How would I get this for every album & on the main gallery page ???

Any help would be great.

Regards, will ;D
Logged

Pascal YAP

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: fr
  • Offline Offline
  • Gender: Male
  • Posts: 13833
  • Hello World :-)
    • CPG 1.5.x ExperiMental website
Re: One page with a textlink to each photo
« Reply #9 on: August 07, 2006, 08:02:28 pm »

Mornin',

This topic and MOD in French board too. Thanx to fofofreek  ;D

PYAP
Logged

Davide Renda

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1427
  • aka "Lontano"
    • www.daviderenda.eu
Re: One page with a textlink to each photo
« Reply #10 on: August 08, 2006, 07:29:10 pm »

seems weird, but on my gallery it only gives a blank page!
see http://www.daviderenda.com/sitemap.php

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Re: One page with a textlink to each photo
« Reply #11 on: August 09, 2006, 09:03:54 am »

to respect private albums the query should be modified as follows
Code: [Select]
$album_filter = '';
if($FORBIDDEN_SET){
$album_filter = ' and ' . str_replace('p.', 'a.', $FORBIDDEN_SET);
}
$result = mysql_query("SELECT a.pid, a.aid, a.title, a.caption, a.keywords, b.title atitle from {$CONFIG['TABLE_PICTURES']} a, {$CONFIG['TABLE_ALBUMS']} b where a.aid = b.aid $album_filter order by a.aid, a.pid desc");
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 6006
Re: One page with a textlink to each photo
« Reply #12 on: August 09, 2006, 09:12:09 am »

seems weird, but on my gallery it only gives a blank page!
see http://www.daviderenda.com/sitemap.php

I'd say you're galley has to many pics to hold all the data or php mem per session isn't enough.
Solution: Introduce pagination (some limit, if it's more pics then start a new site)

Test this with adding eg. LIMIT 100 to the query
Code: [Select]
... desc LIMIT 100");
Logged
my CPG sandbox: Version 1.4.18 with modpack running my Tentacle theme:
http://stramm.st.funpic.org/

sguler

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: One page with a textlink to each photo
« Reply #13 on: October 30, 2006, 08:56:26 am »

That's really nice mod, but I cant get it worked on my site.
http://forums.racingvideoz.com/gallery/sitemap.php
Can someone help me? ???
Thanks
Logged

Nibbler

  • Guest
Re: One page with a textlink to each photo
« Reply #14 on: October 30, 2006, 10:59:40 pm »

Try changing

Code: [Select]
mysql_query
to

Code: [Select]
cpg_db_query
;)
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 21 queries.