blog disappeared

Found a bug? Tell us!!
Post Reply
rx scabin
Regular
Posts: 18
Joined: Tue Oct 17, 2006 7:58 pm

blog disappeared

Post 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.
rx scabin
Regular
Posts: 18
Joined: Tue Oct 17, 2006 7:58 pm

Something happened

Post 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.
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post 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.
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Re: Something happened

Post 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
rx scabin
Regular
Posts: 18
Joined: Tue Oct 17, 2006 7:58 pm

Do not apologize

Post by rx scabin »

Your templates are great.


b :)
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post 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.
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post 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.
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post 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).
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post by carl_galloway »

I'm going to try it now, are you able to hang around online for a few minutes?
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post 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);
}
?> 
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

I'd expect that to work... Let me try it out... on my machine...
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post 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);
}

?> 
carl_galloway
Regular
Posts: 1331
Joined: Sun Dec 04, 2005 5:43 pm
Location: Andalucia, Spain
Contact:

Post 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 :?
Post Reply