Page 1 of 1
blog disappeared
Posted: Sat Nov 11, 2006 8:20 pm
by rx scabin
I just installed some new templates: softened cell. soccer and others I do not remember. When I go to my blog a blank page comes up. One of the sudebar pluginns is the "choose your own template" one.
Something happened
Posted: Sat Nov 11, 2006 8:35 pm
by rx scabin
I went back and removed BE nice, Soccer, and softened cells templates one at a time. It seems that they all cause the blog to disappear. Without them, the blog is fine. By the way, I was running version 1.0.0.
Posted: Sat Nov 11, 2006 8:39 pm
by carl_galloway
Hmmm, first which template are you trying to use - this is obviously the template that is causing the problem.
Second, to get back to a template that does work, enter your admin area, you need to type your blog url into the address bar and add /serendipity_admin.php to it. This will let you get back to the admin screen even though your blog isn't working.
Now can you click the link 'manage styles' and tell us if you see the list of templates of if that side of the screen is blank?
If it is blank, you are going to need to manually delete the template that is causing the problem using ftp. The problem you're describing suggests that one of the templates has an error in the config.inc.php file. If this is the case then I sincerely apologise to you because all the templates you mention are mine.
Re: Something happened
Posted: Sat Nov 11, 2006 8:41 pm
by carl_galloway
rx scabin wrote:I went back and removed BE nice, Soccer, and softened cells templates one at a time. It seems that they all cause the blog to disappear. Without them, the blog is fine. By the way, I was running version 1.0.0.
Thank you for letting me know, I'll check these templates immediately
Do not apologize
Posted: Sat Nov 11, 2006 8:45 pm
by rx scabin
Your templates are great.
b

Posted: Sat Nov 11, 2006 8:52 pm
by carl_galloway
Thank you,
I'm going to check all those templates in version 1.0 again, I hope I haven't pasted something stupid into each template.
Posted: Sat Nov 11, 2006 9:05 pm
by carl_galloway
After checking all my own templates in v1.0 beta2, and also the latest template from yellowled, the yaml template, the problem seems to originate in config.inc.php with the
code used to allow configurable navbars. It seems this code isn't being ignored by s9y v1.0.
I guess we need to add an if version less than 1.1 kind of statement to the code so that users of older serendipity installs are still able to enjoy these templates.
Posted: Sun Nov 12, 2006 5:23 pm
by mgroeninger
Hey Carl,
I used something like this in Usergallery:
Code: Select all
if (version_compare($serendipity['version'],"1.1.beta3") >= 0)) {
}
That uses the php version_compare function to check the two parameters passed to it. If they are equal, it returns a "0", if the first is greater than the second it returns a "1". Otherwise it returns a "-1".
So that line will execute the code in the if statement when the version is 1.1.beta3 or higher....
Garvin uses some other checks (Usergallery actually has several examples, I think).
Posted: Sun Nov 12, 2006 5:33 pm
by carl_galloway
I'm going to try it now, are you able to hang around online for a few minutes?
Posted: Sun Nov 12, 2006 5:39 pm
by carl_galloway
hmmm, that didn't seem to work. This is the code in config.inc.php
Code: Select all
$template_config = array(
array(
'var' => 'colorset',
'title' => 'Color Set',
'description' => 'Enter the color set you want to use for this site',
'type' => 'select',
'default' => 'sunset',
'select_values' => array('softened' => 'Softened', 'sunset' => 'Sunset')
),
array(
'var' => 'amount',
'name' => 'Number of navlinks',
'description' => 'Enter the number of navlinks you want to use in the navbar.',
'type' => 'string',
'default' => '4',
),
);
if (version_compare($serendipity['version'],"1.1.beta3") >= 0)) {
$vars = serendipity_loadThemeOptions($template_config);
$navlinks = array();
for ($i = 0; $i < $vars['amount']; $i++) {
$navlinks[] = array(
'title' => $vars['navlink' . $i . 'text'],
'href' => $vars['navlink' . $i . 'url']
);
$template_config[] = array(
'var' => 'navlink' . $i . 'text',
'name' => NAV_LINK_TEXT . ' #' . $i,
'description' => NAV_LINK_DESC . ' #' .$i,
'type' => 'string',
'default' => constant('NAV_DEFAULT_' . $i),
);
$template_config[] = array(
'var' => 'navlink' . $i . 'url',
'name' => NAV_LINK_URL . ' #' . $i,
'description' => NAV_LINK_URL_DESC . ' #' . $i,
'type' => 'string',
'default' => '#',
);
}
$serendipity['smarty']->assign_by_ref('navlinks', $navlinks);
}
?>
Posted: Sun Nov 12, 2006 5:44 pm
by mgroeninger
I'd expect that to work... Let me try it out... on my machine...
Posted: Sun Nov 12, 2006 6:08 pm
by mgroeninger
Oppps....
My bad. This works:
Code: Select all
if (version_compare($serendipity['version'],"1.1.beta3") >= 0) {
...
}
I had an extra thingy in there...
Here is the whole thing:
Code: Select all
<?php
// Be nice to the frontend users. They don't need the additional constants
// and file lookups. Only load them when in Admin mode.
if ($serendipity['GET']['adminModule'] == 'templates' || $serendipity['POST']['adminModule'] != 'templates') {
// Probe for a language include with constants. Still include defines
// later on, if some constants were missing
$probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
if (file_exists($probelang)) {
include $probelang;
}
include dirname(__FILE__) . '/lang_en.inc.php';
}
$template_config = array(
array(
'var' => 'colorset',
'title' => 'Color Set',
'description' => 'Enter the color set you want to use for this site',
'type' => 'select',
'default' => 'sunset',
'select_values' => array('softened' => 'Softened', 'sunset' => 'Sunset')
),
array(
'var' => 'amount',
'name' => 'Number of navlinks',
'description' => 'Enter the number of navlinks you want to use in the navbar.',
'type' => 'string',
'default' => '4',
)
);
if (version_compare($serendipity['version'],"1.1.beta3") >= 0) {
$vars = serendipity_loadThemeOptions($template_config);
$navlinks = array();
for ($i = 0; $i < $vars['amount']; $i++) {
$navlinks[] = array(
'title' => $vars['navlink' . $i . 'text'],
'href' => $vars['navlink' . $i . 'url']
);
$template_config[] = array(
'var' => 'navlink' . $i . 'text',
'name' => NAV_LINK_TEXT . ' #' . $i,
'description' => NAV_LINK_DESC . ' #' .$i,
'type' => 'string',
'default' => constant('NAV_DEFAULT_' . $i),
);
$template_config[] = array(
'var' => 'navlink' . $i . 'url',
'name' => NAV_LINK_URL . ' #' . $i,
'description' => NAV_LINK_URL_DESC . ' #' . $i,
'type' => 'string',
'default' => '#',
);
}
$serendipity['smarty']->assign_by_ref('navlinks', $navlinks);
}
?>
Posted: Sun Nov 12, 2006 6:20 pm
by carl_galloway
Ah Matthew, you're a scholar and a gentleman, thank you, that fixed it quite nicely. Now I have to edit all the templates and resend the zipfile to Garvin and update the zipfiles on my own site, sigh
