03-04-2012, 09:36 AM
If we have a spam forum, and want to create a simple "The X Post Win" thingy for fun, we can do this simple example:
We need PHP in Templates / Complex Templates or Template Conditionals plugin for this:
Now, we can run the contest.
Well, it is just for fun
There is an additional settings we can do (thanks, Yumi):
Example:
The X Post Winner
[attachment=713]
Hidden Post Winner (Lucky Post)
[attachment=714]
We need PHP in Templates / Complex Templates or Template Conditionals plugin for this:
- Create a custom thread fields:
AdminCP -> Configuration -> Custom Thread Fields- Title: Post Winner
Modify it as our needs - Key: postwin
- Applicable Forums: Select our Spam forum
- Editable by / Required Field?: Moderators
Modify it as our needs. In this example, our Mods are allowed to run a contest. - Underlying Data Type: Integer Unsigned
- Text Mask Filter: Digits
- Title: Post Winner
- Edit our postbit/postbit_classic template.
Find {$post['message']}, and add this code before the variable:
Code:<if $postcounter == $GLOBALS['threadfields']['postwin'] then><div class="largetext" style="text-align: center;">You're The Winner</div><br /></if>
Modify it as our needs.
Now, we can run the contest.
Well, it is just for fun
There is an additional settings we can do (thanks, Yumi):
(03-04-2012 11:56 AM)ZiNgA BuRgA Wrote: [ -> ]You may wish to disable deleting posts in the forum so that people can't cheat by shifting their posts up or similar.
Example:
The X Post Winner
[attachment=713]
Hidden Post Winner (Lucky Post)
[attachment=714]