Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Project Crosshair

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jan 31, 2014
Messages
9
Reaction score
3
BlasterWacks - Project Crosshair - RaGEZONE Forums
Hey people,

Welcome to this topic, and if you'd please read the big letters up top, you'll know this topic is about Project Crosshair.

BlasterWacks - Project Crosshair - RaGEZONE Forums
So before getting down to business, I thought it was smart to give you some information before you read the rest. As some of you may know, I've been out of the scene for a while, so I probably missed some stuff. If you notice me forgetting something, Drop it in a comment!

Also, a question I've bin getting a lot is "Why 'Crosshair'?"; Well, to be very honest, I don't know x).
So after three days of too much coffee (I know that too much coffee is impossible for someone who develops stuff...) and bad music, I've come up with a style, which has a couple of 'agreements' with other CMS's. So I also want to give credits to Bas and the pixeltime team for the idea of the registration.
BlasterWacks - Project Crosshair - RaGEZONE Forums
As you just read, there are some influences from other designs. I hope you like it...

INDEX:
nMckO4 - Project Crosshair - RaGEZONE Forums
( )

REGISTRATION:
YBMxw8J - Project Crosshair - RaGEZONE Forums



p5NIOM4 - Project Crosshair - RaGEZONE Forums



75MnWdk - Project Crosshair - RaGEZONE Forums



HEuCsJ3 - Project Crosshair - RaGEZONE Forums
( )
( )
( )
( )

ME:
iZnQdQz - Project Crosshair - RaGEZONE Forums
( )
This is the design untill now. I hope you like it. Drop a comment on it:D
BlasterWacks - Project Crosshair - RaGEZONE Forums

  • The logo adjusts itself if you change the hotelname.
  • Edit pages in Housekeeping
  • Homes
  • Group forums
  • VIP points
  • Multi-Template
  • Multi-Language
That where all the ideas that I could think of. If there's something you'd like to see, drop a comment!:D
BlasterWacks - Project Crosshair - RaGEZONE Forums
Since the most of you would like to see something code related, I've collected some snippets for you:

A piece of ch.template.php
PHP:
public static function set($key, $value)    
{        
     self::$param['{' . $key . '}'] = $value;   
}
    
public static function setUser($key, $value)    
{        
     self::$user['%' . $key . '%'] = $value;   
 }

private static function parseParams($content)    
{        
     $keys = array_keys(self::$param);        
     $values = array_values(self::$param);       
     $content = str_replace($keys, $values, $content);        
     if (isset($_SESSION['user']))        
     {            
          self::$user = unserialize($_SESSION['user']);            
          $userkeys = array_keys(self::$user);            
          $uservalues = array_values(self::$user);            
          self::$output = str_replace($userkeys, $uservalues, $content);       
     }            
          else        
     {            
          self::$output = $content;        
     }        
     return self::$output;   
}

A piece of ch.users.php
PHP:
private function setKey($key, $id)    
{
     $date = date('H:i');        
     $query = DB::$conn->prepare('INSERT INTO login_session VALUES (?, ?, ?)');        
     $query->bind_param('iss', $id, $key, $date);        
     $query->execute();        
     $query->close();    
}

public function isLogged($key)    
{        
     $query = DB::$conn->prepare('SELECT session_key FROM login_session WHERE session_key = ?');        
     $query->bind_param('s', $key);       
     $query->execute();          
     $query->bind_result($dbkey);        
     $query->store_result();        
     if ($query->num_rows() > 0)        
     {            
          return true;        
     }            
          else       
     {           
          return false;        .
     }       
     $query->close();    
}
BlasterWacks - Project Crosshair - RaGEZONE Forums
So guys and girls, what do you think? Do you think this will succeed? What would you like to see? And of course, would you use it?
Post a comment and let me know!

Cheers,

BW

Btw guys; I'm sorry for the kinda long post! Here's a picture of a potato:
BlasterWacks - Project Crosshair - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
ignition sequence start
Loyal Member
Joined
Jul 27, 2012
Messages
1,833
Reaction score
1,148
So guys and girls, what do you think? Do you think this will succeed?

