Alphabetical user galleries search Alphabetical user galleries search
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Alphabetical user galleries search

Started by jtorral, April 25, 2005, 07:08:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jtorral

I have 1800 albums with 1800 members. in photopost you can search for members albums by selecting the letter of the alphabet which corresponds to their name. I dont see that in CPG. Am I missing it?  Is there a way to look for a members album without scrolling through 300 pages of albums?

Thanks

Nibbler

Like this ?

Are you running bridged or unbridged installation of coppermine ?

jtorral

exact thing I am looking for. I am runing bridge with vbulletin.

Nibbler

I only have this available for 1.4, although it could be adapted for 1.3

udb_base.inc.php

find

        // Get the total number of users with albums
        $sql  = "select null ";
        $sql .= "from {$CONFIG['TABLE_ALBUMS']} as p ";
        $sql .= "where ( category>".FIRST_USER_CAT." $forbidden) ";
        $sql .= "group by category;";


change to

        // Get the total number of users with albums
        $sql  = "select null ";
        $sql .= "from {$CONFIG['TABLE_ALBUMS']} AS alb, {$this->usertable} LEFT JOIN {$CONFIG['TABLE_PICTURES']} AS p ON p.aid = alb.aid WHERE (category - ".FIRST_USER_CAT.")  = {$f['user_id']} ";
        $sql .= "AND ( category>".FIRST_USER_CAT." $forbidden) ";
        if ($l = $_GET['letter']) $sql .= "AND {$f['username']} LIKE '$l%' ";
$sql .= " $forbidden_with_icon group by category;";


themes.inc.php, find

    } else {
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
        $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d'));
    }


change to

    } else {
$pl =  $_GET['letter'] ? ('&letter=' . $_GET['letter']) : '';
        $theme_thumb_tab_tmpl['left_text'] = strtr($theme_thumb_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_thumb_view['user_on_page']));
        $theme_thumb_tab_tmpl['inactive_tab'] = strtr($theme_thumb_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d' . $pl));
        $theme_thumb_tab_tmpl['inactive_next_tab'] = strtr($theme_thumb_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d' . $pl));
        $theme_thumb_tab_tmpl['inactive_prev_tab'] = strtr($theme_thumb_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.php?cat=' . $cat . '&page=%d' . $pl));
    }


index.php, under

    $rowset = $cpg_udb->list_users_query($user_count);

add



// jump box extras begin
starttable('100%', 'Jump by username', 26);
echo '<tr>';
foreach (range('A', 'Z') as $letter){
echo '<td width="'.(100/26).'%" align="center"><a href="index.php?cat=1&letter='.$letter.'"> '.$letter.' </a></td>';
}
echo '</tr>';
endtable();
// jump box extras end

Konstantinos

#4
it looks it aint working for 1.4.2. for example when i press the letter w it sais there are no user galleries which is correct but when i press the letter b instead of showing only the albums that the user name starts with b it shows from many different letters ,

Nibbler