Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> WYSIWYG - Raven's RavenNuke(tm) v2.x Distro
Author Message
bloodgrinder
New Member
New Member


Joined: Oct 31, 2006
Posts: 7

PostPosted: Mon Nov 20, 2006 3:41 pm Reply with quote

Apologies if this has been anwered b4 , I have tried to read all posts here.

Not being a programmer by trade, but being able to understand the logic, I want to ask if there is any way I could modify the fckconfig.js and the index.php of the submit_news module to call a different Fck Toobar with differnt nsngroups.

I have succesfully moddified the "Nuke User" set being called , but this then allows all registered users to have that toolbar.

What i need to be able to do , is only allow a few trusted people access to an extended toolbar (but not admin access) , whilst leaving the other registered users the default Nuke user bar.

Thanks in advance
 
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Mon Nov 20, 2006 5:14 pm Reply with quote

Actually, this is the first I've seen this request. Very interesting...

You could have to set up the tool bar configurations in fckconfig.js. You could do this for each group (i.e. the tool bar matches the group name). Then, you could modify the modules/submit_news/index.php to pass in the group name instead of NukeUser, etc. You would have to account for those who submit news and do not belong to a group (you could default to the current toolbar).

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
bloodgrinder
PostPosted: Tue Nov 21, 2006 8:35 am Reply with quote

Im begginning to really get down to the nitty gritty of this but my limited syntax and command knowledge is letting me down, and I could be way off in my assumptions, but am enjoying learning all the same. I aplogise if everything below is way off.

I have created a New Nsn group called WebEditor and a new toolbarset with the same name in the .js file. I can now happily call this new toolbar by manually replacing "NukeUsers" with "WebEditior in the following line of the indx.php

wysiwyg_textarea("story", "", "NukeUser", "50", "50")

Now I presume i need to create a function that returns the group name a user belongs to ie WebEditor, which then can be substituted for the NukeUser value above.

As i say I understand the logic, ie in the index.php file , create a function that returns the usergroup name, define a variable that is the result of this function, and then substitute this variable in the line above. but as i say my programming knowledge is still very limited.

Any further help would be greatly appreciated.

Thanks in advance
 
kguske
PostPosted: Tue Nov 21, 2006 10:24 pm Reply with quote

I'm pretty sure there is already a function that determines the current user's NSN Group - you might check one of the NSN Groups-aware modules (e.g. NSN Group Downloads) to see how it's used.
 
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9456
Location: Arizona

PostPosted: Fri Nov 24, 2006 9:19 am Reply with quote

I use it in the HTML Newsletter and it is quite easy to use. Make sure the $groups variable contains a dash-separated list of group ids (gid). For example, if I want to check to see that the logged in user is in groups 1,3 and 4, I would make sure $groups = '1-3-4'. Then, this test here will test for the existence of that user in one or more of those groups:

if (in_groups($groups)) { //user is in the group(s)

}

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
kguske
PostPosted: Fri Nov 24, 2006 10:03 pm Reply with quote

Is there another function that returns a user's groups?
 
redhairz
Worker
Worker


Joined: Nov 17, 2006
Posts: 222

PostPosted: Sun Nov 26, 2006 2:16 pm Reply with quote

mayi ask? how do u allow script like adsense script to post in the FCK member area.?
 
View user's profile Send private message
montego
PostPosted: Sun Nov 26, 2006 3:52 pm Reply with quote

redhairz wrote:
mayi ask? how do u allow script like adsense script to post in the FCK member area.?


Please do NOT cross-post. Smack

Thank you.
 
montego
PostPosted: Sun Nov 26, 2006 4:11 pm Reply with quote

kguske/bloodgrinder, I cannot find a function within NSN Groups' functions PHP script, so wrote this (NOT tested):

Code:


//This function will return a user's NSN Group id's in a string
//each group id is separated by a "dash".
function user_nsngroups() {
    global $prefix, $db, $user, $cookie;
    $user_groups = '';
    if (is_user($user)) {
        cookiedecode($user);
        $guid = $cookie[0];
        $currdate = time();
        $results = $db->sql_query("SELECT `gid` FROM `".$prefix."_nsngr_users` WHERE `uid`='$guid' AND (`edate`>'$currdate' OR `edate`='0')");
        while(list($gid) = $db->sql_fetchrow($results)) {
            if ($user_groups != '') $user_groups .= '-';
            $user_groups .= intval($gid);
        }
    }
    return $user_groups;
}


As the comments imply, it will return the user's groups in a string with each group id separated with a dash "-". This is a common way in which NSN Groups stores a list of NSN group id's. You could then simply inspect that string for the group you are interested in.

Regards,
montego

P.S. Remember that I said that this is untested! Laughing
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> WYSIWYG - Raven's RavenNuke(tm) v2.x Distro

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©