• Welcome to Simple Machines Community Forum. Please login or sign up.
December 05, 2021, 06:17:22 PM

News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord


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

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

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.

Advertisement: