Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Matthew K. on March 08, 2010, 03:12:30 AM

Title: Advanced News
Post by: Matthew K. on March 08, 2010, 03:12:30 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2450)

This mod adds a separate news page fed by your regular forum news items. It has a n option to completely disable the news and is driven by permissions, so you can choose which membergroups may view the news.
Title: Re: Advanced News
Post by: Eclipse16V on March 17, 2010, 06:44:01 AM
Nice Mod

Thanks

German Lang

$txt['cannot_view_advnews'] = 'Sorry! Sie haben keine Berechtigung die News zu lesen.';

$txt['permissionname_view_advnews'] = 'Erweiterte News anzeigen';
$txt['permissionhelp_view_advnews'] = 'Erweiterte News ist eine Mod von <a href="http://www.simplemachines.org/community/index.php?action=profile;u=182638" target="_blank">Labradoodle-360</a> welche die News auf in einer Gesamtansicht anzeigt.';
Title: Re: Advanced News
Post by: Matthew K. on March 17, 2010, 11:39:56 AM
Glad you like it! I have fully developed a new version which will include actual news permission, so text strings have changed. I'll shoot you a PM regarding German when I have them in front of me.

Thanks, Labradoodle-360
Title: Re: Advanced News
Post by: Achilles. on April 29, 2010, 02:17:08 PM
Quote from: Labradoodle-360 on March 17, 2010, 11:39:56 AM
Glad you like it! I have fully developed a new version which will include actual news permission, so text strings have changed. I'll shoot you a PM regarding German when I have them in front of me.

Thanks, Labradoodle-360

updates for RC3?
Title: Re: Advanced News
Post by: Matthew K. on April 29, 2010, 05:11:59 PM
I have completed an update for the mod, which includes an update for SMF 2.0 RC3 along with some new features that were suggested I include.

I cannot guarantee a time-frame on this as my dev laptop is still down, with a busy real life schedule I've not had the time to repair it.
Labradoodle-360
Title: Re: Advanced News
Post by: Achilles. on May 02, 2010, 09:59:24 AM
Quote from: Labradoodle-360 on April 29, 2010, 05:11:59 PM
I have completed an update for the mod, which includes an update for SMF 2.0 RC3 along with some new features that were suggested I include.

I cannot guarantee a time-frame on this as my dev laptop is still down, with a busy real life schedule I've not had the time to repair it.
Labradoodle-360
That's great. :) I'll just wait for the update! Thanks!
Title: Re: Advanced News
Post by: Tair on May 25, 2010, 12:05:05 PM
any news about update?
Title: Re: Advanced News
Post by: Matthew K. on May 25, 2010, 12:32:21 PM
Update will be coming very shortly. I have a few things in front of mod updates on my to-do list.
Title: Re: Advanced News
Post by: MATTEK on June 17, 2010, 02:19:45 AM
Awesome. Can't wait for this mod dude!
Title: Re: Advanced News
Post by: Bugo on June 30, 2010, 03:46:29 AM
Change for SMF 2.0 RC3:
<file name="$themedir/BoardIndex.template.php">
<operation>
<search position="replace"><![CDATA[<h3 class="catbg">
<img id="newsupshrink" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" />
', $txt['news'], '
</h3>]]></search>
<add><![CDATA[<h3 class="catbg">
<img id="newsupshrink" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" />
', (($context['allow_advnews']) ? '<a href="'. $scripturl. '?action=news" target="_self">'. $txt['news']. ' </a>' : ''. $txt['news']. ' '), '
</h3>]]></add>
</operation>
</file>


and Russian translation (in attachments)
Title: Re: Advanced News
Post by: MS Modders Team on September 21, 2010, 02:03:51 PM
I've been working on re-writing the code I had updated previously for Advanced News 1.1.

An update should be coming very shortly!

SMF Modders Core Developer,
Labradoodle-360
Title: Re: Advanced News
Post by: MS Modders Team on October 14, 2010, 02:46:27 PM
Update finally here...just didn't upload it for a while.

Screenshots have not been updated yet.

Enjoy!
Title: Re: Advanced News
Post by: mariusfv on December 07, 2010, 10:09:26 AM
Any chance to be ported to SMF 1.1.12 ?
Title: Re: Advanced News
Post by: Matthew K. on December 07, 2010, 12:00:10 PM
No, sorry
Quote from: mariusfv on December 07, 2010, 10:09:26 AM
Any chance to be ported to SMF 1.1.12 ?
Title: Re: Advanced News
Post by: Chas Large on May 08, 2011, 12:40:43 PM
Looks like just the mod I need but won't install on RC5 even if the emulation is set to RC3. Of course it may be my other mods causing the problem but too many errors to do a manual install.

Has it been tested for install on RC5 at all?
Title: Re: Advanced News
Post by: Matthew K. on May 08, 2011, 01:44:26 PM
I've not done a test with Advanced News on SMF 2.0 RC5. My guess is that the permission edit throws an error - even with emulation due to the line I commonly called in the RC3 mods I wrote being changed in RC5, thus causing emulation errors for most of my RC3 mods that were not brought up to date for RC4 and RC5.

