Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Best way to accomplish custom code in SF 5
Avatar
Trevor Levine
Rookie
Free Members
sp_UserOfflineSmall Offline
Apr 20, 2012 - 1:07 pm

The server is currently running SF 4.2.2 and will likely be upgraded to version 5 soon. The current installation has custom code in the following locations in the 4.2.2 code:

  • sf-new-admin-view.php, function sf_render_new_post_list_admin: Adds group names with special formatting to the $out variable.
  • sf-post-support.php, function sf_email_notifications: Adds user group names to the email message.
  • sf-links-blog.php, function sf_show_blog_link: Adds special tech support message to the end of $out.

Is there a better way of doing these tasks using a plugin or default funcitonality within SF5? The plugin documentation for SF5 doesn't seem to be complete. There are several entries in the codex that state: [This page is marked as: Needs Writing]

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 20, 2012 - 1:42 pm

yeah, unfortunately a thousand or more pages there to populate... going to take time...  we have maybe a hundred or so done...  small team (3) here so working it over time...

yes, as you know and allude to, you will lose your changes when you upgrade to 5.0...  and pre 5.0, modifying core was your only real choice...  but with 5.0 now you could, again as you allude to, write a plugin or use some of our multitude of hooks and filters (just like wp) to modify the elements you want...  in your case, since you have multiple changes, it might make sense to create a plugin... but you could just hook into the sp code in the spFunctions.php file in your sp theme for 5.0...

do you have a dev version of your site that you can work on changes before putting on live server?  if so I would start there... we can help you get it going...  we can do the same on live server if you dont mind going without the changes for short period of time...

you are on quite an old version of SP so your WP version is quite out of date too... SP 5.0 does require WP 3.3+..

Avatar
Trevor Levine
Rookie
Free Members
sp_UserOfflineSmall Offline
Apr 23, 2012 - 12:10 pm

WP was just updated. There is no dev site, unfortunately. I would need to know the hooks to use, how to subscribe to them, etc.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 23, 2012 - 1:22 pm

our hooks (actions and filters) work identical to wp hooks...  http://codex.wordpress.org/Plugin_API

so if you know how to use them, you know how to use ours...  you can look here:  http://codex.simple-press.com/.....d-classes/

for some of ours, but that is a bit out of date - and no explanation yet...

so best thing is to look in the code and find ones available where you want it...  since I dont know what you really want to do, hard to be more specific... if you could explain what you want to do, can go further...

for example, before sending a subscription email, we fire the sph_subscriptions_notification_email filter so you can adjust the email if needed...

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 25, 2012 - 12:25 pm

Trevor Levine said
The server is currently running SF 4.2.2 and will likely be upgraded to version 5 soon. The current installation has custom code in the following locations in the 4.2.2 code:

  • sf-new-admin-view.php, function sf_render_new_post_list_admin: Adds group names with special formatting to the $out variable.
  • sf-post-support.php, function sf_email_notifications: Adds user group names to the email message.
  • sf-links-blog.php, function sf_show_blog_link: Adds special tech support message to the end of $out.

What was sf-new-admin-view.php in V4 now uses a common template which is used in a variety of places within SP. However, there are filter hooks available throughout so that custom code can be added so this is most certainly doable. I assume you are referring to the user group of the user making the last post? That data is not readily available in the data object available to that filter so it would need coding up. But not that difficult.

The Email notification does have a filter although I think this might be new for 5.1 - the next release. But now we know where it is going it can be added easily enough to 5.0.5. Again this data is not part of the data object available bit again is easy top get hold of.

The blog link does NOT have a filter currently but we are happy to add one and again - that can then be added into the currernt version knowing it will be there in the next release. That one is pretty easy of course as there is no associated data required.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Apr 25, 2012 - 8:57 pm

If that works, we can walk you through all of them to try out...

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: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625