Enable forum page

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

Re: Enable forum page

Post by garvinhicking »

Hi!

You're welcome. I'm however not a user of the forum plugin itself, so I'm a bit flying blind here.

When you say you submit the board name/description - which button do you click on to? Does your browser load anything?

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/
Imdi
Regular
Posts: 16
Joined: Tue Aug 04, 2009 6:50 am

Re: Enable forum page

Post by Imdi »

yes, it just reloads the same page, but with no boards listed on it, even though I tried creating/naming a board.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Enable forum page

Post by garvinhicking »

Hi!

When you create a new board, do you click on "Submit" below the description, or do you click on "Add new board" on the bottom right of it?

You must first click on "Add new board" to be able to fill in the new information. To save that, you have to click on "Submit", or else you would only again open the interface the enter the information, without ever submitting it...

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/
Imdi
Regular
Posts: 16
Joined: Tue Aug 04, 2009 6:50 am

Re: Enable forum page

Post by Imdi »

yes, I click on 'submit' after I fill in the 'new board' information
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Enable forum page

Post by garvinhicking »

Hi!

Okay, at this point it is getting a bit ugly and I'm afraid we'll have to get down and dirty with editing the plugin file.

Do you have a FTP tool and a texteditor to be able to edit the .php files on the server? If so I could try to walk you through which lines we would need to modify. The only other thing I could offer is to have a look at your server on my own, but then I would need a login to your blog. If you want to do that, please simply send me a PM here on this board to get in touch with me.

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/
Imdi
Regular
Posts: 16
Joined: Tue Aug 04, 2009 6:50 am

Re: Enable forum page

Post by Imdi »

hmmmm.......well, I have an FTP client I use for uploading files {bear with me, as I said I'm learning all of this as we go}, and I also have an admin area for Php files....
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Enable forum page

Post by garvinhicking »

Hi!

Okay, so what I would need you to do is to edit the file plugins/serendipity_event_forum/serendipity_event_forum.php.

Inside that file at around line 2016 you should find this:

Code: Select all

} elseif (isset($serendipity['POST']['action']) && trim($serendipity['POST']['action']) == "new") {
    // Add NEW board
    $LIMIT = serendipity_db_limit(0, 1);
    $sql = "SELECT * FROM {$serendipity['dbPrefix']}dma_forum_boards ORDER BY sortorder DESC LIMIT ".$LIMIT;
    $lastsort = serendipity_db_query($sql);
    if (!is_array($lastsort) || !isset($lastsort[0]['sortorder'])) {
        $newsort = 0;
    } else {
        $newsort = intval($lastsort[0]['sortorder']) + 1;
    }
    $sql = "INSERT INTO {$serendipity['dbPrefix']}dma_forum_boards (
                    name,
                    description,
                    sortorder
        ) VALUES (
                    '".serendipity_db_escape_string(trim($serendipity['POST']['name']))."',
                    '".serendipity_db_escape_string(trim($serendipity['POST']['description']))."',
                    '".$newsort."'
        )";
    serendipity_db_query($sql);

Code: Select all

} elseif (isset($serendipity['POST']['action']) && trim($serendipity['POST']['action']) == "new") {
    // Add NEW board
    $LIMIT = serendipity_db_limit(0, 1);
    $sql = "SELECT * FROM {$serendipity['dbPrefix']}dma_forum_boards ORDER BY sortorder DESC LIMIT ".$LIMIT;
    $lastsort = serendipity_db_query($sql);
    if (!is_array($lastsort) || !isset($lastsort[0]['sortorder'])) {
        $newsort = 0;
    } else {
        $newsort = intval($lastsort[0]['sortorder']) + 1;
    }
    $sql = "INSERT INTO {$serendipity['dbPrefix']}dma_forum_boards (
                    name,
                    description,
                    sortorder
        ) VALUES (
                    '".serendipity_db_escape_string(trim($serendipity['POST']['name']))."',
                    '".serendipity_db_escape_string(trim($serendipity['POST']['description']))."',
                    '".$newsort."'
        )";
    $res = serendipity_db_query($sql);
    echo "ADDING NEW BOARD: " . $sql . "<br />\n" . $res . "<br />\n";
So I have only modified the last line, and inserted another line at the end there. Once you have saved that to your file and try to re-add a board in the s9y interface, you should get an output like:

Now you need to modify that code like this:

ADDING NEW BOARD: INSERT INTO ....

The second place I need to you to modify is in line 1955. It looks like this:

Code: Select all

        $OUTPUT .= "<h2>".PLUGIN_FORUM_TITLE."</h2>\n";
        $OUTPUT .= PLUGIN_FORUM_DESC."<br /><br />\n";
you change this into:

Code: Select all

        $OUTPUT .= "<h2>".PLUGIN_FORUM_TITLE."</h2>\n";
        $OUTPUT .= PLUGIN_FORUM_DESC."<br /><br />\n";
        $OUTPUT .= "DEBUG:<pre>" . print_r($serendipity['POST'], true) . "</pre><br />\n";
I added another line, and this will give you another output above the forum administration with some output, that you need to copy+paste here into this forum.

Tell me if that works, and we'll continue from 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/
Imdi
Regular
Posts: 16
Joined: Tue Aug 04, 2009 6:50 am

Re: Enable forum page

Post by Imdi »

garvinhicking wrote:Hi!

Simply open http://yoururl/serendipity/index.php?se ... age]=forum

Regards,
Garvin

Garvin.....again, I apologize for being dense, but I am trying to learn about this on the fly.....I enter the above URL into my browser address window, replacing 'yoururl' with mine: trueimdi.com/thebraidedwayblog - everything else I copy and paste in the browser exactly as you have it written. All it takes me to is the front page of the blog, not to a forum of any kind. What am I doing wrong? :oops:
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Enable forum page

Post by garvinhicking »

Hi!

http://trueimdi.com/TheBraidedWayBlog/b ... age]=forum

would be your URL. :)

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/
Imdi
Regular
Posts: 16
Joined: Tue Aug 04, 2009 6:50 am

Re: Enable forum page

Post by Imdi »

Interesting.....I tried this before and it did not work. Seems to work fine now....weird. Many thanks to you, Garvin!

:D
Post Reply