Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
themes-topic
Move the position of the reply and cancel buttons
Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Apr 3, 2012 - 7:00 am

I constantly find myself drawn to the upload button when I want to post a reply. How would I go about changing my theme to allow the reply and cancel buttons to appear above the upload button.

The screen grab below should make it clearer what I mean.

spReply_and_Cancel2.pngImage Enlarger

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 3, 2012 - 8:20 am

sees like an odd location, but is possible, just a bit tricky...  actually, I dont see an easy wayto remove (maybe css to make it hidden .spEditorSubmitButton) the existing buttons, but you could add another pair at the top where you want... just hook into the form, on topic view for example 'sph_post_editor_header_top' and output the buttons (get the code from the sp-post-form.php file)...

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Apr 3, 2012 - 9:16 am

I'd be happy with duplication, there is no need to remove the ones that are there at all. So I need to be looking in spTopicView.php for sph_post_editor_header_top and just paste the code? Is that correct.

Glad I still have the test site 🙂

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Apr 3, 2012 - 11:58 am

Just realised sph_ is something that I've never seen before. Sorry but I could do with something a little more prescriptive. Do you have any code snippets with an example of how to 'hook into the form' or indeed hook into anything.

In fact here are some specific questions.

1. Where should I be doing this, in the spTopicView.php?

2. How do hooks work? Can you give me a code example?

3. Assuming that I do this in spTopicView.php where should the code go, roughly, I assume in the editor section?

 

Thanks

 

Conrad

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 3, 2012 - 7:15 pm

simplest way would be to read wordpress docs on hooks:  http://codex.wordpress.org/Plugin_API

I would put the hook into my spFunctions.php...

quick example:

add_filter('sph_post_editor_header_top', 'my_submit_buttons', 10, 3);
function my_submit_buttons($out, $spThisTopic, $a) {
    #output buttons here my adding to $out
    return $out;
}

so basically, when sp is at the top of the editor form, it fires that hook (sph_post_editor_header_top)... anyone can hook into that location and add stuff...  or remove if you are handy with regexp...

you can grab the button code from the sp post form... but beware, you may have to hardcode the text strings and may not get math spam enabling of the button (not an issue if not using math spam)

Avatar
Conrad_Farlow
Sheffield, UK
Member
Free Members
sp_UserOfflineSmall Offline
Apr 8, 2012 - 9:23 pm

Linked to what I was saying about no backward compatibility of image thumbnails, try clicking on the thumbnail on the first post.

See - it's broken.

Conrad

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 8, 2012 - 9:25 pm

yup. already have ticket open.  just no time being Easter to investigate tonight...  Andy on it in AM...  or me in PM... tomorrow...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625