A manual edit install should be able to be completed without any trouble.

In addition, I do plan on updating all of my mods for SMF 2.0 Final, eventually.
Title: Re: Advanced News
Post by: Chas Large on May 08, 2011, 02:44:36 PM
Quote from: Labradoodle-360 on May 08, 2011, 01:44:26 PM
I've not done a test with Advanced News on SMF 2.0 RC5. My guess is that the permission edit throws an error - even with emulation due to the line I commonly called in the RC3 mods I wrote being changed in RC5, thus causing emulation errors for most of my RC3 mods that were not brought up to date for RC4 and RC5.

A manual edit install should be able to be completed without any trouble.

In addition, I do plan on updating all of my mods for SMF 2.0 Final, eventually.
Many thanks, I'll wait for that then. :)
Title: Re: Advanced News
Post by: Matthew K. on May 09, 2011, 12:30:49 PM
Not a problem, hope you're doing well, been a while since we've had a chat :)
Title: Re: Advanced News
Post by: Eclipse16V on July 07, 2011, 06:47:43 AM
Please Update for 2.0
Title: Re: Advanced News
Post by: Matthew K. on July 07, 2011, 10:28:15 AM
Eventually I'll get around to updating all of my mods.
Title: Re: Advanced News
Post by: live627 on July 11, 2011, 02:57:43 AM
Mod updated to 1.2

* Takeover by live627.
! Small tweaks to the code that don't make any difference overall.
- Removed the ability to have news items clickable and redirect to the news page - seems a waste of template edits and principle to me...
+ Tweaked the template to look nicer in my eyes. See, I'm not a fan of big boxes everywhere - adds clutter. So use one round frame, separate the news items with a margin and a padding totaling 1em, and use a dotted grey border. See figure three on the mod page.
+ And, here is my favorite part. Refactored the code to use only hooks and no file edits. SWEET! I love it when I do that! The SMF coding god has endowed his powers on me. lol. No, no deity was involved.
Title: Re: Advanced News
Post by: Eclipse16V on July 13, 2011, 07:37:14 AM
Thanks for update

How do I get the button as a submenu in the home button?

What do I need exactly here?
function advanced_news_menu_buttons($menu_buttons)
{
global $txt, $context, $scripturl, $modSettings, $settings;

$new_button = array(
'title' => $txt['news'],
'href' => $scripturl . '?action=news',
'show' => empty($modSettings['disable_advanced_news_page']) && allowedTo('view_news') && !empty($settings['enable_news']),
);

$new_menu_buttons = array();
foreach ($menu_buttons as $area => $info)
{
$new_menu_buttons[$area] = $info;
if ($area == 'home')
$new_menu_buttons['news'] = $new_button;
}

$menu_buttons = $new_menu_buttons;
}
Title: Re: Advanced News
Post by: Matthew K. on July 13, 2011, 12:40:05 PM
You'd just put
'sub_buttons' => array(
'title' => 'Sub Button 1',
'href' => $scripturl,
'show' => true,
),
Title: Re: Advanced News
Post by: live627 on July 13, 2011, 06:40:26 PM
Code (Find and remove) Select
$new_menu_buttons = array();
foreach ($menu_buttons as $area => $info)
{
$new_menu_buttons[$area] = $info;
if ($area == 'home')
$new_menu_buttons['news'] = $new_button;
}

$menu_buttons = $new_menu_buttons;


Code (Use this instead) Select
$menu_buttons['home']['sub_buttons']['news'] = $new_button;
Title: Re: Advanced News
Post by: Eclipse16V on July 14, 2011, 10:14:15 AM
Thanks live627
Title: Re: Advanced News
Post by: Karlsm on August 08, 2011, 07:12:29 PM
Installed without errors but I don't see the news menu button?

Box is left unchecked in the settings.

Title: Re: Advanced News
Post by: live627 on August 08, 2011, 08:22:03 PM
Title: Re: Advanced News
Post by: arcadios on September 20, 2011, 11:33:13 AM
Quote from: Karlsm on August 08, 2011, 07:12:29 PM
Installed without errors but I don't see the news menu button?

Box is left unchecked in the settings.

same for me, No news button on menu.

./Sources/AdvancedNews.php   file exists
permissions looks fine

i have earlier manually added a new button [website] on the menu bar, don't know if this is a conflict ??
Title: Re: Advanced News
Post by: live627 on September 20, 2011, 08:40:01 PM
What is your cache settings?
Did you remove the home button, by any chance?
Title: Re: Advanced News
Post by: arcadios on September 21, 2011, 06:28:38 PM
cache settings "level one"
memcache parametres  [none]

