Notices

Go Back   FileFront Forums > Main Forums > General Yib-Yab (Off Topic)

Remember Me?

General Yib-Yab (Off Topic)
Pass the time and talk about general topics here.
Feeling nostalgic? Visit the GameFront Hall of Fame!

Reply
 
LinkBack Thread Tools Display Modes
Old July 22nd, 2006   #1
Banned
El Bano
 
Tango Protocol's Avatar
 
Join Date: July 18th, 2003
Status: Available
3,377 posts, 35 likes.
Rep Power: 0
Tango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love you
Default My work is being featured in IPB SDK

There is software called IPB SDK that allows webmasters to integrate their websites into their forums (to share information and to make it interact with the forums and all that jazz).. well, when I was coding something for Universium yesterday, I needed a function that did not yet exist in the IPB SDK. This function would return positive feedback if the user belongs to one of of the specified SECONDARY groups on the forums. Because IPB uses primary groups and secondary group (primary the one being showed in profiles, the secondary is "hidden")

the SDK had a function to do what I needed, but it would only look in the user's primary group, instead of both.

So I wrote a function that would scan secondary groups as well... and the author of the SDK said that my code will be incorporated into the next version release.

Link: Official IPB SDK Forum

Final code:
PHP Code:
function is_ingroup($groups,$member='') {
        global 
$SDK;
        if (
$SDK->is_ingroup($groups$member) or is_in2group($groups$member)) {
                return 
true;
        }
        else {
                return 
false;
        }
}
function 
is_in2group($groups$member='') {
        global 
$SDK;
        
$sdk_userinfo $SDK->get_advinfo($member);
        
$sdk_userinfo_altgroups $sdk_userinfo['mgroup_others'];
        
$sdk_array explode(","$sdk_userinfo_altgroups);

        if (
is_array($groups)) {

                foreach (
$groups as $g) {
                      if (
in_array($g$sdk_array)) {
                                if (!
$x) { $x true; }
                        }
                }
        }
        else {
                if (
in_array($groups$sdk_array)) { $x true; }
        }
        if (
$x) { return true; }
        else { return 
false; }

Documentation:
standalone function is_ingroup ( groupID [array OR int], memberid [int] )

Well return true if user memberid is in any of the groups specified in groupID. Will also return true if groupID matches any of the user memberid secondary groups

--

standalone function is_in2group ( groupID [array OR int], memberid [int] )

Will return true if user memberid has secondary usergroup that matches an entry in groupID



I just thought I'd share that. I thought it was pretty cool that a lot of the IPB community may be using my code in a few weeks

[CENTER]
[url="http://raptr.com/knippy?src=em_smforum"][img]http://raptr.com/badge/b69bb5ce84374c997d571b1dd95aa3ae/fss.png[/img][/url]

[URL="http://forums.filefront.com/member.php?u=108795"][COLOR=darkorange]Crazy Wolf[/COLOR][/URL] is a sexy beast.
[/center]
Tango Protocol is offline   Reply With Quote
Old July 22nd, 2006   #2
Please don't kick.
 
PC Chipmunk's Avatar
 
Join Date: July 8th, 2005
Location: On your roof
Status: Available
908 posts, 2 likes.
Rep Power: 23
PC Chipmunk is worthy of your admirationPC Chipmunk is worthy of your admirationPC Chipmunk is worthy of your admirationPC Chipmunk is worthy of your admirationPC Chipmunk is worthy of your admirationPC Chipmunk is worthy of your admirationPC Chipmunk is worthy of your admirationPC Chipmunk is worthy of your admiration
Default Re: My work is being featured in IPB SDK

I don't think I understood much of that....but well done Knipps


Im just filling this empty space at the bottom here because it makes me anxious when it's empty. Oh god. It's okay. Relax.
PC Chipmunk is offline   Reply With Quote
Old July 22nd, 2006   #3
I would die without my life.
 
Biggus Dickus's Avatar
 
Join Date: January 19th, 2004
Location: Lurking Mastermind
Status: As strange as Kerian.
6,228 posts, 0 likes.
Rep Power: 31
Biggus Dickus is close friends with everybodyBiggus Dickus is close friends with everybodyBiggus Dickus is close friends with everybodyBiggus Dickus is close friends with everybodyBiggus Dickus is close friends with everybodyBiggus Dickus is close friends with everybodyBiggus Dickus is close friends with everybody
Default Re: My work is being featured in IPB SDK

Hmm...Just for information, would it be possible to do this:
Code:
function is_ingroup($groups,$member='') {
        global $SDK;
        return ($SDK->is_ingroup($groups, $member) or is_in2group($groups, $member)) ? true : false;
}
instead of this:
Code:
function is_ingroup($groups,$member='') {
        global $SDK;
        if ($SDK->is_ingroup($groups, $member) or is_in2group($groups, $member)) {
                return true;
        }
        else {
                return false;
        }
}
It's exactly the same thing with less lines. I don't know if it's allowed in this language.


Now you have a reason to stay online.
Biggus Dickus is offline   Reply With Quote
Old July 22nd, 2006   #4
Banned
El Bano
 
Tango Protocol's Avatar
 
Join Date: July 18th, 2003
Status: Available
3,377 posts, 35 likes.
Rep Power: 0
Tango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love you
Default Re: My work is being featured in IPB SDK

Basically something I did for myself to add functionality to software is being "officially" added as functionality.

[CENTER]
[url="http://raptr.com/knippy?src=em_smforum"][img]http://raptr.com/badge/b69bb5ce84374c997d571b1dd95aa3ae/fss.png[/img][/url]

[URL="http://forums.filefront.com/member.php?u=108795"][COLOR=darkorange]Crazy Wolf[/COLOR][/URL] is a sexy beast.
[/center]
Tango Protocol is offline   Reply With Quote
Old July 22nd, 2006   #5
Banned
El Bano
 
Tango Protocol's Avatar
 
Join Date: July 18th, 2003
Status: Available
3,377 posts, 35 likes.
Rep Power: 0
Tango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love you
Default Re: My work is being featured in IPB SDK

Quote:
Originally Posted by Biggus Dickus
Hmm...Just for information, would it be possible to do this:
Code:
function is_ingroup($groups,$member='') {
        global $SDK;
        return ($SDK->is_ingroup($groups, $member) or is_in2group($groups, $member)) ? true : false;
}
instead of this:
Code:
function is_ingroup($groups,$member='') {
        global $SDK;
        if ($SDK->is_ingroup($groups, $member) or is_in2group($groups, $member)) {
                return true;
        }
        else {
                return false;
        }
}
It's exactly the same thing with less lines. I don't know if it's allowed in this language.
I've never seen that in PHP, it'd probably give you a parse error

[CENTER]
[url="http://raptr.com/knippy?src=em_smforum"][img]http://raptr.com/badge/b69bb5ce84374c997d571b1dd95aa3ae/fss.png[/img][/url]

[URL="http://forums.filefront.com/member.php?u=108795"][COLOR=darkorange]Crazy Wolf[/COLOR][/URL] is a sexy beast.
[/center]
Tango Protocol is offline   Reply With Quote
Old July 22nd, 2006   #6
For KAVATCH!!!
1st Class Petty Officer
 
nowhereman's Avatar
 
Join Date: April 20th, 2005
Location: Everywhere
Status: Pixlating
1,468 posts, 0 likes.
Rep Power: 24
nowhereman should make some friends
Default Re: My work is being featured in IPB SDK

Quote:
It's exactly the same thing with less lines. I don't know if it's allowed in this language.
I dont think that that is allowed. Some languages don't like you putting alot of stuff on one line. But it might work i'm not too familiar with PHP.

Also nice work Knippschild.

My crime is that of curiosity. My crime is that of judging people by what they say and think, not what they look like. My crime is that of outsmarting you, something that you will never forgive me for.
nowhereman is offline   Reply With Quote
Old July 22nd, 2006   #7
Trust me, I'm a Doctor
 
*The.Doctor's Avatar
 
Join Date: November 25th, 2003
Status: Drunk
9,879 posts, 1 likes.
Rep Power: 35
*The.Doctor is a person of good advice*The.Doctor is a person of good advice*The.Doctor is a person of good advice*The.Doctor is a person of good advice*The.Doctor is a person of good advice*The.Doctor is a person of good advice*The.Doctor is a person of good advice*The.Doctor is a person of good advice
Send a message via AIM to *The.Doctor
Default Re: My work is being featured in IPB SDK

I don't know what all that code means, but congrats on your work being used!
*The.Doctor is offline   Reply With Quote
Old July 22nd, 2006   #8
Banned
El Bano
 
Tango Protocol's Avatar
 
Join Date: July 18th, 2003
Status: Available
3,377 posts, 35 likes.
Rep Power: 0
Tango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love youTango Protocol - yes, we love you
Default Re: My work is being featured in IPB SDK

Thanks!

I'm just gonna get my name above the code in PHP comments, but.. good enough for me.

[CENTER]
[url="http://raptr.com/knippy?src=em_smforum"][img]http://raptr.com/badge/b69bb5ce84374c997d571b1dd95aa3ae/fss.png[/img][/url]

[URL="http://forums.filefront.com/member.php?u=108795"][COLOR=darkorange]Crazy Wolf[/COLOR][/URL] is a sexy beast.
[/center]
Tango Protocol is offline   Reply With Quote
Old July 22nd, 2006   #9
RogueDevil / Rogue Angel
 
DavetheFo's Avatar
 
Join Date: May 29th, 2003
Location: England
Status: Eating your bandwidth on a planet far away.
4,375 posts, 3 likes.
Rep Power: 32
DavetheFo is worthy of your admirationDavetheFo is worthy of your admirationDavetheFo is worthy of your admirationDavetheFo is worthy of your admirationDavetheFo is worthy of your admirationDavetheFo is worthy of your admirationDavetheFo is worthy of your admirationDavetheFo is worthy of your admiration
Default Re: My work is being featured in IPB SDK

Well Done Mr Knipp!

Thats some very nippy work there.








I'll go get my coat.

Stop looking at this bit
DavetheFo is offline   Reply With Quote
Old July 22nd, 2006   #10
Just Do It.
 
Join Date: January 11th, 2006
Location: Somewhere only we know
Status: Dead
956 posts, 0 likes.
Rep Power: 21
mentalmagic knows it's spelt 'colour'mentalmagic knows it's spelt 'colour'mentalmagic knows it's spelt 'colour'
Default Re: My work is being featured in IPB SDK

No idea what it means, but congrats all the same...


mentalmagic is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IPB 2.2 vs PHPBB 3 Snow_Flake Tech Discussion 5 March 21st, 2008 07:29 AM
SDK TOOLS won't work tbird700 F.E.A.R. Problems, Errors and Help 1 December 10th, 2005 09:10 AM
Plz Help Sdk Instal Dont Work Scorpion_Blood Soldier of Fortune 2 General Yib-Yab (Off Topic) 2 November 24th, 2002 06:49 AM


All times are GMT -7.







   
 





This site is part of the Defy Media Gaming network

The best serving of video game culture, since 2001. Whether you're looking for news, reviews, walkthroughs, or the biggest collection of PC gaming files on the planet, Game Front has you covered. We also make no illusions about gaming: it's supposed to be fun. Browse gaming galleries, humor lists, and honest, short-form reporting. Game on!

FileFront Forums - Terms of Service - Top
Theme Selection
Copyright © 2002-2016 Game Front. All rights reserved. Powered by vBulletin®
Copyright ©2000 - 2016, vBulletin Solutions, Inc.
Forum Theme by Danny King (FileTrekker), Sheepeep & Graeme(rs)
RSS Feed Widget by FeedWind