Azure emulator + RevCms Need help / Skype

vodarn

New Member
Jun 15, 2015
3
0
I really need some help to get revcms runnable with Azure emulator.
The things i want help with:
First: News
4a5IHnm.png

Second: Staff page.
IK38Dwk.png


My Class.forms.php
PHP:
<?php

namespace Revolution;
if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
class forms implements iForms
{

    public $error;

    final public function setData()
    {
        global $engine;
        foreach($_POST as $key => $value)
        {
            if($value != null)
            {
                $this->$key = $engine->secure($value);
            }
            else
            {
                $this->error = 'Please fill in all fields';
                return;
            }
        }
 
    }
 
    final public function unsetData()
    {
        global $template;
        foreach($this as $key => $value)
        {
            unset($this->$key); 
        } 
    }
 
    final public function writeData($key)
    {
        global $template;
        echo $this->$key;
    }
 
    final public function outputError()
    {
        global $template;
        if(isset($this->error))
        {
            echo "<div id='message'> " . $this->error . " </div>";
        }
    }
 
    /* Manage different pages */
 
    final public function getPageNews()
    {
        global $template, $engine;
     
            if(!isset($_GET['id']) || !is_numeric($_GET['id']))
            {
                $_GET['id'] = 1;
            }
                $result = "SELECT title, id FROM cms_news WHERE id != '" . $engine->secure($_GET['id']) . "' ORDER BY id DESC";
             
                while($news1 = $engine->fetch_array($result))
                {
                    $template->setParams('newsList', '&laquo; <a href="index.php?url=news&id='.$news1["id"].'">' . $news1['title'] . '</a><br/>');
                }
             
                $news = $engine->fetch_assoc("SELECT title, longstory, author, published FROM cms_news WHERE id = '" . $engine->secure($_GET['id']) . "' LIMIT 1");
                $template->setParams('newsTitle', $news['title']);
                $template->setParams('newsContent', $news['longstory']);
                $template->setParams('newsAuthor', $news['author']);
                $template->setParams('newsDate', date("d-m-y", $news['published']));
         
                unset($result);
                unset($news1);
                unset($news);
    }
 
    final public function getPageHome()
    {
        /*
        NEEDS TO BE FIXED
        global $template, $engine;
        $a = 1;
        $data = "SELECT title, id, published, shortstory, image FROM cms_news ORDER BY id DESC LIMIT 5";
     
             
        while($news = $engine->fetch_array($data))
           {
         
            $template->setParams('newsTitle-' . $a, $news['title']);
            $template->setParams('newsID-' . $a, $news['id']);
            $template->setParams('newsDate-' . $a, date("d-m-y", $news['published']));
            $template->setParams('newsCaption-' . $a, $news['shortstory']);
            $template->setParams('newsIMG-' . $a, $news['image']);
            $a++;
         
        }
     
        unset($news);
        unset($data);*/
    }
 
}

?>
PHP:
<div class="row">
        <div class="span3">
            <a href="index.php?url=news&id={newsID-1}"><div class="well" style="background-image: url('{url}/app/tpl/skins/{skin}/news/{newsIMG-1}');height:140px;position:relative;overflow:hidden;">
                <p class="newscaption">
                    <strong>{newsTitle-1}</strong><br />
                    <em>{newsCaption-1}</em>
                </p>
            </div></a>
        </div></a>
        <div class="span3">
            <a href="index.php?url=news&id={newsID-2}"><div class="well" style="background-image: url('{url}/app/tpl/skins/{skin}/news/{newsIMG-2}');height:140px;position:relative;overflow:hidden;">
                <p class="newscaption">
                    <strong>{newsTitle-2}</strong><br />
                    <em>{newsCaption-2}</em>
                </p>
            </div>
        </div></a>
        <div class="span3">
            <a href="index.php?url=news&id={newsID-3}"><div class="well" style="background-image: url('{url}/app/tpl/skins/{skin}/news/{newsIMG-3}');height:140px;position:relative;overflow:hidden;">
                <p class="newscaption">
                    <strong>{newsTitle-3}</strong><br />
                    <em>{newsCaption-3}</em>
                </p>
            </div>
        </div></a>
        <div class="span3">
            <a href="index.php?url=news&id={newsID-4}"><div class="well" style="background-image: url('{url}/app/tpl/skins/{skin}/news/{newsIMG-4}');height:140px;position:relative;overflow:hidden;">
                <p class="newscaption">
                    <strong>{newsTitle-4}</strong><br />
                    <em>{newsCaption-4}</em>
                </p>
            </div></a>
        </div>
8UadMrO.png
PHP:
<?php include('header.php'); ?>

    <div class="row">
        <div class="span4">
            <div class="well">
                <p class="btn2 btn-block boxtitle btn-info2">Who are the staff?</p>
                <p>{hotelName} staff are the members of the community who are in charge of running the hotel and ensuring it is safe. They plan competitions, host events and assist users whenever possible. These are the users you should contact for assistance.</p>
                <p>If someone claims to be staff, check this list before answering any personal questions.</p>
            </div>
            <div class="well">
                <p class="btn2 btn-block boxtitle btn-info2">Can I be staff?</p>
                <p>We hire frequently, and when we do it will be posted on the news. Please do not spam staff with requests to be hired as this will result in you being blacklisted from future application periods.</p>
            </div>
        </div>
        <div class="span8">
