Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.3.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=42)
-   -   Mys v1.3.4 News System (http://www.mysidiaadoptables.com/forum/showthread.php?t=4392)

IntoRain 02-14-2014 03:07 PM

News System
 
1 Attachment(s)
Hello! I know some people wanted a system like this so I decided to make one. This mod will allow you to post news to your users - you can create, edit and delete news. Using javascript, it has also a simple pagination system that will show a certain amount of news per page. Users can comment on each news post if you allow comments. News can be posted or saved as drafts to be edited later, admins can see drafts on the site but normal users can't. You can control users' comments: edit, delete and allow/disallow.

IMPORTANT:
If you have your site installed in a subfolder or if you changed page links, you might need to change some of the URLs used in the code. Please address to this post.

IMPORTANT:
It's not possible to send PM's to all users (selecting that option does nothing) about the updates yet!

IMPORTANT:
At the bottom of the post, there's a .rar you can download with the 4 new files (so you won't need to create the files yourself)

Part 0: The looks
After adding this, you should get something like this:
All news
Showing a news and its comments
Showing a specific news that doesn't allow comments

And the acp:
Control all news
Create news ones

Part 1: The database
  • The first step to make this work is create two tables on your website's database. For this go to phpMyAdmin, select your database and wait for everything to load on the left.
  • Scroll down and you will see "Create table". You will be creating two tables: news and newscomments (with whatever prefix your database has)
  • In this page, create 7 columns for the news and 5 for the newscomments (click Add columns -> Execute, to add more lines) with the exact info you will see on the images linked below (it's in portuguese, but the order should be the same) - be careful with the names!! And make sure the ID is set to AUTO_INCREMENT (A_I).
  • After this, your two tables should show up on the left
TUTORIAL IMAGES:
News table and
Newscomments table

Part 2: The objects
Go to your file manager now and let's start coding!
Inside the classes folder, create a file named class_news.php and add this content:

PHP Code:

<?php

use Resource\Native\Object;
use 
Resource\Native\Arrays;

class 
News extends Object {


    private 
$id;
    private 
$user;
    private 
$title;
    private 
$content;
    private 
$date;
    private 
$posted;
    private 
$comments;
    private 
$allowcomment;

     public function 
__construct($id){
         
$mysidia Registry::get("mysidia");
         
$whereClause "id = '{$id}'";
         
$row $mysidia->db->select("news",array(),$whereClause)->fetchObject();
         if(!
is_object($row)) throw new NoPermissionException("News doesn't exist");
         foreach(
$row as $key => $val){
                    
$this->$key $val;              
            }
            
$this->comments $mysidia->db->select("newscomments",array("id"),"newsID = {$this->id} ORDER BY date,id");    
        }
        
        public function 
getID(){
            return 
$this->id;
    }
    
    public function 
getUser(){
        return 
$this->user;
    }
    
    public function 
getUserObject(){
        
$mysidia Registry::get("mysidia");
        
$user = new Member($this->user);
        return 
$user;
    }
    public function 
getTitle(){
        return 
$this->title;
    }
    
    public function 
getContent(){
        return 
$this->content;
    }
    
    public function 
getDate(){
        return 
$this->date;
    }
    
    public function 
getPosted(){
        return 
$this->posted;
    }
    
    public function 
getAllowComment(){
        return 
$this->allowcomment;
    }
    
    public function 
changeAllowComment($allow){
        
$mysidia Registry::get("mysidia");
        if(
$this->allowcomment != $allow){
            
$this->allowcomment $allow;
            
$mysidia->db->update("news",array("allowcomment" => $this->allowcomment),"id = {$this->id}");
        }
        
    }
    
    public function 
addComment($content,$date,$user){
        
$mysidia Registry::get("mysidia");
        
$mysidia->db->insert("newscomments",array("comment" => $this->format($content), "date" => $date"userID" => $user"newsID" => $this->id));
        
$this->comments $mysidia->db->select("newscomments",array("id"),"newsID = {$this->id} ORDER BY date,id");
    }
    
    private function 
format($text){
             
$text html_entity_decode($text);
             
$text stripslashes($text);
             
$text str_replace("rn","",$text);
             return 
$text;
        }
    
    public function 
saveDraft(){
        
$mysidia Registry::get("mysidia");
        
$todayDate $this->todayDate();
        if(
$this->date != $todayDate$this->newDate($todayDate);
        
$this->posted "no";
        
$mysidia->db->update("news",array("posted" => $this->posted),"id = {$this->id}");
    }
    
    public function 
post(){
        
$mysidia Registry::get("mysidia");
        
$todayDate $this->todayDate();
        if(
$this->date != $todayDate$this->newDate($todayDate);
        
$this->posted "yes";
        
$mysidia->db->update("news",array("posted" => $this->posted),"id = {$this->id}");
    }
        
        public function 
editContent($content){
            
$mysidia Registry::get("mysidia");
            
$this->content $content;
            
$mysidia->db->update("news",array("content" => $this->content),"id = {$this->id}");
        }
        
        public function 
editTitle($title){
             
$mysidia Registry::get("mysidia");
            
$this->title $title;
            
$mysidia->db->update("news",array("title" => $this->title),"id = {$this->id}");
        }
        
        public function 
todayDate(){
            
$dateTime = new DateTime;
            
$date $dateTime->format('Y-m-d H:i:s');
            return 
$date;
        }
        public function 
newDate($date){
            
$mysidia Registry::get("mysidia");
            
$this->date $date;
            
$mysidia->db->update("news",array("date" => $this->date),"id = {$this->id}");
        }
        
        public function 
getCommentNumber(){
            
$count $this->comments->rowCount();
            return 
$count;
        }
        
        public function 
getComments(){
            return 
$this->comments;
        }
        
}

?>

In the same folder, create a class_newscomments.php file with these contents:

PHP Code:

<?php

use Resource\Native\Object;
use 
Resource\Native\Arrays;

class 
NewsComments extends Object {


    private 
$id;
    private 
$userID;
    private 
$newsID;
    private 
$comment;
    private 
$date;

     public function 
__construct($id){
         
$mysidia Registry::get("mysidia");
         
$whereClause "id = '{$id}'";
         
$row $mysidia->db->select("newscomments",array(),$whereClause)->fetchObject();
         if(!
is_object($row)) throw new NoPermissionException("News comment doesn't exist");
         foreach(
$row as $key => $val){
                    
$this->$key $val;              
            }    
        }
        
        public function 
getID(){
            return 
$this->id;
    }
    
    public function 
getUser(){
        return 
$this->userID;
    }
    
    public function 
getUserObject(){
        
$mysidia Registry::get("mysidia");
        
$user = new Member($this->userID);
        return 
$user;
    }
    
    public function 
getNews(){
        return 
$this->newsID;
    }
    
    public function 
getNewsObject(){
        
$mysidia Registry::get("mysidia");
        
$news = new News($this->newsID);
        return 
$news;
    }
    
    public function 
getContent(){
        return 
$this->comment;
    }
    
    public function 
getDate(){
        return 
$this->date;
    }
        
        public function 
todayDate(){
            
$dateTime = new DateTime;
            
$date $dateTime->format('Y-m-d H:i:s');
            return 
$date;
        }    
        
        public function 
setContent($content){
            
$mysidia Registry::get("mysidia");
            
$this->content $content;
            
$mysidia->db->update("newscomments",array("comment" => $this->content),"id = {$this->id}");
        }
        

}

?>

Part 3: Displaying news on your site!
Now go to the main folder (where the files like account.php and some folders like admincp and classes are) and create the news.php file with these contents:

PHP Code:

<?php

use Resource\Native\String;
use 
Resource\Native\Float;
use 
Resource\Collection\ArrayList;

class 
NewsController extends AppController{

    public function 
__construct(){
        
parent::__construct("member");    
    }
    
    public function 
index(){
    
        
$mysidia Registry::get("mysidia");
        
$allnews $mysidia->db->select("news",array("id"),"posted = 'yes' ORDER BY date DESC");
        
$count $allnews->rowCount();
        if(
$count == 0) throw new NoPermissionException("There are currently no news to display.");
        
$this->setField("allnews",new DatabaseStatement($allnews));        

    }
    
    public function 
view(){
        
$mysidia Registry::get("mysidia");
        
$pageURL 'http';
         if (
$_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
         
$pageURL .= "://";
         if (
$_SERVER["SERVER_PORT"] != "80") {
          
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
         } else {
          
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
          }
         
        
$parts Explode('/'$pageURL);
        
$id $parts[count($parts) - 1];
        
$news = new News($id);
        
        if(
$news->getPosted() == "no")
        {
            if(
$mysidia->usergroup->getpermission("canmanagecontent") != "yes")//rootadmins, admins and artists
            
{
                throw new 
NoPermissionException("This message doesn't exist or isn't yet viewable.");
            }
        }
        
        
/*include_once("inc/ckeditor/ckeditor.php");     
        $editor = new CKEditor;    
            $editor->basePath = '../../inc/ckeditor/';
            $editor2 = $editor->editor("commentcontent", "Write here");
            $this->setField("editor",new DataObject($editor2));*/
            
            
if($mysidia->input->post("submit")){
                if(!
$mysidia->input->post("commentcontent"))
                    throw new 
BlankFieldException("No content or content has an invalid character.");
                if(
$mysidia->usergroup->getpermission("canadopt") != "yes")
                    throw new 
NoPermissionException("No permission");
                if(
$news->getPosted() == "no")
                    throw new 
NoPermissionException("Can't post comments to drafts.");
                if(
$this->commentAlreadyExists($mysidia->input->post("commentcontent"),$id))
                    throw new 
NoPermissionException("Oops, seems like you tried to post the same comment.");
                if(
$news->getAllowComment() == "no")
                    throw new 
NoPermissionException("No comments allowed on this news post.");
            }  
            
            
$news = new News($id);     
            
$this->setField("news",$news);

    }
    
    private function 
commentAlreadyExists($comment$newsID){
        
$mysidia Registry::get("mysidia");
        
$count $mysidia->db->select("newscomments",array("id"),"comment = '{$comment}' and newsID = '{$newsID}' LIMIT 1")->rowCount();
        return (
$count 0);
    }
    
}
?>

Next, in the folder view, create newsview.php with these contents:

PHP Code:

<?php

class NewsView extends View{
    
    public function 
index(){
    
        
$mysidia Registry::get("mysidia");
        
$document $this->document;        
            
$document->setTitle("News");
            
    
            
$allnews $this->getField("allnews")->get();
            
$count $allnews->rowCount();
            
$pagesTotal ceil($count/2);
            
$document->add(new Comment("<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'></script>
            <script>            
                     var current = 1;
                 var max = current * 2;
                 var min = 1;
                     
            $(document).ready(function(){
                
                $('fieldset+br').hide();
                $('[name^=news]').hide();
                
                for(var i = min; i <= max; i++)
                  {
                      $('[name=news' + i +']').show();
                      $('[name=news' + i +']+br').show();
                  }     
                  
                  $('span[id^=page]').click(function(){
                      current = $(this).html();
                      max = current * 2;
                      oldMax = (current - 1) * 2;
                    
                      min = oldMax + 1;
                  
                      $('fieldset+br').hide();
                      $('[name^=news]').hide();
                      
                  for(var i = min; i <= max; i++)
                  {
                      $('[name=news' + i +']').show();
                      $('[name=news' + i +']+br').show();
                  } 
                  
                      
                  });
                });
            </script>"
));
            
$document->add(new Comment("<span class='pages'><center>"));
            for(
$page 1$page <= $pagesTotal$page++)
            {
                
$document->add(new Comment("<span id='page{$page}' class='page'>{$page}</span> | ",FALSE));              
            }
            
            
            
$document->add(new Comment("</center></span><br><div id='news' class='news'>"));
            
$index 0;
            while(
$news $allnews->fetchColumn())
            {
                
$newsObj = new News($news);
                
$index++;
                
$newsField = new Fieldset("news$index");
                  
$comments $newsObj->getCommentNumber();
                
$newsField->add(new Comment("<span class='date'>Date: {$newsObj->getDate()}</span><br>",FALSE));
                
$newsField->add(new Comment("<span class='title'>{$newsObj->getTitle()}</span>",FALSE));
                
$newsField->add(new Comment("<span class='author'>by <a href='/profile/view/{$newsObj->getUserObject()->getUsername()}' target='_blank'>{$newsObj->getUserObject()->getUsername()}</a></span>",FALSE));
                
$newsField->add(new Comment("<span class='comment'><a href='/news/view/{$newsObj->getID()}'>Comments({$comments})</a></span><br>",FALSE));
                
$newsField->add(new Comment("<span class='content'><img class='authorimg' src='{$newsObj->getUserObject()->getprofile()->getavatar()}'>{$newsObj->getContent()}</span>",FALSE));
                
                
$document->add($newsField);
            }
            
            
$document->add(new Comment('</div>'));    
    }
    
    public function 
view(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$news $this->getField("news");
        (
$news->getPosted() == "yes")? $newsState " ":$newsState "(draft)";
        
$newsName $news->getTitle();
        
$newsContent $news->getContent();
        
$newsAuthor $news->getUserObject()->getUsername();
        
$newsDate $news->getDate();
        
$newsComments $news->getComments();
        
$document->setTitle("news");
        
        
$document->add(new Comment("<div id='news' class='news'>"));
        
$newsField = new Fieldset("news");
        
$newsField->add(new Comment("<span class='date'>Date: {$newsDate}</span><br>",FALSE));
            
$newsField->add(new Comment("<span class='title'>{$newsName}{$newsState}</span>",FALSE));
            
$newsField->add(new Comment("<span class='author'>by <a href='/profile/view/{$newsAuthor}' target='_blank'>{$newsAuthor}</a></span>",FALSE));
            
$newsField->add(new Comment("<span class='content'><p><img class='authorimg' src='../../{$news->getUserObject()->getprofile()->getavatar()}'>{$newsContent}<p></span>",FALSE));
        
$document->add($newsField);
        
$document->add(new Comment("<h1>comments</h1>",FALSE));
        
        if(
$mysidia->input->post("submit")){
            
$todayDate = new DateTime;
            
$date $todayDate->format('Y-m-d H:i:s');
            
$content $mysidia->input->post("commentcontent");
            
$user $mysidia->user->uid;
            
$newsID $news->getID();
            
            
$news->addComment($content,$date,$user);
            
$document->add(new Comment("<b>Successfully added comment.</b>",FALSE));
            
        }
        
        
$newsComments $this->getField("news")->getComments();
        if(
$newsComments->rowCount() != 0){
        while(
$commentID $newsComments->fetchColumn()){
            
$comment = new NewsComments($commentID);
            
$commentField = new Fieldset("comment{$comment->getID()}");
            
$commentField->add(new Comment("<span class='cdate'>Date: {$comment->getDate()}</span><br>",FALSE));
            
$commentField->add(new Comment("<span class='cauthor'>by <a href='/profile/view/{$comment->getUserObject()->getUsername()}' target='_blank'>{$comment->getUserObject()->getUsername()}</a></span>",FALSE));
            
$commentField->add(new Comment("<span class='ccontent'><p><img src='../../{$comment->getUserObject()->getprofile()->getavatar()}'>{$comment->getContent()}<p></span>",FALSE));
            
$document->add($commentField);
        }
        }
        else{
            
$document->add(new Comment("No comments yet."));
        }
        
        if(
$news->getAllowComment() == "yes"){
        
$commentForm = new Form("comment","","post");
        
$commentForm->add(new TextArea("commentcontent"""450));
        
$commentForm->add(new Button("Submit","submit","submit"));
        
$document->add($commentForm);
        
$document->add(new Comment('</div>'));
        }
        else{
            
$document->add(new Comment("<b>This page doesn't allow any more comments.</b>"));
        }
    }

    
}
?>

With this code, it will display two news per page. Change these values to change it to whatever you want (in the same file):

Click here


Now you will be able to access [yoursite]/news page and see that there aren't any news there. (Don't forget to add a /news link to your site! I added mine under Home).

Part 4: The AdminCP
Now let's add the adminCP pages so you can control all news and comments.

Inside the lang folder, there's an admincp folder. Create a lang_news.php file with these contents:

PHP Code:

<?php

//Language variables used for AdminCP/News Page

$lang['default_title'] = "News";

?>

Inside the admincp folder create a news.php file with these contents:

PHP Code:

<?php

class ACPNewsController extends AppController{

    const 
PARAM "pageurl";
    private 
$editor;
    
    public function 
__construct(){    
        
parent::__construct();
        include_once(
"../inc/ckeditor/ckeditor.php");     
        
$mysidia Registry::get("mysidia");
        
$this->editor = new CKEditor;    
        
$this->editor->basePath '../../../inc/ckeditor/';
        if(
$mysidia->usergroup->getpermission("canmanagecontent") != "yes"){
            throw new 
NoPermissionException("You do not have permission to manage users.");
        }
    }
    
    public function 
index(){
        
parent::index();
        
$mysidia Registry::get("mysidia");
        
$allnews $mysidia->db->select("news",array("id"),"");
        
$this->setField("news",new DatabaseStatement($allnews));
        
    }

    public function 
viewcomments(){
    
$mysidia Registry::get("mysidia");
    
$pageURL 'http';
         if (
$_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
         
$pageURL .= "://";
         if (
$_SERVER["SERVER_PORT"] != "80") {
          
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
         } else {
          
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
          }
         
$parts Explode('/'$pageURL);
        
$id $parts[count($parts) - 1];
        
        
$news = new News($id);
        
$this->setField("news",$news);
        
         
         if(
$mysidia->input->post("submit2")){
             
$news = new News($id);
            
$this->setField("news2",$news);
         }

    }
    
    public function 
editcomment(){
        
$mysidia Registry::get("mysidia");
        
$pageURL 'http';
         if (
$_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
         
$pageURL .= "://";
         if (
$_SERVER["SERVER_PORT"] != "80") {
          
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
         } else {
          
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
          }
         
        
$parts Explode('/'$pageURL);
        
$id $parts[count($parts) - 1];
        
        
$newsComment = new NewsComments($id);
        
$comment $this->format($newsComment->getContent());
        
        if(
$mysidia->input->post("submit")){
            if(!
$mysidia->input->post("commentcontent"))
                throw new 
BlankFieldException("No content");
            else
                
$comment $this->format($newsComment->getContent());
        }
                
        
$this->setField("newscomments",$newsComment);
        
$editor2 $this->editor->editor("commentcontent",$comment);
        
$this->setField("editor",new DataObject($editor2));
        
    }
    
    public function 
edit(){
        
$mysidia Registry::get("mysidia");
        if(
$mysidia->input->post("submit")){
            if(!
$mysidia->input->post("newstitle")) throw new BlankFieldException("No title");
            if(!
$mysidia->input->post("pagecontent")) throw new BlanKFieldException("No content");
            }
            
        
$pageURL 'http';
         if (
$_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
         
$pageURL .= "://";
         if (
$_SERVER["SERVER_PORT"] != "80") {
          
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
         } else {
          
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
          }
         
        
$parts Explode('/'$pageURL);
        
$id $parts[count($parts) - 1];
        
        
$news = new News($id);
        
$this->setField("news",$news);
        
$editor $this->editor;
        
$this->setField("editor",new DataObject($editor));
    }
    
    public function 
create(){
    
$mysidia Registry::get("mysidia");
        if(
$mysidia->input->post("submit")){
            if(!
$mysidia->input->post("newstitle")) throw new BlankFieldException("No title");
            if(!
$mysidia->input->post("pagecontent")) throw new BlanKFieldException("No content");
        }
        
        
$editor $this->editor->editor("pagecontent""");    
        
$this->setField("editor",new DataObject($editor));
    }
    
            private function 
format($text){
         
$text html_entity_decode($text);
         
$text stripslashes($text);
         
$text str_replace("rn","",$text);
         return 
$text;
    }
}
?>

Now inside the folder admincp/view create a file newsview.php with these contents:

PHP Code:

<?php

use Resource\Native\String;
use 
Resource\Collection\LinkedList;
use 
Resource\Collection\LinkedHashMap;

class 
ACPNewsView extends View{
    
    private 
$editor;
    
    public function 
index(){
        
//parent::index();
        
$mysidia Registry::get("mysidia");
        
$document $this->document;    
        
$document->setTitle("Manage News And Comments");
        
        
$pagesTable = new TableBuilder("news");
        
$pagesTable->setAlign(new Align("center""middle"));
        
        
$pagesTable->buildHeaders("News Title""Author""Date""Edit""Publish/Save""Delete""View Comments""View News");
        
        
$allnews $this->getField("news")->get();
        
        if(
$mysidia->input->post("submit")){
            
$id $mysidia->input->post("submit");
            
$newsObj = new News($id);
            
$newsObj->saveDraft();
            
$document->add(new Comment("<b>Successfully saved news as draft</b>",TRUE));            
        }
        
        if(
$mysidia->input->post("submit1")){
            
$id $mysidia->input->post("submit1");
            
$newsObj = new News($id);
            
$newsObj->post();
            
$document->add(new Comment("<b>Successfully added and published news.</b>",TRUE));
        }
        
        if(
$mysidia->input->post("submit2")){
            
$id $mysidia->input->post("submit2");
            
$newsObj = new News($id);
            
$document->add(new Comment("Are you sure you wish to delete this news?",TRUE));
            
$form = new Form("title","","post");
            
$form->add(new Button("Yes","submit5",$id));
            
$document->add($form);        
            
        }
        if(
$mysidia->input->post("submit5")){
            
$id $mysidia->input->post("submit5");
            
$mysidia->db->delete("news","id = {$id}");
            
$document->add(new Comment("Successfully deleted news",TRUE));
            
$allnews $mysidia->db->select("news",array("id"),"");
        }
            
        while(
$news $allnews->fetchColumn()){
            
$newsObj = new News($news);
            
$cells = new LinkedList;
            (
$newsObj->getPosted() == "yes")? $draft "":$draft "(draft)";
            
$title "{$newsObj->getTitle()} {$draft}";
            
$cells->add(new TCell($title));
            
$cells->add(new TCell($newsObj->getUserObject()->getUsername()));
            
$cells->add(new TCell($newsObj->getDate()));
            
$cells->add(new TCell(new Link("admincp/news/edit/{$news}","Edit")));
            
            
$form = new Form("title","","post");
            
$form->add(new Button("Save As Draft","submit",$news));
            
$form2 = new Form("title","","post");
            
$form2->add(new Button("Publish","submit1",$news));
            
$form3 = new Form("title","","post");
            
$form3->add(new Button("Delete","submit2",$news));
                    
            (
$newsObj->getPosted() == "yes")? $cells->add(new TCell($form)) : $cells->add(new TCell($form2));
            
$cells->add(new TCell($form3));
            
$cells->add(new TCell(new Link("admincp/news/viewcomments/{$news}","View Comments")));
            
$cells->add(new TCell(new Link("news/view/{$news}","View News On Site")));
            
$pagesTable->buildRow($cells);    
        }
        
        
$document->add($pagesTable);
        
$document->add(new Comment("<a href='/admincp/news/create'>Create</a>",TRUE));
       
    }
    
    public function 
viewcomments(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle("editing comments");
        
$news $this->getField("news");
        
        
$newsComments $news->getComments();
        
        
        
$pagesTable = new TableBuilder("news");
        
$pagesTable->setAlign(new Align("center""middle"));
        
        
$pagesTable->buildHeaders("Author""Date""Content""Edit""Delete");
        
        if(
$mysidia->input->post("submit")){
            
$document->add(new Comment("Are you sure you wish to delete this comment?",FALSE));
            
$id $mysidia->input->post("submit");
            
$form = new Form("title","","post");
            
$form->add(new Button("Yes","submit2",$id));
            
$document->add($form);

        }
                    
        if(
$mysidia->input->post("submit2")){
                
$id $mysidia->input->post("submit2");
                
//echo $id;
                
$mysidia->db->delete("newscomments","id = {$id}");
                
$document->add(new Comment("<b>Comment deleted successfully.</b>",FALSE));
                
$news $this->getField("news2");
                
$newsComments $news->getComments();
        }
            
        while(
$newsID $newsComments->fetchColumn()){
            try{
                
$newsComment = new NewsComments($newsID);
                
$cells = new LinkedList;
                
$cells->add(new TCell($newsComment->getUserObject()->getUsername()));
                
$cells->add(new TCell($newsComment->getDate()));
                
$cells->add(new TCell($newsComment->getContent()));
                
$cells->add(new TCell(new Link("admincp/news/editcomment/{$newsComment->getID()}","Edit")));
                
$form = new Form("form","","post");
                
$form->add(new Button("Delete","submit",$newsID));
                
$cells->add(new TCell($form));
                
$pagesTable->buildRow($cells);
            }
            catch(
NoPermissionException $e){
                
            }
            
        }
        
        
$document->add($pagesTable);
    }
    
    public function 
editcomment(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle("editing comments");
        
$newsComment $this->getField("newscomments");
        
$editor $this->getField("editor")->get();
        
        if(
$mysidia->input->post("submit")){
                
$newsComment->setContent($mysidia->input->post("commentcontent"));
                
$document->add(new Comment("<b>Edited news comment successfully. Text displayed is the old one.<br></b>",FALSE));
                
$newsComment $this->getField("newscomments");
                
$editor $this->getField("editor")->get();
        }
        
        
$document->add(new Comment("Author: {$newsComment->getUserObject()->getUsername()} / Date: {$newsComment->getDate()}",FALSE));
        
$form = new Form("form","","post");
        
        
$form->add(new Comment($editor,FALSE));
        
$form->add(new Button("Submit","submit","submit"));
        
$document->add($form);
    }
    
    public function 
edit(){    
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle("Edit");
        
        
            
$news $this->getField("news");                    
            if(
$mysidia->input->post("submit")){
            
            (
$mysidia->input->post("allowcomments"))?$allow "yes":$allow "no";
            
            
$news->editTitle($mysidia->input->post("newstitle"));
            
$news->editContent($this->format($mysidia->input->post("pagecontent")));
            
$news->changeAllowComment($allow);
            
            if(
$mysidia->input->post("submit") == "submitDraft"){
                
$news->saveDraft();
            }
            
            else{
                
$news->post();
            }
            
$document->add(new Comment("<b>Successfully changed news.</b>"));
        }
        
        
$editor $this->getField("editor")->get()->editor("pagecontent"$this->format($news->getContent()));
        
$form = new Form("title","","post");
        
$form->add(new Comment("<b>Date</b>:{$news->getDate()} and <b>Author</b>: {$news->getUserObject()->getUsername()} and <b>Published</b>: {$news->getPosted()}"));
        
$form->add(new Comment("<b>Title</b>:"));
        
$form->add(new TextField("newstitle",$news->getTitle()));
        
$form->add(new Comment("<b>Contents</b>:"));
        
$form->add(new Comment($editor));
        
$comments = new CheckBox("Allow comments on this news""allowcomments"1"array");
        if(
$news->getAllowComment() == "yes")
            
$comments->setChecked("allowcomments");
        
$comments2 = new CheckBox("Send message to all users notifying about the existence of an update""allowmessage"2"array");
        
$form->add($comments);
        
$form->add($comments2);
        
$form->add(new Button("Save as draft","submit","submitDraft"));
        
$form->add(new Button("Publish","submit","submitPublish"));
        
$document->add($form);
        
    
    }
    
    public function 
create(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle("Create");
        
        if(
$mysidia->input->post("submit")){
            
$todayDate = new DateTime;
            
$date $todayDate->format('Y-m-d H:i:s');
        
            (
$mysidia->input->post("allowcomments"))?$allow "yes":$allow "no";
                
            
            if(
$mysidia->input->post("submit") == "submitDraft"){
                            
            
$mysidia->db->insert("news",array("title" => $mysidia->input->post("newstitle"), "content" => $this->format($mysidia->input->post("pagecontent")), "user" => $mysidia->user->uid"date" => $date"posted" => "no","allowcomment" => $allow));
            }
            
            else{
                            
            
$mysidia->db->insert("news",array("title" => $mysidia->input->post("newstitle"), "content" => $this->format($mysidia->input->post("pagecontent")), "user" => $mysidia->user->uid"date" => $date"posted" => "yes","allowcomment" => $allow));
            
                if(
$mysidia->input->post("allowmessage")){
                    
//$mysidia->db->insert("");
                
}
            }
            
$document->add(new Comment("<b>Successfully changed news. Fill this page again to create a new post. Click <a href='/news' target='_blank'>here</a> to see the news page.</b>"));
        }
        
$todayDate = new DateTime;
        
$date $todayDate->format('Y-m-d');
        
$editor $this->getField("editor")->get();
        
$form = new Form("title","","post");
        
$form->add(new Comment("<b>Date</b>:{$date} and <b>Author</b>: {$mysidia->user->username} and <b>Published</b>: No"));
        
$form->add(new Comment("<b>Title</b>:"));
        
$form->add(new TextField("newstitle",""));
        
$form->add(new Comment("<b>Contents</b>:"));
        
$form->add(new Comment($editor));
        
$comments = new CheckBox("Allow comments on this news""allowcomments"1"array");
        
$comments2 = new CheckBox("Send message to all users notifying about the existence of an update""allowmessage"2"array");
        
$form->add($comments);
        
$form->add($comments2);
        
$form->add(new Button("Save as draft","submit","submitDraft"));
        
$form->add(new Button("Publish","submit","submitPublish"));
        
$document->add($form);
    }
    
        private function 
format($text){
         
$text html_entity_decode($text);
         
$text stripslashes($text);
         
$text str_replace("rn","",$text);
         return 
$text;
    }
}
?>

And so you can add the admincp/news link to your site, go to the file class_adminsidebar.php in the folder classes and find this:

PHP Code:

        $components->add(new Division(new Comment("Images"FALSE)));
        
$image = new Division;
        
$image->add(new Link("admincp/image/upload""Upload Images"));
        
$image->add(new Link("admincp/image/delete""Erase Images"));
        
$image->add(new Link("admincp/image/settings""Adoptable Signature Image/GD Settings"));
        
$components->add($image); 

Add this after that piece of code:

PHP Code:

        $components->add(new Division(new Comment("News"FALSE)));
        
$news = new Division;
        
$news->add(new Link("admincp/news""Manage News and Comments"));
        
$news->add(new Link("admincp/news/create""Create News"));
        
$components->add($news); 

Part 5: The CSS
If you just added started adding news you will see that the news won't display like what the pictures show. I modified the CSS in order to look like that.
If you are using the main theme, go to templates/main/media/style-city.css and add this at the bottom:

PHP Code:

.news fieldset{
color:black;
background-imageurl(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94iG3L7uKrR+GdWD73ydlIB+6hgref1QTlmgmbM3/LeX5GI1Ux1RWpgxpLuZ2+I+IjzZ8wqE4nilvQdkUdfhzI5QDWy+kw5Wgg2pGpeEVeCCA7b85BO3F9DzxB3cdqvBzWcmzbyMiqhzuYqtHRVG2y4x+KOlnyqla8AoWWpuBoYRxzXrfKuILl6SfiWCbjxoZJUaCBj1CjH7GIaDbc9kqBY3W/Rgjda1iqQcOJu2WW+76pZC9QG7M00dffe9hNnseupFL53r8F7YHSwJWUKP2q+k7RdsxyOB11n0xtOvnW4irMMFNV4H0uqwS5ExsmP9AxbDTc9JwgneAT5vTiUSm1E7BSflSt3bfa1tv8Di3R8n3Af7MNWzs49hmauE2wP+ttrq+AsWpFG2awvsuOqbipWHgtuvuaAE+A1Z/7gC9hesnr+7wqCwG8c5yAg3AL1fm8T9AZtp/bbJGwl1pNrE7RuOX7PeMRUERVaPpEs+yqeoSmuOlokqw49pgomjLeh7icHNlG19yjs6XXOMedYm5xH2YxpV2tc0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==);
border-radius:5px;
border:white;
background-colorwhite;
/*border:2px dotted black;*/
border-bottom3px solid brown;

}

.
news .content .authorimg{
float:left;
border1px dotted black;
padding:2px;
margin-right:10px;
margin-bottom:4px;
}

.
news fieldset .title:before{
content:'>>> ';
font-size:11px;
}

.
news{
color:brown;
}
.
news fieldset .content{
text-align:justify;
color:black;
}

.
news .date {
font-size:10px;
font-weightbold;
color:brown;
}

.
news .author a{
color:orange;
}

.
news .author a:hover{
color:brown;
}

.
news .title {
font-size:25px;
font-weight:bold;
color:orange;

}

.
news .author:before {
content' | ';
}
.
news .author {
color:brown;
font-size:10px;
}

.
news .comment{
font-size:10px;
}

.
news .comment:before{
content' | ';
}

.
pages{
color:brown;
}
.
page{
color:white;
background-color:brown;
border-radius:5px;
border:2px solid brown;
}
.
page:hover{
color:orange;
background-color:white;
border:0px;
}

.
cdate{
font-size:10px;
font-weightbold;
color:brown;
}

.
cauthor{
color:brown;
font-size:10px;
}
.
ccontent{
font-size:10px;
text-align:justify;
color:black;
}

.
ccontent img{
float:left;
border1px dotted black;
padding:2px;
margin-right:10px;
margin-bottom:4px;


If you aren't using the main theme, Add that to the css of whatever theme you are using. Right click the page to see the HTML and check what each class does what.


----------------

Please warn me of any bugs you find. I tested it and it should be working properly, so please warn me if you find something that wasn't supposed to happen.

Hall of Famer 02-14-2014 03:17 PM

Nice work, I am sure it took you quite a while to get this done and it must've been a valuable experience. It seems that you are getting a good understanding of the OOP and MVC system, which is nice to know. I hope users like it. ^^

I was wondering though, can you possibly provide a .rar or .zip file for users to download the files and uploads easily? This is likely to work for most sites since I see most of the changes are in new files.

Abronsyth 02-14-2014 03:38 PM

Brilliant! Once I get my file transfers working again (glitches are killing me) I'll most certainly be trying this out! I've been dying for a news system, haha <3 ((Though I still plan to fix up my own...just hard to juggle learning code with everything else that's going on...))

IntoRain 02-14-2014 03:47 PM

Quote:

Originally Posted by Hall of Famer (Post 29047)
Nice work, I am sure it took you quite a while to get this done and it must've been a valuable experience. It seems that you are getting a good understanding of the OOP and MVC system, which is nice to know. I hope users like it. ^^

I was wondering though, can you possibly provide a .rar or .zip file for users to download the files and uploads easily? This is likely to work for most sites since I see most of the changes are in new files.

Thank you! I had contact with OOP before in other language, but it's the first time using MVC, although it makes sense xD Getting the pages in jQuery to work was actually what took me longer to get (and I found two bugs today, so I'm not really confident about it xD ). I tried to implement this one but for some reason it wasn't working, so I made my own (it's simple and actually just hides the news that aren't supposed to show on a certain page lol)

Sure thing! I will add them to the first post! Actually makes things easier xD

Quote:

Originally Posted by Abronsyth (Post 29049)
Brilliant! Once I get my file transfers working again (glitches are killing me) I'll most certainly be trying this out! I've been dying for a news system, haha <3 ((Though I still plan to fix up my own...just hard to juggle learning code with everything else that's going on...))

Thank you! Hopefully this will be helpful for you!

Hall of Famer 02-14-2014 03:53 PM

I understand what you mean. Yeah Mysidia is not quite friendly with JQuery and javascript libraries at this moment, but it is expected to change in future. I am glad to know that you figured it out in the end, it could definitely take a while. Kyttias also told me that getting JQuery to work with Mysidia was painful. XD

IntoRain 02-14-2014 04:04 PM

Quote:

Originally Posted by Hall of Famer (Post 29053)
I understand what you mean. Yeah Mysidia is not quite friendly with JQuery and javascript libraries at this moment, but it is expected to change in future. I am glad to know that you figured it out in the end, it could definitely take a while. Kyttias also told me that getting JQuery to work with Mysidia was painful. XD

It seems that adding .js files with jQuery to the header/template makes it not work properly for some reason, it took a while to figure out why it wasn't making a simple popup when the only thing I did was alert('hey') xD
A good thing about javascript in mysidia is that you can magically send php variables to the javascript since the script is inside a comment, without the need to query the database with ajax. So that's a good side! xD

tahbikat 02-14-2014 09:48 PM

This is WONDERFUL! I'm going to have to add this to my site soon! ^^ Awesome!

IntoRain 02-14-2014 10:51 PM

I'm Glad it will be useful *hopefully* for your site!

Vaporman87 02-23-2014 12:58 AM

Got this up and running on my site. Thanks a bunch for this IntoRain!!!

IntoRain 02-23-2014 09:14 AM

You're welcome! Glad it worked for you! ^^ If you detect any bug, don't hesitate to tell me!

Vaporman87 02-24-2014 09:37 AM

The only thing I noticed is that if you have your site in a subfolder, you need to go in and change the following code in the /view/newsview.php file:

Code:

$newsObj = new News($news);
                        $index++;
                        $newsField = new Fieldset("news$index");
                              $comments = $newsObj->getCommentNumber();
                        $newsField->add(new Comment("<span class='date'>Date: {$newsObj->getDate()}</span><br>",FALSE));
                        $newsField->add(new Comment("<span class='title'>{$newsObj->getTitle()}</span>",FALSE));
                        $newsField->add(new Comment("<span class='author'>by <a href='/profile/view/{$newsObj->getUserObject()->getUsername()}' target='_blank'>{$newsObj->getUserObject()->getUsername()}</a></span>",FALSE));
                        $newsField->add(new Comment("<span class='comment'><a href='/news/view/{$newsObj->getID()}'>Comments({$comments})</a></span><br>",FALSE));
                        $newsField->add(new Comment("<span class='content'><img class='authorimg' src='{$newsObj->getUserObject()->getprofile()->getavatar()}'>{$newsObj->getContent()}</span>",FALSE));

I added my subfolder name, "DigiChars", before the " /news/view/ " and " /profile/view/ " text.

IntoRain 02-25-2014 08:55 AM

Thank you! I will add a note to the first post!

Missy Master 02-26-2014 08:36 PM

This looks really good! I cant wait to try this out --- thanks for sharing this with us! :)

IntoRain 03-03-2014 06:55 PM

Quote:

Originally Posted by Annatar (Post 29209)
This looks really good! I cant wait to try this out --- thanks for sharing this with us! :)

Thank you for the support! ^^

Kesstryl 03-05-2014 01:21 AM

Nice mod, will definitely use this once I start working on my site. Right now I've been diggin g deep into learning MVC, OOP, and PDO before I even touch Mysidia.

Abronsyth 03-07-2014 06:01 PM

Just created and added everything and it is functioning perfectly! I have to fix up the formatting a little bit so it works more neatly with the theme, but it's awesome so far!

How do you think one should go about making it so that a news alert appears at the top of the page until the member visits the news page? So each time a new news post is added members are alerted when they logon?

IntoRain 03-09-2014 08:16 PM

Quote:

Originally Posted by Kesstryl (Post 29297)
Nice mod, will definitely use this once I start working on my site. Right now I've been diggin g deep into learning MVC, OOP, and PDO before I even touch Mysidia.

Thank you! Hope it works well for you! ^^ OOP is one of those concepts that will make so much sense once it clicks xD

Quote:

Originally Posted by Abronsyth (Post 29301)
Just created and added everything and it is functioning perfectly! I have to fix up the formatting a little bit so it works more neatly with the theme, but it's awesome so far!

How do you think one should go about making it so that a news alert appears at the top of the page until the member visits the news page? So each time a new news post is added members are alerted when they logon?

Yay glad it worked for you! ^^ THank you for the input!
I was thinking of sending a new message to users to alert them of a new news, but I kinda got lazy and didn't do it lol
I guess it would work exactly like the messages system that alerts users when they get a new message. Maybe another table that contains all users and a field that says if they have been to the news page ever since a new news was posted. So when posting a news, all fields would reset to "unread" for all users and while it was unread, a message would appear somewhere in the site

Abronsyth 09-24-2014 06:26 PM

Okay, I'm having this error:
CREATE TABLE `newscomments` (

`id` INT( 5 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`newsID` INT( 5 ) NOT NULL DEFAULT 'None',
`userID` INT( 5 ) NOT NULL DEFAULT 'None',
`comment` VARCHAR( 300 ) NULL DEFAULT NULL ,
`date` VARCHAR( 30 ) NULL DEFAULT NULL
) ENGINE = MYISAM
MySQL said: Documentation

#1067 - Invalid default value for 'newsID'

Any ideas?

IntoRain 09-24-2014 07:10 PM

Quote:

Originally Posted by Abronsyth (Post 31180)
Okay, I'm having this error:
CREATE TABLE `newscomments` (

`id` INT( 5 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`newsID` INT( 5 ) NOT NULL DEFAULT 'None',
`userID` INT( 5 ) NOT NULL DEFAULT 'None',
`comment` VARCHAR( 300 ) NULL DEFAULT NULL ,
`date` VARCHAR( 30 ) NULL DEFAULT NULL
) ENGINE = MYISAM
MySQL said: Documentation

#1067 - Invalid default value for 'newsID'

Any ideas?

Did you write "None" instead of selecting 'None' from the list? If it's not that, you can try running it directly and removing the default part:

Code:

CREATE TABLE  `[your_prefix_here]_newscomments` (

`id` INT( 5 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`newsID` INT( 5 ) NOT NULL,
`userID` INT( 5 ) NOT NULL,
`comment` VARCHAR( 300 ) NULL DEFAULT NULL ,
`date` VARCHAR( 30 ) NULL DEFAULT NULL
) ENGINE = MYISAM

This is by clicking on the "SQL" tab. Like here: http://i.imgur.com/VGRaF82.png

Abronsyth 09-25-2014 04:37 AM

The phpMyAdmin that my host is using seems to be a bit dated, so it doesn't actually have a drop-down for most of the parts. I'll go through and run it directly to see if that'll work.

Thank you :)

IntoRain 09-25-2014 08:20 AM

Ah, I see. I think the error is because the value is an integer and "None" was a string. Since the values can't be null, they don't need a default value, so I think it won't hurt to remove it
I hope it works! :)

edit: Added a step I forgot to the tutorial...

parayna 10-04-2014 03:20 PM

Heya ^_^ I am using this Mod (everything works great!) but do you know how I would change the time zone? I am in the UK, see, and it is set in a time zone 5 hours back (so like at 9 my time, it says it was posted at 4, for example)

Thank you ^_^ (I just want it UK time because I am from the UK XD) Also, if there is a way for it to automatically detect a user's time zone and change the times for them that would be great as well! (But I know little about coding so I have no idea how that would be possible...)

IntoRain 10-04-2014 04:10 PM

Quote:

Originally Posted by parayna (Post 31299)
Heya ^_^ I am using this Mod (everything works great!) but do you know how I would change the time zone? I am in the UK, see, and it is set in a time zone 5 hours back (so like at 9 my time, it says it was posted at 4, for example)

Thank you ^_^ (I just want it UK time because I am from the UK XD) Also, if there is a way for it to automatically detect a user's time zone and change the times for them that would be great as well! (But I know little about coding so I have no idea how that would be possible...)

Glad it's working for you!

You can set the DateTime thingy to your timezone, but I don't think it's possible to set it to the user's timezone. Perhaps with javascript, but I'm not really sure how

Check the file newsview.php inside admincp/view, and search for this part:

PHP Code:

public function create(){
    
$mysidia Registry::get("mysidia");
    
$document $this->document;
    
$document->setTitle("Create");
        
    if(
$mysidia->input->post("submit")){
        
$todayDate = new DateTime;

                
//add the following line:
        
$todayDate->setTimezone(new DateTimeZone('Europe/London'));

        
$date $todayDate->format('Y-m-d H:i:s');
//rest of the code here 

I assumed London, but here's the list of available timezones you can use: http://php.net/manual/en/timezones.php

I just used it for my country and it's 1 hour behind lol

parayna 10-04-2014 06:16 PM

OK! Thank you! ^_^ (And yeah, mine is the London one, good guess :P)

EDIT: Yay! It worked! Thanks! :D

parayna 10-07-2014 05:36 PM

Hi again! Sorry for the double post but I seem to have run into something... for some reason the CSS file part won't let me change it. And it is only working for one of my themes...

There aren't any errors popping up or anything, just the CSS of the news page doesn't work on my second theme (it's set to the default, blank one). I have put it into the same file I did to put it into my first theme, but it won't work.

I tried to change it as well (to better suit my first theme) but the images/colours won't change even when I remove the image link for the grey body image, and replace it with my own. Neither will the colours for the borders change when I add a different colour in... do you have any ideas as to what the problem could be? It's kinda confusing me... XD

IntoRain 10-07-2014 06:00 PM

Quote:

Originally Posted by parayna (Post 31355)
Hi again! Sorry for the double post but I seem to have run into something... for some reason the CSS file part won't let me change it. And it is only working for one of my themes...

There aren't any errors popping up or anything, just the CSS of the news page doesn't work on my second theme (it's set to the default, blank one). I have put it into the same file I did to put it into my first theme, but it won't work.

I tried to change it as well (to better suit my first theme) but the images/colours won't change even when I remove the image link for the grey body image, and replace it with my own. Neither will the colours for the borders change when I add a different colour in... do you have any ideas as to what the problem could be? It's kinda confusing me... XD

You might be editing the wrong .css file? The templates/main/media/style-city.css file is just for the main theme, other themes might be in different folders like templates/(other_theme)/.../file.css. Inspect your site's source code (right click > inspect/view code/or similar) to check which .css files it's using with that theme. Might be that xD

parayna 10-07-2014 06:08 PM

I made the themes myself and each theme uses a different style-city.css XD Unless you're not supposed to do that..? I just had trouble getting the bleedin' thing to work so I used the same name XD (just added different pictures for like the background and changed the colours in each one)

EDIT: Grr... got it working XD Finally, I managed to make the theme work with a differently named style-city.css. I changed it to style-red.css and refreshed the page and all of a sudden it decided to work! XD Thanks though ^_^

parayna 12-08-2014 10:28 AM

Hello, I know this hasn't been commented on for a while but do you know how to get the 'Send message to all users notifying about the existence of an update' button working? I think I recall you saying it doesn't work yet but I am thinking of trying to get it working..

Would it be possible to have it so that when that box is ticked it automatically updates the 'messages' database table? (Maybe not an email, just a PM on your site) As in, when you tick it every user on the site gets a PM from 'SYSTEM' or even just the admin...

Would that be possible? Sorry for bugging XD

~Parayna

IntoRain 12-08-2014 01:45 PM

Quote:

Originally Posted by parayna (Post 31619)
Hello, I know this hasn't been commented on for a while but do you know how to get the 'Send message to all users notifying about the existence of an update' button working? I think I recall you saying it doesn't work yet but I am thinking of trying to get it working..

Would it be possible to have it so that when that box is ticked it automatically updates the 'messages' database table? (Maybe not an email, just a PM on your site) As in, when you tick it every user on the site gets a PM from 'SYSTEM' or even just the admin...

Would that be possible? Sorry for bugging XD

~Parayna

Sorry, I didn't get back to this mod because my host started having problems and the loading times were too crazy to get anything done.

My idea was to send a PM to everyone in the site. The condition to send PM's is already there:

newview.php
PHP Code:

  else{
                            
            
$mysidia->db->insert("news",array("title" => $mysidia->input->post("newstitle"), "content" => $this->format($mysidia->input->post("pagecontent")), "user" => $mysidia->user->uid"date" => $date"posted" => "yes","allowcomment" => $allow));
            
                if(
$mysidia->input->post("allowmessage")){
                    
//$mysidia->db->insert("");
                
}
            } 

Next, inside the if, you'd need to retrieve all user ID's from the users table and use a loop to add the message to the messages table, one for each user (you might need the username instead of the userid, I don't remember which one the messages table uses x.x). This was my first idea, I wanted to do something prettier but I didn't come up with anything else lol

parayna 12-09-2014 12:23 PM

Thanks for replying ^_^ I might have a little go when I have more time XD

Thanks~

parayna 12-11-2014 08:36 AM

Well, I tried and failed :cfrown: I think your way would work but I can't make sense of putting it together... I have no idea what to put or where. I understand that you need to edit the database but I have no idea what to write into the code to update each field (I am a very novice coder....) I have been trying for a while now but I can't seem to get it right.. :mii: I have even been looking at other files from the script to see if there is similar coding that I could use and there probably is but I can't make sense from it.. ^_^''

...could you please help me when you have some spare moments? Thank you... >.<

~Parayna

IntoRain 12-11-2014 06:32 PM

Quote:

Originally Posted by parayna (Post 31635)
Well, I tried and failed :cfrown: I think your way would work but I can't make sense of putting it together... I have no idea what to put or where. I understand that you need to edit the database but I have no idea what to write into the code to update each field (I am a very novice coder....) I have been trying for a while now but I can't seem to get it right.. :mii: I have even been looking at other files from the script to see if there is similar coding that I could use and there probably is but I can't make sense from it.. ^_^''

...could you please help me when you have some spare moments? Thank you... >.<

~Parayna

I will post it tomorrow asap! I'm sorry, I was going to code it after you answered, but it's the last week of the semester and I have 4 projects to deliver in a few days xD

parayna 12-12-2014 11:59 AM

Thank you! It's fine, to be honest I can't wait until I have learnt coding more and can code things myself XD I know it's a matter of time but I really want to be able to do things like this myself instead of relying on other people who may or may not be busy >.< But thanks all the same! XD

~Parayna

parayna 12-16-2014 09:57 PM

...bump... ^_^

IntoRain 12-18-2014 06:18 PM

Sorry for the late

Adding a "send message to all users" option:
  1. Go to your database, and select your news table.
  2. At the top, if you are using phpMyAdmin, select to edit the table's structure.
  3. At the bottom you will see an "Add (1) columns..." click execute
  4. Create a new columns like this:
    • Name: allowmessage
    • Type: varchar
    • Size: 3
    • Predefined: As defined -> "no"
    • Select "Null" checkbox
  5. Go to your class_news.php file and change it to this: (new stuff is commented with "NEW!")
    PHP Code:

    <?php

    use Resource\Native\Object;
    use 
    Resource\Native\Arrays;

    class 
    News extends Object {


        private 
    $id;
        private 
    $user;
        private 
    $title;
        private 
    $content;
        private 
    $date;
        private 
    $posted;
        private 
    $comments;
        private 
    $allowcomment;
        private 
    $allowmessage;//NEW!

         
    public function __construct($id){
             
    $mysidia Registry::get("mysidia");
             
    $whereClause "id = '{$id}'";
             
    $row $mysidia->db->select("news",array(),$whereClause)->fetchObject();
             if(!
    is_object($row)) throw new NoPermissionException("News doesn't exist");
             foreach(
    $row as $key => $val){
                        
    $this->$key $val;              
                }
                
    $this->comments $mysidia->db->select("newscomments",array("id"),"newsID = {$this->id} ORDER BY date,id");    
            }
            
            public function 
    getID(){
                return 
    $this->id;
        }
        
        public function 
    getUser(){
            return 
    $this->user;
        }
        
        public function 
    getUserObject(){
            
    $mysidia Registry::get("mysidia");
            
    $user = new Member($this->user);
            return 
    $user;
        }
        public function 
    getTitle(){
            return 
    $this->title;
        }
        
        public function 
    getContent(){
            return 
    $this->content;
        }
        
        public function 
    getDate(){
            return 
    $this->date;
        }
        
        public function 
    getPosted(){
            return 
    $this->posted;
        }
        
        public function 
    getAllowComment(){
            return 
    $this->allowcomment;
        }

    //NEW!
        
    public function getAllowMessage(){
            return 
    $this->allowmessage;
        }
            
        public function 
    changeAllowComment($allow){
            
    $mysidia Registry::get("mysidia");
            if(
    $this->allowcomment != $allow){
                
    $this->allowcomment $allow;
                
    $mysidia->db->update("news",array("allowcomment" => $this->allowcomment),"id = {$this->id}");
            }
            
        }

    //NEW!
        
    public function changeAllowMessage($allow){
            
    $mysidia Registry::get("mysidia");
            if(
    $this->allowmessage != $allow){
                
    $this->allowmessage $allow;
                
    $mysidia->db->update("news",array("allowmessage" => $this->allowmessage),"id = {$this->id}");
            }
            
        }
            
        public function 
    addComment($content,$date,$user){
            
    $mysidia Registry::get("mysidia");
            
    $mysidia->db->insert("newscomments",array("comment" => $this->format($content), "date" => $date"userID" => $user"newsID" => $this->id));
            
    $this->comments $mysidia->db->select("newscomments",array("id"),"newsID = {$this->id} ORDER BY date,id");
        }
        
        private function 
    format($text){
                 
    $text html_entity_decode($text);
                 
    $text stripslashes($text);
                 
    $text str_replace("rn","",$text);
                 return 
    $text;
            }
        
        public function 
    saveDraft(){
            
    $mysidia Registry::get("mysidia");
            
    $todayDate $this->todayDate();
            if(
    $this->date != $todayDate$this->newDate($todayDate);
            
    $this->posted "no";
            
    $mysidia->db->update("news",array("posted" => $this->posted),"id = {$this->id}");
        }
        
        public function 
    post(){
            
    $mysidia Registry::get("mysidia");
            
    $todayDate $this->todayDate();
            if(
    $this->date != $todayDate$this->newDate($todayDate);
            
    $this->posted "yes";
            
    $mysidia->db->update("news",array("posted" => $this->posted),"id = {$this->id}");
    //NEW!
            
    if($this->allowmessage == "yes")
                
    $this->sendToAllUsers($todayDate);
        }
     
    //NEW!       
            
    public function sendToAllUsers($dateToday) {
                    
    $mysidia Registry::get("mysidia");
            
    $allusers $mysidia->db->select("users", array("username"), "");        
            
    $messageTitle "Update";
            
    $messagetext "A new news was posted on the site! Click <a href='/news'>here</a> to view!<br>";
            
            while(
    $user $allusers->fetchColumn()){
                
    $mysidia->db->insert("messages", array("fromuser" => "SYSTEM""touser" => $user"status" => "unread""datesent" => $dateToday"messagetitle" => $messageTitle"messagetext" => $messagetext), ""); 
            }
               }
               
            public function 
    editContent($content){
                
    $mysidia Registry::get("mysidia");
                
    $this->content $content;
                
    $mysidia->db->update("news",array("content" => $this->content),"id = {$this->id}");
            }
            
            public function 
    editTitle($title){
                 
    $mysidia Registry::get("mysidia");
                
    $this->title $title;
                
    $mysidia->db->update("news",array("title" => $this->title),"id = {$this->id}");
            }
            
            public function 
    todayDate(){
                
    $dateTime = new DateTime;
                
    $date $dateTime->format('Y-m-d H:i:s');
                return 
    $date;
            }
            public function 
    newDate($date){
                
    $mysidia Registry::get("mysidia");
                
    $this->date $date;
                
    $mysidia->db->update("news",array("date" => $this->date),"id = {$this->id}");
            }
            
            public function 
    getCommentNumber(){
                
    $count $this->comments->rowCount();
                return 
    $count;
            }
            
            public function 
    getComments(){
                return 
    $this->comments;
            }
            
    }

    ?>

  6. Go to your newsview.php file inside the admincp folder and change it to this: (new stuff is commented with "NEW!")
    PHP Code:

    <?php

    use Resource\Native\String;
    use 
    Resource\Collection\LinkedList;
    use 
    Resource\Collection\LinkedHashMap;

    class 
    ACPNewsView extends View{
        
        private 
    $editor;
        
        public function 
    index(){
            
    //parent::index();
            
    $mysidia Registry::get("mysidia");
            
    $document $this->document;    
            
    $document->setTitle("Manage News And Comments");
            
            
    $pagesTable = new TableBuilder("news");
            
    $pagesTable->setAlign(new Align("center""middle"));
            
            
    $pagesTable->buildHeaders("News Title""Author""Date""Edit""Publish/Save""Delete""View Comments""View News");
            
            
    $allnews $this->getField("news")->get();
            
            if(
    $mysidia->input->post("submit")){
                
    $id $mysidia->input->post("submit");
                
    $newsObj = new News($id);
                
    $newsObj->saveDraft();
                
    $document->add(new Comment("<b>Successfully saved news as draft</b>",TRUE));            
            }
            
            if(
    $mysidia->input->post("submit1")){
                
    $id $mysidia->input->post("submit1");
                
    $newsObj = new News($id);
                
    $newsObj->post();
                
    $document->add(new Comment("<b>Successfully added and published news.</b>",TRUE));
            }
            
            if(
    $mysidia->input->post("submit2")){
                
    $id $mysidia->input->post("submit2");
                
    $newsObj = new News($id);
                
    $document->add(new Comment("Are you sure you wish to delete this news?",TRUE));
                
    $form = new Form("title","","post");
                
    $form->add(new Button("Yes","submit5",$id));
                
    $document->add($form);        
                
            }
            if(
    $mysidia->input->post("submit5")){
                
    $id $mysidia->input->post("submit5");
                
    $mysidia->db->delete("news","id = {$id}");
                
    $document->add(new Comment("Successfully deleted news",TRUE));
                
    $allnews $mysidia->db->select("news",array("id"),"");
            }
                
            while(
    $news $allnews->fetchColumn()){
                
    $newsObj = new News($news);
                
    $cells = new LinkedList;
                (
    $newsObj->getPosted() == "yes")? $draft "":$draft "(draft)";
                
    $title "{$newsObj->getTitle()} {$draft}";
                
    $cells->add(new TCell($title));
                
    $cells->add(new TCell($newsObj->getUserObject()->getUsername()));
                
    $cells->add(new TCell($newsObj->getDate()));
                
    $cells->add(new TCell(new Link("admincp/news/edit/{$news}","Edit")));
                
                
    $form = new Form("title","","post");
                
    $form->add(new Button("Save As Draft","submit",$news));
                
    $form2 = new Form("title","","post");
                
    $form2->add(new Button("Publish","submit1",$news));
                
    $form3 = new Form("title","","post");
                
    $form3->add(new Button("Delete","submit2",$news));
                        
                (
    $newsObj->getPosted() == "yes")? $cells->add(new TCell($form)) : $cells->add(new TCell($form2));
                
    $cells->add(new TCell($form3));
                
    $cells->add(new TCell(new Link("admincp/news/viewcomments/{$news}","View Comments")));
                
    $cells->add(new TCell(new Link("news/view/{$news}","View News On Site")));
                
    $pagesTable->buildRow($cells);    
            }
            
            
    $document->add($pagesTable);
            
    $document->add(new Comment("<a href='/admincp/news/create'>Create</a>",TRUE));
           
        }
        
        public function 
    viewcomments(){
            
    $mysidia Registry::get("mysidia");
            
    $document $this->document;
            
    $document->setTitle("editing comments");
            
    $news $this->getField("news");
            
            
    $newsComments $news->getComments();
            
            
            
    $pagesTable = new TableBuilder("news");
            
    $pagesTable->setAlign(new Align("center""middle"));
            
            
    $pagesTable->buildHeaders("Author""Date""Content""Edit""Delete");
            
            if(
    $mysidia->input->post("submit")){
                
    $document->add(new Comment("Are you sure you wish to delete this comment?",FALSE));
                
    $id $mysidia->input->post("submit");
                
    $form = new Form("title","","post");
                
    $form->add(new Button("Yes","submit2",$id));
                
    $document->add($form);

            }
                        
            if(
    $mysidia->input->post("submit2")){
                    
    $id $mysidia->input->post("submit2");
                    
    //echo $id;
                    
    $mysidia->db->delete("newscomments","id = {$id}");
                    
    $document->add(new Comment("<b>Comment deleted successfully.</b>",FALSE));
                    
    $news $this->getField("news2");
                    
    $newsComments $news->getComments();
            }
                
            while(
    $newsID $newsComments->fetchColumn()){
                try{
                    
    $newsComment = new NewsComments($newsID);
                    
    $cells = new LinkedList;
                    
    $cells->add(new TCell($newsComment->getUserObject()->getUsername()));
                    
    $cells->add(new TCell($newsComment->getDate()));
                    
    $cells->add(new TCell($newsComment->getContent()));
                    
    $cells->add(new TCell(new Link("admincp/news/editcomment/{$newsComment->getID()}","Edit")));
                    
    $form = new Form("form","","post");
                    
    $form->add(new Button("Delete","submit",$newsID));
                    
    $cells->add(new TCell($form));
                    
    $pagesTable->buildRow($cells);
                }
                catch(
    NoPermissionException $e){
                    
                }
                
            }
            
            
    $document->add($pagesTable);
        }
        
        public function 
    editcomment(){
            
    $mysidia Registry::get("mysidia");
            
    $document $this->document;
            
    $document->setTitle("editing comments");
            
    $newsComment $this->getField("newscomments");
            
    $editor $this->getField("editor")->get();
            
            if(
    $mysidia->input->post("submit")){
                    
    $newsComment->setContent($mysidia->input->post("commentcontent"));
                    
    $document->add(new Comment("<b>Edited news comment successfully. Text displayed is the old one.<br></b>",FALSE));
                    
    $newsComment $this->getField("newscomments");
                    
    $editor $this->getField("editor")->get();
            }
            
            
    $document->add(new Comment("Author: {$newsComment->getUserObject()->getUsername()} / Date: {$newsComment->getDate()}",FALSE));
            
    $form = new Form("form","","post");
            
            
    $form->add(new Comment($editor,FALSE));
            
    $form->add(new Button("Submit","submit","submit"));
            
    $document->add($form);
        }
        
        public function 
    edit(){
        
            
            
    //include_once("../inc/ckeditor/ckeditor.php");     
            
    $mysidia Registry::get("mysidia");
                
    //$this->editor = new CKEditor;    
                //$this->editor->basePath = '../../../inc/ckeditor/';
            
    $document $this->document;
            
    $document->setTitle("Edit");
            
            
                
    $news $this->getField("news");
                        
                if(
    $mysidia->input->post("submit")){
                
    /*if(!$mysidia->input->post("newstitle")) throw new BlankFieldException("No title");
                if(!$mysidia->input->post("newscontent")) throw new BlanKFieldException("No content");*/
                
                
    ($mysidia->input->post("allowcomments"))?$allow "yes":$allow "no";
    //NEW!
                
    ($mysidia->input->post("allowmessage"))?$allowM "yes":$allowM "no";
                
                
    $news->editTitle($mysidia->input->post("newstitle"));
                
    $news->editContent($this->format($mysidia->input->post("pagecontent")));
                
    $news->changeAllowComment($allow);
    //NEW!
                
    $news->changeAllowMessage($allowM);
                
                if(
    $mysidia->input->post("submit") == "submitDraft"){
                    
    $news->saveDraft();
                }
                
                else{
                    
    $news->post();
                }
                
    $document->add(new Comment("<b>Successfully changed news.</b>"));
            }
            
            
    $editor $this->getField("editor")->get()->editor("pagecontent"$this->format($news->getContent()));
            
    $form = new Form("title","","post");
            
    $form->add(new Comment("<b>Date</b>:{$news->getDate()} and <b>Author</b>: {$news->getUserObject()->getUsername()} and <b>Published</b>: {$news->getPosted()}"));
            
    $form->add(new Comment("<b>Title</b>:"));
            
    $form->add(new TextField("newstitle",$news->getTitle()));
            
    $form->add(new Comment("<b>Contents</b>:"));
            
    $form->add(new Comment($editor));
            
    $comments = new CheckBox("Allow comments on this news""allowcomments"1"array");
            if(
    $news->getAllowComment() == "yes")
                
    $comments->setChecked("allowcomments");
            
    $comments2 = new CheckBox("Send message to all users notifying about the existence of an update""allowmessage"2"array");
            
    $form->add($comments);
            
    $form->add($comments2);
            
    $form->add(new Button("Save as draft","submit","submitDraft"));
            
    $form->add(new Button("Publish","submit","submitPublish"));
            
    $document->add($form);
            
            
    //echo $mysidia->user->uid;
        
        
    }
        
        public function 
    create(){
            
    $mysidia Registry::get("mysidia");
            
    $document $this->document;
            
    $document->setTitle("Create");
            
            if(
    $mysidia->input->post("submit")){
                
    $todayDate = new DateTime;
                
    //H:i:s
                
    $todayDate->setTimezone(new DateTimeZone('Europe/London'));
                
    $date $todayDate->format('Y-m-d H:i:s');
                
    /*if(!$mysidia->input->post("newstitle")) throw new BlankFieldException("No title");
                if(!$mysidia->input->post("newscontent")) throw new BlanKFieldException("No content");*/
            
                
    ($mysidia->input->post("allowcomments"))?$allow "yes":$allow "no";
                (
    $mysidia->input->post("allowmessage"))?$allowM "yes":$allowM "no";
                    
                
                if(
    $mysidia->input->post("submit") == "submitDraft"){
                                
                
    $mysidia->db->insert("news",array("title" => $mysidia->input->post("newstitle"), "content" => $this->format($mysidia->input->post("pagecontent")), "user" => $mysidia->user->uid"date" => $date"posted" => "no","allowcomment" => $allow"allowmessage" => $allowM));
                }
                
                else{
                                
                
    $mysidia->db->insert("news",array("title" => $mysidia->input->post("newstitle"), "content" => $this->format($mysidia->input->post("pagecontent")), "user" => $mysidia->user->uid"date" => $date"posted" => "yes","allowcomment" => $allow"allowmessage" => $allowM));
                
                    if(
    $mysidia->input->post("allowmessage")){
    //NEW!
                        
    $allusers $mysidia->db->select("users", array("username"), "");
                        
                        
    $today = new DateTime;
                        
    $dateToday $today->format('Y-m-d');
                        
    $messageTitle "Update";
                        
    $messagetext "A new news was posted on the site! Click <a href='/news'>here</a> to view!<br>";
                        
                        while(
    $user $allusers->fetchColumn()){
                            
    $mysidia->db->insert("messages", array("fromuser" => "SYSTEM""touser" => $user"status" => "unread""datesent" => $dateToday"messagetitle" => $messageTitle"messagetext" => $messagetext), ""); 
                        }
                    
                    }
                }
                
    $document->add(new Comment("<b>Successfully changed news. Fill this page again to create a new post. Click <a href='/news' target='_blank'>here</a> to see the news page.</b>"));
            }
            
    $todayDate = new DateTime;
            
    $date $todayDate->format('Y-m-d');
            
    $editor $this->getField("editor")->get();
            
    $form = new Form("title","","post");
            
    $form->add(new Comment("<b>Date</b>:{$date} and <b>Author</b>: {$mysidia->user->username} and <b>Published</b>: No"));
            
    $form->add(new Comment("<b>Title</b>:"));
            
    $form->add(new TextField("newstitle",""));
            
    $form->add(new Comment("<b>Contents</b>:"));
            
    $form->add(new Comment($editor));
            
    $comments = new CheckBox("Allow comments on this news""allowcomments"1"array");
            
    $comments2 = new CheckBox("Send message to all users notifying about the existence of an update""allowmessage"2"array");
            
    $form->add($comments);
            
    $form->add($comments2);
            
    $form->add(new Button("Save as draft","submit","submitDraft"));
            
    $form->add(new Button("Publish","submit","submitPublish"));
            
    $document->add($form);
        }
        
            private function 
    format($text){
             
    $text html_entity_decode($text);
             
    $text stripslashes($text);
             
    $text str_replace("rn","",$text);
             return 
    $text;
        }
    }
    ?>


parayna 12-19-2014 07:46 AM

Thank you IntoRain ^_^

IntoRain 12-19-2014 02:29 PM

Quote:

Originally Posted by parayna (Post 31721)
Thank you IntoRain ^_^

No problem! ^^

MikiHeart 01-16-2015 03:46 AM

I really love your news script. Do you mind if I built on top of it?
I want to add more to it, like the ability to report comments for moderation.

I also have one concern, since the pagination just hides the other news, wouldn't it make the page heavy to load if you have like 100 news with images in each once? Or is it set to load when it's clicked. I don't know much about jQuery.

I also want to addon an archive system. So when a piece of news is a certain age, it will go into the archive, and can no longer be commented.

I also want to add a captcha to help prevent spam.

Kyttias 01-16-2015 10:35 AM

Nah, paginated stuff isn't even pulled to load. Your adopts page is also paginated, past 10 pets or so. I can confirm by right clicking to inspect the source that pets past that number aren't even loaded, so, I assume the same for the news?

MikiHeart 01-16-2015 10:52 AM

I hope so. I can't tell on my local server @.@ Because it loads fast.

Edit: Just a heads up, html can be submitted to the comment form. I tested to see if PHP works, but I couldn't get it to.
This should be roughly tested to make sure no one can put malicious code. @.@


All times are GMT -5. The time now is 09:19 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.