[UNDER DEVELOPMENT] REVCMS group system

Status
Not open for further replies.

Vaulient1

New Member
Jan 17, 2013
11
1
Hey guys , I've recently realized that theres no addon for revcms groups while other cms like ubercms and even holocms has this. So I figured why not I try to code a RevCMS group system?

Heres what I have been working on







685d7393e4f140b6855324e.png


The only problem i have now is a hard time figuring out the php to make the join group to change the groupid in user_stats table. Anybody a professional in php could give me a php or a few tips on how to?
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Could for example link 'Join Group' to; joingroup.php?id=GROUPID - and the code could be something like:

PHP:
<?php
//This is just to help you, I'd suggest do it in class.users.php, and use Revs MySQL engine.
$groupID = filter($_GET['id']);
if ($groupID == null || empty($groupID))
{
//This would show an error if the group ID wasn't entered.
}
else
{
$getGroup = mysql_query("SELECT * FROM `groups` WHERE `id` = '".$groupID."'");
if (mysql_num_rows($getGroup) == 0)
{
//This would show an error that the group doesn't exist.
}
else //All good, could possibly check that the user is in the group already.
{
$checkGroup = mysql_fetch_array(mysql_query("SELECT * FROM `user_stats` WHERE `id` = '".$_SESSION['user']['id']."'"));
if ($checkGroup['groupid'] == $groupID)
{
//The user is already in this group, send them back or something.
}
else //The user isn't in this group, let them in.
{
mysql_query("UPDATE `user_stats` SET `groupid` = '".$groupID."' WHERE `id` = '".$_SESSION['user']['id']."'");
//Add any other groupd queries here that are essential.
}
}
}
?>

Remember this is just an example :). - And I'm unaware of your database structure, so read the code first as you may have to change it.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
My databse is phoenix 3.11 and thank you , ill be sure to inform you if this works :)

Ok yay it didnt work :p

The above code is set for you to work on, confirm the queries are correct and begin on your code and you should get it to work.
 

Vaulient1

New Member
Jan 17, 2013
11
1
Alright i'll try but im ending up on error 505

heres the script for the group page

Code:
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>{hotelName} - VIP</title>
        
 
        <link rel="stylesheet" href="{url}/app/tpl/skins/Custom-Habbo/styles/common.css" type="text/css">
        <script type="text/javascript" src="{url}/app/tpl/skins/Custom-Habbo/js/libs2.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Custom-Habbo/js/visual.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Custom-Habbo/js/libs.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Custom-Habbo/js/common.js"></script>
        <script type="text/javascript" src="{url}/app/tpl/skins/Custom-Habbo/js/fullcontent.js"></script>
