Support Forum

Bring "Add Reply Box" to top

SI sintmacro
sintmacro
Member

Hi, in my previous version off the Simple Press Forums (before 4.5) I had the Reply Box at the top of my forum. I had done this to move some code in the sf-topic-view.php file. Andy had told me what and how and I could change this for a long time. Now I would like to update my forum to the new version but can’t find how to change it. Can you please assist me with this. 

The code that I moved in the 4.4 version was:

# Display Add Post form (hidden)

if((!$topiclock) || ($current_user->forumadmin))
{
if($current_user->sfreply && $sfvars[‘displaymode’] == ‘posts’)
{
$out.= ‘<a id=”dataform”></a>’.”n”;
$out.= sf_add_post($sfvars[‘forumid’], $sfvars[‘topicid’], $topic[‘topic_name’], $topic[‘topic_status_set’], $topic[‘topic_status_flag’], $topic[‘user_id’], $topic[‘topic_subs’], $topic[‘topic_watches’]);
}
}

3 Answers

New Answer

MP Mr Papa
Mr Papa
Member

you no longer need to edit core files to accomplish layout changes… simple press 5 features SP themes which operate much like a wp theme…  so you just have to move around the display elements in your sp theme…

first, theme basics:  http://codex.simple-press.com/codex/themes/theme-basics/using-themes/

second, make your own theme instead of editing ours:  http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/

then in the theme, you will have template files that are just like wp theme templates with a hierachy…  and they tend to have a loop, just like the wp loop…

so your are talking about topic view or the template file spTopicView.php in your theme template file folders…  find where the reply window is displayed:

                sp_SectionStart(‘tagClass=spHiddenSection’, ‘editor’);
                    sp_PostEditorWindow($addPostForm, $editPostForm);
                sp_SectionEnd(”, ‘editor’);

and simply move it where you want… 

you can also review that template function at the codex: http://codex.simple-press.com/codex/api/template-functions-and-the-api/display-template-functions/topic-view/sp_posteditorwindow/

to see what customization is available via arguments to the template function…  the current two arguments $addPostForm and $editPostForm are defined at the top of the template file…

SI sintmacro
sintmacro
Member

Thanks MrPapa. I made a copy of the Stacked Theme and change it to my own theme. Changes of Editor place works fine. 

Many thanks.