View Single Post
  #4 (permalink)  
Old 07-25-2006, 07:52 PM
John's Avatar   
John John is online now
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,569
Last Blog:
Tidy up your HTML
Credits: 0
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

well after a few hours of deep thought i got it, thank you for pushing me in the right direction

Finished Code:
PHP Code:
include("config.php");
// Create array here

echo "<select name='t_title'>";
$themelist = array();
$dir "../demo/themes/";
if (
is_dir($dir)) {
   if (
$dh opendir($dir)) {
       while ((
$file readdir($dh)) !== false) {
            if(
file_exists("../demo/themes/$file/theme.php")){

                 
array_push($themelist$file); // Add value to array

           
}
       }
       
closedir($dh);
   }
}
$dbThemeList = array();
$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))
{
     
array_push($dbThemeList$row['t_title']); // Add value to array
}
$newThemes array_filter($themelistcreate_function('$elt''return !in_array($elt,' var_export($dbThemeListtrue) . ');'));


for (
$i=0$i sizeof($themelist); $i++) {
if(
$newThemes[$i]!=""){

echo 
"<option value='" $newThemes[$i] . "' name='t_title'>" $newThemes[$i] . "</option>";
}
}
echo 
"</select>"
Reply With Quote