• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Photo / Image Competition with a Question forum Xenforo 2

Admin

Well-Known Member
Staff member
Administrator
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!


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

50319731041_1e0559332e_o.png

50319905177_243012d420_o.png


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'

50319905392_e1d6c74e1e_o.png


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
Additionally, you may consider removing the following permissions from Registered users;
  • React to posts
  • Post new thread
50319905627_93983d60ba_o.png


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.

50319732021_beda2f981f_o.png



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),

50319906037_24aab38cb4_o.png


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.
Your template code should now look like this (but with your node ID):
50319906257_46c73dfaa7_o.png

  • 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.
Your template code should now look like this (but with your node ID):
50319732746_7a4de21bc7_o.png

  • 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.
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top