Member
Member
jackdaw   2013-01-20, 09:57
#1
Somehow, after changing my theme, this code is not showing the search bar anymore:

`<?php if (getOption('Allow_search')) { printSearchForm(''); } ?>`

so I searched for the option 'Allow Search' and can not find it anymore. Where is it placed in the admin?
Administrator
Administrator
fretzl   2013-01-20, 10:16
#2
Did you perhaps change your [i]themeoptions.php[/i] ?
The option should be defined in there.

You could of course force the search form to be always visible by just using `<?php printSearchForm(''); ?>`
Thereby circumnavigating the need for a theme option.
Member
Member
jackdaw   2013-01-20, 10:58
#3
No, I did not change the themeoptions:

`require_once(SERVERPATH . "/" . ZENFOLDER . "/admin-functions.php");

class ThemeOptions {

var $iSupport = array('Allow_comments' => array('type' => 1, 'desc' => 'Set to enable comment section.'),

'Allow_ratings' => array('type' => 1, 'desc' => 'Set to enable album and image ratings.'),

'Allow_search' => array('type' => 1, 'desc' => 'Set to enable search form.'),

'Theme_colors' => array('type' => 2, 'desc' => 'Set the colors of the theme')

);

function ThemeOptions() {

setOptionDefault('Allow_comments', true);

setOptionDefault('Allow_ratings', true);

setOptionDefault('Allow_search', true);

setOptionDefault('Theme_colors', 'light');

}

function getOptionsSupported() {

return $this->iSupport;

}

function handleOption($option, $currentValue) {

if ($option == 'Theme_colors') {

$gallery = new Gallery();

$theme = $gallery->getCurrentTheme();

$themeroot = SERVERPATH . "/themes/$theme/styles";

echo '<select id="themeselect" name="' . $option . '"' . ">\n";

generateListFromFiles($currentValue, $themeroot , '.css');

echo "</select>\n";

}

}

}`

When I just use
`<?php printSearchForm(''); ?>`
it works, but the first page is blank. When I click on page 2 it will begin showing the pictures.
Administrator
Administrator
fretzl   2013-01-20, 11:24
#4
Unfortunately I'm not a coder/developer but I miss `'type' => OPTION_TYPE_CHECKBOX` in your 'Allow_search' array.
Administrator
Administrator
acrylian   2013-01-20, 11:32
#5
It seems you need to update your theme a bit. We have here a detailed example of all possible option types (themes and plugins do share the same set):
https://github.com/zenphoto/DevTools/blob/master/demo_plugin-and-theme/demo_plugin/zenphoto_demoplugin.php
Member
Member
jackdaw   2013-01-20, 13:24
#6
Thanks. I think I got it fixed Smile
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.