● This years April Fools joke I did, for those that missed it.

Tue Apr 05, 2016 1:23 am
Clan Leader
Top Dog
Nuke Dev / Coder
3015 Posts
coRpSE
Currently Offline
Offline

Most Played:
This week: 77.7hrs.
Total Played: 195hrs.


  
There is life outside of the game.
Reputation: 7317.9
votes: 7
This year, I wanted to do something different on our site. For those of you that were using FireFox, you guys missed out as well of those that did not come to the site. Last year, I made it look like my site got hacked. I also did that two years ago. Three years ago, I don't remember what I did but I know for at the last 6+ years, it has been something I have done on my site for this obscure yearly traditions. This year, I went and did something that was a popular form of trolling a few years back. Just watch this if you did not make it to my site today.



I made this post over at Lonestars site a few days ago and I figured to put it here as well, but one question that came up was how I did it. Below is a copy and paste from Lonestars site,
Please login to see this link
Get registered or Log in




Don't know about anyone else but I would love to know how you did that
mate?

Also how did you make it look like you got hacked the year before?


Last year and the year before I did this:
Please login to see this link
Get registered or Log in


Don't do anything but go to that page and watch. ;)

as for what I did this year, it was a mix of PHP and css.

What I did was this, for the css, I created a file and name it lets say, af-css.css
Then inside that file I put this code,

Code: [ Select all ]

/*
  Spin Class
*/
.aprilfools {
  -webkit-animation: spin 5s linear infinite;
  animation: spin 5s linear infinite;
}

/* Color Guard! */
html {
  -webkit-animation: rainbow 1s infinite;
}

@-webkit-keyframes spin {
  0%   { -webkit-transform: rotate(0deg); }
  100%   { -webkit-transform: rotate(360deg); }
}

@-webkit-keyframes rainbow {
  100% { -webkit-filter: hue-rotate(360deg); }
}

div.afbanner {
   background-image: url('http://www.headshotdomain.net/images/April-Fools.png');
   background-size: cover;
    background-repeat: no-repeat;
   z-index: 9999;
   position: relative;
   margin-left: auto;
   margin-right: auto;
   top: 0;
   width: 648px;
   height: 314px;
}


Next, I created an image for the banner to show up that says April Fools and stuck that into my images folder. Then I uploaded the css file somewhere on my site where I know I will find it when ever I need it.

Then, I went into my header.php file found in the root of my site and I put the code below in right after themeheader(); and before the }

PHP:  [ Select all ]

//  ###################  APRIL FOOLS DAY #####################    
     
 global $userinfo;
    
$cookietime 5                    //Time between popups. In minutes. Set to 0 for no time between message showing up on page refreshes
    
$cookie_name 'april_fool_hsx'    //Cookie Name
    
$cookie_value 'true';
//    $uname2 = $userinfo['username'];     //Only used if you want to target specific people or only your self for testing purposes
    
$afdate date("md");                //Check to see if today is April Fools day
//############################################################    
    
if (!isset($_COOKIE['april_fool_hsx']) /*&& $uname2 == 'coRpSE' */&& $afdate == '0401'){
     
   echo "<link rel=\"stylesheet\" href=\"./PATH_TO_CSS/af-css.css\" type=\"text/css\">";         
     
   echo '<audio autoplay loop> <source src="./includes/ap/rick-rolled.mp3" type="audio/mpeg"> Your browser does not support the audio element.</audio>';
 
       echo '<div class="afbanner"> </div>';
        
//create cookie
        
setcookie($cookie_name$cookie_valuetime() + (60 $cookietime), "/" );
        
//cookie created
    

// ################### END APRIL FOOLS ###################### 

 

Last thing I did was I went to the images I wanted to spin on my site, and I just gabe them a class of aprilfools, something like this,

Code: [ Select all ]

<img src="./Path/To/Some/Image.jpg" class="aprilfools">


That's all I did.

basically, this writes a cookie that disables it until the cookie expires, which I have set to 5 min on my site.

Unfortunately FireFox does not display the CSS goodies like Chrome, Opera and Edge do.


Expand
Tue Apr 05, 2016 1:34 pm
Clan Leader
No Life!!!
347 Posts
Reputation: 963.9
Makes me Dissy!


Expand
Sun Apr 17, 2016 10:28 pm
Clan Member
Blabbing Noob
66 Posts
Reputation: 310.9
You know, I don't think the Rickrolled will ever truly die.
Forums ©