I want to have my site built in pieces...or modules...so i can write a module for the site, then upload it to the modules directory. in the admin panel, i want it to display allt he modules in that dir. next to them, i want to display links. they are: install, uninstall, activate, deactivate, delete
if the module is not installed (determined by if the there is any data int he database for that module), only install will be a link, the rest will be text. if it is installed, but not acticvated, uninstall and activate should be links and the rest text. if it is installed and activated, it uninstall and deactivate are the links, and the rest are text.
I was told to do this, i needed to put the entire dir list into and array and compare it to MySQL data (which determines if the module is installed and activated or not)
I am not sure how to do this, so if someone could help me, I would greatly appreciate it.
BTW: you can AIM/MSN me if you want for easier communication...im sorry if this post makes no sense...i have a hard time explaining stuff
Thanks,
Kevinif you have stuff in the db and you want to compare it to stuff you want ro run then you have to have another array huh?
make a new array
$something = array("install","uninstall"....);
you get the picture.
then compare them but doing a array_search() (<!-- m --><a class="postlink" href="http://us2.php.net/manual/en/function.array-search.php">http://us2.php.net/manual/en/function.array-search.php</a><!-- m -->)ok i dont mean to be a nuisance...but i really dont get how to do what i want...even with your example...it still is very confusing...maybe a short chunk of PHP...or a code sample? to get me in the right directiondid you look at the link I provided?
you need to query the db and get the info you want and run it in the array_search. if it is in there it wuill return true and if not it will return false.
if you write some code and you get sutck I will help you, but I will not write it.
$something = array(1=>"install",2=>"uninstall"....);
if($key = array_search ($row['data'],$something)){
// echo $row['data'] here if match
}
if the module is not installed (determined by if the there is any data int he database for that module), only install will be a link, the rest will be text. if it is installed, but not acticvated, uninstall and activate should be links and the rest text. if it is installed and activated, it uninstall and deactivate are the links, and the rest are text.
I was told to do this, i needed to put the entire dir list into and array and compare it to MySQL data (which determines if the module is installed and activated or not)
I am not sure how to do this, so if someone could help me, I would greatly appreciate it.
BTW: you can AIM/MSN me if you want for easier communication...im sorry if this post makes no sense...i have a hard time explaining stuff
Thanks,
Kevinif you have stuff in the db and you want to compare it to stuff you want ro run then you have to have another array huh?
make a new array
$something = array("install","uninstall"....);
you get the picture.
then compare them but doing a array_search() (<!-- m --><a class="postlink" href="http://us2.php.net/manual/en/function.array-search.php">http://us2.php.net/manual/en/function.array-search.php</a><!-- m -->)ok i dont mean to be a nuisance...but i really dont get how to do what i want...even with your example...it still is very confusing...maybe a short chunk of PHP...or a code sample? to get me in the right directiondid you look at the link I provided?
you need to query the db and get the info you want and run it in the array_search. if it is in there it wuill return true and if not it will return false.
if you write some code and you get sutck I will help you, but I will not write it.
$something = array(1=>"install",2=>"uninstall"....);
if($key = array_search ($row['data'],$something)){
// echo $row['data'] here if match
}