jmcsmith
  • Posts: 7
  • Joined: 13/08/2013
I am looking to add forums to a website I am developing and would like to have topics posted in a certain section or with a certain tag be displayed on another page as blog posts. This would allow people to "comment" on the post using the same userid and pw as they use for the forums.
I was hoping someone could point me in the right direction. I searched the forums and could not find anything.
Thanks
JMCSMITH
bbobb
  • Posts: 1558
  • Joined: 21/10/2008
You can't make it without a modification. In a simple case add a flag to forum table, that is a blog forum token. You should change edit forum form to set such a flag. After this you can filter topics and posts by user name and the forum flag in other places. But the blog forum will be visible in forum lists.
A very easy thing to implement.

Zero2Cool
  • Posts: 1076
  • Joined: 26/04/2011
What I did to accomplish a blog is I added a "BLOG" status.

A user creates a topic, sets the Status to "BLOG" and then on the page below, I grab the last X posts and display them.

http://packershome.com/Blog.aspx 


My next course of action is to add a customizable 'buy me a beer' link for each specific blogger and also a drop down menu to view all blogs from a specific blogger.

Here's the sql statement I've been using to query the most recent 10 blog entries.
SELECT TOP 10 T.TopicID, U.Name, T.Posted, T.Topic, M.Message 
FROM yaf_Topic as T 
LEFT JOIN yaf_Message as M 
ON T.TopicID = M.TopicID 
LEFT JOIN yaf_User as U 
ON U.UserID = T.UserID 
WHERE T.Status = 'Blog' 
AND M.Position = 0 
ORDER BY T.Posted DESC
jmcsmith
  • Posts: 7
  • Joined: 13/08/2013
Originally Posted by: Zero2Cool

What I did to accomplish a blog is I added a "BLOG" status.

A user creates a topic, sets the Status to "BLOG" and then on the page below, I grab the last X posts and display them.

http://packershome.com/Blog.aspx 


My next course of action is to add a customizable 'buy me a beer' link for each specific blogger and also a drop down menu to view all blogs from a specific blogger.

Here's the sql statement I've been using to query the most recent 10 blog entries.

SELECT TOP 10 T.TopicID, U.Name, T.Posted, T.Topic, M.Message 
FROM yaf_Topic as T 
LEFT JOIN yaf_Message as M 
ON T.TopicID = M.TopicID 
LEFT JOIN yaf_User as U 
ON U.UserID = T.UserID 
WHERE T.Status = 'Blog' 
AND M.Position = 0 
ORDER BY T.Posted DESC


This is exactly what I am trying to do! Could you point me in the direction of the Statuses and where you set them when making a post?

Thanks!
Zero2Cool
  • Posts: 1076
  • Joined: 26/04/2011
Check your theme XML file. Towards the bottom, you'll see the "status" icons. Put your status name and icon file name in there.

Then navigate to your yaf_admin_topicstatus.aspx page and add your custom status.

Make sure to make Status' available for users. To verify this, under Host > Features look for the Allow Topic Status Option checkbox.
jmcsmith
  • Posts: 7
  • Joined: 13/08/2013
you sir, are the man!

one more question. Is there a way to make it so only admin can apply a status?
bbobb
  • Posts: 1558
  • Joined: 21/10/2008
Zero2Cool, this should be so.

SELECT TOP 10 T.TopicID, U.Name, T.Posted, T.Topic, M.Message 
FROM yaf_Topic as T 
LEFT JOIN yaf_Message as M 
ON T.TopicID = M.TopicID 
LEFT JOIN yaf_User as U 
ON U.UserID = T.UserID 
JOIN yaf_ACTIVEACCESS as A
ON (A.FORUMID = T.FORUMID AND A.USERID = @PAGEUSERID) 
WHERE T.Status = 'Blog' 
AND M.Position = 0 AND M.IsDeleted = 0 AND M.IsApproved = 1
AND A.READACCESS > 0
ORDER BY T.Posted DESC

Zero2Cool
  • Posts: 1076
  • Joined: 26/04/2011
Originally Posted by: bbobb

Zero2Cool, this should be so.

SELECT TOP 10 T.TopicID, U.Name, T.Posted, T.Topic, M.Message 
FROM yaf_Topic as T 
LEFT JOIN yaf_Message as M 
ON T.TopicID = M.TopicID 
LEFT JOIN yaf_User as U 
ON U.UserID = T.UserID 
WHERE T.Status = 'Blog' 
AND M.Position = 0🅱 AND M.IsDeleted = 0 AND M.IsApproved = 1[/b]
ORDER BY T.Posted DESC


You should join it to forum table and to activeaccess table too.


True. I don't worry about that because I do not have any messages that are tagged delete or not approved. I delete them to avoid cluttering up my database. But for others, yes, excellent addition and oversight on my part! THank you.
Zero2Cool
  • Posts: 1076
  • Joined: 26/04/2011
Originally Posted by: jmcsmith

you sir, are the man!

one more question. Is there a way to make it so only admin can apply a status?



Unfortunately, I don't know. I was thinkign it would be great to make it accessible by a group/role but haven't figured that out. So for me, its open to everyone.
bbobb
  • Posts: 1558
  • Joined: 21/10/2008
Look for the full script. I didn't tested but it should be all you need.
jmcsmith
  • Posts: 7
  • Joined: 13/08/2013
I have been thinking about it some more. I think if I make a forum for the blog posts and just select the top 10 0 position messages to show on the blog page that could work also. Granted the forum would have to be locked so only admins could post in it. Is this possible to do and still allow users to comment on posts?
Zero2Cool
  • Posts: 1076
  • Joined: 26/04/2011
Originally Posted by: jmcsmith

I have been thinking about it some more. I think if I make a forum for the blog posts and just select the top 10 0 position messages to show on the blog page that could work also. Granted the forum would have to be locked so only admins could post in it. Is this possible to do and still allow users to comment on posts?



I am going to say, but I can't explain how other than to check the Access and Role configurations be clever!

I believe you can set the forum section to only reply for "members" and then another access/role to allow bloggers to create topics.
jmcsmith
  • Posts: 7
  • Joined: 13/08/2013
Originally Posted by: Zero2Cool

Originally Posted by: jmcsmith

I have been thinking about it some more. I think if I make a forum for the blog posts and just select the top 10 0 position messages to show on the blog page that could work also. Granted the forum would have to be locked so only admins could post in it. Is this possible to do and still allow users to comment on posts?



I am going to say, but I can't explain how other than to check the Access and Role configurations be clever!

I believe you can set the forum section to only reply for "members" and then another access/role to allow bloggers to create topics.


Created a new access mask and assigned it to registered users for the "blog" forum. They can now reply but not create a thread. I should then be able to retrieve the top 10 posts with a 0 position using a query like this:

SELECT TOP 10 T.TopicID, U.Name, T.Posted, T.Topic, M.Message 
FROM yaf_Topic as T 
LEFT JOIN yaf_Message as M 
ON T.TopicID = M.TopicID 
LEFT JOIN yaf_User as U 
ON U.UserID = T.UserID 
WHERE t.ForumID=3
AND M.Position = 0 AND M.IsDeleted = 0 AND M.IsApproved = 1
ORDER BY T.Posted DESC


with the forumid 3 being the blog forum
Forum Jump  
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.

About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button

Project Twitter Updates

Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved