News:

SMF 2.1.2 has been released! Take it for a spin! Read more.

Main Menu

Advanced News

Started by Matthew K., March 08, 2010, 03:12:30 AM

Previous topic - Next topic

Michael Pfaff

Quote from: live627 on January 17, 2012, 08:12:43 PM
SMF stores the news in a weird way. All the entries are stored in a single setting, which means without dates, or other reliable sorting aids. However, it explodes them into a simple aarray which can be reversed in bulk, so the first becomes last and vice versa.

Gotcha.

Well, thanks so much for the quick support and information. Very much appreciated!

live627

We can try it anyways and see what happens...

Code (Find in AdvancedNews.php) Select
isAllowedTo('view_news');

Code (Replace with) Select
isAllowedTo('view_news');

// Reverse the news. There's _some_ chance that a newer item goes first.
$context['news_lines'] = array_reverse($context['news_lines']);

Michael Pfaff

Quote from: live627 on January 17, 2012, 08:53:11 PM
We can try it anyways and see what happens...

Code (Find in AdvancedNews.php) Select
isAllowedTo('view_news');

Code (Replace with) Select
isAllowedTo('view_news');

// Reverse the news. There's _some_ chance that a newer item goes first.
$context['news_lines'] = array_reverse($context['news_lines']);


Nice! I'll give this a shot tomorrow and see if it pans out.

live627

Cool. Post back  when you do, eh? Others may want to do the same.

pierrelogic

Was digging into my installed mods and tried to use the SMF Package Parser to look at Advanced News mod.

What does it mean when the parser itself throws an an error?

QuoteFatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in C:\Inetpub\wwwroot\smfhacks\packageparser\package.php:381 Stack trace: #0 C:\Inetpub\wwwroot\smfhacks\packageparser\package.php(381): SimpleXMLElement->__construct('') #1 C:\Inetpub\wwwroot\smfhacks\packageparser\package.php(271): parsePackage('/temp/package-i...', 'install', 'all') #2 C:\Inetpub\wwwroot\smfhacks\packageparser\package.php(170): parseArchive(Array, '0', '0') #3 C:\Inetpub\wwwroot\smfhacks\packageparser\package.php(150): PackageInstructions() #4 C:\Inetpub\wwwroot\smfhacks\packageparser\package.php(1443): PackageParser() #5 {main} thrown in C:\Inetpub\wwwroot\smfhacks\packageparser\package.php on line 381

Just try again later?
It's all about the ride

live627

I have no idea what you're trying to do. Well, okay, I do, but this mod doesn't modify any files and therefore, using a parser won't do much good.

Whatever software you're using is still buggy.

pierrelogic

Quote from: live627 on February 25, 2012, 02:07:00 AM
I have no idea what you're trying to do. Well, okay, I do, but this mod doesn't modify any files and therefore, using a parser won't do much good.

Whatever software you're using is still buggy.

I understand that this mod is really not modifying any files.  However (please correct me if I'm wrong) the parser is a tool to help with manual installs, right?  My question and point I was trying to make was why did the parser not work the first time but it worked just fine when I tried it later on the same mod?  Website hiccup? 

Not a big deal, I was just curious.
It's all about the ride

NekoJonez

Bug report: I had to manually add this line in my language file but the help text wasn't showing up.
Retro video game blogger, writer, actor, podcaster and general amazing dude.

Twitter
My Blog

Jessica.

Installed with no errors; only issue is that the menu item "News" is not appearing in the menu.
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

Arantor

And it won't because of Menu Editor Lite.
No good deed goes unpunished / All helpful urges should be circumvented

I have something to say: it's better to burn out than to fade away. There can be only one.

Jessica.

I installed this mod before Menu Editor Lite and it did not appear.
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

Arantor

Don't know about that, but if MEL is installed, all mods that change the menu will be similarly affected... It completely ditches anything in the menu and substitutes its own.
No good deed goes unpunished / All helpful urges should be circumvented

I have something to say: it's better to burn out than to fade away. There can be only one.

Jessica.

I removed MEL and reinstalled Advanced News. Menu item "News" still not appearing.
Testing Zone - SMF 2.0.7, default Curve
School & Chat - phpBB3, over 170 mods installed, official live forum

I use the latest version of Chrome

phpBB: Forum = a section; Board = whole site
SMF: Forum = whole site; Board = a section

rcane

Hi,

I was curious about using this on 2.0.18.  It seems to work, showing the check box to make news appear, but I cannot get it to work with a restricted unique permission group.

I made a group that has it's own permissions but it's tied to the 'no primary group' for some reason.

Dave En Velo

Has anyone got this to work on 2.0.17.  I installed the mod as if for 2.0.5 and had some file permission issues which I resolved with chmod 777.  It does not seem to have done much apart from removing News from the Login screen and all users, apart from Admin. I don't see any new functionality.

live627

To get the menu item to show, find in ./Sources/AdvancedNews.php
function advanced_news_menu_buttons($menu_buttons)and replace withfunction advanced_news_menu_buttons(&$menu_buttons)

Dave En Velo

Thanks live627 I now see the added menu item and finally understand what the mod does, although the description is clear enough when I read it again.  My summary would be:

  • Makes News visibility permissions based so can be limited by user, including not visible on login screen.
  • Adds News menu item.  Not sure I see the value of this since it is only offered when permission is granted and then it is in its normal position top right anyway.  Probably I am missing something. 

Anyway it does what I want which is to remove News from login screen.

Thanks again.

Advertisement: