Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Issue with edit for admin and moderators
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 5, 2015 - 9:56 pm

believe when a user posts a url in a post, it gets made clickable... that is, the url text is converted to a hyperlink...

the user desires just the plain text url - not converted to hyperlink..

as I mentioned, if you are able to add a standard WordPress hook to a custom sp theme, this can be accomplished...  its only 3 or 4 lines of code...  but before posting it, just wanted to make sure you were willing to do that...

as to child theme, see:  https://simple-press.com/simpl.....ld-themes/

as to custom theme, see:  https://simple-press.com/docum.....g-a-theme/

Avatar
bjj scout
Member
Free Members
sp_UserOfflineSmall Offline
Jan 6, 2015 - 7:28 am

Sure thing sir, I'll be willing to do it.

I don't mind if every other person is stopped from posting links except admin and moderators. 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 6, 2015 - 7:35 am

If all you really want to do is prevent people from posting links in their forum posts then go to the permission set that your users utilise and turn off the permission 'Can create links in posts'.. Leave this option turned on for the permissions being used by your moderators and admins get full permissions at all times.

andy-signature.png
YELLOW
SWORDFISH
Avatar
bjj scout
Member
Free Members
sp_UserOfflineSmall Offline
Jan 7, 2015 - 5:27 am

I'll prefer the code to display links in text. Eg. A user drops http://www.google.com it should remain as a text instead of getting hyperlinked automatically. 

Or will setting such permission allow users to drop text link without getting them hyperlinked? 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 7, 2015 - 12:12 pm

Try adding the following code to your spFunctions.php file in the /templates folder of the SP theme you are using. Note you must add this exactly as it appears here. Using the raw code button and then copying and pasting should work OK and you could use the theme editor admin panel provided by Simple:Press to make the edits with.

add_filter('sph_save_links_filter', 'remove_links_save', 1, 3);
function remove_links_save($content, $original, $charcount) {
    global $spThisUser;
    if (!$spThisUser->moderator) {
        return $original;
    }
    return $content;
}
add_filter('sph_display_links_filter', 'remove_links_display', 1, 3);
function remove_links_display($content, $original) {
    global $spThisUser;
    if (!$spThisUser->moderator) {
    return $original;
    }
    return $content;
}

See if that does what you want.

As always we recommend that you create your own SP child theme or custom theme so that any customisation is not lost during a future update.

andy-signature.png
YELLOW
SWORDFISH
Avatar
bjj scout
Member
Free Members
sp_UserOfflineSmall Offline
Jan 23, 2015 - 10:32 pm

Thanks a lot sir, your code worked for me but will be best if I am able to strip off the part where it displays for moderators.

Both moderators, users and admins alike should see it as text link when viewing it. 

 

Thanks again  

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 24, 2015 - 12:23 am

you were able to modify it?  or need help?

Avatar
bjj scout
Member
Free Members
sp_UserOfflineSmall Offline
Jan 24, 2015 - 5:42 am

I'll need help again with it sir

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Jan 24, 2015 - 6:44 am

Change it for this:

add_filter('sph_save_links_filter', 'remove_links_save', 1, 3);
function remove_links_save($content, $original, $charcount) {
    return $original;
}
add_filter('sph_display_links_filter', 'remove_links_display', 1, 3);
function remove_links_display($content, $original) {
    return $original;
}

That will do it for all users.

andy-signature.png
YELLOW
SWORDFISH
Avatar
bjj scout
Member
Free Members
sp_UserOfflineSmall Offline
Jan 26, 2015 - 6:52 pm

I'm really grateful sir.

Much regards

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625