简体   繁体   中英

CMS made simple fresh install news module not working

I just installed cmsms 2.1.5, I've only added a news item. However when I check my website it doesn't show the news items.

What can prevent the news items from displaying? I have not changed any settings, templates or stylesheets.

This may sound like a generic question but this has been driving me nuts.

Thank you in advance.

EDIT: As opposed to what I mentioned earlier that the news module is not working in the fresh CMSMS install, I figured out that the problem was only replicating when I added the news article. When I added articles they were not showing, however example articles that were there as part of the installation were getting displayed. Any suggestions?

After digging through CMSMS forums, I figured out that the problem was my HTTP server and my databases timezones were not synced. However the new articles were getting saved in the database but the code to retrieve the news items

 $db = cmsms()->GetDb();
    $now = $db->DbTimeStamp(time());
    $query = "SELECT mn.*, mnc.news_category_name FROM ".CMS_DB_PREFIX."module_news mn LEFT OUTER JOIN ".CMS_DB_PREFIX."module_news_categories mnc ON mnc.news_category_id = mn.news_category_id WHERE status = 'published' AND ";
    $query .= "(".$db->IfNull('start_time',$db->DBTimeStamp(1))." < $now) AND ";
    $query .= "((".$db->IfNull('end_time',$db->DBTimeStamp(1))." = ".$db->DBTimeStamp(1).") OR (end_time > $now)) ";
    $query .= 'ORDER BY news_date DESC LIMIT 1';
    $row = $db->GetRow($query);

uses the timeStamp feature. So digging around on forums I found out that this can be resolved by synching the http server and database server upon every request. Which is done by appending $config['set_db_timezone']=1 in your config file, as found in an old config reference found here .

Hope this will help you too :) I will do more digging and will come back with the exact working of this thing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM