Split pages fails, Static pages gives a SQL error, etc

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
rich
Regular
Posts: 10
Joined: Thu Nov 03, 2005 11:27 pm

Split pages fails, Static pages gives a SQL error, etc

Post by rich »

God this is going to sound like one major moan, and it really isn't meant to be that way - I want to use s9y, I love the ease at which it installed and got up and running, and I found creating my own template a breeze. But I've hit numerous problems, mostly with the plugins that are driving me around the bend, and I'd truly appreciate some suggestions / advice here.

Split Pages don't link corectly

I have a long article. I entered the nextpage tag correctly, and the article when viewed surely enough stops at the tag, the numbers appear as links but the links are totally screwed. If you click one it just reloads the current category page again. Here is an example:

http://www.corephp.co.uk/archives/6-Fro ... ia-XT.html

I have mod_rewrite enabled, caching turned off.

Static Pages SQL error

I installed the static pages plugin (via Spartacus), the admin menu entry appears, I can fill out the form and upon submit it errors with a SQL error which is basically because the staticpages table doesn't exist. Ok so the installation didn't create it, fair enough, but I couldn't find the schema in the source comments, or any of the files in the plugins/serendipity_event_staticpage directory. Am I looking in the wrong place? Where is the documentation?

photoblog doesn't use the thumbnail

I installed photoblog because I wanted to attach an image to an article from the media library. So I selected it, told it to use the thumbnail and saved it. Sure enough the image appears, but it's the massive full-sized version. I go back in, check again, definitely says to use the thumbnail, re-save - no difference.

Am I just missing something obvious here?! I haven't gone mad and installed every single plugin I could find or anything, only those above (beyond the base set + extended properties).

I'm using Serendipity 0.9 and PHP 4.3.10, and would appreciate any advice you can impart.

Cheers,

Rich
falk
Regular
Posts: 512
Joined: Tue Sep 27, 2005 10:16 am
Location: DD
Contact:

Re: Split pages fails, Static pages gives a SQL error, etc

Post by falk »

Hello Rich,

staticpages is my part, so i give an answer.
rich wrote:Static Pages SQL error

I installed the static pages plugin (via Spartacus), the admin menu entry appears, I can fill out the form and upon submit it errors with a SQL error which is basically because the staticpages table doesn't exist. Ok so the installation didn't create it, fair enough, but I couldn't find the schema in the source comments, or any of the files in the plugins/serendipity_event_staticpage directory. Am I looking in the wrong place? Where is the documentation?
The function to create the tables is setupDB().
What version of staticpages are you using? There are some bugs in 3.07 and 3.08, the current version in CVS is 3.10.
What database you are using? We have some problems with pgsql.
rich
Regular
Posts: 10
Joined: Thu Nov 03, 2005 11:27 pm

Post by rich »

Static Pages is version: 3.10 - I installed it from Spartacus, not manually, incase that has anything to do with it?

I will look for the setupDB function now and run it, thank you! I'm using MySQL.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Split pages fails, Static pages gives a SQL error, etc

Post by garvinhicking »

Hi!

I'm very sorry that you are having a hard time with some plugins. We do our best to fix those as soon as we know of problems, and thank you for helping us in this process.
Split Pages don't link corectly
The reason is that your permalinks seem to be missing a "/" in their configurations. Your link currently reads:

Code: Select all

http://www.corephp.co.uk/index.php?archives6-From-A-to-B-via-XT.html&serendipity[entrypage]=1
but it should read:

Code: Select all

http://www.corephp.co.uk/index.php?/archives/6-From-A-to-B-via-XT.html&serendipity[entrypage]=1
(Note the slashes before and after /archives/)

Can you please tell me what path settings and permalinks you configured?
photoblog doesn't use the thumbnail
Can you check your uploads/ directory and see if a thumbnail was created for your uploaded image and is correctly sized? It sounds as if the thumbnail has the same size as your big image?

I am sure, we can get the issues fixed and get you a shiny blog. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
rich
Regular
Posts: 10
Joined: Thu Nov 03, 2005 11:27 pm

Post by rich »

Many thanks for your reply. My permalinks are the standard installation ones, I did not change them.

I changed 'Path to archives' to "/archives/" (and all the rest of the "Path to" values) but it didn't appear to have made any difference.

I tried adding a / infront of the "Permalink Entry URL structure" but all my links then redirected me to archives.org :) (Firefox messing around because the URL came out as http://archives/blah)

How should they look? Here are my path settings:

Relative path: /
Templates path: templates/
URL to blog: http://www.corephp.co.uk/
Autodetect used HTTP-Host: No
Index file name: index.php

Permalinks are as described above, i.e. currently they are all: /whatever/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

In fact the path values you had before where not really related.

The problem was that your HTTP Path contains a "/" character, which is rewritten to an empty character within our serendipity_currentURL() function. This is of course a bug within Serendipity (though it's a rarely used function), that shows up when your HTTP Path does not contain a unique string like "/blog/" or so.

I will fix the bug and report the fix here in a few minutes.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Okay, the fix is quite easy.

In your include/functions_permalinks.inc.php you just need to apply this patch:

http://svn.berlios.de/viewcvs/serendipi ... 594&r2=647

I'm really sorry for the inconvenience this caused.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
rich
Regular
Posts: 10
Joined: Thu Nov 03, 2005 11:27 pm

Post by rich »

Excellent, thank you :) That worked fine.

My articles now page correctly. Re: photoblog, yes there was a thumbnail version created (definitely not the same size!), but I've uninstalled photoblog and will just use an img src tag instead.

Thanks for your help. Glad to have helped crush a bug!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Rich, great to hear that.

The photoblog thing usually is not even needed if you want to insert thumbnails. Just create an entry, click on the "Media" Button above the entry box and then choose the image you want to insert. On the next page you can choose whether to display the thumbnail or the "big link". This at least works here and should work everywhere else.

Photoblog is only meant to attach special, singular pictures to an entry.

Did you get the static pages to work? I saw the error that had been made, the default column of the new language column hat a \'\' instead of ''. I changed that and committed it as version 3.12 by now. So if you haven't already created the table manually, you can download that new version (or fix the error yourself), drop the staticpage plugin and install it again, and it will re-install the table properly this time.

BTW, your site looks very good and informative. Immediately added it to my blogroll. :-)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
rich
Regular
Posts: 10
Joined: Thu Nov 03, 2005 11:27 pm

