Advertisement:

Author Topic: AWSP - Add WebSite Permission (Partially Hook!)  (Read 23405 times)

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
AWSP - Add WebSite Permission (Partially Hook!)
« on: September 13, 2010, 08:12:19 PM »
Link to Mod

AWSP - Add WebSite Permission

- For SMF 2.0.x
- Partially using hook, minor modifications on one file.

1. Please do your own backup though every installation is backed up automatically.
2. By default, forum members are usually allowed to have their own website link with its title (advertised).
3. These websites links and titles are shown at memberlist, display (post), personal messsage, profile summary etc (are there any more?).
4. Some links and titles are anoying and forum admins / owners dislike this (or they want to charge some payment for them :P).
5. Using this mod added permission, forum admins / owners can decide which groups are allowed to have their website link(s).
6. This mod will automatically stop displaying members' website link with its title, if any, until permission is given.
7. You can test it in all lower SMF 2.0.x version too as IMO it should work just fine. ;)


Thank you for using/testing it.


Yours friendly,
Abu Fahim Ismail.

BSD License. Feel free to modify accordingly but keep original and current authors' link(s) if it is in there somewhere. ;)

Original Author: Joker™
Alternative Support Site: BurkeKnight Enterprises
Github link: ahrasis/AWSP-Add-Web-Site-Permission-Mod

 

#Change Logs

@Version 1.4.3
- Fix display in both classic and simple view in permission page.

@Version 1.4.2
- Fix permission from being displayed as an option in guest profile permission.
- Properly track and record all previous changes.
- Add github link.

@Version 1.4.1
- Author and license changed.
- Mod upgraded to partially hook.
- Remove previously created $context and simplify the code.

@Version 1.4.0
- Arantor's fix is now correctly applied.

@Version 1.3.0
- Try to fix permission by adding membersAllowedTo('permission') in Subs-Members.php as suggested here.

@Version 1.2.0
- Remove this bug.

@Version 1.1.0
- Add turkish language support.

@Version 1.0.0
- Initial release.
« Last Edit: January 02, 2015, 01:28:25 PM by PI3KUM »

Oya

  • Guest
Re: Permission for Website url in Profile
« Reply #1 on: September 13, 2010, 08:14:27 PM »

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: Permission for Website url in Profile
« Reply #2 on: September 13, 2010, 10:23:58 PM »
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Permission for Website url in Profile
« Reply #3 on: September 13, 2010, 11:03:26 PM »
I would also suggest adding some sort of template side edits.

What happens if I already have something in that field and then you toggle the permission? I will still have it filled out, it just won't show up when I go to edit my profile. You should have something in the displays that prevents it from even being displayed if the permission is not true.

Oya

  • Guest
Re: Permission for Website url in Profile
« Reply #4 on: September 14, 2010, 03:43:12 AM »
btw this is part of http://arantormods.com/index.php?action=media;sa=item;in=1
is the code of that mod and my mod here is same ?

no but teh other mod i found does more and with one less eidt

fixing teh display would be ogod tho larbadoodle i havent really looked myself to see how easy tat'd be and arantor is well a bit bad tempered so i aint gonna sk him bout it

Offline iPhoneDestek

  • Jr. Member
  • **
  • Posts: 200
  • Gender: Male
  • MOD Translator from iPhoneDestek.org
    • iPhoenDestek
Re: Permission for Website url in Profile
« Reply #5 on: September 14, 2010, 06:54:06 AM »
translatıon ın turkısh



Code: [Select]

<file name="$languagedir/ManagePermissions.turkish.php">
 <operation>
  <search position="end" />
   <add><![CDATA[
// Permission Mod translation by SirtLanVadisi.net
    $txt['permissionname_add_website'] = 'Web Site Adressi ekleyebilir';
    $txt['permissionhelp_add_website'] = ' Üyenin Websitesi ve Adressi belirli yerlerde Forumda gösterilir.Profil alanında';
 // End Permission Mod translation by SirtLanVadisi.net
   ]]></add>
 </operation>
