On these pages are my WordPress plugins, the odd article and my Support Forum.

For my random rantings on everything else please visit my blog at Yellow Swordfish

WP Plugins


Articles

If you find any of my plugins useful, please comsider a donation towards my running costs.

Thank you

In preparation for the release of Simple:Press Version 4.0, the Support Forum has moved to a new site dedicated to the plugin. This will also be the future home for Simple:Press Forum.


Version 3.1.4 will still be available for download here in the short term.


For the support forum - and to visit our new site and to get details of version 4.0, click on the logo to take you to simplepressforum.com

This forum is currently locked - access is read only
Current User: Guest
Please consider registering

 
Search Forums:


 




sf_recent_posts_expanded in Version 3.1.3

UserPost

10:41 pm
11 Aug 2008


Peter

Guest

1

I had a smooth upgrade from Version 2.1 to Version 3.1.3 on one of my sites. Thanks for a great forum script whose wide-ranging functionality and ease of upgrade amazes me.

I'm testing a local install for upgrading highinterestsavings.ca and theblog.ca, but have run into a minor issue.

Scenario 1: http://www.highinterestsavings.ca/

As you can see, I have the full forum view of the most recent posts on a non-forum page. This was previously done quite nicely with sf_recent_posts_expanded() in sf-tags.php.

However, in 3.1.3 I now get a bunch of errors about functions not defined, such as sf_render_new_post_list_user(). I can fix these errors with:

      include_once('wp-content/plugins/simple-forum/forum/sf-page.php');
      include_once('wp-content/plugins/simple-forum/forum/sf-forumcomponents.php');
      include_once('wp-content/plugins/simple-forum/forum/sf-pagecomponents.php');

Is this a bug?

Scenario 2: http://www.theblog.ca/koodo-mobile

Here, I have the topics embedded at the bottom of a post for a specific forum. This was previously achieved by hacking sf_recent_posts_expanded() to add a parameter “whichforum”, which I then used to easily inject something like “WHERE forum_id = $whichforum” to (SELECT DISTINCT forum_id, topic_id FROM “.SFPOSTS.” ORDER BY post_id DESC LIMIT “.$limit);. Of course, now in Version 3.1.3 this has become a bit more complicated, since sf_recent_posts_expanded() now relies on other functions such as sf_get_users_new_post_list().

Before I proceed to jump deeper into code hacking, has this functionality (to display only the latest topics in a specific forum) been included somewhere by default now in 3.1.3?

3:05 am
12 Aug 2008


Mr Papa

Moderator

Arizona, USA

posts 1602

2

Lets take this one at a time…

Scenario 1 - interesting, but yes, this does seem to be a problem…

the fix I would make would be to add the following three lines to file sf-includes.php at line 246

    include_once('forum/sf-page.php');
    include_once('forum/sf-forumcomponents.php');
    include_once('forum/sf-pagecomponents.php');   

that routine is supposed to include the files required for tags…  seems we missed those during our code restructure…  the fix will be a bit different for 3.2, but I have already committed a fix…

3:17 am
12 Aug 2008


Mr Papa

Moderator

Arizona, USA

posts 1602

3

Scenario 2…

There are a couple of other tags you can use to get what you want…

sf_recent_posts_tag()
sf_recent_posts_alt_tag()

however, they wont look styled like the forum as they are more meant for sidebars… but they certainly will do what you want and their is plenty of class elements applied to the output so you can style it…

otherwise, you will have to dig much deeper with you hacks…

6:45 am
12 Aug 2008


Peter

Guest

4

Thanks so much for the reply. I've upgraded the forum successfully on http://www.highinterestsavings.ca and am almost ready with my hacked version of sf_recent_posts_expanded() so that I can upgrade http://www.theblog.ca for the more complicated Scenario 2.

9:58 am
12 Aug 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5252

5

Sorry we missed that one.  It's always been a hard one to test out.

6:16 am
14 Aug 2008


Peter

Guest

6

Yay, all upgrades complete!

If anybody is interested, here's my ugly (note that I used explicit table names) hacked version of sf_recent_posts_expanded() for sf-tags.php that takes two parameters: the number of posts to show and the forum whose posts should be displayed. It results in the display shown at the bottom of this post: http://www.theblog.ca/koodo-mobile:

http://www.theblog.ca/wp-content/uploads/2008/08/sf_recent_posts_expanded.txt


9:56 am
14 Aug 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5252

7

We will be mnore careful with this one in 3.2

5:26 pm
20 Aug 2008


CatStyle

Member

posts 8

8

Peter,

I like what you have done here.  Is there a way that this could be changed so that it instead shows the forum replies to the blog topic.  So, instead of the table that appears on your blog post showing the most recent posts from the forum that the blog post gets posted to, it would show the actual responses to the forum topic that was created from the blog post.  I hope that makes sense. 

That would be so cool if it could be done…

6:19 pm
21 Aug 2008


Peter

Guest

9

CatStyle said:

Peter,

