Album search results to be displayed as the albums from a category Album search results to be displayed as the albums from a category
 

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]

Main Menu

Album search results to be displayed as the albums from a category

Started by allvip, November 13, 2019, 01:30:00 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

allvip

Sorry for the late reply.
I left your topic in future request https://forum.coppermine-gallery.net/index.php/topic,79951.0.html
I only split my answer from the rest of the topic and moved visual.

TRY THIS

1) in tour_theme/theme.php


/******************************************************************************
** Section <<<pageheader>>> - START
******************************************************************************/
function pageheader($section, $meta = '')
{
    global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;

    $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

    $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

    header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
    header("Content-Type: text/html; charset=$charset");
    user_save_profile();

    $template_vars = array(
        '{LANG_DIR}' => $lang_text_dir,
        '{TITLE}' => theme_page_title($section),
        '{CHARSET}' => $charset,
        '{META}' => $meta,
        '{GAL_NAME}' => $CONFIG['gallery_name'],
        '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
        '{SYS_MENU}' => theme_main_menu('sys_menu'),
        '{SUB_MENU}' => theme_main_menu('sub_menu'),
        '{ADMIN_MENU}' => theme_admin_mode_menu(),
        '{CUSTOM_HEADER}' => $custom_header,
        '{JAVASCRIPT}' => theme_javascript_head(),
        '{MESSAGE_BLOCK}' => theme_display_message_block(),
    );
// START CUSTOM CODE
    global $cat, $CPG_PHP_SELF, $pid, $uid, $album, $cat_data, $CURRENT_ALBUM_DATA, $CURRENT_PIC_DATA;
$superCage = Inspekt::makeSuperCage();
    if ($cat < 0) {
        $what = 'alb_';
        $current_id = -$cat;
    } else {
        $what = 'cat_';
        $current_id = $cat;
    }
   // css mod - start
    if ($CPG_PHP_SELF == 'index.php' && $current_id == 0) {
      $bodyID = 'homePage';
} elseif ($CPG_PHP_SELF == 'index.php') {
      $bodyID = $what.$current_id;
} elseif ($CPG_PHP_SELF == 'thumbnails.php' && is_numeric($album)) {
      $bodyID = 'cat_' . $CURRENT_ALBUM_DATA['category'];
} elseif ($CPG_PHP_SELF == 'thumbnails.php' && !is_numeric($album)) {
      $bodyID = $album;
} elseif ($CPG_PHP_SELF == 'displayimage.php') {
      $bodyID = 'cat_' . $CURRENT_ALBUM_DATA['category'];
} elseif ($CPG_PHP_SELF == 'login.php') {
      $bodyID = 'loginPage';
} elseif ($CPG_PHP_SELF == 'search.php') {
      $bodyID = 'searchPage';
} elseif ($CPG_PHP_SELF == 'profile.php') {
      $bodyID = 'profilePage';
} elseif ($CPG_PHP_SELF == 'contact.php') {
      $bodyID = 'contactPage';
} elseif ($CPG_PHP_SELF == 'upload.php') {
      $bodyID = 'uploadPage';
} elseif ($CPG_PHP_SELF == 'usermgr.php') {
      $bodyID = 'usermgrPage';
} elseif ($CPG_PHP_SELF == 'pluginmgr.php') {
      $bodyID = 'pluginmgrPage';
} else {
      $bodyID = 'adminPage';
}
$template_vars['{BODYID}'] = $bodyID;
    if ($CPG_PHP_SELF == 'thumbnails.php' && is_numeric($album)) {
      $bodyCLASS = $what.$current_id;
} elseif ($CPG_PHP_SELF == 'displayimage.php') {
      $bodyCLASS = 'displayimage';
} else {
      $bodyCLASS = 'body-class';
}
$template_vars['{BODYCLASS}'] = $bodyCLASS;
    // css mod - end
    $template_vars = CPGPluginAPI::filter('theme_pageheader_params', $template_vars);
    echo template_eval($template_header, $template_vars);

    // Show various admin messages
    adminmessages();
}
/******************************************************************************
** Section <<<pageheader>>> - END
******************************************************************************/


2) in your_themename/style.css


#search .alblink  {
padding:0px;
}
#search .alblink a {
font: italic bold 14px 'Folio BQ', serif;
    text-transform: uppercase;
text-decoration: none;
    color:#0051ba;
    transition: 0.5s;
background-color:transparent;
}
#search .image {
    max-width: 120px;
padding:0px 5px;
height: auto;
max-width: 170px;
transition: 0.5s;
}
#search .tableh1 {
    padding: 5px 15px 15px;
   font: italic bold 14px 'Folio BQ';
   letter-spacing: 1px;
   background:#f3f3f3;
   text-transform: uppercase;
   color:#f297a2;
   white-space: unset !important;
   word-break: normal;
}
#search .tableh2,
#search a,
#search .image {
    padding: 0px 5px;
}


3) template.html

<body> to


<body id="{BODYID}" class="{BODYCLASS}">

Sweetener

This is such a good idea, I hope coppermine developers will look at this and put it in the original version. A body class like wordpress does will allow us to customize more our themes.

allvip


allvip

Quote from: Sweetener on November 13, 2019, 02:17:32 PM
A body class like wordpress does will allow us to customize more our themes.

The code I give you has id:
home Page for index
cat_1, cat_2 etc for index.php?cat=2 etc and the albums in the cats thumbnails.php

and clases alb_1 for thumbnails.php?album=1 etc
and for displayimage.php has the cat_2 id and displayimage class if is part of cat 2

lastuplod have lastup, last comments has lastcom etc

Imspect with firefox inspect every page


allvip

ADD in style.css


#search .tableh2,
#search a,
#search .image {
    padding: 0px 5px;
}


Let me know what EXACTLY IS MISSING TO BE THE WAY YOU WANT.

Sweetener

Quote from: allvip on November 13, 2019, 03:54:47 PM
The code I give you has id:
home Page for index
cat_1, cat_2 etc for index.php?cat=2 etc and the albums in the cats thumbnails.php

and clases alb_1 for thumbnails.php?album=1 etc
and for displayimage.php has the cat_2 id and displayimage class if is part of cat 2

lastuplod have lastup, last comments has lastcom etc

Imspect with firefox inspect every page


The albums gets this class "cat_CATID" instead of "alb_ALBID"

allvip