Brain Housekeeping Edit

Detox

Member
Jul 24, 2010
365
24
Hello!

I'm trying to edit BrainCMS Housekeeping... I got to point where I have it like HoloCMS, But I can't seem to get it to POST into the database.
( )

Original Code

PHP:
<aside class="right-side">
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <section class="panel">
                    <header class="panel-heading">
                        Create a News Article<br>
                        <form name="mygallery" action="" method="POST">
                        </header>
                        <div class="panel-body">
                            <?php admin::PostNews(); ?>
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">Title</label>
                                <div class="col-sm-10">
                                    <input type="text" value="<?php echo $_SESSION['title']; ?>" name="title"class="form-control">
                                </div>
                            </div><br><br>
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">Short Story</label>
                                <div class="col-sm-10">
                                    <input type="text" value="<?php echo $_SESSION['slogan']; ?>" name="slogan"class="form-control">
                                </div>
                            </div><br><br>
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">Image</label>
                                <div class="col-sm-10">
                                    <?php
                                        echo '<select onChange="showimage()" class="form-control" name="topstory" style="    width: 100%;font-size: 14px;"';
                                        if ($handle = opendir(''.$_SERVER['DOCUMENT_ROOT'].'/adminpan/img/newsimages'))
                                        {   
                                            while (false !== ($file = readdir($handle)))
                                            {
                                                echo'';
                                                if ($file == '.' || $file == '..')
                                                {
                                                    continue;
                                                }   
                                                echo '<option name="topstory" data-image="'.$config['hotelUrl'].'/adminpan/img/newsimages/' . $file . '" value="'.$config['hotelUrl'].'/adminpan/img/newsimages/' . $file . '"';
                                                if (isset($_POST['topstory']) && $_POST['topstory'] == $file)
                                                {
                                                    echo ' selected';
                                                }
                                                echo '>' . $file . '</option>';
                                            }
                                        }
                                        echo '</select>';
                                    ?>
                                    <br>
                                    <style>
                                        .imagebox {
                                        width: auto;
                                        background-repeat: repeat-y;
                                        border-radius: 6px;
                                        float: left;
                                        margin-right: 0.72pc;
                                        margin-bottom: 10px;
                                        webkit-box-shadow: 0 3px rgba(0,0,0,.17),inset 0px 0px 0px 1px rgba(0,0,0,0.31),inset 0 0 0 2px rgba(255,255,255,0.44)!important;
                                        -moz-box-shadow: 0 3px rgba(0,0,0,.17),inset 0px 0px 0px 1px rgba(0,0,0,0.31),inset 0 0 0 2px rgba(255,255,255,0.44)!important;
                                        box-shadow: 0 3px rgba(0,0,0,.17),inset 0px 0px 0px 1px rgba(0,0,0,0.31),inset 0 0 0 2px rgba(255,255,255,0.44)!important;
                                        }
                                    </style>
                                    <div class="imagebox">
                                        <img style="border-radius: 6px;"src="<?= $config['hotelUrl'];?>/adminpan/img/newsimages/choose.gif" name="topstory" border=0>
                                    </div>
                                    <br><br>
                                </div>
                            </div>
                            <br><br>
                            <script src="<?= $config['hotelUrl'];?>/adminpan/js/ckeditor/ckeditor.js"></script>
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">Long Story</label>
                                <div class="col-sm-10">
                                    <textarea id="editor1" name="news"  rows="15" cols="80"><?php echo $_SESSION['news']; ?></textarea>
                                </div>
                            </div><br><br>
                            <button style="width: 130px;
                            float: right;
                            margin-right: 14px;" name="postnews" type="submit" class="btn btn-success">Post the Article</button>
                        </div>
                    </section>
                </div>
            </form>
        </header>

My Code:

PHP:
<table cellpadding='0' cellspacing='8' width='100%' id='tablewrap'>
<tr> <td width='22%' valign='top' id='leftblock'>
 <div>
 <!-- LEFT CONTEXT SENSITIVE MENU -->
<?php include_once('includes/sitenavi.php'); ?>
 <!-- / LEFT CONTEXT SENSITIVE MENU -->
 </div>
 </td>
 <td width='78%' valign='top' id='rightblock'>
 <div><!-- RIGHT CONTENT BLOCK -->

                        <header class='tableheaderalt'>Compose News Article
                        <form name="mygallery" action="" method="POST">
                            </header>
                            <div class='tableborder'>
                            <?php admin::PostNews(); ?>
                                


