Author |
Message |
Darrell3831
Worker


Joined: Feb 18, 2004
Posts: 244
|
Posted:
Fri May 27, 2005 7:37 pm |
|
Are there any tutorials for creating modules with administrative counter parts for Nuke 7.5 written yet?
If so, where?
Thanks,
Darrell |
_________________ http://www.psy-center.com |
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Fri May 27, 2005 11:52 pm |
|
7.5? The Nuke Manual and Idiot's guide cover that release because it's the same as the 6.5-7.5. |
|
|
|
 |
Darrell3831

|
Posted:
Sat May 28, 2005 8:35 am |
|
I've never seen the idiots guide. Where might I find that?
I looked thru the nuke manual here on this site for about an hour yesterday trying to find out how to write modules for the new admin section in 7.5, but I did'nt see a peep about the new archietech.
I wish the manual had a search feature built into it.
I'm looking at a couple other modules that are set up for 7.5 and I don't see what I'm missing.
I have moved the admin stuff into the modules directory, and I've changed the links and case file to reflect these changes, and I've moved the admin graphic out of the sub-directory I used to keep it in because the code in 7.5 dosent allow for that any more..
They are now in /images/admin like everybody else does...
Although in my opinion that destroys the modular design/idea of having admin moved in the same subdirectory as the public aspect of the same module. /modules/modulename/*.*
But I can't get the admin section to auto-recognize my module.
It is not putting the icon in the admin list, and it is not recognizing the public side of the module in the main menu.
It's not automatically adding an entry for the script into the nuke_modules table either.
My module ran in 7.4, and it ran in 7.5 too before I started editing it... The only thing is that the module was in the top list instead of the bottom list of the new admin section.
I want to move it into the bottom list so that it is auto-recognized by admin.php, and so that edit admins allows you to grant or restrict access to my module.
I see that the guy that wrote the shout box on my site has his module designed to auto recognize and offer a check box in edit admins. I just want to emulate this same feature.
So... I'd like to see a tutorial for creating modules if you know of one designed with the changes of 7.5 included, because in comparision to the shout box authors code, I don't see what I'm missing.
Thank you! |
|
|
|
 |
Raven

|
Posted:
Sat May 28, 2005 8:47 am |
|
My mistake 7.5 is where the admin changed location. I was thinking it was 7.6. Did you remember to remove the old case, links, and modules entry from the root admin folder? |
|
|
|
 |
Darrell3831

|
Posted:
Sat May 28, 2005 9:57 am |
|
Yes Sir,
I did remove my old stuff from the /admin area...
I did a upgrade recently. For that to work properly I had to remove the old stuff from the standard admin modules that come with nuke 7.4.
When my 7.4 was upgraded to 7.5 at first there were double entries in admin for the standard admin modules.
At that time my module was working, just in the top box instead of the bottom box. I'd prefer it to be in the bottom box.
I'm using the shout box code I have as a kind of tutorial. I like the way this person wrote his code. Sensitive administartive features are accessed thru his icon in the top box that only superadmins can see. Less sensitive administrative features are accessed thru the icon in the bottom admin box which you can assign to your individual admins/editors.
I think this new aspect of 7.5 is designed to allow the addition of editors to each individual module, right?
If this is what I think it is, it's great to be able to automatically recognize new modules, and add admins to it. It alleviates a lot of manual coding with each admin module you add, edit, remove or upgrade.
Auto-recognition of new modules is a great feature. I'm excited to finally have it. I just need to know how to write scripts for it.. lol
Also having all the code for one module in one location is an excellent idea. It's long overdue for that as well.
It's a shame that admin icons are outside the module directory structure though. It's one last little nagging feature that needs to be corrected before we have totally self contained, auto-recognizing, modules.
Default admin icons should be in the module directory, not the root images directory.
The only problem with this now is the check in admin.php that also looks for corresponding images in each individual theme.
From admin.php
Code: function adminmenu($url, $title, $image) {
global $counter, $admingraphic, $Default_Theme;
$ThemeSel = get_theme();
if (file_exists("themes/$ThemeSel/images/admin/$image")) {
$image = "themes/$ThemeSel/images/admin/$image";
} else {
$image = "images/admin/$image";
}
|
Because of the way this is written when a developer creates his links.php and writes the call to adminmenu() he cannot include a file path to the image.
From /modules/anymodule/admin/links.php
Code:adminmenu("".$admin_file.".php?op=randomtarotmodule", "Random Tarot", "randomtarot.gif");
|
It would be great to include a complete path to randomtarot.gif, but you can't...
If adminmenu() were restructured slightly then designers could put their admin icons inside the modules directory.
Distribution, upgrades, removals, and installs would be much simplier...
One location to add a module, one location to remove a module. Not pieces all over the place..
Despite the admin icon issue, I think this is a great step forward in the development of Nuke!
I'm excited to learn how to incorporate it into my modest little modules.
I searched google for a 7.5 tutorial, but I don't see one anywhere.
I guess I'm missing something simple, but I don't see it yet. I'll keep looking.
Thanks,
Darrell |
|
|
|
 |
BobMarion
Former Admin in Good Standing

Joined: Oct 30, 2002
Posts: 1037
Location: RedNeck Land (known as Kentucky)
|
Posted:
Sat May 28, 2005 10:22 am |
|
For you to have two sets of admin features, 1 for supers and 1 for assigniees, you will have to have two sets of admin files:
admin/* --> supers
modules/modname/admin/* --> assigniees
To allow the admin image to be in your modules directory structure you would have to add a field to the adminmenu and do some recoding in the admin.php to accept the new field. The new field would be a True/False settign to trigger full link or image name as it is now.
The admin system in 7.5 is a copy of the admin system that was designed for NSN-Nuke.
A good way to see the differences between say 7.4 admin scripting and 7.5 admin scripting would be to download modules that have seperate but equal versions for PHP-Nukes 7.1 thru 7.4 and 7.5 - 7.7 . NSN Modules are just such modules NSN Mailing List is a small module that would be fairly easy to learn the differences from. To be completely honest there isn't much difference between 7.4 and 7.5 admins. |
_________________ Bob Marion
Codito Ergo Sum
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Darrell3831

|
Posted:
Sat May 28, 2005 10:44 am |
|
Thanks Bob,
I understand what you mean about recoding admin.php. It's not really something I want to do at this time. I'd like to see it in future releases of nuke though.
We're so close to autonomous modules.. (isolated/self containted/auto recognizing) I just believe that is something the community should want.
It's easier for developers and site owners.
I also understand about needing two seperate sets of code to support seperate sets of administrative functions and editor functions.
Unfortunately, I can't find what I'm doing wrong. I can't get my installation to even recognize stuff I add in the modules directory. Something might be broken that I don't know about.
When I add a module the field is not being put into the modules directory.. I'm stumped, but still looking.
thanks,
Darrell |
|
|
|
 |
Darrell3831

|
Posted:
Sat May 28, 2005 8:54 pm |
|
This problem isent simply me not understanding how to create modules.
Finally after a day of trying to get my own to work I removed another module that was working and tried to reinstall it.
This is a very simple module with no databases or anything.
My nuke 7.5 won't recognize it. I just upgraded a couple days ago from nuke 7.4. 7.4 was working for me.
Are their any known issues with nuke 7.5 not recognizing modules??
The Graphicadmin() function in admin.php has changed significantly from 7.4 to 7.5. This seems to be the new code that recognizes modules. Does anyone see anything wrong with it??
Code: closedir($handle);
$modlist = explode(" ", $modlist);
sort($modlist);
for ($i=0; $i < sizeof($modlist); $i++) {
if($modlist[$i] != "") {
$row = $db->sql_fetchrow($db->sql_query("SELECT mid from " . $prefix . "_modules where title='$modlist[$i]'"));
$mid = intval($row['mid']);
if ($mid == "") {
$db->sql_query("insert into " . $prefix . "_modules values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '1', '0', '')");
}
}
}
|
When I remove a module it's corresponding entry in nuke_modules is removed. However it never recognizes them when I put them back.
Thanks,
Darrell |
|
|
|
 |
Guardian2003
Site Admin

Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam
|
Posted:
Sun May 29, 2005 9:33 pm |
|
Have you installed any new modules recently that made changes to the core nuke database?
There have been issues with some modules changing the core nuke database fields and then of course when you remove the module it causes a problem because there is a mis-match between the number of fields in the database and the and the number of fields to which data is being written.
A quick forum search for 'modules not updating' should find a few threads on this. |
|
|
|
 |
Darrell3831

|
Posted:
Sun May 29, 2005 11:06 pm |
|
The only module that I know of that I used to have which would cause this kind of problem is Event Calendar. That has been uninstalled several months now and things were working properly before the upgrade from 7.4 to 7.5.
I went and checked anyway, the record that Event Calendar ads to nuke_authors is not in the database now. I had removed it already.
Code:ALTER TABLE `nuke_authors` ADD `radminCalendarAdmin` TINYINT(2) NOT NULL AFTER `radminency`;
|
The core files of my Nuke installation should not possibly contain old calendar code, because I over wrote my 7.4 with version 7.5, then I overwrote 7.5 with chatserv's 3.0 patch for 7.5. Then I edited my config, reinstalled GT and Sentinel.
I appreciate the idea though. Do you have any others?
Thanks,
Darrell |
|
|
|
 |
Darrell3831

|
Posted:
Mon May 30, 2005 9:29 am |
|
I found something!!
I started comparing the .sql files from nuke 7.5 to my actual database and I found a discrepency.
I have this in my 7.5 database:
Code:#
# Table structure for table `nuke_modules`
#
CREATE TABLE `nuke_modules` (
`mid` int(10) NOT NULL auto_increment,
`title` varchar(255) NOT NULL default '',
`custom_title` varchar(255) NOT NULL default '',
`active` int(1) NOT NULL default '0',
`view` int(1) NOT NULL default '0',
`inmenu` tinyint(1) NOT NULL default '1',
`url` varchar(255) default NULL,
`mod_group` int(10) default '0',
`admins` varchar(255) NOT NULL default '',
PRIMARY KEY (`mid`),
KEY `mid` (`mid`),
KEY `title` (`title`),
KEY `custom_title` (`custom_title`)
) TYPE=MyISAM AUTO_INCREMENT=82 ;
|
and this is what the Nuke 7.5 .sql tries to create:
Code:#
# Estructura de tabla para la tabla `nuke_modules`
#
CREATE TABLE nuke_modules (
mid int(10) NOT NULL auto_increment,
title varchar(255) NOT NULL default '',
custom_title varchar(255) NOT NULL default '',
active int(1) NOT NULL default '0',
view int(1) NOT NULL default '0',
inmenu tinyint(1) NOT NULL default '1',
mod_group int(10) default '0',
admins varchar(255) NOT NULL default '',
PRIMARY KEY (mid),
KEY mid (mid),
KEY title (title),
KEY custom_title (custom_title)
) TYPE=MyISAM;
|
I did not run the 7.5 sql, only the 7.4 -> 7.5 upgrade.
My database currently contains this:
Code: `url` varchar(255) default NULL,
|
Which is presumably not supposed to be in 7.5. I don't recognze it from any module I might have added... Although it may very well be.
Does anyone recognize it?
What do you suggest I do to fix it?
Thanks,
Darrell |
|
|
|
 |
Guardian2003

|
Posted:
Mon May 30, 2005 4:30 pm |
|
It rings bell somewhere in the back of my head - I think this was related to a forum mod but I just cannot quite put my finger on it. |
|
|
|
 |
Darrell3831

|
Posted:
Mon May 30, 2005 5:05 pm |
|
Resolved
I hope...
I backed up the table and deleted the url column/fields. Instantly almost everything began to work with respect to auto recognizing new modules... Turns out I was writing code properly from the start.. *sigh*
My Sommarie main menu had to be edited slightly though. If anyone needs this edit let me know...
I have not seen any ill effects from removing this field from nuke_modules. I do not know how it got there, or what it was originally for..
It appeared in my database somewhere between Nuke 6.9 and 7.4.
(Yeah, I archive backups to CD that far back.. lol)
Thanks. |
|
|
|
 |
|