That isn't for the community to decide, only you can show us if project 'Crosshair' is a success. Good luck on your project!

Nice potato by the way. I think it gives this thread the glam all dev threads have been needing.
 
Joined
Aug 10, 2011
Messages
7,399
Reaction score
3,307
You may want to think about several things more for example:

Code:
$query = DB::$conn->prepare('SELECT session_key FROM login_session WHERE session_key = ?');

As you only check if there is atleast one session with a certain key, why not LIMIT 1 ?

This will stop executing the query once it finds something and thus reduces memory and CPU usage a bit.

It is not much but if you want to make a solid application it is important that you try to optimize everything as much as possible.
 

AWA

Master Summoner
Loyal Member
Joined
Feb 24, 2008
Messages
595
Reaction score
389
You may want to think about several things more for example:

Code:
$query = DB::$conn->prepare('SELECT session_key FROM login_session WHERE session_key = ?');

As you only check if there is atleast one session with a certain key, why not LIMIT 1 ?

This will stop executing the query once it finds something and thus reduces memory and CPU usage a bit.

It is not much but if you want to make a solid application it is important that you try to optimize everything as much as possible.
If session_key is a primary key (which I hope), it doesn't really matter.
 
Joined
Jun 23, 2010
Messages
2,324
Reaction score
2,195
Well he atleast he could

Code:
SELECT NULL FROM session_key

as he only needs the row count.

And I don't know the structure of his database so.

Even better is to just use the MySql function COUNT. The mysqli_num_rows retreives all result sets to count (depens if you use buffered or unbuffered result sets).
 
Newbie Spellweaver
Joined
Jan 31, 2014
Messages
9
Reaction score
3
Busy on the menu, still needs some positioning tho:


Made a logout container, which fades in when you press logout (BG also fades to black with some opacity):
 
Run, but I'll find you.
Joined
Jan 29, 2011
Messages
777
Reaction score
327
Not bad. The design can be done a little better but I understand that this is still in the early stages.
When blurring the page elements, are they using CSS blur or an actual image?
 
I don't even know
Loyal Member
Joined
Apr 7, 2010
Messages
1,699
Reaction score
420
PHP:
private static function parseParams($content)    
{        
     $keys = array_keys(self::$param);        
     $values = array_values(self::$param);       
     $content = str_replace($keys, $values, $content);        
     if (isset($_SESSION['user']))        
     {            
          self::$user = unserialize($_SESSION['user']);            
          $userkeys = array_keys(self::$user);            
          $uservalues = array_values(self::$user);            
          self::$output = str_replace($userkeys, $uservalues, $content);       
     }            
          else        
     {            
          self::$output = $content;        
     }        
     return self::$output;   
}

I'm sorry but your parseParams function made me cringe, why not use something like this:

PHP:
private static function parseParams($content)    
{
     if (isset($_SESSION['user']))        
     {            
          self::$param = array_merge(self::$param, unserialize($_SESSION['user'])); 
     }

     return (self::$output = strtr($content, self::$param));   
}

Also, give the boxes on the ME page some padding please.

Good luck with your project!
 
Joined
Feb 22, 2012
Messages
2,103
Reaction score
1,271
Why you don't use Smarty btw?
It'd be so much cleaner, and you could make better use to your parse stuff.
When I did my old CMS, I used like:

$CMS->Register($user, $templating);

On Register's method, I used to add all my infos provided in MySQL (users), for instance, if the table was: id, username, password, figure, ip_last, ip_reg, blahblah

you could use, even without coding a new table:
{$blahblah} on tpl file.
or {$username}.

Any TPL files had a PHP on it, well, it was Smarty, which is an enterpreter, but still, it was cleaner. Everything I used at the TPL was first declared at PHP, and then used on TPL.

Instance:

PHP:
{foreach $key $item}
HELLO {$key}!!!!
{/foreach}

So, absolutely no php in any page. Including Housekeeping.

That's what I think you should do.
 
Status
Not open for further replies.
Back
Top