Advertisement
Mimergt

Tinypass WP plugin Custom AccessGaranted II

Mar 26th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     $rid = "wp_post_" . strval($post->ID); // Same like the tinypass.php of the plugin source (is the post id )
  3.     $store = new TPAccessTokenStore();
  4.     $store->loadTokensFromCookie($_COOKIE);
  5.    
  6.     $tagToken = $store->getAccessToken($rid); // Get the token of the tag for the RID
  7.     if($tagToken != null && $tagToken->isAccessGranted()) { // ok obvusly if the acces is Garanted load the code above
  8.         $show = '<p>Wuuuju!! this is The Private Content </p>'; //just an exaple
  9.         return $show;
  10.     }
  11.     else { //if the acces is NOT Garanted
  12.         echo('Dam!! Not Works'); //an exaple to...
  13.     }
  14.                
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement