News:

Join the Facebook Fan Page.

Main Menu

SMF Articles

Started by SMFHacks.com Team, September 04, 2008, 04:03:00 PM

Previous topic - Next topic

Aleksi "Lex" Kilpinen

A nice system, but the permissions don't really play like SMF permissions usually do. I can not seem to be able to make a category that is viewable only by one membergroup.
At least I haven't found a way to do that.

To explain a bit further:
My permissions on the forum use allow, disallow and deny.
The membergroup permission to view in forum wide permissions is allowed for everyone, because this is a master setting for the articles page.
I have a membergroup X that I would like to give exclusive access to a category, regardless of that group being in primary or secondary group for the member.
So far I have not been able to find a combination of the permissions that would allow this. Either everyone gets in, or no one gets in. ( Well, I can limit out groups completely, like guests - but if I limit say group Y, and a member is in both Y and X he will not get in because Y is denied. )
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Chen Zhen

#981
re. permissions

Edit the hooks file & replace the articles_load_permissions function with the following:

function articles_load_permissions(&$permissionGroups, &$permissionList, &$leftPermissionGroups, &$hiddenPermissions, &$relabelPermissions)
{
global $context, $modSettings;

$permissionList['membergroup'] += array(
'view_articles' => array(false, 'smfarticles', 'smfarticles'),
'add_articles' => array(false, 'smfarticles', 'smfarticles'),
'edit_articles' => array(false, 'smfarticles', 'smfarticles'),
'delete_articles' => array(false, 'smfarticles', 'smfarticles'),
'rate_articles' => array(false, 'smfarticles', 'smfarticles'),
'articles_comment' => array(false, 'smfarticles', 'smfarticles'),
'articles_auto_approve' => array(false, 'smfarticles', 'smfarticles'),
'articles_autocomment' => array(false, 'smfarticles', 'smfarticles'),
'articles_admin' => array(false, 'smfarticles', 'smfarticles'),
);

// SMF 2.1 branch behavior will differ
$version = version_compare((!empty($modSettings['smfVersion']) ? substr($modSettings['smfVersion'], 0, 3) : '2.0'), '2.1', '<') ? 'v2.0' : 'v2.1';

if ($version === 'v2.0')
{
$permissionGroups['membergroup']['simple'] += array(
'smfarticles',
);
$permissionGroups['membergroup']['classic'] += array(
'smfarticles',
);
}
else
$permissionGroups['membergroup'] += array(
'smfarticles',
);

}

My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Aleksi "Lex" Kilpinen

Thanks Chen Zhen, that looks like a promising suggestion - but sadly, the 2.0 install doesn't seem to use the hooks file..
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Chen Zhen


re. permissions

I'll give you a modified install file.
It's not my mod therefore I will not upload an updated package.

You'll have to unzip the package and replace the articles2.xml file with what is attached then re-zip the package and install it on your forum.
Report back and let us know if it resolves your issue.
If it does perhaps vbgamer will update his package with the fix.




My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

vbgamer45

Permissions I want to redo one day. Right now everything is allow all. And the only way to deny is deny each member group
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Aleksi "Lex" Kilpinen

I'll take a look at it, thanks.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Aleksi "Lex" Kilpinen

Quote from: Chen Zhen on May 06, 2018, 01:01:08 PM
re. permissions
Okay, thanks for the effort - but comparing the original and your file, I'd be willing to guess this will have no effect.
That would only edit the part where ManagePermissions.php specifically states that it's completely optional to use.

Quote
// List of all the groups dependant on the currently selected view - for the order so it looks pretty, yea?
// Note to Mod authors - you don't need to stick your permission group here if you don't mind SMF sticking it the last group of the page.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Chen Zhen


The permissions for article categories have a unique table.

File: ../Sources/Articles2.php
function: MainView()

find:

if ($context['user']['is_guest'])
$groupid = -1;
else
$groupid =  $user_info['groups'][0];

// Set page title
$context['page_title'] = $mbname . ' - ' . $txt['smfarticles_title'];

