News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Removing links

Started by aleco, October 05, 2005, 01:43:22 PM

Previous topic - Next topic

aleco

Hello all!

First off - great piece of software! Switched over from phpBB and haven't looked back yet  :)

It's so good I've even tried to implement it into my other sites - which leads me to my question:

Is there a way to disable links in a certain board only? Or a way to enable similes in posts, but not the links or other code?

Basically I'm using part of my main forum to allow users to post comments on another part of my site. However, people tried to use my old comment system for spamming their links about the place, so ideally i'd like the links not to be converted.

I tried strip_tags, but this removed the smilies as well :(

I'm currently using $rowcom['body'] = doUBBC($rowcom['body'], $rowcom['smileysEnabled']);to grab the info, add smilies, and then display later.

Or, what would be even better, would be if links could be disabled for guests only?

I've searched on this forum but cannot find anything specifically on this area with any code, just discussions on how it would be nice.

Thanks for any help you can provide, as I'm still trying to become familiar with the forum software!

Elissen

Might not be the nicest way to do it, but it is the easiest. This change will allow you to post a link, but it won't make a link out of it. Nor can you use the url-tags any more

index.php, search
        // Load the current user's permissions.
        loadPermissions();

Add after
        if ($board == 2) {
          $modSettings['autoLinkUrls'] = false;
          if (!empty($modSettings['disabledBBC']))
            $modSettings['disabledBBC'] = $modSettings['disabledBBC'] . ',url,iurl';
          else
            $modSettings['disabledBBC'] = 'url,iurl';
        }


There is a better (read: more elegant) way to do it but I don't have time atm to see where.

Oh, change the board-id (2) at the top :)

aleco

Thanks very much, Elissen!  :D

Seems to have done the trick, plus I finally finished integrating the main forum into the other site to act as a commenting system! 8) So thanks also to the smf team for making such a good piece of software

/gushing

Advertisement: