zigvt Posted February 6, 2011 Share Posted February 6, 2011 I have this software that lets user's use themes and so on. But one feature they didn't add into the peice of code is image display of the theme before the person chooses. I was hoping someone could help me figure out what bit of code I need to make it work. I know joomla has this feature but I don't care for joomla and I like this script alot more. All I can offer is the code where it displays the theme selector. PHP Part // HANDLE SUBMITTED DISPLAY SETTINGS // if (isset($_POST["SubmitDisplay"])) { myQ(" UPDATE `[x]users` SET `use_theme` = '{$_POST["theme"]}', WHERE `id`='".me('id')."' LIMIT 1 "); } /* Populate the site themes */ if ($handle = opendir("theme/")) { $themeInUse = (me("use_theme") != "" ? me("use_theme") : $CONF["DEFAULT_THEME"]); while (false !== ($file = readdir($handle))) { if ($file != "." and $file != ".." and $file != "templates" and is_dir("theme/".$file)) { $themesReplacementArray[] = array( "theme" => $file, "select" => ($file == $themeInUse ? "selected=\"selected\"" : ""), ); } } closedir($handle); } $tpl -> Loop("themes", $themesReplacementArray); HTML Part <form method="post"> <table width="100%" border="0" cellspacing="2" cellpadding="0"> <tr> <td><strong>Site style: </strong></td> <td width="10"> </td> <td> <select name="theme" id="theme"> <loop themes> <option value="{theme}" {select}>{theme}</option> </loop themes> </select> </td> </tr> <tr> <td colspan="3"><input name="SubmitDisplay" type="submit" class="submit" id="SubmitDisplay" value="Save" /></td> </tr> </table> </form> Thanks in advance. Quote Link to comment Share on other sites More sharing options...
zigvt Posted February 6, 2011 Author Share Posted February 6, 2011 No one can help? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 6, 2011 Share Posted February 6, 2011 i suggest that you look into the joomla code to see how it's done there, then use that as a basis for your own version. if it's already done in joomla, there may be no point in re-inventing the wheel. Quote Link to comment Share on other sites More sharing options...
zigvt Posted February 25, 2011 Author Share Posted February 25, 2011 Figured out thank you it was pretty simple. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.