PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
bloodgrinder
New Member
New Member


Joined: Oct 31, 2006
Posts: 7

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

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: 4620

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

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).
View user's profile Send private message
bloodgrinder
New Member
New Member


Joined: Oct 31, 2006
Posts: 7

PostPosted: Tue Nov 21, 2006 8:35 am Reply with quote Back to top

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
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 4620

PostPosted: Tue Nov 21, 2006 10:24 pm Reply with quote Back to top

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.
View user's profile Send private message
montego
Site Admin


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

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

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)

}
View user's profile Send private message Visit poster's website
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 4620

PostPosted: Fri Nov 24, 2006 10:03 pm Reply with quote Back to top

Is there another function that returns a user's groups?
View user's profile Send private message
redhairz
Worker
Worker


Joined: Nov 17, 2006
Posts: 216

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

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
Site Admin


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

PostPosted: Sun Nov 26, 2006 3:52 pm Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website
montego
Site Admin


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

PostPosted: Sun Nov 26, 2006 4:11 pm Reply with quote Back to top

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
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum