Fork me on GitHub

How can we display JUST 1 article instead of 5 or 10?  Bottom

  • Dunno why but PN has a fixed number of articles displayed in the news HP: you can select just multiples of 5 like 10, 15, 20 and so on.
    Anybody has a solution to avoid this limit and display a free number of news without hacking the core?
    I mean.. is there a center-block (let's call it LAST#NEWS) that displays 1 (or 2 or 3,or 4, or 7...) last articles (or is so difficult to build)?
    Thanks :)
  • This has annoyed me for some time, as well. You can download specific programs, such as PagEd, which can replace PN news completely and just display one article on the main page.

    However, if you want to keep PN news, like I did, because I use AutoTheme 1.7, the fix is thus:

    1) Use phpMyAdmin to access your database. If you've never used this program before or generally have no experience, please backup your entire database first.

    2) In your PN database, locate the table called nuke_module_vars (you may have a prefix other than "nuke_.") Select that table and browse through the rows. It's a good idea to sort the rows by pn_id now.

    3) Row #35 should look like:

    Code

    35      /PNConfig   storyhome   s:1:"10";


    4) Just change that 10 into 1 or 2, but don't touch anything else... just the number 10.

    This will give you the number of stories you choose on the homepage. However, it only lasts until you click on Admin > Settings. If you click on Admin > Settings, the number will go back to whatever it was, so you'll have to go back and do this again.

    Hope this helps
  • Thanks, i'll try this last one, as long Postnuke team doesn't show us the secret for a free number of news in HP ;)
  • After two years I still wonder if there's a (simple?) core-hack to solve this problem forever..
    Thanks :)
  • Sigh, there is a setting that allows you to set number of stories to display inside Administration -> Settings.

    Its just that it doesn't work for people who registered before you changed the settings.
  • Do you know where thats stored for users? So I can manually edit their profiles to the new settings?

    Edit: Nm, found it under PN_users -> pnstorynum
  • Thx Kenshino, but the broblem is that the setting you mean only allows 5, 10 or more stories.. :(
    Any idea?

    Thanks in advance :)
  • This is a shot in the dark, but you may be able to modify the selections given by editing NS-Settings admin.php and looking for sel_storyhome. There will be 2 places in the file where a series will occur. If you add additional selection options to these 2 sets, theoretically, it should give you the ability to set what ever numbers you add. I could be completely wrong about this... but I THINK it will work. Haven't tested it yet. Even then you still have the problem like Kenshino mentioned, that all existing users will have whatver the setting was set to when they registered. Hope this helps.
  • Thanks rigbyd, I will try right now :)
  • It worked, thanks!!!!! :) :) :)

This list is based on users active over the last 60 minutes.