I like what you have done here.  Is there a way that this could be changed so that it instead shows the forum replies to the blog topic.  So, instead of the table that appears on your blog post showing the most recent posts from the forum that the blog post gets posted to, it would show the actual responses to the forum topic that was created from the blog post.  I hope that makes sense. 

That would be so cool if it could be done…


I wouldn't consider that to be a trivial tweak. If I'm understanding this right, you want it to show an actual topic view, which is quite different. Are you looking to replace the comments function in WordPress with the forum?

2:44 am
22 Aug 2008


CatStyle

Member

posts 8

10

Hi Peter…

Thanks for your reply!  Yes, replacing the comments in the blog section with the replies from the forum is pretty much what I was looking to do.  I've had some of my users ask for the ability to post a reply in the forum and have it show up as a comment under the corresponding blog topic.  So you think this would be pretty difficult to do?

6:20 am
22 Aug 2008


Peter

Guest

11

Unfortunately there isn't a convenient function in sf-tags.php that can be modified. Also, replacing the traditional comment functionality isn't a current intention of the forum, so I'm guessing you'd be moving into really custom territory given the current setup. Your best bet might be to hope that the developers decide to make it part of the core code.

A quick and dirty method (which might not be that quick) would be to write a custom database query to pull, say, the last 5 forum posts in a forum topic and just display those on the blog post. There would be a link to the full view of the forum thread, which readers would be forced to go to if they want to make a “comment”. Then you would disable the WordPress comments feature. This novelty of this might quickly wear off and you'd be left wanting a proper solution.

6:48 am
22 Aug 2008


Mr Papa

Moderator

Arizona, USA

posts 1602

12

we've had a couple of requests to make simple:press forum replace the comments system of wp, but quite frankly we have resisted doing this…  I dont think our opinion on this has changed… that said, if you could expand on the type of template tag that might help, we might consider some sort of compromise…

11:50 pm
24 Aug 2008


CatStyle

Member

posts 8

13

Hi Guys….

Thanks for your replies!

Peter - I think I understand what you're saying but I wouldn't have a clue as to how to do it.  I'm not very good at programming.  I've tried to learn but I guess I'm just not suited for it.  I understand how to add code and hack existing code if someone has already written the hack but that's about as far as my programming talents will take me.  Thank you for taking the time to respond to me though!

Mr Papa -  I guess a template tag that would allow me to pull in to the blog post all of the forum posts that go with that blog post.  I don't necessarily have to have it set up so that people can post comments on the blog so if there was a tag that pulled in the forum posts I could just turn off the WordPress commenting system and have the link that goes to the forum for people to comment.  What I'm really trying to do is get all of the comments that go with that blog post visible on the blog post page.  I have users that prefer to read the blog posts/comments on the blog instead of going to the forum to read and they end up missing comments that are left on the forum.  So, turning off WP Commenting and having a tag that would pull in all the comments from the forum topic that go with that blog post would work great.

6:39 am
25 Aug 2008


Mr Papa

Moderator

Arizona, USA

posts 1602

14

not sure I follow… its late and been a long day…  so let me try to repeat it back…

provide a template tag that takes as input the post id… you want returned all the posts in the forum topic linked to the blog post id?  what do you want returned? post author (might be guest)? post content?  this sounds fairly easy from our side assuming you are willing to receive this information in an array of sorts without any formatting…  would have to leave that to the individual tag users… just the data maam…

just details… Tongue out

8:54 am
25 Aug 2008


Yellow Swordfish

Admin

Peterborough, England

posts 5252

15

We do have a template tag for this on the development plans. I wont promise it in 3.2 at this stage but one day…

3:34 am
26 Aug 2008


CatStyle

Member

posts 8

16

Mr Papa -  By George I think you've go it! I guess what would need to be returned would be the post author, post author avatar, post content, post date/time and I think that would do it.  Like you said, I think the styling would best be left to the individual tag user.

Andy - Great! I'm glad this is planned.  I've had multiple users of my website ask me if I can do this so I really think quite a few forum owners would benefit from this.

4:19 am
26 Aug 2008


Mr Papa

Moderator

Arizona, USA

posts 1602

17

okay, I will ad my comments and your comments to the ticket for consideration…  3.2 is not yet feature frozen, so it still has a chance of getting in there, but no gurantee…



Reply to Topic: sf_recent_posts_expanded in Version 3.1.3

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 12 + 9        (Required)

Topic Reply:


 
 

About the Stuff at Yellow Swordfish forum

Currently Online:

11 Guests

Maximum Online: 71

Forums:

Groups: 3

Forums: 16

Topics: 2068

Posts: 14091

Members:

There are 1003 members

There are 837 guests


Yellow Swordfish has made 5252 posts

Top Posters:

Mr Papa - 1602

-Radio- - 558

ovizii - 114

jfv - 82

angelic007 - 72

Administrator: Yellow Swordfish | Moderators: Yellow Swordfish, Mr Papa, -Radio-


© Simple:Press Forum - Version 3.1.4 (Build 357)