jus aded a new button in fron of the home one...
Title: Re: Advanced News
Post by: vkbr on October 06, 2011, 10:29:41 PM
Love this mod. Thanks. I wonder, would be great to have different news for each membergroup. Is that possible?
thanx
vk
Title: Re: Advanced News
Post by: Matthew K. on October 06, 2011, 10:34:34 PM
Not with this mod it's not. Although I did develop a mod called "Advanced News 2.0" which completely re-writes the whole system, never finished it. Too much like the forums themselves.
Title: Re: Advanced News
Post by: vkbr on October 07, 2011, 12:11:47 AM
Well, i'd love to have it...
thanks for answer.
vk
Title: Re: Advanced News
Post by: Michael Pfaff on January 17, 2012, 03:38:08 PM
How do I make it so that a membergroup can see the News page but not Edit it?

Right now, as admin, I can see the News page, but the only options I see for permissions are to Edit the News and send out Newsletters.

What if I just want one membergroup to see the News page?
Title: Re: Advanced News
Post by: live627 on January 17, 2012, 06:46:40 PM
The permission for this mod  should be under :"Use basic forum functionality". I trust that you are using one of the "gold" releases?
Title: Re: Advanced News
Post by: Michael Pfaff on January 17, 2012, 07:19:24 PM
Quote from: live627 on January 17, 2012, 06:46:40 PM
The permission for this mod  should be under :"Use basic forum functionality". I trust that you are using one of the "gold" releases?

Ah, great! I found it. Thank you.
Title: Re: Advanced News
Post by: Michael Pfaff on January 17, 2012, 07:21:58 PM
One more quick question: is there any way to have the news show up on the News page in order of the latest addition to the news?

Right now, at the top of my News page it has the oldest News item.
Title: Re: Advanced News
Post by: live627 on January 17, 2012, 07:32:34 PM
Quote from: Michael Pfaff on January 17, 2012, 07:19:24 PM
Quote from: live627 on January 17, 2012, 06:46:40 PM
The permission for this mod  should be under :"Use basic forum functionality". I trust that you are using one of the "gold" releases?

Ah, great! I found it. Thank you.
Yeah, it's not in the same spot as the other news permission because viewing the news page isn't an admin task but is closer to a basic feature.. :)

Quote from: Michael Pfaff on January 17, 2012, 07:21:58 PM
One more quick question: is there any way to have the news show up on the News page in order of the latest addition to the news?

Right now, at the top of my News page it has the oldest News item.
No.
Title: Re: Advanced News
Post by: Michael Pfaff on January 17, 2012, 07:41:12 PM
Quote from: live627 on January 17, 2012, 07:32:34 PM
Yeah, it's not in the same spot as the other news permission because viewing the news page isn't an admin task but is closer to a basic feature.. :)

Right on. Thanks for the hasty response.

Quote from: live627 on January 17, 2012, 07:32:34 PM
Quote from: Michael Pfaff on January 17, 2012, 07:21:58 PM
One more quick question: is there any way to have the news show up on the News page in order of the latest addition to the news?

Right now, at the top of my News page it has the oldest News item.
No.

Darn. That means this mod is less useful to me.  :'(
Title: Re: Advanced News
Post by: 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.
Title: Re: Advanced News
Post by: Michael Pfaff on January 17, 2012, 08:34:29 PM
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!
Title: Re: Advanced News
Post by: 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']);
Title: Re: Advanced News
Post by: Michael Pfaff on January 17, 2012, 08:59:25 PM
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.
Title: Re: Advanced News
Post by: live627 on January 17, 2012, 09:07:41 PM
Cool. Post back  when you do, eh? Others may want to do the same.
Title: Re: Advanced News
Post by: pierrelogic on February 24, 2012, 12:02:02 PM
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?
Title: Re: Advanced News
Post by: 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.
Title: Re: Advanced News
Post by: pierrelogic on February 25, 2012, 02:39:51 PM
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.
Title: Re: Advanced News
Post by: NekoJonez on February 04, 2014, 02:02:50 PM
Bug report: I had to manually add this line in my language file but the help text wasn't showing up.
Title: Re: Advanced News
Post by: Jessica. on February 08, 2014, 07:58:29 PM
Installed with no errors; only issue is that the menu item "News" is not appearing in the menu.
Title: Re: Advanced News
Post by: Arantor on February 08, 2014, 08:36:59 PM
And it won't because of Menu Editor Lite.
Title: Re: Advanced News
Post by: Jessica. on February 08, 2014, 08:44:37 PM
I installed this mod before Menu Editor Lite and it did not appear.
Title: Re: Advanced News
Post by: Arantor on February 08, 2014, 08:46:19 PM
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.
Title: Re: Advanced News
Post by: Jessica. on February 08, 2014, 11:23:50 PM
I removed MEL and reinstalled Advanced News. Menu item "News" still not appearing.
Title: Re: Advanced News
Post by: rcane on November 24, 2021, 06:45:12 PM
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.
Title: Re: Advanced News
Post by: Dave En Velo on January 21, 2022, 07:45:41 PM
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.
Title: Re: Advanced News
Post by: live627 on January 21, 2022, 10:56:56 PM
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)
Title: Re: Advanced News
Post by: Dave En Velo on January 22, 2022, 06:38:56 AM
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:


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

Thanks again.