WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Display a Blog menu
  • Print
Pages: 1 2 [3] 4   Go Down

Author Topic: Display a Blog menu  (Read 79660 times)

spida

  • Guest
Re: Display a Blog menu
« Reply #50 on: October 29, 2008, 10:35:22 AM »
@Ton: I mean: Where do I find YOUR version of the view.php? Is it included in the current news module?
Logged

Offline gemnb

  • Posts: 52
Re: Display a Blog menu
« Reply #51 on: October 29, 2008, 10:45:02 AM »
@spida: I don't understand what you mean  :?
Logged

spida

  • Guest
Re: Display a Blog menu
« Reply #52 on: October 29, 2008, 11:04:53 AM »
Hi Ton,

never mind, I didn't see the attachment in your earlier post. I'll try it and report.

Thanks for your help,
have a nice day,
spida
Logged

spida

  • Guest
Re: Display a Blog menu
« Reply #53 on: October 31, 2008, 05:31:01 PM »
Hi Ton,

I just tried your view.php and still have the same result. At the article's end is only displayed: No comments yet (it actually says "Keine gefunden", since the site is in German).

I really wonder what the cause for my problem might be and would be great if you guys here in the forum could help me further.

These are my settings so far:
- Public commenting enabled for news in news options
- public commenting enabled in specific article
- blog menu in version 0.2 (is there a newer one perhaps?)
- modules/news/view.php as posted above by Ton
- the whole thing under WB 2.7 on a standard *nix web server

I really need the commenting function, thus any further help is very welcome.

Cheers,
spida
« Last Edit: October 31, 2008, 05:34:19 PM by spida »
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Display a Blog menu
« Reply #54 on: October 31, 2008, 05:42:10 PM »
What is in your (news) settings page set as comment-footer?
Code: (Should be something like this) [Select]
</table>
<br /><a href="[ADD_COMMENT_URL]">Commentaar toevoegen</a>

It should at least display the "add comment" link. (can we look somewhere?)

I am using the same view.php without problems (example: http://WebsiteBaker.allwww.nl/wb/posts/je-laatste-blog-post-op-de-homepage20.php)

It isn't a blogmenu issue. That one is just displaying links.
It must be something in your news settings.

Ruud
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

spida

  • Guest
Re: Display a Blog menu
« Reply #55 on: October 31, 2008, 06:15:25 PM »
Hi Ruud,

thank you for your reply.
Actually, my commenting footer is empty, as all the fields in this section of the settings are empty. I must have deleted the contents earlier, stupid me...  :?

I guess I have to re-install the module in this case. And if so, where do I get the module singulary? Or could you give me the field's contents?

EDIT: I installed a new WB on my local server and copied the missing code. Thank you, Ruud, for getting me onto the right track!

Best regards,
spida
« Last Edit: October 31, 2008, 06:39:17 PM by spida »
Logged

JohnsonY

  • Guest
Re: Display a Blog menu
« Reply #56 on: November 24, 2008, 12:58:35 AM »
Hi thanks for the great add-on but I just getting a "bug" with this add-on.

I have setup with 2 languages on the WebsiteBaker. Then I use the following code to display 2 blogs selection with different language. The code is like

Code: [Select]
<?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. is there any fix? or I did the wrong code
Logged

spida

  • Guest
Re: Display a Blog menu
« Reply #57 on: November 25, 2008, 08:18:07 PM »
Hi,

so, you want to have the menu displayed only if the page id is checked and rendered correctly?

Is "PAGE_ID" the right reference? Is this as it is in the database?

Cheers,
spida
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Display a Blog menu
« Reply #58 on: November 25, 2008, 11:12:54 PM »
Quote from: JohnsonY on November 24, 2008, 12:58:35 AM
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 ....
December 1969 looks like an empty posted_when field. (where the data and time is stored)
Looking at the posts itself, do you see strange dates?
Try re-saving the posts on page_id 8. (it should set the posted_when date to today)
If you are using WB2.7, try display_blog_menu(8,1);. The ,1 tells this snippet to use the published_when date. This is the date you can enter in the backend to tell when an item may be shown.

Quote
and the post count # also count with the first language post too
I have no idea what you mean by this. Could you explain this better?

Ruud
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

EinoLeino

  • Guest
Re: Display a Blog menu
« Reply #59 on: January 23, 2009, 07:44:39 PM »
How do i change archives month names to my own language?
Now there are all in english, and i want them to be in finnish
Logged

Offline gemnb

  • Posts: 52
Re: Display a Blog menu
« Reply #60 on: January 23, 2009, 11:31:26 PM »
There are several possibilities, but you could do it like this:

Replace the following lines in include.php
Code: [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;

with

Code: [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()){
                    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
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Display a Blog menu
« Reply #61 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:
Code: [Select]
$database->query("SET lc_time_names = 'fi_FI';");
From that moment your month names should be in Finnish.

Ruud
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline xoanon

  • Posts: 34
Re: Display a Blog menu
« Reply #62 on: January 24, 2009, 03:23:21 AM »
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
Code: [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;

with

Code: [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
« Last Edit: January 24, 2009, 03:36:42 AM by xoanon »
Logged

EinoLeino

  • Guest
Re: Display a Blog menu
« Reply #63 on: January 24, 2009, 11:24:30 AM »
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:
Code: [Select]
$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.
Logged

abidan

  • Guest
Re: Display a Blog menu
« Reply #64 on: April 13, 2009, 06:21:43 PM »
Hi great mod!

I just have a small problem. I dont think my archiving menu works properly, you can see on www.buildmeafabwebs ite.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
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Display a Blog menu
« Reply #65 on: April 13, 2009, 09:38:46 PM »
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
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

abidan

  • Guest
Re: Display a Blog menu
« Reply #66 on: April 14, 2009, 03:35:57 PM »
Ruud, Dude, YOUR a Star thankyou i missed that line from instructions :) Cheers!
Logged

Offline sky writer

  • Posts: 926
Re: Display a Blog menu
« Reply #67 on: May 02, 2009, 05:24:07 PM »
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.
Logged

Offline sky writer

  • Posts: 926
Re: Display a Blog menu
« Reply #68 on: May 02, 2009, 06:07:13 PM »
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.
Logged

Offline Ruud

  • Posts: 3671
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: Display a Blog menu
« Reply #69 on: May 02, 2009, 10:05:05 PM »
There is a better way.

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

Code: [Select]
$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:
Code: [Select]
$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
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline sky writer

  • Posts: 926
Re: Display a Blog menu
« Reply #70 on: May 03, 2009, 05:10:22 AM »
Thank you!
Logged

cyberdog

  • Guest
Re: Display a Blog menu
« Reply #71 on: June 04, 2009, 01:24:30 AM »
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!
Logged

Offline stumed

  • Posts: 9
Re: Display a Blog menu
« Reply #72 on: June 25, 2009, 09:01:26 PM »
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
Logged

mr-fan

  • Guest
Re: Display a Blog menu
« Reply #73 on: June 26, 2009, 12:02:29 PM »
Quote
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:-).

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
Logged

Offline stumed

  • Posts: 9
Re: Display a Blog menu
« Reply #74 on: June 26, 2009, 05:50:49 PM »
@mr-fan

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

Stumed
Logged

  • Print
Pages: 1 2 [3] 4   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Display a Blog menu
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2