cleaned up formatting and added custom.css

This commit is contained in:
Botanic 2013-06-16 22:57:09 -07:00
parent 1d155268d2
commit 473703c19f
11 changed files with 116 additions and 99 deletions

View file

@ -1,7 +1,7 @@
<?php
class Helpers{
static public function loadTemplate( $template, $vars = array (), $forcelibrender = false )
static public function loadTemplate( $template, $vars = array (), $forcelibrender = false )
{
global $AMS_LIB;
global $SITEBASE;
@ -44,35 +44,35 @@ class Helpers{
foreach ( $variables[$template] as $key => $value ){
$smarty -> assign( $key, $value );
}
if($vars['permission'] == 1){
$inherited = "layout_admin.tpl";
}else{
$inherited = "layout_user.tpl";
}
//extends:' . $inherited .'|register.tpl
$smarty -> display( $template.'.tpl' );
if( $vars['permission'] == 1 ){
$inherited = "layout_admin.tpl";
}else{
$inherited = "layout_user.tpl";
}
// extends:' . $inherited .'|register.tpl
$smarty -> display( $template . '.tpl' );
}
static public function create_folders(){
global $AMS_LIB;
global $SITEBASE;
$arr = array( $AMS_LIB . '/ingame_templates/',
$AMS_LIB . '/configs',
$AMS_LIB . '/cache',
$SITEBASE . '/cache/',
$SITEBASE . '/templates/',
$SITEBASE . '/templates_c/',
$SITEBASE . '/configs'
);
foreach ( $arr as & $value ){
$arr = array( $AMS_LIB . '/ingame_templates/',
$AMS_LIB . '/configs',
$AMS_LIB . '/cache',
$SITEBASE . '/cache/',
$SITEBASE . '/templates/',
$SITEBASE . '/templates_c/',
$SITEBASE . '/configs'
);
foreach ( $arr as & $value ){
if ( !file_exists( $value ) ){
mkdir( $value );
}
}
}
}
static public function check_if_game_client()
static public function check_if_game_client()
{
// if HTTP_USER_AGENT is not set then its ryzom core
if ( !isset( $_SERVER['HTTP_USER_AGENT'] ) ){

View file

@ -1,11 +1,10 @@
<?php
class Sql{
public function db_query( $query, $values = array() )
public function db_query( $query, $values = array() )
{
echo "tst";
}
}
}
}

View file

@ -1,6 +1,6 @@
<?php
class Users{
public function add_user(){
// check if values exist
if ( isset( $_POST["Username"] ) and isset( $_POST["Password"] ) and isset( $_POST["Email"] ) )
@ -18,7 +18,7 @@ class Users{
}
// if all are good then create user
if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success" ) and ( $email == "success" ) and ( isset( $_POST["TaC"] ) ) ){
$edit = array(
$edit = array(
'name' => $_POST["Username"],
'pass' => $_POST["Password"],
'mail' => $_POST["Email"],
@ -31,7 +31,7 @@ class Users{
header( 'Location: email_sent.php' );
exit;
}else{
$pageElements = array(
$pageElements = array(
'GAME_NAME' => variable_get( 'ryzommanage_game-name', '' ),
'WELCOME_MESSAGE' => variable_get( 'ryzommanage_register-welcome', '' ),
'USERNAME' => $user,
@ -44,7 +44,7 @@ class Users{
}else{
$pageElements['USERNAME_ERROR'] = 'FALSE';
}
if ( $pass != "success" ){
$pageElements['PASSWORD_ERROR'] = 'TRUE';
}else{
@ -68,10 +68,10 @@ class Users{
return $pageElements;
}
}
/**
* Function checkUser
*
*
* @takes $username
* @return string Info: Returns a string based on if the username is valid, if valid then "success" is returned
*/
@ -84,7 +84,7 @@ class Users{
return "Username must be 5 or more characters.";
}elseif ( !preg_match( '/^[a-z0-9\.]*$/', $username ) ){
return "Username can only contain numbers and letters.";
}elseif ( sql :: db_query( "SELECT COUNT(*) FROM {users} WHERE name = :name", array(
}elseif ( sql :: db_query( "SELECT COUNT(*) FROM {users} WHERE name = :name", array(
':name' => $username
) ) -> fetchField() ){
return "Username " . $username . " is in use.";
@ -98,7 +98,7 @@ class Users{
}
/**
* Function checkPassword
*
*
* @takes $pass
* @return string Info: Returns a string based on if the password is valid, if valid then "success" is returned
*/
@ -117,7 +117,7 @@ class Users{
}
/**
* Function confirmPassword
*
*
* @takes $pass
* @return string Info: Verify's $_POST["Password"] is the same as $_POST["ConfirmPass"]
*/
@ -132,16 +132,16 @@ class Users{
}
/**
* Function checkEmail
*
*
* @takes $email
* @return
* @return
*/
public function checkEmail( $email )
{
if ( isset( $email ) ){
if ( !validEmail( $email ) ){
return "Email address is not valid.";
}elseif ( db_query( "SELECT COUNT(*) FROM {users} WHERE mail = :mail", array(
}elseif ( db_query( "SELECT COUNT(*) FROM {users} WHERE mail = :mail", array(
':mail' => $email
) ) -> fetchField() ){
return "Email is in use.";
@ -230,4 +230,3 @@ class Users{
}
}

View file

@ -3,6 +3,6 @@
// Base include file for library functions for AMS
// ***********************************************
function __autoload( $className ){
require_once 'autoload/' . strtolower ($className) . '.php';
}
require_once 'autoload/' . strtolower ( $className ) . '.php';
}

View file

@ -16,7 +16,7 @@ if ( isset( $_POST["Username"] ) and isset( $_POST["Password"] ) and isset( $_PO
}
// if all are good then create user
if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success" ) and ( $email == "success" ) and ( isset( $_POST["TaC"] ) ) ){
$edit = array(
$edit = array(
'name' => $_POST["Username"],
'pass' => $_POST["Password"],
'mail' => $_POST["Email"],
@ -29,7 +29,7 @@ if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success"
header( 'Location: email_sent.php' );
exit;
}else{
$pageElements = array(
$pageElements = array(
'GAME_NAME' => $GAME_NAME,
'WELCOME_MESSAGE' => $WELCOME_MESSAGE,
'USERNAME' => $user,
@ -42,7 +42,7 @@ if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success"
}else{
$pageElements['USERNAME_ERROR'] = 'FALSE';
}
if ( $pass != "success" ){
$pageElements['PASSWORD_ERROR'] = 'TRUE';
}else{
@ -64,7 +64,7 @@ if ( ( $user == "success" ) and ( $pass == "success" ) and ( $cpass == "success"
$pageElements['TAC_ERROR'] = 'TRUE';
}
if ( helpers :: check_if_game_client() ){
helpers :: loadtemplate( '../../ams_lib/ingame_templates/register.phtml', $pageElements );
helpers :: loadtemplate( '../../ams_lib/ingame_templates/register.phtml', $pageElements );
}else{
helpers :: loadtemplate( 'templates/register.phtml', $pageElements );
}

View file

@ -0,0 +1,17 @@
.login-header
{
height:190px;
}
.brand img
{
height:100%;
margin-bottom:-18px;
margin-top:-15px;
width:100%;
}
#for-is-ajax
{
display:none;
}

View file

@ -1,12 +1,12 @@
<?php
function add_user(){
// add user locally here
// add user locally here
$return = users :: add_user();
return $return;
}
return $return;
}
function checkUser(){
}
}

View file

@ -6,18 +6,18 @@ require( '../../ams_lib/libinclude.php' );
if ( isset( $_POST["function"] ) ){
require( "inc/" . $_POST["function"] . ".php" );
$return = $_POST["function"]();
}
}
function loadpage ( $page ){
require_once( 'autoload/' . $page . '.php' );
}
}
$page = 'home';
if ( isset( $_GET["page"] ) ){
$page = $_GET["page"];
}
//temporary set permission to 1 which = admin mode
$return = array('permission' => 1, 'no_visible_elements' => 'TRUE');
}
// temporary set permission to 1 which = admin mode
$return = array( 'permission' => 1, 'no_visible_elements' => 'TRUE' );
helpers :: loadTemplate( $page , $return );

View file

@ -1,7 +1,7 @@
$(document).ready(function(){
//themes, change CSS with JS
//default theme(CSS) is cerulean, change it if needed
var current_theme = $.cookie('current_theme')==null ? 'spacelab' :$.cookie('current_theme');
var current_theme = $.cookie('current_theme')==null ? 'cerulean' :$.cookie('current_theme');
switch_theme(current_theme);
$('#themes a[data-value="'+current_theme+'"]').find('i').addClass('icon-ok');

View file

@ -11,7 +11,7 @@
<span class="icon-bar"></span>
</a>
<a class="brand" href="index.php"> <img alt="Charisma Logo" src="img/mainlogo.png"></a>
<!-- theme selector starts -->
<div class="btn-group pull-right theme-container">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
@ -31,7 +31,7 @@
</ul>
</div>
<!-- theme selector ends -->
<!-- user dropdown starts -->
<div class="btn-group pull-right">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
@ -45,7 +45,7 @@
</ul>
</div>
<!-- user dropdown ends -->
</div>
</div>
@ -53,7 +53,7 @@
<!-- topbar ends -->
<div class="container-fluid">
<div class="row-fluid">
<!-- left menu starts -->
<div class="span2 main-menu-span">
<div class="well nav-collapse sidebar-nav">
@ -67,17 +67,17 @@
</div><!--/.well -->
</div><!--/span-->
<!-- left menu ends -->
<noscript>
<div class="alert alert-block span10">
<h4 class="alert-heading">Warning!</h4>
<p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> enabled to use this site.</p>
</div>
</noscript>
<div id="content" class="span10">
<!-- content starts -->
<div class="sortable row-fluid ui-sortable">
<a data-original-title="6 new members." data-rel="tooltip" class="well span3 top-block" href="#">
@ -100,7 +100,7 @@
<div>$13320</div>
<span class="notification yellow">$34</span>
</a>
<a data-original-title="12 new messages." data-rel="tooltip" class="well span3 top-block" href="#">
<span class="icon32 icon-color icon-envelope-closed"></span>
<div>Messages</div>
@ -108,7 +108,7 @@
<span class="notification red">12</span>
</a>
</div>
<div class="row-fluid">
<div class="box span12">
<div class="box-header well">
@ -123,15 +123,15 @@
<h1>Charisma <small>free, premium quality, responsive, multiple skin admin template.</small></h1>
<p>Its a live demo of the template. I have created Charisma to ease the repeat work I have to do on my projects. Now I re-use Charisma as a base for my admin panel work and I am sharing it with you :)</p>
<p><b>All pages in the menu are functional, take a look at all, please share this with your followers.</b></p>
<div class="clearfix"></div>
</div>
</div>
</div>
<div class="row-fluid sortable ui-sortable">
<div class="box span4">
<div class="box-header well" data-original-title="">
<h2><i class="icon-user"></i> Member Activity</h2>
@ -149,7 +149,7 @@
<strong>Name:</strong> <a href="#">Usman
</a><br>
<strong>Since:</strong> 17/05/2012<br>
<strong>Status:</strong> <span class="label label-success">Approved</span>
<strong>Status:</strong> <span class="label label-success">Approved</span>
</li>
<li>
<a href="#">
@ -157,7 +157,7 @@
<strong>Name:</strong> <a href="#">Sheikh Heera
</a><br>
<strong>Since:</strong> 17/05/2012<br>
<strong>Status:</strong> <span class="label label-warning">Pending</span>
<strong>Status:</strong> <span class="label label-warning">Pending</span>
</li>
<li>
<a href="#">
@ -165,7 +165,7 @@
<strong>Name:</strong> <a href="#">Abdullah
</a><br>
<strong>Since:</strong> 25/05/2012<br>
<strong>Status:</strong> <span class="label label-important">Banned</span>
<strong>Status:</strong> <span class="label label-important">Banned</span>
</li>
<li>
<a href="#">
@ -173,13 +173,13 @@
<strong>Name:</strong> <a href="#">Saruar Ahmed
</a><br>
<strong>Since:</strong> 17/05/2012<br>
<strong>Status:</strong> <span class="label label-info">Updates</span>
<strong>Status:</strong> <span class="label label-info">Updates</span>
</li>
</ul>
</div>
</div>
</div><!--/span-->
<div class="box span8">
<div class="box-header well" data-original-title="">
<h2><i class="icon-list-alt"></i> Realtime Traffic</h2>
@ -241,7 +241,7 @@
</p>
</div>
</div><!--/span-->
<div class="box span4">
<div class="box-header well" data-original-title="">
<h2><i class="icon-list"></i> Buttons</h2>
@ -278,10 +278,10 @@
<li><a href="#"><i class="icon-tint"></i> Separated link</a></li>
</ul>
</div>
</div>
</div><!--/span-->
<div class="box span4">
<div class="box-header well" data-original-title="">
<h2><i class="icon-list"></i> Weekly Stat</h2>
@ -295,9 +295,9 @@
<ul class="dashboard-list">
<li>
<a href="#">
<i class="icon-arrow-up"></i>
<i class="icon-arrow-up"></i>
<span class="green">92</span>
New Comments
New Comments
</a>
</li>
<li>
@ -311,21 +311,21 @@
<a href="#">
<i class="icon-minus"></i>
<span class="blue">36</span>
New Articles
New Articles
</a>
</li>
<li>
<a href="#">
<i class="icon-comment"></i>
<span class="yellow">45</span>
User reviews
User reviews
</a>
</li>
<li>
<a href="#">
<i class="icon-arrow-up"></i>
<i class="icon-arrow-up"></i>
<span class="green">112</span>
New Comments
New Comments
</a>
</li>
<li>
@ -339,28 +339,28 @@
<a href="#">
<i class="icon-minus"></i>
<span class="blue">93</span>
New Articles
New Articles
</a>
</li>
<li>
<a href="#">
<i class="icon-comment"></i>
<span class="yellow">254</span>
User reviews
User reviews
</a>
</li>
</ul>
</div>
</div><!--/span-->
</div><!--/row-->
<!-- content ends -->
</div><!--/#content.span10-->
</div><!--/fluid-row-->
<hr>
<div class="modal hide fade" id="myModal">
@ -380,7 +380,7 @@
<footer>
<p class="pull-right">Powered by: <a href="http://usman.it/free-responsive-admin-template">Charisma</a></p>
</footer>
</div><!--/.fluid-container-->
{/block}

View file

@ -51,7 +51,9 @@
<!-- The fav icon -->
<!--<link rel="shortcut icon" href="img/favicon.ico">-->
<!--custom css file-->
<link href="css/custom.css" rel="stylesheet">
</head>
<body>
@ -66,7 +68,7 @@
<span class="icon-bar"></span>
</a>
<a href="index.html"> <img src="img/ryzomtop.png" height="65" style="padding-left:26px;"/></a>
<!-- theme selector starts -->
<div class="btn-group pull-right theme-container" >
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
@ -86,7 +88,7 @@
</ul>
</div>
<!-- theme selector ends -->
<!-- user dropdown starts -->
<div class="btn-group pull-right" >
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
@ -117,14 +119,14 @@
</div><!--/.well -->
</div><!--/span-->
<!-- left menu ends -->
<noscript>
<div class="alert alert-block span10">
<h4 class="alert-heading">Warning!</h4>
<p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a> enabled to use this site.</p>
</div>
</noscript>
<div id="content" class="span10">
<!-- content starts -->
{/if}
@ -231,7 +233,7 @@
<script src="js/jquery.history.js"></script>
<!-- application script for Charisma demo -->
<script src="js/charisma.js"></script>
</body>
</html>