SMF Support > SMF 1.1.x Support
Stand alone pages from topics
canada01:
hay great concept :)
AngelinaBelle:
Another idea would be to allow SOME content viewable by all, and SOME content viewable by members only.
You could accomplish this by
* Using one or two boards for "everybody can read" content, and keep the rest of the boards for "members only" content
* You can even use SSI functions to show the subject lines of members-only content.
* SMF Articles allows you to create articles that are not on the boards.
* Some portals have "pages" or "articles" which are designed to be listed on the site front page (portal page)
* You can even use a portal to show lists of subject lines to posts the user cannot read unless logged in.
Because all of these simple solutions, would make it possible to show the same content to the search engines as you show to guests, any one of them might be useful to you for arranging your site the way you want it.
Coon:
Thanks for all the tips guys and girls.
I think the best option would be to block recent topics and show all old topics to guests and bots.
Is anyone up for the challenge? Unfortunately, I'm not good at this coding, but if someone did it, I really think this mod would be successful. I think there would be a big demand for it and no reason for people not to implement it.
I don't really have much money to throw at this, but I could add some money to the pot if anyone else is interested.
Please let us know if anyone has the code to make this work.
AngelinaBelle:
Initially, it sounded like you wanted two things
1) Some more-or-less static content that everyone (including guests) can read, but not reply to. For displaying this in various ways, you want some of the features of a portal or CMS
2) An actual forum, where registered members can interact with each other.
Functionally, you want two separate things -- a CMS and a separate forum. The easiest way to make this happen, using only SMF, would be to separate your content. Keep the read-only stuff in one set of boards, with permissions set to make the content read-only and viewable by all. Then, you would have another set of boards which would be invisible to guests, including search engines. These boards would have all the normal permissions set for members. You can even use one of the portal mods to display the read-only content in a variety of ways.
After some discussion, you began talking about keeping newer content for your members, and allowing guests to view older content, including forum topics and replies, and discussed with Mr. Phil the idea of rules you might like to implement to control either simply showing older content to guests, or else moving older content to one or more read-only "archive" board viewable by guests.
These are two very different ideas.
Mr. Phil and Arantor are both trying to help you specify what you want, but I don't think, at this point, either one understands what you want.
I think we all understand that you want to show some content to everybody, and that, to increase posting in your forum, you want to encourage registration by keeping some content "for members only". You feel that putting the barrier at 'register if you want to post' discourages lazy people from posting. But you think that if you put the barrier at 'register if you want to see the discussions, and you'll be able to post too' will interest lazy people enough to get them to register, and that, once registered, they will post.
What we are not clear on is WHICH content you actually want to show to guests and which you want to reserve to the members. I can understand you might like to try a number of things, to find out which works best for your forum. I think you'll need to be specific about which you want to try out first, and go from there.
Also, if you have ideas like "display topics on a nicely formatted individual page", you'll need to provide some more detail to indicate how that is different from how a read-only topic is already formatted and displayed on a page. URLs to other websites with "that look" you want would be useful to help explain what you are looking for.
MrPhil:
--- Quote from: Coon on June 26, 2012, 01:29:55 AM ---Please let us know if anyone has the code to make this work.
--- End quote ---
Here's an admittedly crude hack to block anything newer than 7 days from being shown to guests (and search engines). In Sources/Display.php, around line 797 (SMF 2.0.2), find
--- Code: --- // Get each post and poster in this topic.
$request = $smcFunc['db_query']('display_get_post_poster', '
SELECT id_msg, id_member, approved
FROM {db_prefix}messages
WHERE id_topic = {int:current_topic}' . (!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : (!empty($modSettings['db_mysql_group_by_fix']) ? '' : '
GROUP BY id_msg') . '
HAVING (approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR id_member = {int:current_member}') . ')') . '
ORDER BY id_msg ' . ($ascending ? '' : 'DESC') . ($context['messages_per_page'] == -1 ? '' : '
LIMIT ' . $start . ', ' . $limit),
array(
'current_member' => $user_info['id'],
'current_topic' => $topic,
'is_approved' => 1,
'blank_id_member' => 0,
)
);
--- End code ---
and change to
--- Code: --- // Get each post and poster in this topic.
$request = $smcFunc['db_query']('display_get_post_poster', '
SELECT id_msg, id_member, approved
FROM {db_prefix}messages
WHERE id_topic = {int:current_topic}' .
($user_info['is_guest'] ? ' AND poster_time <' . (time()-7*24*3600) : '') . ' ' .
(!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : (!empty($modSettings['db_mysql_group_by_fix']) ? '' : '
GROUP BY id_msg') . '
HAVING (approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR id_member = {int:current_member}') . ')') . '
ORDER BY id_msg ' . ($ascending ? '' : 'DESC') . ($context['messages_per_page'] == -1 ? '' : '
LIMIT ' . $start . ', ' . $limit),
array(
'current_member' => $user_info['id'],
'current_topic' => $topic,
'is_approved' => 1,
'blank_id_member' => 0,
)
);
--- End code ---
(One line split and a new one inserted.)
Change the 7 (in 7*24*3600) to the number of days you want. You might need to tweak this if a few hours off due to database timestamps not being GMT (e.g., 7*24*3600+6*3600, or using SQL DATE functions in some manner). 0 days should disable this feature. I'm sure there are more elegant ways to deal with this, such as using {parameters}. Someone making a mod out of this would probably want to put a value in the settings table, which I didn't bother with.
Newer posts are simply omitted. This can produce puzzling results if all the posts are too new, leaving a page that has all the headers and so on, but no posts. A properly done mod should probably detect this and give a message "Newer posts may have been omitted. Sign in to see them.". Since the query itself omits newer posts, the PHP code doesn't know they're missing unless it does a separate query. You might just want to put that message on every page and leave it at that.
For SMF 1.1, it should be even cleaner. Find:
--- Code: --- // Get each post and poster in this topic.
$request = db_query("
SELECT ID_MSG, ID_MEMBER
FROM {$db_prefix}messages
WHERE ID_TOPIC = $topic
ORDER BY ID_MSG " . ($ascending ? '' : 'DESC') . ($modSettings['defaultMaxMessages'] == -1 ? '' : "
LIMIT $start, $limit"), __FILE__, __LINE__);
--- End code ---
and change to
--- Code: --- // Get each post and poster in this topic.
$request = db_query("
SELECT ID_MSG, ID_MEMBER
FROM {$db_prefix}messages
WHERE ID_TOPIC = $topic " .
($user_info['is_guest'] ? ' AND poster_time <' . (time()-7*24*3600) : '') . "
ORDER BY ID_MSG " . ($ascending ? '' : 'DESC') . ($modSettings['defaultMaxMessages'] == -1 ? '' : "
LIMIT $start, $limit"), __FILE__, __LINE__);
--- End code ---
(One line added to, and a new line inserted.)
This has been tested on SMF 2.0.2, but not SMF 1.1.x.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version