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
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Just For Fun
Neat and fun idea!
You may wish to disable deleting posts in the forum so that people can't cheat by shifting their posts up or similar.

My Blog
03-04-2012 11:56 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #3
RE: Just For Fun
Thanks, Yumi.

I've updated the first post for the additional setting (disable deleting posts in the forum).

03-05-2012 03:49 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: