|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Aliresalat Smarty Rookie
Joined: 09 Feb 2014 Posts: 23 Location: Iran
|
Posted: Fri Jul 25, 2014 3:56 am Post subject: lock page plugin v2 |
|
|
A plug-in application for blocking a page of your site
I remember like it, especially admin
-----------------------------------------------
File name : modifier.lock.php
Code: |
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* modifier.lock v2
* File name: modifier.lock.php
* Name: lock page
* Date: 2014.07.25
*
* Examples:
<center>
<div class="inputfield">
This page has been blocked {$image.username}
</div>
{$user|lock}
</center>
*
* @author : Ali Resalat (300) <info.Aliresalat@Gmail.com>
* @web site : www.Aliresalat.ir
* @Yahoo ID : Mitooo.Mitooo
*/
function smarty_modifier_lock($Fild='')
{
class aliresalatProtector{
var $password = 'your password';
function showLoginForm(){
echo "
<html lang='fa' dir='rtl'>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<style type='text/css'>
.inputfield {border-style:solid;font-family:byekan,b yekan;font-size:18px;text-align:right;-moz-transition:all 0.5s;-webkit-transition:all 0.5s;transition:all 0.5s;}
.inputfield:hover {-moz-box-shadow: 0px 0px 13px #f4ff19;-webkit-box-shadow: 0px 0px 13px #f4ff19;box-shadow: 0px 0px 13px #f4ff19;-moz-transition: all 0.5s;-webkit-transition: all 0.5s ;transition: all 0.5s;}
.inputfield:focus {background-color:#e8e9ed;border-color:#3b5ad4;-moz-box-shadow: 0px 0px 28px #4772ff;-webkit-box-shadow: 0px 0px 28px #4772ff;box-shadow: 0px 0px 28px #4772ff;-moz-transition: all 0.5s;-webkit-transition: all 0.5s ;transition: all 0.5s;}element {box-shadow: 0px 0px 3px 0px rgb(204, 0, 0);}
.sharing img:hover{
-webkit-transform:scale(1.2);
-moz-transform:scale(1.2);
-o-transform:scale(1.2);
box-shadow:0px 0px 3px gray;
-webkit-box-shadow:0px 0px 30px gray;
-moz-box-shadow:0px 0px 30px gray;
opacity: 1;
}
</style>
</html>";
}
function login(){
$loggedin = isset($_SESSION['loggedin']) ? $_SESSION['loggedin'] : false;
if ( (!isset($_POST['submitBtn'])) && (!($loggedin))){
$_SESSION['loggedin'] = false;
$this->showLoginForm();
exit();
} else if (isset($_POST['submitBtn'])) {
$pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';
if ($pass != $this->password) {
$_SESSION['loggedin'] = false;
$this->showLoginForm();
exit();
} else {
$_SESSION['loggedin'] = true;
}
}
}
}
// Auto create
$protector = new aliresalatProtector();
$protector->login();
}
/* vim: set expandtab: */
?>
|
Examples 1 : {$user|lock}
Output : ------------------------
Examples 2 :
{if $user.lockimages}
<center>
<div class="inputfield">
This page has been blocked {$image.username}
</div>
</center>
{$user|lock}
{/if}
Output : This page has been blocked admin or User name of your website
Why not |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|