function mytheme_admin() { global $themename, $shortname, $options; $i = 0; if ($_REQUEST['saved']) { echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' 主题设置已保存</strong></p></div>'; } if ($_REQUEST['reset']) { echo '<div id="message" class="updated fade"><p><strong>' . $themename . ' 主题已重新设置</strong></p></div>'; } ?> <div class="wrap rm_wrap"> <h2><?php echo $themename; ?> 主题选项</h2> <p>当前主题: <?php echo $themename; ?> 定制版 | 设计者:<a href="http://Web.Menzil.Cn" target="_blank">Menzil Team</a> | <a href="http://Web.Menzil.Cn" target="_blank">查看更新</a> | <a href="http://Web.Menzil.Cn" target="_blank">常见问题</a></p> <div class="rm_opts"> <form method="post"> <?php foreach ($options as $value) { switch ($value['type']) { case "open": ?> <?php break; case "close": ?> </div> </div> <?php break; case "title": break; case 'text': ?> <div class="rm_input rm_text"> <label for="<?php echo $value['id']; ?> "><?php echo $value['name']; ?> </label> <input name="<?php echo $value['id']; ?> " id="<?php echo $value['id']; ?> " size="25" type="<?php echo $value['type']; ?> " value="<?php if (get_settings($value['id']) != "") { echo stripslashes(get_settings($value['id'])); } else { echo $value['std']; } ?> " /> <small><?php echo $value['desc']; ?> </small> <small><?php echo $value['section']; ?> </small> <div class="clearfix"></div> </div> <?php break; case 'textarea': ?> <div class="rm_input rm_textarea"> <label for="<?php echo $value['id']; ?> "><?php echo $value['name']; ?> </label> <textarea name="<?php echo $value['id']; ?> " type="<?php echo $value['type']; ?> " style = "width:100%"><?php if (get_settings($value['id']) != "") { echo stripslashes(get_settings($value['id'])); } else { echo $value['std']; } ?> </textarea> <small><?php echo $value['desc']; ?> </small> <small><?php echo $value['section']; ?> </small> <div class="clearfix"></div> </div> <?php break; case 'select': ?> <div class="rm_input rm_select"> <label for="<?php echo $value['id']; ?> "><?php echo $value['name']; ?> </label> <select name="<?php echo $value['id']; ?> " id="<?php echo $value['id']; ?> "> <?php foreach ($value['options'] as $key => $option) { ?> <option <?php if (get_settings($value['id']) == $option) { echo 'selected="selected"'; } ?> value="<?php echo $option; ?> "><?php echo $key; ?> </option> <?php } ?> </select> <small><?php echo $value['desc']; ?> </small> <small><?php echo $value['section']; ?> </small> <div class="clearfix"></div> </div> <?php break; case "checkbox": ?> <div class="rm_input rm_checkbox"> <label for="<?php echo $value['id']; ?> "><?php echo $value['name']; ?> </label> <?php if (get_option($value['id'])) { $checked = "checked=\"checked\""; } else { $checked = ""; } ?> <input type="checkbox" name="<?php echo $value['id']; ?> " id="<?php echo $value['id']; ?> " value="true" <?php echo $checked; ?> /> <small><?php echo $value['desc']; ?> </small> <small><?php echo $value['section']; ?> </small> <div class="clearfix"></div> </div> <?php break; case "section": $i++; ?> <div class="rm_section"> <div class="rm_title"> <h3><img src="<?php bloginfo('template_directory'); ?> /includes/options/clear.png" class="inactive" alt="""><?php echo $value['name']; ?> </h3> <span class="submit"><input type="submit" class="button-primary" name="save<?php echo $i; ?> " value="保存设置" /></span> <div class="clearfix"></div> </div> <div class="rm_options"> <?php break; } } function show_id() { global $wpdb; $request = "SELECT {$wpdb->terms}.term_id, name FROM {$wpdb->terms} "; $request .= " LEFT JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_id = {$wpdb->terms}.term_id "; $request .= " WHERE {$wpdb->term_taxonomy}.taxonomy = 'category' "; $request .= " ORDER BY term_id asc"; $categorys = $wpdb->get_results($request); foreach ($categorys as $category) { $output = '<ol>' . $category->name . " [<font color=#0196e3>" . $category->term_id . '</font>]</ol>'; echo $output; } } ?> <span class="show_id"> <h4>分类对应 ID</h4> <?php show_id(); ?> </span> <input type="hidden" name="action" value="save" /> </form> <form method="post"> <p class="submit"> <input type="submit" class="button-primary" name="reset" value="恢复默认设置" /> <input type="hidden" name="action" value="reset" /> 提示:此按钮将恢复到主题初始状态,您的所有设置将消失! </p> </form> </div> <?php }
?> </div> </div> <div style="height:40px;"><div class="success" id="message_box"></div></div> </td> <td ALIGN=CENTER > <div class="col-md-4 col-md-offset-4" id="map" style="margin-left:20%; width: 500px; height: 400px;"></div> </td></tr> </table> <div class="container" style="margin-top:50px"><table align="center"> <tr> <?php $ids = show_id($albumid); for ($i = 0; $i < $count; $i++) { $pic = '<td ALIGN=CENTER><div ondblClick="javascript:togglebucklist(' . $ids[$i] . ')" id="propic1"><img src="' . $path[$i] . '" alt"image" width=150 height=auto id="propic1" class="img-thumbnail"/></div>'; echo $pic; } ?> </tr> </table></div> <script type="text/javascript"> <?php $db = pg_connect("host=postgres.cise.ufl.edu port=5432 dbname=atheteodb user=jclewis password=2991Uf!1855") or die('connection failed'); $picture = pg_query($db, "select photoname, lat, lon from photo where albumid={$albumid}"); $row = 0; while ($pic = pg_fetch_assoc($picture)) {
if ($sku) { $command .= " -c " . escapeshellarg($sku); } if ($debug) { $command .= " --debug"; } $filename = str_replace(" ", "-", $title); $filename = preg_replace("/[^-a-zA-Z0-9]/", "", $filename); $filename = strtolower($filename) . ".pdf"; header("Content-Type: application/pdf"); header("Content-disposition: attachment; filename={$filename}"); passthru($command); } else { if ($_POST['store']) { store_in_db($db, $title, $subtitle, $url, $sku); $rowid = $db->lastInsertRowid(); show_id($rowid); } else { if ($_POST['update']) { update_in_db($db, $id, $title, $subtitle, $url, $sku); show_id($id); } else { if ($_POST['delete']) { delete_from_db($db, $id); show_id(-1); } else { show_id(-1); } } } }