</file>
<file name="$languagedir/ManagePermissions.turkish-utf8.php">
 <operation>
  <search position="end" />
   <add><![CDATA[
// Permission Mod translation by SirtLanVadisi.net
    $txt['permissionname_add_website'] = 'Web Site Adressi ekleyebilir';
    $txt['permissionhelp_add_website'] = ' Ãœyenin Websitesi ve Adressi belirli yerlerde Forumda gösterilir.Profil alanında';
 // End Permission Mod translation by SirtLanVadisi.net
   ]]></add>
 </operation>
</file>

« Last Edit: September 14, 2010, 07:03:41 AM by ®SirtLan »

$$  Q u a l i t y    I n f o r m a t i o n    L i n e  for iPhone $$



<   M O D  |  T R A N S L A T O R  |  TO  |  TUR  |  A N D   |  G E R   >


Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: Permission for Website url in Profile
« Reply #6 on: September 14, 2010, 10:15:03 AM »
I would also suggest adding some sort of template side edits.

What happens if I already have something in that field and then you toggle the permission? I will still have it filled out, it just won't show up when I go to edit my profile. You should have something in the displays that prevents it from even being displayed if the permission is not true.
i think it could be done fairly easily with put if condition in load.php . Editing template files is last option for me now , as i'm bit tired off providing support for different theme's . So, it is better to heck source files rather putting code in templates. I'll be updating mod about this very soon ;).

no but teh other mod i found does more and with one less eidt

fixing teh display would be ogod tho larbadoodle i havent really looked myself to see how easy tat'd be and arantor is well a bit bad tempered so i aint gonna sk him bout it
I had a bit of tough time understanding that first :). Now as far as that mod is concern i've not seen the code , will take a look at it later . About the template file i've explained myself above already.

translatıon ın turkısh

Code: [Select]
<file name="$languagedir/ManagePermissions.turkish.php">
 <operation>
  <search position="end" />
   <add><![CDATA[
// Permission Mod translation by SirtLanVadisi.net
    $txt['permissionname_add_website'] = 'Web Site Adressi ekleyebilir';
    $txt['permissionhelp_add_website'] = ' Üyenin Websitesi ve Adressi belirli yerlerde Forumda gösterilir.Profil alanında';
 // End Permission Mod translation by SirtLanVadisi.net
   ]]></add>
 </operation>
</file>
<file name="$languagedir/ManagePermissions.turkish-utf8.php">
 <operation>
  <search position="end" />
   <add><![CDATA[
// Permission Mod translation by SirtLanVadisi.net
    $txt['permissionname_add_website'] = 'Web Site Adressi ekleyebilir';
    $txt['permissionhelp_add_website'] = ' Ãœyenin Websitesi ve Adressi belirli yerlerde Forumda gösterilir.Profil alanında';
 // End Permission Mod translation by SirtLanVadisi.net
   ]]></add>
 </operation>
</file>
Thanks a lot bro , will add it shortly :).
« Last Edit: September 14, 2010, 11:04:39 AM by Joker™ »
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Permission for Website url in Profile
« Reply #7 on: September 14, 2010, 11:01:34 AM »
Haha do you not think I am aware of that, Joker?

I said template side for a reason. Go ahead, try it Source end and see what you can do :) If you can successfully do it without causing *any* errors, go for it.

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: Permission for Website url in Profile
« Reply #8 on: September 14, 2010, 11:30:43 AM »
Haha do you not think I am aware of that, Joker?

I said template side for a reason. Go ahead, try it Source end and see what you can do :) If you can successfully do it without causing *any* errors, go for it.
Mod updated , do try and give the feedback :)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Permission for Website url in Profile
« Reply #9 on: September 14, 2010, 11:43:25 AM »
Looks good. Nice job

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: Permission for Website url in Profile
« Reply #10 on: September 14, 2010, 11:46:01 AM »
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Oya

  • Guest
Re: Permission for Website url in Profile
« Reply #11 on: September 14, 2010, 01:42:08 PM »
dont work proply

