Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
phoenix-cms
Worker
Worker



Joined: Aug 05, 2005
Posts: 139

PostPosted: Fri Sep 23, 2005 5:17 pm Reply with quote

hi below is module code for admin and mods does anyone know how to make this do the same thing but like nukes admin/links
code becuase i have new admin auth functions but would like this to display in shorter not sure in admin to find module name i tried ".module." and $module and even $name is there anotherway to detect the module name like modules/modulename/admin/links.php

Code:
    // PHP-Nuke system Moderation System

    $handle=opendir('modules');
    $modlist = "";
    while ($file = readdir($handle)) {
   if ( (!ereg("[.]",$file)) ) {
   $modlist .= "$file ";
   }
    }
    closedir($handle);
    $modlist = explode(" ", $modlist);
    sort($modlist);
    for ($i=0; $i < sizeof($modlist); $i++) {
   if(!empty($modlist[$i])) {
   $row = $db->sql_fetchrow($db->sql_query("SELECT mid from " . $prefix . "_modules where title='$modlist[$i]'"));
   $mid = intval($row['mid']);
   if (empty($mid)) {
   $db->sql_query("insert into " . $prefix . "_modules values (NULL, '$modlist[$i]', '$modlist[$i]', '0', '0', '1', '0', '')");
   }
   }
    }
   $result = $db->sql_query("SELECT title, admins FROM ".$prefix."_modules ORDER BY title ASC");
   $row2 = $db->sql_fetchrow($db->sql_query("SELECT name FROM ".$prefix."_authors WHERE aid='$aid'"));
   while ($row = $db->sql_fetchrow($result)) {
   $admins = explode(",", $row['admins']);
   $auth_user = 0;
   for ($i=0; $i < sizeof($admins); $i++) {
   if ($row2['name'] == $admins[$i]) {
   $auth_user = 1;
   }
   }
   if ($radminsuper == 1 OR $auth_user == 1) {
   if (file_exists("modules/".$row['title']."/admin/index.php") AND file_exists("modules/".$row['title']."/admin/links.php") AND file_exists("modules/".$row['title']."/admin/case.php")) {
   include("modules/".$row['title']."/admin/links.php");
   }
   }
   }
    // PHP-Nuke system Moderation System


i would like it something nuke the old nuke 7.4 format but going via modules/$module_name/admin/links.php

Code:
// Old PHP-Nuke system

    $linksdir = dir("admin/links");
    while($func = $linksdir->read()) {
    if(substr($func, 0, 6) == "links.") {
    include($linksdir->path."/$func");
    }
    }
    closedir($linksdir->handle);
   // Old PHP-Nuke system


any idears
 
View user's profile Send private message Send e-mail
phoenix-cms







PostPosted: Fri Sep 23, 2005 5:29 pm Reply with quote

i tried this but cant get it to read the module folder

// PHP-Nuke system Moderation System
$moduledir = dir("modules/".$file."/admin");
while($func = $moduledir->read()) {
if(substr($func, 0, -3) == "links.php") {
include($moduledir->path."/$func");
}
}
if ( (!ereg("[.]",$file)) ) {
$modlist .= "$file ";
}
closedir($moduledir->handle);

what would you guys suggest

thanks

steve
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

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 ©