Creating new entry from WikiWord

Creating and modifying plugins.
Post Reply
randybrown
Regular
Posts: 27
Joined: Sun Oct 10, 2004 10:05 pm

Creating new entry from WikiWord

Post by randybrown »

One of the things that has attracted my attention about s9y is the inclusion of WikiMarkup with the WikiText filter. There's one final touch which could be added when creating new links with a WikiWord:

I have set the Wikilinks New URL to the URL for editing a new document:

http://domain.tld/serendipity/entries?s ... ction]=new

But, to complete this, the TITLE field at the new entry form shoudl be filled in with the WikiWord. This will make the process more transparent and also remove the chance of typos.

I tried adding

Code: Select all

?title="WikiWord"
to the end of the URL, but this didn't work.

Also, the new page name (the WikiWord name) shoudl be written to the Wikilinks File.

Any possibility of a quick hack for this?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Creating new entry from WikiWord

Post by garvinhicking »

Hi Randy!

There's an easy quick hack: Edit your serendipity_functions.inc.php file, find the function serendipity_printEntryForm() (it's line 2799 in my latest CVS checkout). At the function top, add this line (I added a few already existing lines so that you see where to insert it:

Code: Select all

    $serendipity['EditorBrowsers'] = '(IE|Mozilla)';
    if (isset($serendipity['GET']['title'])) {
        $entry['title'] = $serendipity['GET']['title'];
    }
    $draftD = '';
    $draftP = '';
    $categoryselector_expanded = false;
Then you can append the link ?serendipity[title]=WikiWord.

Have fun,
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/
randybrown
Regular
Posts: 27
Joined: Sun Oct 10, 2004 10:05 pm

Post by randybrown »

Thanks, Gavin. Applying patch.... now.
randybrown
Regular
Posts: 27
Joined: Sun Oct 10, 2004 10:05 pm

Post by randybrown »

Oddest thing... when I apply the patch, s9y stops working. I've checked and double-checked, even looked at the server logs - there is no problem with the php.

An even odder thing, even after copying over a fresh

Code: Select all

serendipity_functions.inc.php
, s9y still doesn;t work.

Any clues.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Uh, that really sounds weird. What do you mean by "stops working"? Don'T you get any output? Can't imagine what is going on there :(

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/
randybrown
Regular
Posts: 27
Joined: Sun Oct 10, 2004 10:05 pm

Post by randybrown »

Yes, there's no output - blank window. Even after replacing the editted file with a fresh copy, there's nothing. I have to delete everyting and reinstall. But if I make the change again, the same thing happens.

That's why I used the word "odd..." Maybe, "puzzling" would be better. ;-)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

I suppose it must be something with your editor! Check if you save with \n as separators, or if you wrongly upload the file as binary?!

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/
randybrown
Regular
Posts: 27
Joined: Sun Oct 10, 2004 10:05 pm

Post by randybrown »

I'm using PSPad to edit and ftp the files. It has not caused problems with other php work I do.

Something which just came to mind: the file in question is 151K in size. I don't think I have editted files of that size in PSPad before and wonder if PSPad is botching it?

Will test in another editor.

But... I have replaced the file using WS-FTP too, with the same results. Odd. I'm sure it's something on my end.
randybrown
Regular
Posts: 27
Joined: Sun Oct 10, 2004 10:05 pm

Post by randybrown »

I used TextPad to edit the file in a fresh install of the current beta. All went well. So, I am wondering if PSPad does, in fact, muck up larger files?

Next question:

Where do I append:

Code: Select all

?serendipity[title]=WikiWord
.. at the end of:

Code: Select all

http://domain.tld/serendipity/entries?serendipity[adminModule]=entries&serendipity[adminAction]=new 
?

Thanks.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Okay, looks like we have the evildoer in form of PSPad. But I don't know the tool :)

You need to append the link to read like this:

Code: Select all

http://domain.tld/serendipity/entries?serendipity[adminModule]=entries&serendipity[adminAction]=new&serendipity[title]=WikiWord 


:)

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/
randybrown
Regular
Posts: 27
Joined: Sun Oct 10, 2004 10:05 pm

Post by randybrown »

Got it to work. Thanks.

Let me pass on some details:

This was not working at first. When I would click on the ? at the end of a WikiWord, s9y would simply reload the same page - it would nto advance to the edit page.

During install, I left the default setting in URL rewriting; for my server it was "Use Apache errorhandling." After changing that to "Use Apache mod_rewrite" all works well.

I don't know if this was a mistake on my part during install, or somethign which needs to be looks at in either documentation or the install process, but wanted to pass it along.

Thanks for your help Garvin.
Post Reply