Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 11:40:56 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155556 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: News AnyNews multiple group contributions  (Read 483 times)
sky writer

Offline Offline

Posts: 285



« on: November 29, 2011, 06:20:06 PM »

I've searched and can't find any solution.

I manage a website and have always been the only contributor.  I have had both the News and AnyNews modules working very well for our purposes... until now.

Some other members would now like to have access to add "blog" like posts from time to time.  So I created a group and added them as users, and gave them permission for the "News" page.  The News page has multiple News Groups, and I only want them to have access to one News Group each, or at the very least one News Group as a collective.  I want this restriction so they can not edit or delete all the other News Posts on the site.  This is my ultimate solution as it would allow me to include these posts in my Blog-Menu listings as well.  Is this currently possible?

I couldn't seem to find a way, so my next thought was, create a separate HIDDEN news page for each of them, and give them permission only for that page.  Done.  Then create a new News Group in each News Page.  Done.  Then use AnyNews to display all News Posts by adding their News Group id to my current AnyNews code Array.  This all works great, except that AnyNews is very limited in the way that you can display the number of posts.  It's either ALL, or a select number of posts, up to 999.  Is there a way to tell AnyNews to display with pagination, for instance, ten posts, then have a NEXT link at the bottom, like the regular News module does?

Hope this makes sense.  I would happily clarify if it helps anyone help me.

Thank you!
Logged
sky writer

Offline Offline

Posts: 285



« Reply #1 on: November 30, 2011, 05:47:16 PM »

I don't think re-writing "Access" to limit "News" group accessibility is going to be an option, so I am going to simplify and focus my question to the more realistic option...

How difficult would it be to add pagination to the AnyNews Module?  I am going to look at the News module and see if I can incorporate the code that handles pagination... but I am not even sure where to start looking.

Thanks in advance to anyone who would be willing even to point me in the right direction.
Logged
Bug

Offline Offline

Posts: 188


« Reply #2 on: November 30, 2011, 08:34:06 PM »

Nonono.... Do it in another way!

The now following will make a lot of people here at least frown a bit...

My guess is you would  indeed do best to make two news pages with visibility on hidden, but do not use anynews for this, use a third newspage and let the 'real' newspage collect athe newsposts of both hidden pages..

How?

Open view

Search for the string that gets the messages from the database,
Code:
$query_users = $database->query("SELECT group_id,title,active FROM ".TABLE_PREFIX."mod_news_groups WHERE section_id = '$section_id' ORDER BY position ASC");

If you change $section_id to the number of the hidden page it collects the news messages from another page

If you put in OR and add another one ...


Code:
$query_users = $database->query("SELECT group_id,title,active FROM ".TABLE_PREFIX."mod_news_groups WHERE section_id = '34' OR section_id = '73' ORDER BY position ASC");


But that would make all newspages load those posts...

But if you add some if and else shizzle ...

Code:

if ($section_id == "164"){
$showposts = 17; }
else if ($section_id == "20"){
$showposts = 166; }
else if ($section_id == "151"){
$showposts = 168; }
else{
$showposts = $section_id;
}


$query_users = $database->query("SELECT group_id,title,active FROM ".TABLE_PREFIX."mod_news_groups WHERE section_id = '$showposts' ORDER BY position ASC");


Something like that ....

(all numbers are ofcourse uit mn duim gezogen)


Logged
sky writer

Offline Offline

Posts: 285



« Reply #3 on: December 01, 2011, 07:57:53 PM »

Thank you for your reply.
I'm very interested in this approach, but I tried what you provided so far and didn't get the desired results.

I'm unsure of what actual numbers go in this part of the code:
Code:
if ($section_id == "164"){
$showposts = 17; }
else if ($section_id == "20"){
$showposts = 166; }
else if ($section_id == "151"){
$showposts = 168; }

And how do I get multiple HIDDEN sections to appear on the ONE REAL News page?

Sorry, I am trying to follow, but can't see how this is accomplished with your provided code.
Logged
Bug

Offline Offline

Posts: 188


« Reply #4 on: December 01, 2011, 11:31:15 PM »

i pm'd you three files, that will do the trick

Logged
tugboat

Offline Offline

Posts: 39



WWW
« Reply #5 on: January 24, 2012, 04:36:10 PM »

What if I wanted to use this as a droplet, is this possible? if so, what do I write in the code area?
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!