Display a Blog menu

sky writer

Quote from: Ruud on October 28, 2008, 09:35:04 AM
Guys,

The ?g=3?g=3 is not in the view.php but in the table settings in the backend of WB.
The breadcrumb links are being built from the original link. but when called from a "group link" it will include the group parameter too.

In the post header (settings button of newspage) the links are built using:
<td valign="top"><a href="[BACK]">[PAGE_TITLE]</a> >> <a href="[BACK]?g=[GROUP_ID]">[GROUP_TITLE]</a></td>

The [back] link will have the g= parameter (what is not right) and so the second level [back] will have two of them.

Change that line in:
<td valign="top"><a href="/pages/artikel.php">[PAGE_TITLE]</a> >> <a href="/pages/artikel.php?g=[GROUP_ID]">[GROUP_TITLE]</a></td>

And it is fixed.
Note: I used /pages/artikel.php in this example because that was in the "problem" page that spida reported. For other site, use whatever link is your news/blog page.

That will fix it.

Ruud


Ruud,

Thank you so much for this fix.  It works perfectly on the group link breadcrumbs.  Is there any way to make the "Back" link operate the same way when accessing post groupings of date specific links?  In other words, if someone clicks on June 2008 (2) and then clicks to view one of the two posts, then clicks the "Back" button, they are currently taken back to the root news posting page (with all posts listed).  Is there any way to take them back to the June 2008 News Posts page (with the two posts), that they came from?

sky writer

Maybe this will help others.

I did a code compare between the "Blog Menu" news/view.php and the News V3.5 view.php (installed with WB 2.8.1).  There was just a short bit of code to add over to allow it to function...

find:

// Check if we should only list posts from a certain group
if(isset($_GET['g']) AND is_numeric($_GET['g']))
    {
$query_extra = " AND group_id = '".$_GET['g']."'";
} else {
$query_extra = '';
}

// Get settings


Change to:


// Check if we should only list posts from a certain group
if(isset($_GET['g']) AND is_numeric($_GET['g']))
    {
$query_extra = " AND group_id = '".$_GET['g']."'";
} elseif(isset($_GET['m']) AND is_numeric($_GET['m']) AND isset($_GET['y']) AND is_numeric($_GET['y']) AND isset($_GET['method']) AND is_numeric($_GET['method'])){
$startdate = mktime(0,0,0,$_GET['m'],1,$_GET['y']);
$enddate = mktime(0,0,0,$_GET['m']+1,1,$_GET['y']);
switch($_GET['method']){
case 0:
$date_option = "posted_when";
break;
case 1:
$date_option = "published_when";
break;
}
$query_extra = " AND ".$date_option." >= '$startdate' AND ".$date_option." < '$enddate'";
} else {
$query_extra = '';
}

// Get settings

gucci

cool,

thanks martin.

The droplet should be listet on AMASP.

Regards gucci

mr-fan

jea,

take the droplet ->blog menu....without replacing the view.php

https://forum.websitebaker.org/index.php/topic,16331.msg107151.html#msg107151

regards martin

gucci

#81
Hello all,

