ok, well ive managed to build 2 little scripts, 1 that lists all the themes for a cms that are located in a certian directory, and another script that lists all the themes for a cms that have been added to a the database. however, what i want to do, is have a list that shows all the themes in the directory that have not been added to the database yet.
Lists all the themes in the themes folder:
PHP Code:
PHP Code:
$dir = "../themes/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(file_exists("../themes/$file/theme.php")){
$themelist .= "$file ";
}
}
closedir($dh);
}
}
$themelist = explode(" ", $themelist);
sort($themelist);
for ($i=0; $i < sizeof($themelist); $i++) {
if($themelist[$i]!=""){
echo $themelist[$i] . "<br>";
}
}
Lists all the themes that have been added to the database:
PHP Code:
PHP Code:
$q = "SELECT * FROM nuke_theme_preview";
$result = mysql_query($q) or die ('Something is wrong with query: ' . $q . '<br>'. mysql_error());
while ($row = mysql_fetch_assoc($result))
{
echo $row['t_title'] . "<br>";
}
What i want done is something that will list all the themes in the directory that are not in the database. I believe I have to use the IN ( ) MySQL construct, but i have no idea how to format the syntax. could someone give me a hand
Thank You.