<?php
$getRanks = mysql_query("SELECT id, username, rank FROM users WHERE rank = 7 ORDER BY id DESC");
while ($Ranks = mysql_fetch_assoc($getRanks))
{    
        echo '<div class="well"><p class="btn2 btn-block boxtitle btn-info2">' . $Ranks['name'] . '</p>';
     
        $getMembers = mysql_query("SELECT id,username,motto,look,online,last_online FROM users WHERE rank = '" . $Ranks['id'] . "'");
     
        echo '<div class="box-content">';
     
        if (mysql_num_rows($getMembers) > 0)
        {
                $oe = 1;
             
                while ($member = mysql_fetch_assoc($getMembers))
                {
                        if ($oe == 2)
                        {
                                $oe = 1;
                        }
                        else
                        {
                                $oe = 2;
                        }
     
                        echo '<table width="100%" style="padding: 5px; margin-left: -15px; background-color: ' . (($oe == 2) ? '#fff' : '#E6E6E6') . ';">
                        <tbody>
                                <tr>
                                        <td valign="middle" width="75">
                                                <img style="margin-top: -10px;" src="Cannot be shown on devbest :D' .$member['look'] . '&size=l">
                                        </td>
                                        <td valign="top">
                                                <p style="font-size: 90%;">Username: <strong>' .$member['username'] . '</strong><br>Motto: <strong>' . $member['motto'] . '</strong><br><i>Last Online: '. date("D, d F Y H:i (P)", $member['last_online']) .'</i></p>
                                                <br />';
                                             
                                        echo '</td>
                                        <td valign="top" style="float: right;">
                                                ' . (($member['online'] == "1") ? '<b>Online</b>': '<b>Offline</b>') . '
                                        </td>
                                </tr>
                        </tbody>
                        </table>';
                }
        }
        else
        {
                echo '<i>There are no users in this staff group yet.</i>';
        }
     
        echo '</div>
        </div>';
}
?>
        </div>
    </div>

<?php include('footer.php'); ?>
 
Last edited:

JayC

Always Learning
Aug 8, 2013
5,504
1,401
OT: Take a look at the rules, asking for help not on the forums is against the rules of DevBest help threads.
On Topic:
Second of all for the news:
You even posted the code
$template->setParams('newsTitle', $news['title']);$template->setParams('newsContent', $news['longstory']);$template->setParams('newsAuthor', $news['author']);$template->setParams('newsDate', date("d-m-y", $news['published']));

where do you see newsCaption-1/2/3/4 even being declared?? Where is newsCaption eve declared in that? If you want to do that I would just create a new query at the top like this:
$GrabCaptions = mysql_query("SELECT * from NEWS WHERE title = '.{newsTitle}.' = ORDER BY date_published DESC");
$Captions = mysql_fetch_assoc($GrabCaptions);

echo $Captions['caption'];

very brief code you will need to expand on it and probably work things around to get it to work, this is just the general concept/idea

Nextly:
$getRanks = mysql_query("SELECT * FROM users WHERE `rank` ='7' ORDER BY id DESC");
while ($Ranks = mysql_fetch_assoc($getRanks))
 

vodarn

New Member
Jun 15, 2015
3
0
OT: Take a look at the rules, asking for help not on the forums is against the rules of DevBest help threads.
On Topic:
Second of all for the news:
You even posted the code
$template->setParams('newsTitle', $news['title']);$template->setParams('newsContent', $news['longstory']);$template->setParams('newsAuthor', $news['author']);$template->setParams('newsDate', date("d-m-y", $news['published']));

where do you see newsCaption-1/2/3/4 even being declared?? Where is newsCaption eve declared in that? If you want to do that I would just create a new query at the top like this:
$GrabCaptions = mysql_query("SELECT * from NEWS WHERE title = '.{newsTitle}.' = ORDER BY date_published DESC");
$Captions = mysql_fetch_assoc($GrabCaptions);

echo $Captions['caption'];

very brief code you will need to expand on it and probably work things around to get it to work, this is just the general concept/idea

Nextly:
$getRanks = mysql_query("SELECT * FROM users WHERE `rank` ='7' ORDER BY id DESC");
while ($Ranks = mysql_fetch_assoc($getRanks))

So, the news stuff, ill have to fix when im more "in" to it. But your idea about the staff page just gives me this.
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in staff.php on line 19
 

JayC

Always Learning
Aug 8, 2013
5,504
1,401
So, the news stuff, ill have to fix when im more "in" to it. But your idea about the staff page just gives me this.
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in staff.php on line 19
$getRanks = mysql_query("SELECT * FROM `users` WHERE `rank` ='7' ORDER BY `id` DESC");
while ($Ranks = mysql_fetch_assoc($getRanks))
 

DR34M3R

New Member
Jun 16, 2014
21
5
I use Azure emu and revcms and you just add the ranks in your database.

SQL:
CREATE TABLE IF NOT EXISTS `ranks` (
`id` int(11) unsigned NOT NULL,
`name` varchar(50) NOT NULL,
`badgeid` varchar(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Gegevens worden geëxporteerd voor tabel `ranks`
--

INSERT INTO `ranks` (`id`, `name`, `badgeid`) VALUES
(9, 'Moderator In Opleiding', 'ADM'),
(8, 'Moderator In Opleiding', 'ADM'),
(1, 'User', ''),
(2, 'Expert', 'BOT'),
(3, 'VIP', 'VIP'),
(4, 'Moderator in opleiding', 'ADM'),
(5, 'Moderator', 'ADM'),
(6, 'Hoofd Moderator', 'ADM'),
(7, 'Moderator In Opleiding', 'ADM'),
(10, 'Moderator', 'ADM'),
(11, 'Community Manager', 'ADM'),
(12, 'Hotel Manager', NULL);
 

Users who are viewing this thread

Top