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: [Solved]: Looking for someone to hack and skip an album page with 1 album  (Read 3064 times)

0 Members and 1 Guest are viewing this topic.

tadasp

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Tauta, inc

This solution used to work with 1.3 coppermine but not with 1.4.x

I don't realy understand why is this does not work with newer version of coppermine ... could anyone take a look at this issue?


--------------------

It used to work with Coppermine 1.3.

Open index.php

search

Code:

$link = "<a href=\"index.php?cat={$subcat['cid']}\">{$subcat['name']}</a>";


replace with

Code:

// add by kak - to detect ???

          $sql = "SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} as a WHERE category = {$subcat['cid']}".$unaliased_album_filter;
                $result = db_query($sql);               
                $row = mysql_fetch_array($result);                       
          if ($album_count == 1) $link = "<a href=\"thumbnails.php?album={$row['aid']}\">{$subcat['name']}</a>";             
                else $link = "<a href=\"index.php?cat={$subcat['cid']}\">{$subcat['name']}</a>";           
// end
----------------------------------------


             
« Last Edit: June 05, 2008, 01:11:41 pm by Joachim Müller »
Logged

foulu

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 236
  • uhm
Re: Looking for someone to hack and skip an album page with 1 album
« Reply #1 on: June 05, 2008, 10:51:10 am »

Well, changes:

Quote
// add by kak - detect if this category have 1 album || not

          $sql = "SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} as a WHERE category = {$subcat['cid']}".$unaliased_album_filter;
                $result = db_query($sql);               
                $row = mysql_fetch_array($result);                       
          if ($album_count == 1) $link = "<a href=\"thumbnails.php?album={$row['aid']}\">{$subcat['name']}</a>";             
                else $link = "<a href=\"index.php?cat={$subcat['cid']}\">{$subcat['name']}</a>";           
// end

to

Quote
                // add by kak - detect if this category have 1 album || not                                       
                if ($album_count == 1) {
                    $sql = "SELECT aid FROM {$CONFIG['TABLE_ALBUMS']} as a WHERE category = {$subcat['cid']}".$unaliased_album_filter;
                    $result = cpg_db_query($sql);               
                    $row = cpg_db_fetch_row($result);
                    $link = "<a href=\"thumbnails.php?album={$row['aid']}\">{$subcat['name']}</a>";
                } else {
                    $link = "<a href=\"index.php?cat={$subcat['cid']}\">{$subcat['name']}</a>";
                }
                // end

tadasp

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • Tauta, inc
Re: Looking for someone to hack and skip an album page with 1 album
« Reply #2 on: June 05, 2008, 12:01:05 pm »

gracias senior!!!  ;D ;D ;D ;D ;D

Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.