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)

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 :)


All times are GMT -5. The time now is 07:33 AM.

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