YAFLogo

jmcsmith
  • jmcsmith
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
11 years ago
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

Sponsor
bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
11 years ago
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
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
11 years ago
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
  • jmcsmith
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
11 years ago

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

Originally Posted by: Zero2Cool 

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
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
11 years ago
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
  • jmcsmith
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
11 years ago
you sir, are the man!

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

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
11 years ago
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
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
11 years ago

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.

Originally Posted by: bbobb 

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
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
11 years ago

you sir, are the man!

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

Originally Posted by: jmcsmith 

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
  • bbobb
  • 100% (Exalted)
  • YAF Developer
11 years ago
Look for the full script. I didn't tested but it should be all you need.
jmcsmith
  • jmcsmith
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
11 years ago
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
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
11 years ago

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?

Originally Posted by: jmcsmith 

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
  • jmcsmith
  • 50.2% (Neutral)
  • YAF Forumling Topic Starter
11 years ago

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?

Originally Posted by: Zero2Cool 

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.

Originally Posted by: jmcsmith 

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