10 mins to create/convert a forum node to a Question forum type, and a couple of basic Template Edits to have a quite effective photo/image competition on your site for members.
Goal: A forum node with a thread, per month, where members will submit their photo/image entry. Members will vote on photos/images they like. At the end of the month, the post with the highest votes is marked as the Winner by a moderator/staff member. Celebrate!
From /admin.php?nodes/ either;
i) add a new node with forum type Question, or
ii) edit an existing node and change its type to Question
Edit the node you just created/converted, and untick the option labelled 'Allow answers given to votable questions to be downvoted'
Note: Before saving the node settings, look at your browser's URL bar to note the node ID as you'll need this for Step 5 below. Your node ID is the number near the end of the URL, for example with URL of /admin.php?forums/monthly-photo-competition.89/edit the node ID is 89.
For me, I have the following;
Note: The below permissions sets up the presumption that only moderators/staff will create the monthly competition thread and mark the winning image/photo post.
At a minimum, you'll likely want to ensure that your Registered Users user group has at least the following permissions;
And lastly, for permissions, ensure your Moderators/Staff user group has the permissions
Note: Utilise Analyze permissions ( /admin.php?permissions/analyze ) | Node permissions to check/confirm your desired permissions are set correctly. Pick both a 'regular' user and a moderator/staff member against your Photo/Image Competition node to see their permissions.
From Templates ( /admin.php?templates/ ), 1) choose the active style for your site (it's always recommended to have/use a child style, when editing templates),
I have a seperate sticky thread with the overall competition rules, and a thread each month for the competition. The first post in the monthly thread reminding/linking to the overall rules and setting the theme for that month's competition. The previous months winner chooses the theme for the next month.
Goal: A forum node with a thread, per month, where members will submit their photo/image entry. Members will vote on photos/images they like. At the end of the month, the post with the highest votes is marked as the Winner by a moderator/staff member. Celebrate!
Step 1: Create, or convert an existing, forum node and make it a question forum type.
From /admin.php?nodes/ either;
i) add a new node with forum type Question, or
ii) edit an existing node and change its type to Question
Step 2: Remove the ability to give down votes.
Edit the node you just created/converted, and untick the option labelled 'Allow answers given to votable questions to be downvoted'
Note: Before saving the node settings, look at your browser's URL bar to note the node ID as you'll need this for Step 5 below. Your node ID is the number near the end of the URL, for example with URL of /admin.php?forums/monthly-photo-competition.89/edit the node ID is 89.
Step 3: Review the remaining node options, including within advanced group, to define your configuration.
For me, I have the following;
- 'Display in the node list': ticked
- 'Allow new messages to be posted in this forum': ticked
- 'Count messages posted in this forum toward user total': ticked
- 'Include threads from this forum when users click "New posts"': ticked
- -- All other tick boxes are unticked --
Step 4: Review your node permissions.
Note: The below permissions sets up the presumption that only moderators/staff will create the monthly competition thread and mark the winning image/photo post.
At a minimum, you'll likely want to ensure that your Registered Users user group has at least the following permissions;
- View node
- View threads by others
- View thread content
- Vote on threads/posts
- Post replies
- View attachments to posts
- Upload attachments to posts
- React to posts
- Post new thread
And lastly, for permissions, ensure your Moderators/Staff user group has the permissions
- Post new thread
- Mark post as solution to any question thread
Note: Utilise Analyze permissions ( /admin.php?permissions/analyze ) | Node permissions to check/confirm your desired permissions are set correctly. Pick both a 'regular' user and a moderator/staff member against your Photo/Image Competition node to see their permissions.
Step 5: Edit Templates to change phrase usage from Solution to Winner.
From Templates ( /admin.php?templates/ ), 1) choose the active style for your site (it's always recommended to have/use a child style, when editing templates),
Step 5.1: Modify the thread_view_type_question template
- enter 'thread_view' into the filter box (2)
- click on the thread_view_type_question template (3) to open/edit it
- Scroll down to line 28 with content of {{ phrase('solution') }}
- Replace line 28 to instead have content of <xf:if is="in_array($xf.reply.containerKey, ['node-89'])">Winner<xf:else />{{ phrase('solution') }}2</xf:if>
- Note: Replace node-89 in the line above with the id number of your Photo/Image Competition node, as noted in Step 2.
- Click the 'Save and exit button' at the bottom to return to the templates list
Step 5.2: Modify the post_question_macros template
- enter 'post_question' into the filter box (2)
- click on the post_question_macros template (3) to open/edit it
- scroll down to line 19 with content of <xf:set var="$makeSolutionText" value="{{ phrase('mark_as_solution') }}" />
- On a new line immediately below it, add the following code;
Code:
<xf:if is="in_array($xf.reply.containerKey, ['node-89'])">
<xf:set var="$isSolutionText" value="Unmark as Winner" />
<xf:else />
<xf:set var="$isSolutionText" value="{{ phrase('unmark_as_solution') }}" />
</xf:if>
<xf:if is="in_array($xf.reply.containerKey, ['node-89'])">
<xf:set var="$makeSolutionText" value="Mark as Winner" />
<xf:else />
<xf:set var="$makeSolutionText" value="{{ phrase('mark_as_solution') }}" />
</xf:if>
- Note: Replace node-89 in the two lines above with the id number of your Photo/Image Competition node, as noted in Step 2.
- Click the 'Save and exit button' at the bottom to return to the templates list
Done!
Now go ahead and create a thread in your Photo Competition forum, announcing the competition rules and theme, and inviting users to post and upload/link their photo or image for the competition.I have a seperate sticky thread with the overall competition rules, and a thread each month for the competition. The first post in the monthly thread reminding/linking to the overall rules and setting the theme for that month's competition. The previous months winner chooses the theme for the next month.