• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Gesior AAC] Scrolling Newsticker Feature :Scrollmachine:

b u m p
o.o you are advised(obliged) to replace your scrollnews.php with:
PHP:
<?PHP
 /****************************************
 ||   SCROLLNEWS FEATURE © Cybermaster  ||
 ||    * * * * * * OTland.net    * * * * * * ||
 ||* * * * * * * * * * * * * * * * * * *||
 -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
 
if($action == "edit_ticker") {
    if($logged && $group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
        $main_content .= '<h2>SCROLLNEWS CONTROL PANEL</h2><hr /><br/>';
        $header = htmlspecialchars(stripslashes(substr(trim($_POST['header']),0,2000)));
        $header_color = htmlspecialchars(stripslashes(substr(trim($_POST['header_color']),0,2000)));
        $header_bgcolor = htmlspecialchars(stripslashes(substr(trim($_POST['header_bgcolor']),0,2000)));
        $text = htmlspecialchars(stripslashes(substr(trim($_POST['text']),0,2000)));
        $text_bgcolor = htmlspecialchars(stripslashes(substr(trim($_POST['text_bgcolor']),0,2000)));
        
    if($_POST['updateticker'] == 1 && $logged && $group_id_of_acc_logged >= $config['site']['access_admin_panel']) {    
        $SQL->query("INSERT INTO `z_scrolling_news` (`id`, `header`, `header_color`, `header_bgcolor`, `text`, `text_bgcolor`) VALUES (NULL, '".$header."', '".$header_color."', '".$header_bgcolor."', '".$text."', '".$text_bgcolor."')");                
        $main_content .= '<div class="TableContainer" >  <table class="Table1" cellpadding="0" cellspacing="0" >    <div class="CaptionContainer" >      <div class="CaptionInnerContainer" >        <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <div class="Text" >Added New Ticker</div>        <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>        <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>        <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>        <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>      </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td>Your news ticker has been published.</td></tr>          </table>        </div>  </table></div></td></tr><br><center><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=scrollnews&action=edit_ticker" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ><br/></div></div></td></tr></form></table></center>';
        }
    else
        {    
    $main_content .= '<form action="?subtopic=scrollnews&action=edit_ticker" method=post><div class="TableContainer"><table class="Table1" cellpadding="0" cellspacing="0" ><div class="CaptionContainer" >      <div class="CaptionInnerContainer" >      <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >[+] Add a ticker</div>       <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>  <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>   </div>    </div>    <tr>      <td>        <div class="InnerTableContainer" >          <table style="width:100%;" ><tr><td class="LabelV" >Ticker Title:</td><td style="width:100%;" ><input name="header" value="" size="30" maxlength="50" ></td></tr><tr><td class="LabelV" ><a href="http://www.w3schools.com/HTML/html_colornames.asp">Title Font Color:</a></td><td style="width:100%;" ><input name="header_color" value="" size="15" maxlength="30" >&nbsp;ex. orange, aqua, #F0F8FF</td></tr>    <tr><td class="LabelV" ><a href="http://www.w3schools.com/HTML/html_colornames.asp">Title BG Color:</a></td><td style="width:100%;" ><input name="header_bgcolor" value="" size="15" maxlength="30" ></td></tr><td class="LabelV" ><span>Ticker Text:</span></td><td style="width:100%;"><textarea name="text" rows="6" cols="45" wrap="virtual"></textarea></td></tr>    <tr><td class="LabelV" ><a href="http://www.w3schools.com/HTML/html_colornames.asp">Ticker Text BGColor:</a></td><td><input name="text_bgcolor" value="" size="15" maxlength="30" ></td></tr></table>        </div>  </table></div></td></tr><table width="100%"><tr align="center"><td><table border="0" cellspacing="0" cellpadding="0" >    <tr><td style="border:0px;" ><input type="hidden" name="updateticker" value="1" >    <div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >    <div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >    <div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>    <input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td>    <tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ></table></td></tr></table>';
        }
    
    $news = $SQL->query('SELECT * FROM `z_scrolling_news` ORDER BY `id`;');
    $main_content .= '<br/><h2>[-] Delete a ticker</h2><br/><div style="height:200px;width:530px;font:12px/16px Georgia, Garamond, Serif;overflow:scroll;"><table width="100%" border="0" cellpadding="0" cellspacing="1"><tr bgcolor="'.$config['site']['vdarkborder'].'" align="left"><td><strong><span style="color:white;">ID</span></strong></td><td align="center"><span style="color:white;"><strong>Header</strong></span></td><td align="center"><span style="color:white;"><strong>Text</strong></span></td><td align="center"><span style="color:white;"><strong>Action</strong></span></td></tr>';
    
    foreach ($news as $ticker) 
    {$order++;
        if(is_int($order / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder'];
        $text = $ticker['text']; 
        $header = $ticker['header'];
        if (strlen($text) > 50) $text = substr($text, 0, strrpos(substr($text, 0, 50), ' ')) . '...';
        if (strlen($header) > 15) $header = substr($header, 0, strrpos(substr($header, 0, 15), ' ')) . '...';
        $main_content .= '<tr bgcolor="'.$bgcolor.'"><td>'.$ticker['id'].'<br/></td><td>'.$header.'<br/></td><td>'.$text.'<br/></td><td><a href="?subtopic=scrollnews&action=remove_ticker&id='.$ticker['id'].'" onclick="return confirm(\'Are you sure that you want remove this ticker? \')"><span style="color:red">[DELETE]</span></a></td></tr>';
    }
    $main_content .= '</table></div>';
    }
        
    else
        $main_content .= 'You are not logged in or you are not authorized to access this page.';
    }
    
    if($action == 'remove_ticker') {
        if($logged && $group_id_of_acc_logged >= $config['site']['access_admin_panel']) {
            $id = (int) $_REQUEST['id'];
            $tickerr = $SQL->query("SELECT `id` FROM `z_scrolling_news` WHERE `id` = ".$id." LIMIT 1")->fetch();
            
            if($tickerr['id'] == $id){
                $SQL->query("DELETE FROM `z_scrolling_news` WHERE `id` = ".$tickerr['id']);
                header('Location: ?subtopic=scrollnews&action=edit_ticker');
            }
            else
                $main_content .= 'Ticker with ID '.$id.' does not exist. Could not perform deletion.';
        }
        else
            $main_content .= 'You are not logged in or you are not authorized to access this page.';
        }
?>

The older one had a bug. I've edited the one in main post too.
:ninja: should work fine at 100% now
 
pls dl the calhalla layout and check out what is wrong with the news ticker function :(
 
this should go modernac..
 
Sorry, but I have to say it, marquess are ones of the most annoying elements on pages ;p.
 
Back
Top