i want to use blog menu for my site, but I`ve seen that there are new versions of the view.php with some bugfix.


Replacing view.php in the news module directory means that you replace the bugfix.
Has someone made an adjustment?

Cheers gucci

Turskis

Same here. With WB 2.8 and replaced view.php in news module

daydreamer

In my posts it is showing [TEXT_POSTED_BY] [TEXT_ON] [PUBLISHED_DATE] like that why is this?

sky writer

#78
I upgraded from 2.7-2.8 with the blog menu intact and no problems.

stumed

@daydreamer

Hi, I dont try in the 2.8 version. It work well for me in 2.7. after some changes in the code(adding block for viewing in one page, not all)
I think that it's work in 2.8 but I'm not sure. I will testing it in some next weeks.

Cheers!

Stumed

daydreamer

Does blog menu work with WB 2.8 Thanks

stumed

@mr-fan

All in works fine with your great helpful. :-D
Thank you very much for your help, it's very very appreciate.

Stumed

mr-fan

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

english isn't my fav -too ;)

i mean you don't want to display the menu on all pages! ? right!

-so just make a new block in your template (in the info.php see help docs multiple blocks...)

-put the call in a code section on the site you want show it & set the section to the block "right" for eg!

i've got a example in german on a site from me - there was a global block in the template that show a default section on every page with no special content and on the "news" page i show the blogmenu...
http://www.mr-vilsbiburg.de/pages/mr-infos.php

regards from bavaria
martin

stumed

Hi everyone,

It's my first post here...in english, so i need some comprehensive due to my english writing...I try my best.

I need some help about the Blog menu. I read all the posts but something I missed for my specific needs.

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

Another problems...I change the code in the include.php for the month can displaying in french.

I changed this code (submit by Ruud) for changing in finnish to french bot nothing work.
$database->query("SET lc_time_names = 'fr_FR';");

Can anyone give me some help please and excuse me again for my english writing.

Stumed

cyberdog

Hi all,

I have installed and tested the Blogmenu on a client's website while in development. All working fine. However the client requested the ability to include video footage so I thought IF POSSIBLE it would be a good idea to use the Mediablog module instead of the news module. this is because the MediaBlog module already has support for video.

Can anyone please point me to the right path to achieve this?

Many thanks!


Ruud

There is a better way.

In the file /modules/blog_menu/include.php find the line below (line 46):


$query = "SELECT * FROM " .TABLE_PREFIX ."mod_news_groups WHERE page_id=$page_id AND active=true;";


add to that line ORDER BY `position` the way that is shown below:

$query = "SELECT * FROM " .TABLE_PREFIX ."mod_news_groups WHERE page_id=$page_id AND active=true ORDER BY `position`;";


Now the categories will be displayed in the same order as in the backend.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

sky writer

Not sure if this is the best/easiest way, but I did manage to get things ordered the way I wanted.

-go to your database (cPanel - myphpAdmin for me)
-Change the "position" numbers in mod_news_groups to the order you want.
-Click "Operations" (at top of page)
-Choose "position" "Ascending" in "Alter Table Order by"

Maybe this will help someone.

If there is a better way, I am still interested in hearing it.

sky writer

I love this module, and have had it up and working for some time now.  One thing I can't seem to figure out...
How can I change the order that the "Categories" (groups) are listed?
Right now it seems to list them by the group_id from database mod_news_groups.
I thought I could just change the database group "position" number for each group and that might do it.  But no luck.

Any help would be appreciated.

abidan

Ruud, Dude, YOUR a Star thankyou i missed that line from instructions :) Cheers!

Ruud

Did you replace the view.php in your news module?

See this line in the README in the module zip file:
Quote* replace view.php in the news module directory with the included news_view.php and rename it back to view.php
Changing that file should add the missing functionality to show pages per month.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

abidan

Hi great mod!

I just have a small problem. I dont think my archiving menu works properly, you can see on www.buildmeafabwebsite.co.uk, for some reason when i click on one of the months, either march or april it does not simply list that months posts? It correctly lists the numbers of posts for that month on the menu, but i assumed that when you clicked on the month it would also just return that months posts? Is this normal functionality, is it supposed to work like that i.e. list ALL posts or is it supposed to limit to that months posts when clicked? Have a i done something wrong?

Thanks in advance

EinoLeino

Quote from: Ruud on January 24, 2009, 12:08:45 AM
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:
$database->query("SET lc_time_names = 'fi_FI';");

From that moment your month names should be in Finnish.

Ruud

Thanks man! That worked! So simple and easy way.

xoanon

#63
Quote from: gemnb on January 23, 2009, 11:31:26 PM
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 definition


Replace the following lines in include.php

           $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;


with


           $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

Ruud

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:
$database->query("SET lc_time_names = 'fi_FI';");

From that moment your month names should be in Finnish.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

gemnb

There are several possibilities, but you could do it like this:

Replace the following lines in include.php

           $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;


with


           $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;


Regards,
Ton