News:

SMF 2.1.3 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

Matthew K.

Link to Mod

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.

Eclipse16V

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.';
I worked with:
SMF 2 in German

Shop:
SID Giessen

Matthew K.

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

Achilles.

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?

- All donations will proceed to my Youth Foundation.

http://poseidondesigners.tk/ -- Affordable Website Designs // Banners & More!

Matthew K.

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

Achilles.

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!

- All donations will proceed to my Youth Foundation.

http://poseidondesigners.tk/ -- Affordable Website Designs // Banners & More!

Tair

any news about update?

Matthew K.

Update will be coming very shortly. I have a few things in front of mod updates on my to-do list.

MATTEK

Awesome. Can't wait for this mod dude!
SMF 2.0.1

Like Comics, Books, Movies or T.V. Shows? Read about them here!!

Bugo

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)

MS Modders Team

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
Please do not send us PMs. If you have a question, ask in our forum.
http://smfmodders.com/index.php

MS Modders Team

Update finally here...just didn't upload it for a while.

Screenshots have not been updated yet.

Enjoy!
Please do not send us PMs. If you have a question, ask in our forum.
http://smfmodders.com/index.php

mariusfv

Any chance to be ported to SMF 1.1.12 ?

Matthew K.


Chas Large

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?
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Matthew K.

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.

Chas Large

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. :)
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Matthew K.

Not a problem, hope you're doing well, been a while since we've had a chat :)

Eclipse16V

Please Update for 2.0
I worked with:
SMF 2 in German

Shop:
SID Giessen

Matthew K.

Eventually I'll get around to updating all of my mods.

live627

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.

Eclipse16V

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;
}
I worked with:
SMF 2 in German

Shop:
SID Giessen

Matthew K.

You'd just put
'sub_buttons' => array(
'title' => 'Sub Button 1',
'href' => $scripturl,
'show' => true,
),

live627

#23
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;

Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

Karlsm

Installed without errors but I don't see the news menu button?

Box is left unchecked in the settings.


live627

  • Check for ./Sources/AdvancedNews.php and ensure that it exists
  • Make sure membergroup permissions are set

arcadios

#27
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 ??

live627

What is your cache settings?
Did you remove the home button, by any chance?

arcadios

cache settings "level one"
memcache parametres  [none]

jus aded a new button in fron of the home one...

vkbr

Love this mod. Thanks. I wonder, would be great to have different news for each membergroup. Is that possible?
thanx
vk

Matthew K.

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.

vkbr

Well, i'd love to have it...
thanks for answer.
vk

Michael Pfaff

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?

live627

The permission for this mod  should be under :"Use basic forum functionality". I trust that you are using one of the "gold" releases?

Michael Pfaff

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.

Michael Pfaff

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.

live627

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.

Michael Pfaff

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.  :'(

live627

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.

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.

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.

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: