Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Just For Fun
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #1
Just For Fun
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:
  1. 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
  2. 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 Biggrin

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
   

Hidden Post Winner (Lucky Post)
   

(This post was last modified: 03-05-2012 03:46 AM by RateU.)
03-04-2012 09:36 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Just For Fun - RateU - 03-04-2012 09:36 AM
RE: Just For Fun - ZiNgA BuRgA - 03-04-2012, 11:56 AM
RE: Just For Fun - RateU - 03-05-2012, 03:49 AM

 Standard Tools
Forum Jump: