- Joined
- Jan 1, 2009
- Messages
- 385
- Reaction score
- 20

This tutorial can be used to create a Moderator group also that can see only the pages you want them to see.
So, let's start with the easy part. The database.
We will add Moderator and Premium columns ( that's the way I want to do it, if you want to do it your way than your are free to do that ):
PHP:
ALTER TABLE `game_users`
ADD `Premium` INT(1) NOT NULL,
ADD `Moderator` INT(1) NOT NULL
Now create a template notpremium.tpl
PHP:
<style type="text/css">
<!--
.style7 {color: #FF0000}
.style8 {
color: #FFFF00;
font-weight: bold;
}
-->
</style>
<br />
<table width="672" colspan="4">
<tr><td class="c" colspan="9"><center>
<font color=red><b>Premium Membership</b></font>
</center></td></tr>
<tr>
<th colspan="9"><p>You do not have access to this section/feature because you do not own a Premium Membership Package.</p>
<p><a href="donate.php">For more informations, click here.</a></p>
<p> Donating to our community is in the benefit of both sides. As we all know nothing is free and will never be. We are currently hosting a dedicated server which we payed for a couple of months ahead. We expect that we can reach the necesary sum to continue this server for our players. We offer you the chance of buying ingame utilities for this donations. You win, you get a server and items and we get the pleasure of a growing community. </p>
<p> </p>
<p><br />
</p></th>
</tr>
</table>
</body>
</html>

Now choose the files you want to hide from normal users. Let's say simulator.php.
At the beginning you have
PHP:
define('INSIDE' , true);
define('INSTALL' , false);
$xnova_root_path = './';
include($xnova_root_path . 'extension.inc');
include($xnova_root_path . 'common.' . $phpEx);
if(isset($_POST['submit'])) {;
And So On
PHP:
if(($user['Premium']=="")||($user['Premium']=="0")) {
$body = gettemplate('notpremium');
$page = parsetemplate($body, $parse);
display($page, $lang['Chat'], false);
}else{
So you will have:
PHP:
<?php
/**
* Trinity Dev
*/
define('INSIDE' , true);
define('INSTALL' , false);
$xnova_root_path = './';
include($xnova_root_path . 'extension.inc');
include($xnova_root_path . 'common.' . $phpEx);
if(($user['Premium']=="")||($user['Premium']=="0")) {
$body = gettemplate('notpremium');
$page = parsetemplate($body, $parse);
display($page, $lang['Chat'], false);
}else{
That will show the template we created above to any users that has nothing or 0 in the Premium column. So in that template you will post a Buy A Premium Account message :closedeyes:
If you want to show this page only to mods then instead of if(($user['Premium']=="")||($user['Premium']=="0")) make it if(($user['Moderator']=="")||($user['Moderator']=="0")) or if you want to work with authleve then if($user['authlevel']>1).
You can do that on any page.
Now let's say you want to add some ads.
In the php code of the page you want to have the ads on, add:
PHP:
if(($user['Premium']=="")||($user['Premium']=="0")||($user['Moderator']=="0")||($user['Moderator']==""))
$ads="ad html code/script code / blabla";
else
$ads="";
$parse['adverts']=$ads;
Anyway that's the way to do it. You can add Please Upgrade messages and anything else you want.
On my files I've also added some button so I can easely make and unmake users premium from the admin panel.. upgrade planets.. etc. Also I've added some columns to know when the user has become premium, what premium account he has, how many days and how much he paid for it...you can do that to

If you need more help just post it.
Was this usefull at all?:sneaky2: Give a thank you!

Last edited: