Tom Posted June 1, 2012 Report Share Posted June 1, 2012 SimpleNews SimpleNews is a basic module which builds upon the default functionality of the phpVMS News system, allowing you to show a list of links to latest news items, a paginated view of news items and an individual page per item. No attribution or link back is required (see Licence). Installation To install, simply extract the contents of the zip archive and drag the contents into the root public folder of your phpVMS installation. Usage To display a list of latest news items anywhere on your site, call the following: <?php SimpleNews::NewsList(); ?> By default the list will show the 5 latest items, however you can configure it to show however many you wish, as follows: <?php SimpleNews::NewsList(10); ?> You can link to a paginated list of news items at index.php/SimpleNews or a certain page of the list at index.php/SimpleNews/page/2 etc. (In theory this is compatible with the likes of the jQuery infinite scroll plugin, but I haven't tested it) You can also link to a single news item like so: index.php/SimpleNews/item/1 Licence Released under the ☺ Licence Feel free to edit this code however you want. Please also don't hesitate to fork this repo and raise pull requests in order to extend the module however you feel is appropriate. View on github: https://github.com/t...ritt/SimpleNews Download zip: https://github.com/t.../zipball/master 1 Quote Link to comment Share on other sites More sharing options...
tobyrice01 Posted November 6, 2014 Report Share Posted November 6, 2014 Thank you! I know this is one late reply, but still. Works for me when PopUpNews did not. Thanks! Quote Link to comment Share on other sites More sharing options...
abb136 Posted July 20, 2015 Report Share Posted July 20, 2015 Tom, can you make an update to run in phpvms 5.5 released by simpilot to run in php 5.5 an up?, i have errors when ru in this environment by the problems using the reserved word this--> in the php 5.4 environment. Regards 1 Quote Link to comment Share on other sites More sharing options...
Kapitan Posted October 26, 2015 Report Share Posted October 26, 2015 Works great but for some reason all my news after i publish have a stupid question marks arround the text ...for example : � RWY�10/28�CLSD�DUE TO�WIP. Quote Link to comment Share on other sites More sharing options...
Tom Posted October 27, 2015 Author Report Share Posted October 27, 2015 Works great but for some reason all my news after i publish have a stupid question marks arround the text ...for example : � RWY�10/28�CLSD�DUE TO�WIP. This plugin doesn't make any changes for input/output encoding. You'll want to check the encoding on the phpVMS news table vs the encoding you've specified in the header. For best support you'll want them to be UTF8. Quote Link to comment Share on other sites More sharing options...
flyalaska Posted October 28, 2015 Report Share Posted October 28, 2015 Tom, can you make an update to run in phpvms 5.5 released by simpilot to run in php 5.5 an up?, i have errors when ru in this environment by the problems using the reserved word this--> in the php 5.4 environment. Regards What errors? Quote Link to comment Share on other sites More sharing options...
Ariel Posted November 1, 2015 Report Share Posted November 1, 2015 What errors? I get strict standards errors when i change the .tpl files to .php Strict Standards: Non-static method NewsData::GetNews() should not be called statically, assuming $this from incompatible context in public_html/core/modules/SimpleNews/SimpleNews.php Strict Standards: Non-static method NewsData::Truncate() should not be called statically, assuming $this from incompatible context in public_html/core/templates/simplenews_page.php Strict Standards: Non-static method NewsData::IsNextPage() should not be called statically, assuming $this from incompatible context in public_html/core/templates/simplenews_page.php Strict Standards: Non-static method NewsData::CountPages() should not be called statically, assuming $this from incompatible context in public_html/core/common/NewsData.class.php when not changed i get this Strict Standards: Non-static method NewsData::GetNews() should not be called statically, assuming $this from incompatible context in public_html/core/modules/SimpleNews/SimpleNews.php on line 18 Notice: The template file "public_html/core/templates/simplenews_page.php" doesn't exist in public_html/core/classes/TemplateSet.class.php on line 231 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 1, 2015 Report Share Posted November 1, 2015 This is how I fixed my strict standard errors when converting to 5.5 Open core/common/NewsData.class Find public function and replace it with public static function. Most cases there are several lines that need to be replaced. Quote Link to comment Share on other sites More sharing options...
Ariel Posted November 1, 2015 Report Share Posted November 1, 2015 This is how I fixed my strict standard errors when converting to 5.5 Open core/common/NewsData.class Find public function and replace it with public static function. Most cases there are several lines that need to be replaced. but did you change the .tpl files to .php? Quote Link to comment Share on other sites More sharing options...
Ariel Posted November 2, 2015 Report Share Posted November 2, 2015 Okay so i was able to get it to work with your modification of the NewsData.class but i also found that in order to use the code <?php SimpleNews::NewsList(); ?> you must also change the "public function" to "public static function" in the core/modules/SimpleNews/SimpleNews.php i believe there is 4 lines to edit but when i click on the news to read it it takes me to the news page and gives me this Fatal error: Using $this when not in object context in public_html/core/modules/SimpleNews/SimpleNews.php on line 39 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 2, 2015 Report Share Posted November 2, 2015 You on phpvms 5.5.2? Quote Link to comment Share on other sites More sharing options...
Ariel Posted November 2, 2015 Report Share Posted November 2, 2015 You on phpvms 5.5.2? Yes sir!! Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 2, 2015 Report Share Posted November 2, 2015 I dont use that mod, I will install it and see if I can get the errors to go away and than zip it to you. Quote Link to comment Share on other sites More sharing options...
Ariel Posted November 2, 2015 Report Share Posted November 2, 2015 I dont use that mod, I will install it and see if I can get the errors to go away and than zip it to you. I'd really appreciate that. What mod do you use for news? Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 2, 2015 Report Share Posted November 2, 2015 default Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 2, 2015 Report Share Posted November 2, 2015 Open core/classes/CodonModule.class.php Right after <?php on a new line add ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); Quote Link to comment Share on other sites More sharing options...
Ariel Posted November 2, 2015 Report Share Posted November 2, 2015 Open core/classes/CodonModule.class.php Right after <?php on a new line add ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED); that doesnt do anything i still get this error when accessing /index.php/SimpleNews/item/1 Fatal error: Using $this when not in object context in /home3/vdelta/public_html/beta/core/modules/SimpleNews/SimpleNews.php on line 39 i get this error when accessing /index.php/SimpleNews Fatal error: Using $this when not in object context in /home3/vdelta/public_html/beta/core/modules/SimpleNews/SimpleNews.php on line 17 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 2, 2015 Report Share Posted November 2, 2015 That fixed the same error I had - http://www.flyaka.com/test/index.php/SimpleNews/item/1 try installing with a clean copy, without the tweaks except the last edit. Quote Link to comment Share on other sites More sharing options...
Ariel Posted November 2, 2015 Report Share Posted November 2, 2015 That fixed the same error I had - http://www.flyaka.com/test/index.php/SimpleNews/item/1 try installing with a clean copy, without the tweaks except the last edit. AHH...that fixed it...thank you very VERY much!! 1 Quote Link to comment Share on other sites More sharing options...
flyalaska Posted November 2, 2015 Report Share Posted November 2, 2015 Awesome Quote Link to comment Share on other sites More sharing options...
Tom Posted November 2, 2015 Author Report Share Posted November 2, 2015 Feel free to open a pull request with your fixes Quote Link to comment Share on other sites More sharing options...
Kapitan Posted November 3, 2015 Report Share Posted November 3, 2015 Looks like my question marks on news are only showing if i use space , when i look for the code source and have - space on news page after publish instead space i have question marks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.