if i set it so i dont have permisson i cant see any website links even from those who do have permisson to post tehm

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Permission for Website url in Profile
« Reply #12 on: September 14, 2010, 02:55:22 PM »
I should have noticed that...duh!

Here's your problem.
./Sources/Load.php
Code: (Find) [Select]
'website' => (!empty($context['enable_website_url'])) ? array(
'title' => $profile['website_title'],
'url' => $profile['website_url'],
) : array('title' => '', 'url' =>''),
Code: (Should be) [Select]
        'website' => ($context['enable_website_url']) ? array(
            'title' => $profile['website_title'],
            'url' => $profile['website_url'],
        ) : array('title' => '', 'url' =>''),

You don't need to find out whether $context['enable_website_url'] is empty or not; it's a permission that you put in a context for ease, but you still need to keep it in permission format when checking it.

Oya

  • Guest
Re: Permission for Website url in Profile
« Reply #13 on: September 14, 2010, 03:30:37 PM »
no

that checks the *current* user permisson

not the permisson of the user whose profile ur checkin

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Permission for Website url in Profile
« Reply #14 on: September 14, 2010, 03:53:59 PM »
But that is in the user array, so it would.

Oya

  • Guest
Re: Permission for Website url in Profile
« Reply #15 on: September 14, 2010, 03:55:18 PM »
no it wont

it doesnt load the permissons of every user whose avatar is displayed so it never checks that

u could even try it and see what happens

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Permission for Website url in Profile
« Reply #16 on: September 14, 2010, 03:57:40 PM »
allowedTo(''); checks for the user, not if it's checked or not.

Plus, it's in the array, so it should work how I quoted.

Oya

  • Guest
Re: Permission for Website url in Profile
« Reply #17 on: September 14, 2010, 06:24:14 PM »
yes... the *current* user

so i have a new user  who doesnt have this permisson allowedto() returns false

because thats false for *him* it means he cant see *ANY* of the urls even mine and im the admin so i definately have permisson which isnt the same as hiding one he already put in when he did have permisson before

Offline Joker™

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,914
  • Gender: Male
    • siddhartha-gupta on GitHub
Re: Permission for Website url in Profile
« Reply #18 on: September 14, 2010, 09:40:46 PM »
dont work proply

if i set it so i dont have permisson i cant see any website links even from those who do have permisson to post tehm
thanks for reporting it , will try to remove the bug shortly :).
« Last Edit: September 14, 2010, 09:54:06 PM by Joker™ »
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Offline iPhoneDestek

  • Jr. Member
  • **
  • Posts: 200
  • Gender: Male
  • MOD Translator from iPhoneDestek.org
    • iPhoenDestek
Re: Permission for Website url in Profile
« Reply #19 on: September 15, 2010, 07:16:11 AM »
translation in german


Code: [Select]


<file name="$languagedir/ManagePermissions.german.php">
 <operation>
  <search position="end" />
   <add><![CDATA[
// Permission Mod translation by SirtLanVadisi.net
    $txt['permissionname_add_website'] = 'Kann Webseite Adresse zufügen';
    $txt['permissionhelp_add_website'] = 'Webseite und die URL der Nutzer im Forum und Profil angezeigt.';
 // End Permission Mod translation by SirtLanVadisi.net
   ]]></add>
 </operation>
</file>
<file name="$languagedir/ManagePermissions.german-utf8.php">
 <operation>
  <search position="end" />
   <add><![CDATA[
// Permission Mod translation by SirtLanVadisi.net
    $txt['permissionname_add_website'] = 'Kann Webseite Adresse zufügen';
    $txt['permissionhelp_add_website'] = 'Webseite und die URL der Nutzer im Forum und Profil angezeigt.';
 // End Permission Mod translation by SirtLanVadisi.net
   ]]></add>
 </operation>
</file>




$$  Q u a l i t y    I n f o r m a t i o n    L i n e  for iPhone $$



<   M O D  |  T R A N S L A T O R  |  TO  |  TUR  |  A N D   |  G E R   >