TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 428
  • Total: 428

Anti-Theft Block

Started by akulion, September 25, 2006, 11:55:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rafferty

Thanks Sabre, yes I'm using the member groups and not the post counted groups. Is that incorrect?

FERNSIDEâ„¢

#101
Hi mate  :)

I am by no means knowledgeable in the coding arena, and only go by trial n error, and through reading the knowledge provided in past posts.

No that thats outta the way, lets get started!! lol

Ok mate, the easiest way(for meee :D) is to add all the "post group numbers" you want stopped, where it states

$groups = array(1,2,11,19);

And thats it bud!!    Mission accomplished without any further coding.
Go have a beer, and marvel at its simplicity!! lol

So Here's the code to add, some of the previous ones didnt work for me:

global $context, $user_info;
$groups = array(ADD POST MEMBER GROUPS HERE  eg. 1, 2, 3, etc etc etc);

if ($context['user']['is_guest'] || array_intersect($groups, $user_info['groups']))
echo '

ADD THE REST OF THE CODE HERE


There is no doubt an easier/ more efficient way to do this, but until the knowledgable speak up, this is what we have  ;)

You could also leave the staff member groups in for good measure :)

Good luck mate  :)


thefley

How would I do this in just the SMF pro gallery to keep others from images copies or Hyperlinked from?

IchBin

If you are indeed using the SMF gallery mod this code should only work in the gallery.

global $context, $user_info;
$groups = array(ADD POST MEMBER GROUPS HERE  eg. 1, 2, 3, etc etc etc);

if (isset($_GET['action']) && $_GET['action'] == 'gallery'){

    if ($context['user']['is_guest'] || array_intersect($groups, $user_info['groups']))
         echo 'ADD THE REST OF THE CODE HERE BETWEEN THE single quotes';
}

Rafferty

TY guys it seems this wouldnt work in my case. Access throughout my forum is based on Membergroup and not post count groups.

IchBin

It should work not matter group type. All it checks is the Group ID number. Did you try it?

Rafferty

yes as i posted before it doesn't block anyone no matter what groups i put in

IchBin

Please post your code.

Rafferty


IchBin

Quote from: Rafferty on February 24, 2008, 12:42:37 PM
QuoteTry it this way.

No Errors but the listed groups cannot copy, no one can

Judging by this comment you have me a little confused. Are you trying to block access to the listed groups from copying, or are you trying to allow. The code that I've posted would block access to the said groups. So if you don't want those groups to be blocksed, you need to add everyone to the array that you want to be blocked.

This website is proudly hosted on Crocweb Cloud Website Hosting.