Subject: Denim theme variation issue on user settings page

Posted on: 17/12/15 11:39am
By: ::Ben

I just made a custom theme based on Denim theme. Everything seems to be ok, but user settings page is not complete. Footer is missing on http://geeklog.fr/usersettings.php

If I revert to Denim theme, the page is display correctly. Strange...

Re: Denim theme variation issue on user settings page

Posted on: 17/12/15 02:52pm
By: Laugh

Are you using custom user setting templates? If so you may be missing a div somewhere. Some weird things can happen if you miss closing a div. Big Grin

Re: Denim theme variation issue on user settings page

Posted on: 17/12/15 04:48pm
By: ::Ben

No custom user setting templates and it's working perfectly on my local computer.
I uploaded again the denim theme and my theme variation folder but still get this issue Frown

It's not a browser issue. Code of the page stop with the end of the preferences/profile.thtml file. Very very strange Geek

Re: Denim theme variation issue on user settings page

Posted on: 18/12/15 07:06am
By: Laugh

Did you want to send me the theme to take a quick look?

Re: Denim theme variation issue on user settings page

Posted on: 18/12/15 11:22am
By: ::Ben

Yes Tom, you can download the theme here. Also, feel free to test the theme settings on the main "Command & Control" page.

Re: Denim theme variation issue on user settings page

Posted on: 18/12/15 11:58am
By: Laugh

The footer and left column are missing when I view my user settings page on Geeklog.fr.

On my development site though when I use the cool theme it does appear (I have the forum, ban, and gus plugins installed). Maybe it is another plugin that is causing the issue?

Also with the cool theme I downloaded I notice that it has a jquery_ui directory. It isn't needed.

Re: Denim theme variation issue on user settings page

Posted on: 18/12/15 03:31pm
By: ::Ben

Ok this is a mediagallery (1.16.17) issue Geek



Re: Denim theme variation issue on user settings page

Posted on: 20/12/15 06:11am
By: ::Ben

To solve this issue set "Display MG Info in User Profile" to No on mediagallery config page. This seems to be an issue with KZ_Template class but I can't find where Question

Anyway, Tom did you see the options for customize the Cool theme on the public_html/admin/index.php page and if yes what do you thing about? It would be a nice feature to include something like this in Geeklog Smile

Re: Denim theme variation issue on user settings page

Posted on: 20/12/15 10:01am
By: Laugh

Yes I did but I haven't had a chance to figure out how you did it. Was it code you added to functions.php? Where does it save the color info?

Something like this would be a nice a edition especially if we could do it for all major parts of Geeklog (like error message etc...)

I am not really the theme guy though. You should mention it to Dengen.

Maybe it would be better if it was incorporated into Geeklog and then theme's could support it...

Hard to say as I haven't really looked into it. Maybe you should mention it on the mailing list and then list how you see it working?


Re: Denim theme variation issue on user settings page

Posted on: 20/12/15 01:25pm
By: ::Ben

The main code is store in the commandcontrol.html

PHP Formatted Code
 

<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
<h2>Theme <?php global $TLANG; echo $TLANG['theme_name']; ?></h2>
<h3 style="padding-left:20px;">Settings</h3>
<blockquote>
<?php
//New settings
if(isset($_POST['submit']))
{
        //Save settings to file
        $style = '.navigation_bg { background-color:' . $_POST['navigation_bg'] . '; }' . LB ;
        $style .= '#footer { background-color:' . $_POST['footer_bg'] . '; }' . LB ;
        $style .= '.header_bg1 { background-color: ' . $_POST['header_bg1'] . '; }' . LB ;
        $style .= '.header_bg2 { background-color: ' . $_POST['header_bg2'] . '; }' . LB ;
        $style .= '#header { background: rgba(0, 0, 0, 0) linear-gradient(to bottom, ' . $_POST['header_bg1'] . ', ' . $_POST['header_bg2'] . ' 50%, ' . $_POST['header_bg2'] . ' 90%, ' . $_POST['header_bg1'] . ') repeat scroll 0 0; }' . LB ;
        $style .= '/* end of custom settings */';
       
        file_put_contents($_CONF['path_data'] . $_CONF['theme'] . '_style.txt', $style);
}
// Select settings from file
function parse($file){
    $css = file_get_contents($file);
    preg_match_all( '/(?ims)([a-z0-9\s\.\:#_\-@,]+)\{([^\}]*)\}/', $css, $arr);
    $result = array();
    foreach ($arr[0] as $i => $x){
        $selector = trim($arr[1][$i]);
        $rules = explode(';', trim($arr[2][$i]));
        $rules_arr = array();
        foreach ($rules as $strRule){
            if (!empty($strRule)){
                $rule = explode(":", $strRule);
                $rules_arr[trim($rule[0])] = trim($rule[1]);
            }
        }

        $selectors = explode(',', trim($selector));
        foreach ($selectors as $strSel){
            $result[$strSel] = $rules_arr;
        }
    }
    return $result;
}
if(file_exists($_CONF['path_data'] . $_CONF['theme'] . '_style.txt')) $css = parse( $_CONF['path_data'] . $_CONF['theme'] . '_style.txt' );

?>
<h4>Header</h4>
<h5>Gradiant top & bottom</h5>
<p><input name="header_bg1" class="color no-alpha" value="<?php echo $css['.header_bg1']['background-color']; ?>" /></p>
<h5>Gradiant center</h5>
<p><input name="header_bg2" class="color no-alpha" value="<?php echo $css['.header_bg2']['background-color']; ?>" /></p>

<?php  global $_PLUGINS; if(in_array('menu', $_PLUGINS)) {?>

<h4>Navigation</h4>
<p><input name="navigation_bg" class="color no-alpha" value="<?php echo $css['.navigation_bg']['background-color']; ?>" /></p>

<?php } ?>

<h4>Footer</h4>
<p><input name="footer_bg" class="color no-alpha" value="<?php echo $css['#footer']['background-color']; ?>" /></p>
<p><input type="submit" name="submit" value="Valid"></p>
</blockquote>
</form>
 


Settings are saved in a text file as css rules in the data directory. Then the header.thml use this file like this

PHP Formatted Code
<style><?php if(file_exists($_CONF['path_data'] . $_CONF['theme'] . '_style.txt')) echo LB . file_get_contents( $_CONF['path_data'] . $_CONF['theme'] . '_style.txt' ) . LB ?></style>


Very simple and easy to customize

Re: Denim theme variation issue on user settings page

Posted on: 20/12/15 05:28pm
By: ::Ben

Mediagallery 1.7 is coming soon and will solve this issue. You can try the code from
https://github.com/dengenxp/MediaGallery

Thanks.

書込: Denim theme variation issue on user settings page

Posted on: 27/12/15 05:58am
By: ivy

MediaGallery 1.6.16 have old original template engine.
So error occure by using 'theme_default' .
'theme_default' => 'xxx'

MediaGallery 1.7 use Geeklog 2.0 new theme engine, so works 'theme_default'.


Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=96188