<table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'>
<tr>
<td class='tablerow1'  width='40%'  valign='middle'><b>Title</b><div class='graytext'>The full title of your article.</div></td>
<td class='tablerow2'  width='60%'  valign='middle'><input type='text' name='title' value="<?php echo $_SESSION['title']; ?>" size='30' class='textinput'></td>
</tr>

<tr>
<td class='tablerow1'  width='40%'  valign='middle'><b>Short Story</b><div class='graytext'>A small introduction to the article.<br />HTML is not allowed here.</div></td>
<td class='tablerow2'  width='60%'  valign='middle'><textarea name='short_story' cols='60' rows='5' wrap='soft' id='sub_desc'   class='multitext'><?php echo $_SESSION['slogan']; ?></textarea></td>
</tr>

                        <tr>
<td class='tablerow1'  width='40%'  valign='middle'><b>Topstory Image</b><div class='graytext'>The URL to the topstory image.</div></td>
<td class='tablerow2'  width='60%'  valign='middle'>
    
    <?php
                                        echo '<center><select onChange="showimage()" class="form-control" name="topstory" style="    width: 100%;font-size: 14px;"';
                                        if ($handle = opendir(''.$_SERVER['DOCUMENT_ROOT'].'/adminpan/img/newsimages'))
                                        {   
                                            while (false !== ($file = readdir($handle)))
                                            {
                                                echo'';
                                                if ($file == '.' || $file == '..')
                                                {
                                                    continue;
                                                }   
                                                echo '<option name="topstory" data-image="'.$config['hotelUrl'].'/adminpan/img/newsimages/' . $file . '" value="'.$config['hotelUrl'].'/adminpan/img/newsimages/' . $file . '"';
                                                if (isset($_POST['topstory']) && $_POST['topstory'] == $file)
                                                {
                                                    echo ' selected';
                                                }
                                                echo '>' . $file . '</option>';
                                            }
                                        }
                                        echo '</select>';
                                    ?>
                                    <br>
                                    <style>
                                        .imagebox {
                                        width: auto;
                                        background-repeat: repeat-y;
                                        border-radius: 6px;
                                        float: left;
                                        margin-right: 0.72pc;
                                        margin-bottom: 10px;
                                        webkit-box-shadow: 0 3px rgba(0,0,0,.17),inset 0px 0px 0px 1px rgba(0,0,0,0.31),inset 0 0 0 2px rgba(255,255,255,0.44)!important;
                                        -moz-box-shadow: 0 3px rgba(0,0,0,.17),inset 0px 0px 0px 1px rgba(0,0,0,0.31),inset 0 0 0 2px rgba(255,255,255,0.44)!important;
                                        box-shadow: 0 3px rgba(0,0,0,.17),inset 0px 0px 0px 1px rgba(0,0,0,0.31),inset 0 0 0 2px rgba(255,255,255,0.44)!important;
                                        }
                                    </style>
                                    <div class="imagebox">
                                        <img style="border-radius: 6px;"src="<?= $config['hotelUrl'];?>/adminpan/img/newsimages/choose.gif" name="topstory" border=0>
                                    </div>
                                    <br><br>
                                </div>
                            </div>

</td>
</tr>

<tr>
<td class='tablerow1'  width='40%'  valign='middle'><b>Story</b><div class='graytext'>The actual news message.<br />HTML is allowed here.</div></td>
<td class='tablerow2'  width='60%'  valign='middle'>
<script src="<?= $config['hotelUrl'];?>/adminpan/js/ckeditor/ckeditor.js"></script>
                            <div class="form-group">
                                <div class="col-sm-10">
                                    <textarea id="editor1" name="news"  rows="15" cols="80"><?php echo $_SESSION['news']; ?></textarea>
                                </div>
                            </div><br><br>
</td>
</tr>

<tr>
<tr>
<td align='center' class='tablesubheader' colspan='2' >
<button style="" name="postnews" type="submit" class="realbutton">Post the Article</button>
</td></tr>
</tr>
</div>
                    </section>
                </div>
</form>
</header>
 

Detox

Member
Jul 24, 2010
365
24
any changes to the class or?

OMG Derp! yes because I changed the whole CSS from the original! -_-

So I think I'm on the right path somewhere.

This code

Code:
<form name="mygallery" action="" method="POST">

controls this!

You must be registered for see images attach


But the original code from HoloCMS

has this.

Code:
 <form action='index.php?p=news_compose&do=save' method='post' name='theAdminForm' id='theAdminForm'>

When I remove the mygallery the images don't work anymore.
But when I removed it and replace it with theAdminForm and tried again it still didn't work.
 
Last edited:

Users who are viewing this thread

Top