<link rel="shortcut icon" href="{url}/favicon.ico" type="image/vnd.microsoft.icon" /><script 
        
        <script type="text/javascript">
            document.habboLoggedIn = true;
            var habboName = "{username}";
            var habboId = {userid};
            var habboReqPath = "";
            var habboStaticFilePath = "{url}/app/tpl/skins/Custom-Habbo";
            var habboImagerUrl = "http://www.habbo.co.uk/habbo-imaging/";
            var habboPartner = "";
            var habboDefaultClientPopupUrl = "{url}/client";
            window.name = "habboMain";
            if (typeof HabboClient != "undefined") {
                HabboClient.windowName = "eac955c8dbc88172421193892a3e98fc7402021a";
                HabboClient.maximizeWindow = true;
            }
        </script>
        
        <!--[if IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Custom-Habbo/styles/ie8.css" type="text/css">
        <![endif]-->
        <!--[if lt IE 8]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Custom-Habbo/styles/ie.css" type="text/css" />
        <![endif]-->
        <!--[if lt IE 7]>
            <link rel="stylesheet" href="{url}/app/tpl/skins/Custom-Habbo/styles/ie6.css" type="text/css" />
            <script type="text/javascript" src="{url}/app/tpl/skins/Custom-Habbo/js/pngfix.js"></script>
            <script type="text/javascript">
                try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
            </script>
            <style type="text/css">
                body { behavior: url({url}/app/tpl/skins/Custom-Habbo/js/csshover.htc); }
            </style>
        <![endif]-->
    </head>
    
    <body id="home">
    
        <div id="overlay"></div>
        <div id="header-container">
            <div id="header" class="clearfix">
                <h1><a href="{url}/"></a></h1>
                <div id="subnavi">
                    <div id="subnavi-user">
                                           <div style="margin-top:7px"><b>Fact:</b> <script language="JavaScript">
 
 
var r_text = new Array ();
 
 
r_text[0] = "Telling your friends about {hotelName} will make it even more fun!";
 
 
r_text[1] = "{hotelName} Hotel no longer charges for VIP, it is completely free!";
 
 
r_text[2] = "{hotelName} Hotel will only keep on growing if you vote daily!";
 
 
r_text[3] = "You can buy Super VIP to help cover our server bills!";
 
 
r_text[4] = "{hotelName} Hotel opened on February 17, 2012";
 
r_text[5] = "{hotelName} Hotel is a new and developing retro hotel!";
 
 
var i = Math.floor(5*Math.random())
 
 
 
 
 
document.write(r_text[i]);
 
 
 
 
 
</script>
</div>
                    </div>
                    <div id="subnavi-search">
 
                        <div id="subnavi-search-upper">
                            <ul id="subnavi-search-links">
<li><a href="{url}/help" style="color:#000" target="_blank">Help   </a></li><li><a href="{url}/logout" style="color:#000">Sign Out</a></li>
                            </ul>
                        </div>
                    </div>
                    <div id="to-hotel">
                        <a href="{url}/client" class="new-button green-button" target="eac955c8dbc88172421193892a3e98fc7402021a" onclick="HabboClient.openOrFocus(this); return false;"><b>Enter {hotelName} Hotel</b><i></i></a>
                    </div>
                </div>
                <ul id="navi">
                    <?PHP include "/navigation.php" ?>
        </div>
        <div id="content-container">
            <div id="navi2-container" class="pngbg">
                <div id="navi2" class="pngbg clearfix">
                    <ul>
<li class="selected">Groups<span></span></li> 
 
<li><a href="{url}/creategroup">Create Group</a><span></span></li>
                    </ul>
                </div>
            </div>
 
            <div id="container">
                <div id="content" style="position: relative" class="clearfix">
                    <div id="column1" class="column">
<div class="habblet-container ">
                            <div class="cbb clearfix blue ">
                                <h2 class="title">Groups to join</h2>
                                <div style="padding:5px">
<?PHP
 
$p1 = 3; // thanks kyle for nothing! <3
 
$pages = mysql_query("SELECT COUNT(id) FROM groups");
$p2 = ceil(mysql_result($pages, 0) / $p1);
 
$page = (isset($_GET['page'])) ? (int)$_GET['page'] :  1;
$start = ($page - 1) * $p1;
 
 
 
$getgroups = mysql_query("SELECT * FROM groups LIMIT $start, $p1");
$nummy = mysql_query("SELECT * FROM groups");
$numrows = mysql_num_rows($nummy);
 
if($numrows!=0){
 
while($groups = mysql_fetch_assoc($getgroups)){
 
$groupid = $groups['id'];
$name = $groups['name'];
$desc = $groups['desc'];
$badge = $groups['badge'];
$ownerid = $groups['ownerid'];
$created = $groups['created'];
$roomid = $groups['roomid'];
$locked = $groups['locked'];
$privacy = $groups['privacy'];
 
echo "<div class='badgecontainer'><center><b>$name</b><br /><em>$badge</em><br /><img src='http://habzen.co.uk/r63/c_images/badges/$badge.gif' /><br /><b>$created</b>"; echo "c | "; include("joingroup.php"); echo"</center></div>";
}
echo "Pages: ";
if($p2 >= 1 && $page <= $p2){
for($x=1; $x<=$p2; $x++) {
 
echo ($x == $page) ? '<strong><a href="?page='.$x.'">'.$x.'</a></strong> ' : '<a href="?page='.$x.'">'.$x.'</a> ';
 
}
}
}
else
echo "<div class='badgecontainer'>Thanks for checking out the groups!</div>";
 
?>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
</div>
</div>
                        </div>
                    </div>
 
<div id="column2" class="column">
                        <div class="habblet-container ">
                            <div class="cbb clearfix blue ">
                                <h2 class="title">All About Groups</h2>
                                <div style="padding:5px">
                                    Groups are a fun thing in the hotel. You can join various groups made by our fellow members. A group can become sucessfull if it has the most users who joined it. So be sure to choose wisely on which group you would prefer ;)
                                </div>
                            </div>
                        </div>
</div>
 
</div>
</div>
        <script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
        <script type="text/javascript">
            HabboView.run();
        </script>
 
        <!--[if lt IE 7]>
            <script type="text/javascript">
                Pngfix.doPngImageFix();
            </script>
        <![endif]-->
        
        <div id="footer" >
        </div>
    
    </body>
</html>
 
Status
Not open for further replies.

Users who are viewing this thread

Top