$dbresult = $smcFunc['db_query']('', "
SELECT
c.ID_CAT, c.title, c.imageurl, c.filename, c.roworder, c.description, p.view 
FROM {db_prefix}articles_cat AS c
LEFT JOIN {db_prefix}articles_catperm AS p ON (p.ID_GROUP = $groupid AND c.ID_CAT = p.ID_CAT) 
WHERE c.ID_PARENT = 0 ORDER BY roworder ASC");
$context['articles_cat'] = array();
while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
// Skip category if they do not have permission to view it
if ($row['view'] == '0')
continue;

$context['articles_cat'][] = $row;
}
$smcFunc['db_free_result']($dbresult);


replace with:

if ($user_info['is_guest'])
$groupid = array(-1);
else
$groupid = $user_info['groups'];

// Set page title
$context['page_title'] = $mbname . ' - ' . $txt['smfarticles_title'];
$dbresult = $smcFunc['db_query']('', '
SELECT
c.ID_CAT, c.title, c.imageurl, c.filename, c.roworder, c.description, p.view, p.ID_GROUP
FROM {db_prefix}articles_cat AS c
LEFT JOIN {db_prefix}articles_catperm AS p ON (p.ID_CAT = c.ID_CAT)
WHERE c.ID_PARENT = 0
ORDER BY roworder ASC'
);
$context['articles_cat'] = array();

while ($row = $smcFunc['db_fetch_assoc']($dbresult))
{
// List category if they have permission to view it
if ($row['view'] != '0' && ($user_info['is_admin'] || in_array($row['ID_GROUP'], $groupid)))
$context['articles_cat'][] = $row;
}
$smcFunc['db_free_result']($dbresult);


My SMF Mods & Plug-Ins

WebDev

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Westwegoman

Quote from: Mick. on August 15, 2011, 05:28:09 PM
Vb, it seems that when 'liking' an article and pasting an article link on facebook, it does not take you to the article itself, it posts the home page link instead.

I just recently noticed that pasting a link to an article in Facebook actually posts a link that brings up the home page also.

I searched through but didn't see a solution, unless I missed it.

vbgamer45

It is probably do the url having a ; which SMF uses by default and Facebook does not like those characters.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Westwegoman

Quote from: vbgamer45 on June 20, 2018, 09:45:33 PM
It is probably do the url having a ; which SMF uses by default and Facebook does not like those characters.

Ok thanks. I saw you had said that but didn't know if a work around had been discovered.

vbgamer45

Basically change the links to use & instead of ;
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Westwegoman

Quote from: vbgamer45 on June 20, 2018, 10:52:58 PM
Basically change the links to use & instead of ;

How would one go about doing that?

vbgamer45

It would require opening the template files for articles and changed the url passed in the facebook code I believe
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

SMFHacks.com Team

3.0.3b
+Added install support for SMF 2.1 RC1
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Hatshepsut

I think this mod needs to be updated.
In SMF 2.1 RC2+, when I write an article, I get an error message directly in the editor window:

Notice: Undefined index: show_bbc in /home/bulataka/public_html/test/Themes/default/Articles2.1.template.php on line 853

Click =>

Also, when I try to import Tinyportal articles (I use Tinyportal 1.6.5), I get two error messages:

- first error message at the top:

Notice
: Undefined index: admin_menu_name in
/home/bulataka/public_html/test/Sources/Articles2.php
on line
1829


- second error message, as message box:

Database Error
Unknown column 'authorID' in 'field list'
File: /home/bulataka/public_html/test/Sources/Articles2.php
Line: 2912

SMFHacks.com Team

Update

3.0.4
!Fixed importing new versions of TinyPortal article system
!Fixed some undefined errors for SMF 2.1.x
Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Hatshepsut

Quote from: SMFHacks.com Team on April 15, 2020, 10:33:02 AM
Update

3.0.4
!Fixed importing new versions of TinyPortal article system
!Fixed some undefined errors for SMF 2.1.x

Thanks, problems solved :)

captcha

#998
I tested SMF Articles 3.04 in SMF 2.0.17 and 2.1 RC. There is no way to add a new article. I added a category at first. Changed permissions to global moderator. There is no place can find add article button for any members (even if administrator, global moderator).
SMF Articles 3.03b can add a new article.
I do not if it is bug or there is any trick to add a new article.

vbgamer45

Inside the category do you have this near the bottom
"Add Sub Category - Add Article -  Return to Article Index"


Also, do you have any permissions setup on the category. If so can you take a screenshot of what you have setup.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: