TennShadow Posted January 20, 2016 Report Posted January 20, 2016 I've recently noticed that my VA news hasn't updated on VACentral since March of 2013. In my admin panel, under NEWS, I have recent news there. Can someone give me a hint at where to start troubleshooting? As far as I can tell, I've made all the required updates and so far everything seems to be working fine except for the news. Thanks, Keith Quote
Administrators simpilot Posted January 21, 2016 Administrators Report Posted January 21, 2016 I do not know what version you are using but on my version there is a function behind the scenes when loading the admin dashboard. https://github.com/DavidJClark/phpvms_5.5.x/blob/master/admin/modules/Dashboard/Dashboard.php#L36 And there is a function in the vastats update here -> https://github.com/DavidJClark/phpvms_5.5.x/blob/master/core/common/CentralData.class.php#L258 Some older versions do not have this built in, and it also seems to have disappeared somewhere between the 934 and 935 release and returned later. Quote
TennShadow Posted January 22, 2016 Author Report Posted January 22, 2016 Thanks David, I'm running 935 and I'm definitly missing those lines. I went back on Github and found a earlier version of code that had it but so far nothing has updated. I added the below to the CentralData.class.php I added $all_news = SiteData::getAllNews(); if(count($all_news) > 0) { $news_parent = self::addElement(null, 'newsitems'); foreach($all_news as $news) { $body = str_ireplace('<br>', "\n", $news->body); $body = str_ireplace('<br />', "\n", $body); $body = htmlentities(strip_tags($body)); $news_xml = self::addElement($news_parent, 'news', null, array( 'id' => $news->id, 'subject' => $news->subject, 'body' => $body, 'postdate' => $news->postdate, 'postedby' => $news->postedby, ) ); } } right after self::set_xml('update_vainfo'); self::$xml->addChild('pilotcount', StatsData::PilotCount()); self::$xml->addChild('totalhours', StatsData::TotalHours()); self::$xml->addChild('totalflights', StatsData::TotalFlights()); self::$xml->addChild('totalschedules', StatsData::TotalSchedules()); then added /** * CentralData::send_news() * * @return */ public static function send_news() { if (!self::central_enabled()) return false; $all_news = SiteData::getAllNews(); if(!is_array($all_news) && count($all_news) == 0) { return false; } self::startBody('vanews'); self::addElement(null, 'total', count($all)); $news_parent = self::addElement('newsitems'); foreach($all_news as $news) { $news_xml = self::addElement($news_parent, 'news', null, array( 'id' => $news->id, 'subject' => $news->subject, 'body' => '<![CDATA['.$news->body.']]>', 'postdate' => $news->postdate, 'postedby' => $news->postedby, )); } CronData::set_lastupdate('vanews'); $res = self::sendToCentral(); return $res; } after # Package and send CronData::set_lastupdate('update_vainfo'); return self::send_xml(); } Is there anything that you can thing of that I've missed? Quote
FDC001 Posted February 6, 2016 Report Posted February 6, 2016 Having the same issue as well. News not uploading to VaCentral. Quote
TennShadow Posted February 8, 2016 Author Report Posted February 8, 2016 In short of upgrading my .935 site to the new 5.5 is there a way to get this working? I've added the above into my files but that didn't work. I'd like to get this working with my current version. I will eventually update to 5.5 but I've got a lot of work to do to make that happen and right now I just don't have the time to invest to that project. Quote
Administrators simpilot Posted February 9, 2016 Administrators Report Posted February 9, 2016 Have you added this line to your dashboard controller? https://github.com/DavidJClark/phpvms_5.5.x/blob/master/admin/modules/Dashboard/Dashboard.php#L36 Quote
TennShadow Posted February 9, 2016 Author Report Posted February 9, 2016 Have you added this line to your dashboard controller? https://github.com/D...shboard.php#L36 Sorry - looks like I didn't mention that above, but yes, I added it. thanks, Keith Quote
Administrators simpilot Posted February 9, 2016 Administrators Report Posted February 9, 2016 I am guessing at this point but it is probably a difference in db table structure or a line of code missing somewhere. Have you enabled error logging and see if anything pops up there? Quote
TennShadow Posted February 9, 2016 Author Report Posted February 9, 2016 I am guessing at this point but it is probably a difference in db table structure or a line of code missing somewhere. Have you enabled error logging and see if anything pops up there? I haven't. I'll do that and report back. Thanks! Quote
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.