WebsiteBaker 2.13.9 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
</table><br /><a href="[ADD_COMMENT_URL]">Commentaar toevoegen</a>
<?php if (PAGE_ID != 7) { } else { display_blog_menu(7); }?><?php if (PAGE_ID != 8) { } else { display_blog_menu(8); }?>
The result is my first language display category and history with prefect, but the other 1 will have bug on the history it show the history is December 1969 ....
and the post count # also count with the first language post too
$output =""; //query to obtain history per month for the selected page $query = "SELECT MONTHNAME(FROM_UNIXTIME(".$date.")) as mo,MONTH(FROM_UNIXTIME(".$date.")) as m,FROM_UNIXTIME(".$date.",'%Y') as y,COUNT(*) as total FROM " .TABLE_PREFIX ."mod_news_posts WHERE page_id=$page_id AND active=true GROUP BY y,m ORDER BY y DESC,m DESC;"; $result = $database->query($query); if($result->numRows() > 0){ if ($history_header != "") { echo $history_header; } while($history = $result->fetchRow()){ $output .= "<li><a href=\"" .WB_URL.PAGES_DIRECTORY .$page_link .PAGE_EXTENSION ."?y=".$history['y']."&m=".$history['m']."&method=".$date_option."\">" .$history['mo']." ".$history['y']."</a> (".$history['total'].")</li>\n"; } } $output = "<ul>".$output."</ul>"; echo $output;
$output =""; //query to obtain history per month for the selected page $query = "SELECT MONTHNAME(FROM_UNIXTIME(".$date.")) as mo,MONTH(FROM_UNIXTIME(".$date.")) as m,FROM_UNIXTIME(".$date.",'%Y') as y,COUNT(*) as total FROM " .TABLE_PREFIX ."mod_news_posts WHERE page_id=$page_id AND active=true GROUP BY y,m ORDER BY y DESC,m DESC;"; $result = $database->query($query); if($result->numRows() > 0){ if ($history_header != "") { echo $history_header; } while($history = $result->fetchRow()){ if ($history['mo']=='January'){$history['mo']='January in you language';} if ($history['mo']=='February'){$history['mo']='February in you language';} if ($history['mo']=='March'){$history['mo']='March in you language';} // and so on... $output .= "<li><a href=\"" .WB_URL.PAGES_DIRECTORY .$page_link .PAGE_EXTENSION ."?y=".$history['y']."&m=".$history['m']."&method=".$date_option."\">" .$history['mo']." ".$history['y']."</a> (".$history['total'].")</li>\n"; } } $output = "<ul>".$output."</ul>"; echo $output;
$query = "SELECT MONTHNAME(FROM_UNIXTIME(".$date.")) as mo,.....
$database->query("SET lc_time_names = 'fi_FI';");
There are several possibilities, but you could do it like this:by AM. 24/1/09 - also included a suggestion for multilanguage sites that follow the 'pages/country-code' format i.e. 'pages/en' .... the following modification will work - I use English & Greek for my site // $uri = ($_SERVER['REQUEST_URI']); if ( stristr($uri, 'pages/contry_code')) { if ($history['mo']=='January'){$history['mo']='January in you language';} }note: ensure that you replace country_code with the correct definitionReplace the following lines in include.phpCode: [Select] $output =""; //query to obtain history per month for the selected page $query = "SELECT MONTHNAME(FROM_UNIXTIME(".$date.")) as mo,MONTH(FROM_UNIXTIME(".$date.")) as m,FROM_UNIXTIME(".$date.",'%Y') as y,COUNT(*) as total FROM " .TABLE_PREFIX ."mod_news_posts WHERE page_id=$page_id AND active=true GROUP BY y,m ORDER BY y DESC,m DESC;"; $result = $database->query($query); if($result->numRows() > 0){ if ($history_header != "") { echo $history_header; } while($history = $result->fetchRow()){ $output .= "<li><a href=\"" .WB_URL.PAGES_DIRECTORY .$page_link .PAGE_EXTENSION ."?y=".$history['y']."&m=".$history['m']."&method=".$date_option."\">" .$history['mo']." ".$history['y']."</a> (".$history['total'].")</li>\n"; } } $output = "<ul>".$output."</ul>"; echo $output;withCode: [Select] $output =""; //query to obtain history per month for the selected page $query = "SELECT MONTHNAME(FROM_UNIXTIME(".$date.")) as mo,MONTH(FROM_UNIXTIME(".$date.")) as m,FROM_UNIXTIME(".$date.",'%Y') as y,COUNT(*) as total FROM " .TABLE_PREFIX ."mod_news_posts WHERE page_id=$page_id AND active=true GROUP BY y,m ORDER BY y DESC,m DESC;"; $result = $database->query($query); if($result->numRows() > 0){ if ($history_header != "") { echo $history_header; } while($history = $result->fetchRow()){ // for multilanguage sites that follow the 'pages/country-code' format i.e. 'pages/en' // the following modification will work - I use English & Greek for my site // $uri = ($_SERVER['REQUEST_URI']); if ( stristr($uri, 'pages/country_code')) { if ($history['mo']=='January'){$history['mo']='January in you language';} if ($history['mo']=='February'){$history['mo']='February in you language';} if ($history['mo']=='March'){$history['mo']='March in you language';} // and so on... } $output .= "<li><a href=\"" .WB_URL.PAGES_DIRECTORY .$page_link .PAGE_EXTENSION ."?y=".$history['y']."&m=".$history['m']."&method=".$date_option."\">" .$history['mo']." ".$history['y']."</a> (".$history['total'].")</li>\n"; } } $output = "<ul>".$output."</ul>"; echo $output;Regards,Ton
$output =""; //query to obtain history per month for the selected page $query = "SELECT MONTHNAME(FROM_UNIXTIME(".$date.")) as mo,MONTH(FROM_UNIXTIME(".$date.")) as m,FROM_UNIXTIME(".$date.",'%Y') as y,COUNT(*) as total FROM " .TABLE_PREFIX ."mod_news_posts WHERE page_id=$page_id AND active=true GROUP BY y,m ORDER BY y DESC,m DESC;"; $result = $database->query($query); if($result->numRows() > 0){ if ($history_header != "") { echo $history_header; } while($history = $result->fetchRow()){ // for multilanguage sites that follow the 'pages/country-code' format i.e. 'pages/en' // the following modification will work - I use English & Greek for my site // $uri = ($_SERVER['REQUEST_URI']); if ( stristr($uri, 'pages/country_code')) { if ($history['mo']=='January'){$history['mo']='January in you language';} if ($history['mo']=='February'){$history['mo']='February in you language';} if ($history['mo']=='March'){$history['mo']='March in you language';} // and so on... } $output .= "<li><a href=\"" .WB_URL.PAGES_DIRECTORY .$page_link .PAGE_EXTENSION ."?y=".$history['y']."&m=".$history['m']."&method=".$date_option."\">" .$history['mo']." ".$history['y']."</a> (".$history['total'].")</li>\n"; } } $output = "<ul>".$output."</ul>"; echo $output;
The simple way is to set the locale for the SQL server. (see http://dev.mysql.com/doc/refman/4.1/en/locale-support.html)Just before the line: Code: (include.php) [Select]$query = "SELECT MONTHNAME(FROM_UNIXTIME(".$date.")) as mo,.....you add this line:Code: [Select]$database->query("SET lc_time_names = 'fi_FI';");From that moment your month names should be in Finnish.Ruud
* replace view.php in the news module directory with the included news_view.php and rename it back to view.php
$query = "SELECT * FROM " .TABLE_PREFIX ."mod_news_groups WHERE page_id=$page_id AND active=true;";
$query = "SELECT * FROM " .TABLE_PREFIX ."mod_news_groups WHERE page_id=$page_id AND active=true ORDER BY `position`;";
The menu works fine but it display on all my page. I put the code in a div section on rideside column.Here is the code;<div id="myblog"> <?php display_blog_menu(95,1,'<h2>Catégories</h2>','<h2>Archives</h2>',2);?> </div>The "95" is my page_id but it appears on all my pages. I put the code on a "code page" but the menu appears in "the content page" and I don't want this. I just want that it appears in my right column like Eki website on his latest...latest post:-).