News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

Recent posts

#1
cpg1.6 themes (visuals) / Masonry View Code
Last post by donsenilo - Yesterday at 10:01:56 PM
I created this Code (with a little Help of A.I.) to change the Appearance of the Thumbnails.
It works and looks good (for me), so maybe someone would find it useful.

I created a new Theme using the water_drop as Source. Here is my Site if you wanna have a look: https://myasa.eu/.

This Code goes at the End of the theme.php (but before the //EOF):
/******************************************************************************
 ** Section <<<theme_display_thumbnails>>> - ABSOLUT KRISENSICHERES MASONRY LAYOUT
 ******************************************************************************/
function theme_display_thumbnails(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $page, $total_pages, $sort_options, $display_tabs, $mode = 'thumb', $date = '')
{
    global $CONFIG;

    if ($nbThumb == 0) {
        theme_no_img_to_display($album_name);
        return;
    }

    // 1. Start des Masonry-Containers
    echo '<div class="cpg_masonry_container">';

    // 2. Loop durch alle Bilder
    foreach ($thumb_list as $thumb) {
        echo '<div class="cpg_masonry_brick">';
       
        // KRISENSICHERER LINK-BAU: Wir generieren die displayimage.php URL direkt aus der Bild-ID (pid)
        if (!empty($thumb['pid'])) {
            $image_url = "displayimage.php?album=" . $aid . "&amp;pid=" . $thumb['pid'];
            echo '<a class="cpg_masonry_link" href="' . $image_url . '">' . $thumb['image'] . '</a>';
        } else {
            // Fallback, falls keine PID existiert (gibt zumindest das Bild aus)
            echo $thumb['image'];
        }
       
        // Bildunterschrift (Dateiname, Bewertungen etc.)
        if (!empty($thumb['caption'])) {
            echo '<div class="cpg_caption">' . $thumb['caption'] . '</div>';
        }
       
        // Admin-Knöpfe für Bearbeiten/Löschen (falls eingeloggt)
        if (!empty($thumb['admin_menu'])) {
            echo '<div class="cpg_admin_menu">' . $thumb['admin_menu'] . '</div>';
        }
       
        echo '</div>';
    }

    echo '</div>';

    // 3. Seitennummerierung (Pagination)
    if ($display_tabs && $total_pages > 1) {
        echo '<div class="cpg_pagination">';
        theme_display_video_tabs($total_pages, $page, $mode);
        echo '</div>';
    }
}
This goes into the style.css:
/* Setzt umschließende System-Tabellen vollständig zurück */
.thumbnails,
.thumbnails > table,
.thumbnails > table > tbody > tr > td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

/* Der Hauptcontainer erzeugt das Spalten-Layout */
.cpg_masonry_container {
    display: block !important;
    column-count: 4 !important;
    column-gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 20px auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Jede einzelne Kachel */
.cpg_masonry_brick {
    display: inline-block !important;
    width: 100% !important;
    margin-bottom: 20px !important;
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    padding: 12px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    break-inside: avoid !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 4px;
}

/* Der neue, direkte Link umschließt das Bild perfekt */
a.cpg_masonry_link {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    cursor: pointer !important;         /* Erzwingt das Hand-Symbol */
    text-decoration: none !important;
}

/* Das Bild innerhalb des Links zentrieren */
a.cpg_masonry_link img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    border: none !important;
}

/* Bildtitel und Beschreibung */
.cpg_caption {
    margin-top: 10px !important;
    font-size: 11px !important;
    color: #555 !important;
    line-height: 1.4 !important;
}

/* Admin-Menü falls eingeloggt */
.cpg_admin_menu {
    margin-top: 10px !important;
    font-size: 10px !important;
}

/* RESPONSIVE STEUERUNG */
@media (max-width: 1200px) { .cpg_masonry_container { column-count: 3 !important; } }
@media (max-width: 768px)  { .cpg_masonry_container { column-count: 2 !important; } }
@media (max-width: 480px)  { .cpg_masonry_container { column-count: 1 !important; } }
#2
cpg1.6 bridging / Re: Converting MyBB to SMF
Last post by Krash - Yesterday at 01:10:59 AM
Fixed the login problem by enabling subdomain independent cookies in SMF.  Not sure why that worked, Coppermine is installed in subdirectory in forum.

The update ran correctly.  Bridge is working with hacks posted above.  May be able to get original admin's login, but it's ok as is.

Thanks for the info.

#3
cpg1.6 bridging / Re: Converting MyBB to SMF
Last post by phill104 - September 15, 2026, 01:15:26 PM
The login should use the SMF login, that is the expected behaviour. Once logged in at the correct level in SMF you should also be logged into CPG.

If you search these forums there are many posts on recovering a lost admin account. probably best to start there. Once your admin account is restored you can use bridemgr as expected and also run update.php

You can also disable bridging via PHPmyadmin. Browse to the config table and disable bridging there by changing the 1 to a 0 in the bridged_enable entry
#4
cpg1.6 bridging / Re: Converting MyBB to SMF
Last post by Krash - September 15, 2026, 05:22:03 AM
Ok, believe I've upgraded CM to current version 1.6.29 in the production forum.  The update failed, apparently because it was still bridged to MyBB.  Tried bridgemgr.php script but it requires login by whomever originally installed the gallery long ago.  So I hacked the code in smf21.inc.php, hacked the database, and it displayed update progress screen and showed it completed. 

Upgraded CM is apparently now bridged to SMF.  Everything seems to be working, database has been updated, gallery is intact, but we're back to the original problem, CM does not recognize SMF login.  I'm unable to login to CM to access bridge manager, members cannot login to CM.  The CM login redirects to SMF.

Had the same login problem on the acfsmf clone, fixed it by deleting and reinstalling CM, but every time I do something it's different.  Hesitate to try that in production with the hacks in place.

smf21.inc.php hack -


        function __construct()
        {
            global $BRIDGE;

            if (!USE_BRIDGEMGR) {
                require_once('../smf/Settings.php');
                $boardurl = 'http://www.mysite.com/board';
            } else {
            //  require_once($BRIDGE['relative_path_to_config_file'] . 'Settings.php');
                require_once('/home/u0fgcfwp0drf/domains/australian-coins.net/public_html/Settings.php');
            }


Database hack -


short_name    smf21

#5
cpg1.6 bridging / Re: Converting MyBB to SMF
Last post by Krash - September 15, 2026, 04:18:52 AM
Quote from: Krash on September 15, 2026, 04:15:35 AMOk, here's the problem.  Forum has been converted from MyBB to SMF.  Coppermine is still bridged to MyBB.  When I run update.php it errors out with this -


Fatal error: Uncaught Error: Failed opening required '../inc/config.php' (include_path='.:/opt/alt/php80/usr/share/pear:/opt/alt/php80/usr/share/php:/usr/share/pear:/usr/share/php') in /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/bridge/mybb.inc.php:56 Stack trace: #0 /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/bridge/mybb.inc.php(213): cpg_udb->__construct() #1 /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/include/init.inc.php(246): require_once('/home/u0fgcfwp0...') #2 /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/update.php(23): include_once('/home/u0fgcfwp0...') #3 {main} thrown in /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/bridge/mybb.inc.php on line 56


Can't load CM to get into bridge manager.  Can't login to bridgemgr.php because original install was done years ago by another admin.  I need to change the bridge from MyBB to SMF by manually editing the files, but can't find it.



#6
cpg1.6 bridging / Re: Converting MyBB to SMF
Last post by Krash - September 15, 2026, 04:15:35 AM
Ok, here's the problem.  Forum has been converted from MyBB to SMF.  Coppermine is still bridged to MyBB.  When I run update.php it errors out with this -


Fatal error: Uncaught Error: Failed opening required '../inc/config.php' (include_path='.:/opt/alt/php80/usr/share/pear:/opt/alt/php80/usr/share/php:/usr/share/pear:/usr/share/php') in /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/bridge/mybb.inc.php:56 Stack trace: #0 /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/bridge/mybb.inc.php(213): cpg_udb->__construct() #1 /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/include/init.inc.php(246): require_once('/home/u0fgcfwp0...') #2 /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/update.php(23): include_once('/home/u0fgcfwp0...') #3 {main} thrown in /home/u0fgcfwp0drf/domains/australian-coins.net/public_html/gallery/bridge/mybb.inc.php on line 56


Can't load CM to get into bridge manager.  I need to change the bridge from MyBB to SMF by manually editing the files, but can't find it.


#7
cpg1.6 bridging / Re: Converting MyBB to SMF
Last post by ron4mac - September 14, 2026, 05:01:38 PM
If you upgrade your gallery, AFAIK, you can bridge with SMF 2.1 regardless whether you've previously bridged with MyBB. Steps you should take: unbridge your current 1.6.03 gallery; use the installer_stub (found in this forum or with the Github release files) to upgrade your gallery to 1.6.29; establish the bridge to SMF 2.1.
#9
cpg1.6 bridging / Converting MyBB to SMF
Last post by Krash - September 13, 2026, 08:30:47 PM
Unable to start new topic in cpg1.6 bridging board, so I'm posting here.  Converted an old MyBB forum to SMF 2.1.7.  A major part of the forum content is in a Coppermine 1.6.03 install which was bridged to MyBB 1.8.12.  The Coppermine install includes bridge files for SMF 1.0 and 2.0, not 2.1.  Current Coppermine version is 1.6.29, haven't looked at it yet.

Before I spend a lot of time on this, is it possible to bridge Coppermine to SMF 2.1 if it's already been bridged to MyBB?

#10
cpg1.6 themes (visuals) / Re: How to hide album stats in...
Last post by FrA1l3 - September 11, 2026, 12:27:29 AM
Quote from: ron4mac on March 06, 2026, 07:05:39 PMOr you can, in the theme's style.css file, find (or add if not present) an entry for .album_stat and add display:none to it.
.album_stat {
    ...
    ....
    display: none;
}


this is the best and cleanest solution

Also with this modification, I should recommend to change the parameter "Size of album thumbnails" at least to 200px ( by default is 120px )

 Thank you so much!