News not working? [Shock 2.0 (RevCMS skin)]

Antisj

Member
Apr 21, 2014
126
13
Hi, guys!
Im currently using "Shock 2.0 (RevCMS skin) (Look-a-like habin,sjovt,habbiz cms)" and i have a problem, the news management, posting does not work automatically, i have to do it all myself.

And also in the /news.php there is a "Maximum per player for 2 comments" but that does not work either? What can i do?
 

Antisj

Member
Apr 21, 2014
126
13
First problem:

* I have to do this on my own. /me
With that i mean changing the news on the /me page.
IVGYz37.png

 
show screenshots if u can for both problems.
Sure!
 
Second issue:
This right here is the biggest issue.
Users can spam the news arcticles becuase there is no limit becuase this line of code does not seem to work?
JlknHjx.png
 

Kak

Posting Freak
Apr 21, 2017
951
165
im not sure what your news comments box even looks like but try replacing your news comments code with this?

Code:
 </div>
                    <?php
                   
                   
                    if(isset($_POST['post_comment']))
                      $posted_on = date("M j, Y g:i A");
                   
                    if (filter(! isset($_POST['comment']))) {
                      $_POST['comment'] = '';
                      }
                   
                    $comment = strip_tags (filter($_POST['comment']));
                    if($comment == NULL){
                            //define("ERROR", "You have to type in a reply!<br /><br />");
                        //$error_message = 'You have to type in a reply!<br /><br />';
                      }else{
                    if (isLogged)
                    {
                        mysql_query("INSERT INTO cms_comments (article, userid, comment, posted_on, author) VALUES ('".htmlentities($_GET['id'])."', '".$_SESSION['userid']."', '".filter($comment)."', '".$posted_on."', '" . $_SESSION['user']['username']. "');");
                        define('SUCCESS', 'You have successfully posted a comment on this news article!');
                     
                     
                        define("ERROR", "<br>Thanks for your reply!<br />");
                       
                            //$error_message = 'Thanks for your reply!<br /><br />';
                      }
                    }
                    ?>
                   
                    <div class="habblet-container ">
                    <div class="cbb clearfix notitle ">
                    <div id="article-wrapper"><h2>Place Comment</h2>
                    <div class="article-meta"></div>
                    <div class="article-body">
                    <?php
                    if($userPosts >= 1)
                    {
                        define('ERROR', 'Sorry, you are only allowed one comment per article.');
                    }
                    if(defined("SUCCESS")){
                    ?>
                    <div class="rounded rounded-green" width="20%">
                                        <?php echo SUCCESS; ?><br />
                                    </div>
                                    <div>&nbsp;</div>
                    <?php
                    }
                    if(defined("ERROR")) {
                    ?>
                    <div class="rounded rounded-red" width="20%">
                                        <?php echo ERROR; ?><br />
                                    </div>
                                    <div>&nbsp;</div>
                    <?php
                    }
                    else
                    {
                    ?>
                    <form action="" method="post">
                    <textarea name="comment" maxlength="500"></textarea><br /><br />
                    <input type="submit" name="post_comment" value="Place Comment" />
                    </form>
                    <?php
                    }
                    ?>
                    </div>
                    </div>
                    </div>
                    </div>
                   
                    <style type="text/css">
                    input[type="text"], input[type="password"] {
                    background-color: #F1F1F1;
                    border: 1px solid #999999;
                    width: 175px;
                    padding: 5px;
                    font-family: verdana;
                    font-size: 10px;
                    color: #666666;
                    }
                    input[type="submit"] {
                    background-color: #F1F1F1;
                    border: 1px solid #999999;
                    padding: 5px;
                    font-family: verdana;
                    font-size: 10px;
                    color: #666666;
                    }
                    textarea {
                    background-color: #F1F1F1;
                    border: 1px solid #999999;
                    padding: 5px;
                    width: 517px;
                    height: 70px;
                    font-family: verdana;
                    font-size: 10px;
                    color: #666666;
                    }
                    select {
                    background-color: #F1F1F1;
                    border: 1px solid #999999;
                    padding: 5px;
                    font-family: verdana;
                    font-size: 10px;
                    color: #666666;
                    }
                    </style>
                    <?php
                    $getComments = mysql_query("SELECT * FROM site_news_comments WHERE article = '".htmlentities($_GET['id'])."' ORDER by id DESC");
                    ?>
                    <div class="habblet-container ">
                    <div class="cbb clearfix notitle ">
                    <div id="article-wrapper"><h2>Comments <?php echo mysql_num_rows($getComments); ?></h2>
                    <div class="article-meta"></div>
                    <div class="article-body">
                    <?php
                          if(mysql_num_rows($getComments) == 0) {
                              echo "No comments for this article!";
                          } else {
                              echo '<table width="528px">';
                              while($Comments = mysql_fetch_array($getComments)){
                              $getUserInfo = mysql_query("SELECT * FROM users WHERE username = '".$Comments['author']."'");
                              $userInfo = mysql_fetch_array($getUserInfo);
                                      echo '
                                      <tr>
                                        <td width="90px" valign="top"></div>
                                        <div style="
                    height: 65px;
                    width: 50px;
                    float: left;
                    overflow: hidden;
                    ">
                                          <div style="float:left"><img position:absolute; src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$userInfo['look'].'&size=b&direction=2&head_direction=3&gesture=sml&size=2"></div>
                                          ';
                                            if($userInfo['rank'] >= 5) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/STAFF.gif"></div>';
                                            }
                                            if($userInfo['rank'] == 3) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/XXX.gif"></div>';
                                            }
                                            if($userInfo['rank'] == 4) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/XXX.gif"></div>';
                                            }
                                            if($userInfo['rank'] == 2) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/VIP.gif"></div>';
                                            }
                                            if($userInfo['rank'] == 1) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/lid.png"></div>';
                                            }
                                       

                                     echo '

                                    </td>
                                        <td width="427px" valign="top">
                                        <i><a href="/me">'.$userInfo['username'].' </a></i>
                                                             <br /><br />'.$Comments['comment'].'
                                                           

                                        </td>
                                      </tr>
                              <tr>
                                        <td width="80px" valign="top">
                                       
                                        </td>
                                                    <td width="400px" align="right">

                                                                 
                                                                 

                                           

                    </div></div></div></div>
                    <br>
                    <div style="width:125%; height:1px; background-color:#ccc; margin-top:-17px;"></div>


                                </td>
                              </tr>';
                              }
                              echo '</table>';
                            }
                            ?></div> </div> </div> </div>
                    </div>
 

