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 [2]   Go Down

Author Topic: Custom Sidebar only on the homepage  (Read 8009 times)

0 Members and 1 Guest are viewing this topic.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Custom Sidebar only on the homepage
« Reply #20 on: October 09, 2013, 09:08:52 pm »

thanks a lot Niecher for the class ideea
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Custom Sidebar only on the homepage
« Reply #21 on: October 09, 2013, 09:11:41 pm »

I never would of thing to replace style="{CPG_MAIN_BLOCK_OUTER_STYLE} from Andre code with class="cpg_main_block_outer_style"
I'm so happy and greatfull for your help

thank youuuuuuuuuuu
was very important for my new theme
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Custom Sidebar only on the homepage
« Reply #22 on: October 10, 2013, 10:34:07 am »

I don't understand what you did, respectively why you did it that way. Your solution will return
Code: [Select]
    <div id="cpg_main_block_outer" class="cpg_main_block_outer_style">
    <div id="cpg_main_block_outer" >
        <div class="cpg_main_block_inner">
            {GALLERY}
            <br /> <!-- workaround for issue 64492 - do not remove the line break! -->
        </div>
    </div>
on index.php. As you can see, you now have 2 cpg_main_block_outer blocks and I assume, only one of them get closed.


My idea was to use inline CSS instead of a new class and an additional div block. I.e. the token in
Code: [Select]
<div id="cpg_main_block_outer" style="{CPG_MAIN_BLOCK_OUTER_STYLE}">will be replaced the following way:
Code: [Select]
    global $CPG_PHP_SELF;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'index.php' && !count($superCage->get->_source)) {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = 'width: 60%';
    } else {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = '';
    }

I recommend to use that solution to get valid HTML code.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Custom Sidebar only on the homepage
« Reply #23 on: October 10, 2013, 01:44:36 pm »

I think I don't understand where to put the code:

replace in template.html:

Code: [Select]
<div id="cpg_main_block_outer" >
        <div class="cpg_main_block_inner">
            {GALLERY}
            <br /> <!-- workaround for issue 64492 - do not remove the line break! -->
        </div>
    </div>

with:

Code: [Select]
<div id="cpg_main_block_outer" style="{CPG_MAIN_BLOCK_OUTER_STYLE}">

and add under function pageheader in theme.php:

Code: [Select]
    global $CPG_PHP_SELF;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'index.php' && !count($superCage->get->_source)) {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = 'width: 60%';
    } else {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = '';
    }
every time I delete:
[code]
<div id="cpg_main_block_outer" >
        <div class="cpg_main_block_inner">
            {GALLERY}
            <br /> <!-- workaround for issue 64492 - do not remove the line break! -->
        </div>
    </div>
I get the result from the attachment.
[/code]
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Custom Sidebar only on the homepage
« Reply #24 on: October 10, 2013, 01:50:49 pm »

Please try to comprehend how this mod is supposed to work before randomly applying or replacing anything.

Here again the complete mod, expecting an unmodified gallery:

Open your theme's template.html file, find
Code: [Select]
<div id="cpg_main_block_outer">(just this line!) and replace with
Code: [Select]
<div id="cpg_main_block_outer" style="{CPG_MAIN_BLOCK_OUTER_STYLE}">
Now, open your theme's theme.php file and add the following code to the pageheader function:
Code: [Select]
    global $CPG_PHP_SELF;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'index.php' && !count($superCage->get->_source)) {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = 'width: 60%';
    } else {
        $template_vars['{CPG_MAIN_BLOCK_OUTER_STYLE}'] = '';
    }
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Custom Sidebar only on the homepage
« Reply #25 on: October 10, 2013, 01:55:39 pm »

ok.it works perfect.thans a looooooooooooot.
boy I such and idiot
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Custom Sidebar only on the homepage
« Reply #26 on: October 10, 2013, 01:57:41 pm »

 boy I am such an idiot
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Custom Sidebar only on the homepage
« Reply #27 on: October 10, 2013, 02:10:47 pm »

please delete all my 2 pages post
how will want to use your code will have to read 2 pages of wrong posts
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Custom Sidebar only on the homepage
« Reply #28 on: October 10, 2013, 02:15:47 pm »

I just added a link to the solution to my second reply.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Custom Sidebar only on the homepage
« Reply #29 on: October 10, 2013, 02:21:11 pm »

great.thanks
Logged
Pages: 1 [2]   Go Up
 

Page created in 0.025 seconds with 20 queries.