RevCMS PHP Error

Results 1 to 9 of 9
  1. #1
    Proficient Member Kristophers is offline
    MemberRank
    Dec 2013 Join Date
    198Posts

    RevCMS PHP Error

    Well first of before people tell me MYSQL is deprecated I'm not worried about that. However I'm trying to get this to show the 5 badges I have in my badge slots on the me page.

    Look below for updated code.


    Should be in the grey boxes and for some reason its not showing. I don't have much PHP experience and can use a little help with making this work and possibly another feature for RevCMS for others who would like to use :)
    Last edited by Kristophers; 01-09-15 at 09:05 AM.


  2. #2
    Enthusiast RitzOriginal is offline
    MemberRank
    Jul 2015 Join Date
    29Posts

    Re: RevCMS PHP Error

    Is there some CSS that's supposed to make the badges overlay the backgrounds? It looks like there should be, maybe a DIV called "badge-front"?

  3. #3
    Proficient Member Kristophers is offline
    MemberRank
    Dec 2013 Join Date
    198Posts

    Re: RevCMS PHP Error

    Quote Originally Posted by RitzOriginal View Post
    Is there some CSS that's supposed to make the badges overlay the backgrounds? It looks like there should be, maybe a DIV called "badge-front"?
    The background of the badges is there just for design. The badge is supposed to display in front of that. Which for some reason somethings missing but I dont see what... ugh..

  4. #4
    Enthusiast RitzOriginal is offline
    MemberRank
    Jul 2015 Join Date
    29Posts

    Re: RevCMS PHP Error

    Take a look at this, just pieced together from Puhekupla.
    Spoiler:

    Code:
    <link rel="Stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" type="text/css"/>
    <style>
    .home_badge_item {
        margin-left: 4px;
        margin-right: 4px;
        height: 50px;
        width: 50px;
        box-shadow: 5px 5px 15px rgba(23, 23, 23, 0.5);
        background-color: #3A485F;
        border-radius: 3px;
        border: 1px solid #181818;
        overflow: hidden;
        margin-bottom: 10px;
    }
    </style>
    <div class="box_content" style="padding: 15px;">
    <div class="row">
    <div class="col-md-12">
    <div class="home_badge_item pull-left" rel="tooltip-<strong>FR710</strong><br /><strong>Flash Mobi</strong><br />-"><div style="height: 50px; width: 50px; background-image: url(https://puhekupla.com/images/badges/FR710.gif); background-position: center; background-repeat: no-repeat;"><a href="https://puhekupla.com/en/badges" style="width: 50px; height: 50px; display: block;"></a></div></div><div class="home_badge_item pull-left" rel="tooltip-<strong>FR709</strong><br /><strong>Je fais la mise au point</strong><br />-"><div style="height: 50px; width: 50px; background-image: url(https://puhekupla.com/images/badges/FR709.gif); background-position: center; background-repeat: no-repeat;"><a href="https://puhekupla.com/en/badges" style="width: 50px; height: 50px; display: block;"></a></div></div><div class="home_badge_item pull-left" rel="tooltip-<strong>BR904</strong><br /><strong>Troféu Deslumbrante</strong><br />-"><div style="height: 50px; width: 50px; background-image: url(https://puhekupla.com/images/badges/BR904.gif); background-position: center; background-repeat: no-repeat;"><a href="https://puhekupla.com/en/badges" style="width: 50px; height: 50px; display: block;"></a></div></div>
    </div>
    </div>
    </div>

    Which makes: https://i.imgur.com/qR7sN1X.png.
    Last edited by RitzOriginal; 01-09-15 at 07:00 AM.

  5. #5
    Proficient Member Kristophers is offline
    MemberRank
    Dec 2013 Join Date
    198Posts

    Re: RevCMS PHP Error

    They are doing it a little differently then how I am.
    Last edited by Kristophers; 01-09-15 at 09:05 AM.

  6. #6
    Enthusiast RitzOriginal is offline
    MemberRank
    Jul 2015 Join Date
    29Posts

    Re: RevCMS PHP Error

    Removed, fixed code below.
    Last edited by RitzOriginal; 01-09-15 at 09:26 AM.

  7. #7
    Proficient Member Kristophers is offline
    MemberRank
    Dec 2013 Join Date
    198Posts

    Re: RevCMS PHP Error

    I've gotten it to work now.



    Just having CSS issues. Updated Code Below:

    Spoiler:
    <style type="text/css"> #badge-back { position: absolute; left: 90px; top: 85px; }#new-personal-info .enter-hotel-btn { position: absolute; top: -10px; right: 20px; padding: 28px 0; background: transparent url(); !important; }
    #new-personal-info .enter-hotel-btn { position: absolute; top: -10px; right: 20px; padding: 28px 0; background: transparent url(); !important; }
    #badge-sq{display:inline-block; margin-left:4px;margin-right:4px;height:45px;width:45px;background-color:silver;opacity:.8;border-radius:3px;border:1px solid #181818;overflow:hidden;margin-bottom:10px}
    </style>
    <div class="habblet-container ">
    <div id="new-personal-info" style="background-image:url({url}/app/tpl/skins/Habbo/images/personal_info/hotel_views/htlview_us.png)">
    <div id="badge-back">
    <?php
    $getBadges = mysql_query("SELECT * FROM `users_badges` WHERE `user_id` = '" . $_SESSION['user']['id'] . "' AND `badge_slot` >= '1' ORDER BY `badge_slot` DESC LIMIT 5");if (mysql_num_rows($getBadges) == 0)
    echo '<div id="badge-sq">You do not have any badges!</div>';
    else
    {
    while ($badgeInfo = mysql_fetch_array($getBadges))
    {
    echo '<div id="badge-sq"><img style="display:block;margin:auto;" src="{url}/game/c_images/album1584/'.$badgeInfo['badge_id'].'.gif" style="display:inline;" draggable="false"></div>';
    }
    }


    ?> </div>
    Last edited by Kristophers; 01-09-15 at 09:17 AM.

  8. #8
    Loyalty Vaulient is offline
    MemberRank
    May 2012 Join Date
    MalaysiaLocation
    1,796Posts

    Re: RevCMS PHP Error

    Quote Originally Posted by Kristophers View Post
    I've gotten it to work now.



    Just having CSS issues. Updated Code Below:

    Spoiler:
    <style type="text/css"> #badge-back { position: absolute; left: 90px; top: 85px; }#new-personal-info .enter-hotel-btn { position: absolute; top: -10px; right: 20px; padding: 28px 0; background: transparent url(); !important; }
    #new-personal-info .enter-hotel-btn { position: absolute; top: -10px; right: 20px; padding: 28px 0; background: transparent url(); !important; }
    #badge-sq{margin-left:4px;margin-right:4px;height:45px;width:45px;background-color:silver;opacity:.8;border-radius:3px;border:1px solid #181818;overflow:hidden;margin-bottom:10px}
    </style>
    <div class="habblet-container ">
    <div id="new-personal-info" style="background-image:url({url}/app/tpl/skins/Habbo/images/personal_info/hotel_views/htlview_us.png)">
    <div id="badge-back">
    <?php
    $getBadges = mysql_query("SELECT * FROM `users_badges` WHERE `user_id` = '" . $_SESSION['user']['id'] . "' AND `badge_slot` >= '1' ORDER BY `badge_slot` DESC LIMIT 5");if (mysql_num_rows($getBadges) == 0)
    echo '<div id="badge-sq">You do not have any badges!</div>';
    else
    {
    while ($badgeInfo = mysql_fetch_array($getBadges))
    {
    echo '<div id="badge-sq"><img src="{url}/game/c_images/album1584/'.$badgeInfo['badge_id'].'.gif" style="display:inline;" draggable="false"></div>';
    }
    }


    ?> </div>
    Why did you position: absolute; it?

  9. #9
    Enthusiast RitzOriginal is offline
    MemberRank
    Jul 2015 Join Date
    29Posts

    Re: RevCMS PHP Error

    The main issue was that the table name in the SQL query was missing an s, luckily @Kristophers spotted it after an hour . I'm useless with CSS, all that needs fixing now though is the vertical image alignment within the div, he'll update the code once it's done.



Advertisement