Antisj

Member
Apr 21, 2014
126
13
im not sure what your news comments box even looks like but try replacing your news comments code with this?

Code:
 </div>
                    <?php
                  
                  
                    if(isset($_POST['post_comment']))
                      $posted_on = date("M j, Y g:i A");
                  
                    if (filter(! isset($_POST['comment']))) {
                      $_POST['comment'] = '';
                      }
                  
                    $comment = strip_tags (filter($_POST['comment']));
                    if($comment == NULL){
                            //define("ERROR", "You have to type in a reply!<br /><br />");
                        //$error_message = 'You have to type in a reply!<br /><br />';
                      }else{
                    if (isLogged)
                    {
                        mysql_query("INSERT INTO cms_comments (article, userid, comment, posted_on, author) VALUES ('".htmlentities($_GET['id'])."', '".$_SESSION['userid']."', '".filter($comment)."', '".$posted_on."', '" . $_SESSION['user']['username']. "');");
                        define('SUCCESS', 'You have successfully posted a comment on this news article!');
                    
                    
                        define("ERROR", "<br>Thanks for your reply!<br />");
                      
                            //$error_message = 'Thanks for your reply!<br /><br />';
                      }
                    }
                    ?>
                  
                    <div class="habblet-container ">
                    <div class="cbb clearfix notitle ">
                    <div id="article-wrapper"><h2>Place Comment</h2>
                    <div class="article-meta"></div>
                    <div class="article-body">
                    <?php
                    if($userPosts >= 1)
                    {
                        define('ERROR', 'Sorry, you are only allowed one comment per article.');
                    }
                    if(defined("SUCCESS")){
                    ?>
                    <div class="rounded rounded-green" width="20%">
                                        <?php echo SUCCESS; ?><br />
                                    </div>
                                    <div>&nbsp;</div>
                    <?php
                    }
                    if(defined("ERROR")) {
                    ?>
                    <div class="rounded rounded-red" width="20%">
                                        <?php echo ERROR; ?><br />
                                    </div>
                                    <div>&nbsp;</div>
                    <?php
                    }
                    else
                    {
                    ?>
                    <form action="" method="post">
                    <textarea name="comment" maxlength="500"></textarea><br /><br />
                    <input type="submit" name="post_comment" value="Place Comment" />
                    </form>
                    <?php
                    }
                    ?>
                    </div>
                    </div>
                    </div>
                    </div>
                  
                    <style type="text/css">
                    input[type="text"], input[type="password"] {
                    background-color: #F1F1F1;
                    border: 1px solid #999999;
                    width: 175px;
                    padding: 5px;
                    font-family: verdana;
                    font-size: 10px;
                    color: #666666;
                    }
                    input[type="submit"] {
                    background-color: #F1F1F1;
                    border: 1px solid #999999;
                    padding: 5px;
                    font-family: verdana;
                    font-size: 10px;
                    color: #666666;
                    }
                    textarea {
                    background-color: #F1F1F1;
                    border: 1px solid #999999;
                    padding: 5px;
                    width: 517px;
                    height: 70px;
                    font-family: verdana;
                    font-size: 10px;
                    color: #666666;
                    }
                    select {
                    background-color: #F1F1F1;
                    border: 1px solid #999999;
                    padding: 5px;
                    font-family: verdana;
                    font-size: 10px;
                    color: #666666;
                    }
                    </style>
                    <?php
                    $getComments = mysql_query("SELECT * FROM site_news_comments WHERE article = '".htmlentities($_GET['id'])."' ORDER by id DESC");
                    ?>
                    <div class="habblet-container ">
                    <div class="cbb clearfix notitle ">
                    <div id="article-wrapper"><h2>Comments <?php echo mysql_num_rows($getComments); ?></h2>
                    <div class="article-meta"></div>
                    <div class="article-body">
                    <?php
                          if(mysql_num_rows($getComments) == 0) {
                              echo "No comments for this article!";
                          } else {
                              echo '<table width="528px">';
                              while($Comments = mysql_fetch_array($getComments)){
                              $getUserInfo = mysql_query("SELECT * FROM users WHERE username = '".$Comments['author']."'");
                              $userInfo = mysql_fetch_array($getUserInfo);
                                      echo '
                                      <tr>
                                        <td width="90px" valign="top"></div>
                                        <div style="
                    height: 65px;
                    width: 50px;
                    float: left;
                    overflow: hidden;
                    ">
                                          <div style="float:left"><img position:absolute; src="http://www.habbo.com/habbo-imaging/avatarimage?figure='.$userInfo['look'].'&size=b&direction=2&head_direction=3&gesture=sml&size=2"></div>
                                          ';
                                            if($userInfo['rank'] >= 5) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/STAFF.gif"></div>';
                                            }
                                            if($userInfo['rank'] == 3) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/XXX.gif"></div>';
                                            }
                                            if($userInfo['rank'] == 4) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/XXX.gif"></div>';
                                            }
                                            if($userInfo['rank'] == 2) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/r63/c_images/badges/VIP.gif"></div>';
                                            }
                                            if($userInfo['rank'] == 1) {
                                                echo '<div style="position: absolute; z-index:1"><img src="{url}/lid.png"></div>';
                                            }
                                      

                                     echo '

                                    </td>
                                        <td width="427px" valign="top">
                                        <i><a href="/me">'.$userInfo['username'].' </a></i>
                                                             <br /><br />'.$Comments['comment'].'
                                                          

                                        </td>
                                      </tr>
                              <tr>
                                        <td width="80px" valign="top">
                                      
                                        </td>
                                                    <td width="400px" align="right">

                                                                
                                                                

                                          

                    </div></div></div></div>
                    <br>
                    <div style="width:125%; height:1px; background-color:#ccc; margin-top:-17px;"></div>


                                </td>
                              </tr>';
                              }
                              echo '</table>';
                            }
                            ?></div> </div> </div> </div>
                    </div>
I replaced and the site is all white (/news)
 

Users who are viewing this thread

Top