Post by rich »

Ahh, I did wonder what the "Media" button does! I should have clicked it - that's perfect (I have turned off HTMLarea, too many markup issues for my liking, and I'm quite comfortable entering the html by hand).

I hadn't got around to the static pages thing yet because you resolved the split pages issue for me (I was going to use a static page instead if I couldn't get the split to work), but I will install the latest version.

I do have an issue with the split pages - what value should I enter for "Do you want to show the entry's body on succeeding pages?" ?

At the moment it shows the Entry Body at the top of every page, which looks weird. I tried 0, -1, 2, all sorts but it either just shows the entry body + the correct page, or it shows ONLY the entry body! I'm sure it's something simple...

Thanks for the feedback on the blog, I will add in the rest of my articles and book reviews to it today and build up a good amount content.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Rich!
I hadn't got around to the static pages thing yet because you resolved the split pages issue for me (I was going to use a static page instead if I couldn't get the split to work), but I will install the latest version.
Okay, that's fine. Just pay attention you're fetching version 3.12 of the plugin. SourceForge CVS might take a few hours until it's available.
I do have an issue with the split pages - what value should I enter for "Do you want to show the entry's body on succeeding pages?" ?
Actually there was a bug in the configuration for that plugin in the version before the one I committed today. Inside the plugin file it should read "boolean" for the configuration item type, not "string". Thus what you are entering fails; you might want to try entering "false" though!

The way it should work is to not show the BODY content of your entry on pages > 1...

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
rich
Regular
Posts: 10
Joined: Thu Nov 03, 2005 11:27 pm

Post by rich »

I'm using version: 1.2 - I entered the word 'false', saved and it had been lost the next time the configure plugin screen loaded :) (and naturally had no effect on the front-end either).

How do you modify the plugin code? I tried changing the plugins/serendipity_event_entrysplit/serendipity_event_entrysplit.php file, I changed it from a string to a boolean in the select block - but nothing happened. So I inserted a massive great big syntax error in the file, and still it worked fine :) So I'm guessing it's cached or stored somewhere else?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Actually Plugins are not cached, but parse errors in plugins should not immediately show up -- only in the plugin configuration you'll see a "Error" notice.

I changed this block:

Code: Select all

            case 'showbody':
                $propbag->add('type', 'boolean');
                $propbag->add('name', PLUGIN_ENTRYSPLIT_SHOWBODY);
                $propbag->add('description', '');
                $propbag->add('default', true);
                break;
So there where we set the 'type' property, I switched 'string' with 'boolean'.

Try to change the "name" (PLUGIN_ENTRYSPLIT_SHOWBODY) to something else and see if it shows up in your plugin config screen. If not, this would mean, you are in fact editing a wrong file %-)

(But it definitely is downloaded to your /plugins/ directory, you are right on that)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
rich
Regular
Posts: 10
Joined: Thu Nov 03, 2005 11:27 pm

Post by rich »

Yes that was the code change I made - but I should have paid more attention, as the only problem was that the file was never being saved :oops:

Because I installed it through spartacus it is owned by "nobody" and I had no rights to modify it. Opps :) Am going to have to run the admin system through wrap, or just install them manually from now on (pair networks shared hosting, things don't run as a local user by default).
rich
Regular
Posts: 10
Joined: Thu Nov 03, 2005 11:27 pm

Post by rich »

Ok server is now sorted and I can modify the code in the plugin without any troubles. I hope you don't mind a few observations about it:

I changed the showbody from string to boolean, the radio boxes appear in the admin, entry is saved properly. Has no effect on the site, but...

Code: Select all

$text = &$this->getFieldReference('extended', $eventData);
This gets the full extended text, which works fine. I debugged the variable and traced it through, the page splitting works and the pagination gets added, so by the exit of the function $text contains exactly the right part of text for that page + the pagination appended to it. Perfect. However this section:

Code: Select all

if ($current_page > 1 && !serendipity_db_bool($this->get_config('showbody'))) {
	$bodytext = &$this->getFieldReference('extended', $eventData);
	$bodytext = '';
}
didn't make any sense to me, it just seemed to be grabbing the contents of the extended section again, and then blanking them. So I changed "extended" for "body" and voila - it worked perfectly :)

I believe if you modify that in the plugin source when you next comit, it will be ready for everyone to use properly (and what a nice little plugin it is!), but I fully appreciate that as I don't know the s9y codebase at all, I might have inadvertantly screwed something here?

Cheers,

Rich
Post Reply