function openDirImages($image = false) { global $boardir, $adkportal, $txt, $smcFunc, $boardurl, $adkFolder; echo ' <table style="text-align: center; width: 100%;">'; echo ' <tr> <td colspan="5"> ' . $txt['adkblock_none'] . '<input type="radio" name="img" value=""', empty($image) ? ' checked="checked"' : '', ' /> </td> </tr> <tr> <td> </td> </tr> <tr>'; $icons = getIcons(); $i = 1; foreach ($icons as $icon) { if ($i == 6) { echo '</tr><tr>'; $i = 1; } echo ' <td> <img src="' . $adkFolder['images'] . '/blocks/' . $icon['icon'] . '" alt="" /><input type="radio" name="img" value="' . $icon['icon'] . '" ', !empty($image) && $image == $icon['icon'] ? ' checked="checked"' : '', ' /> </td>'; $i++; } echo ' </tr></table>'; }
if ($row['primaryType'] === 'Ranged Weapon' || $row['primaryType'] === 'Melee Weapon') { $sql = 'SELECT * FROM weapon WHERE name=:name'; $statement = $database->prepare($sql); $statement->bindParam(':name', htmlspecialchars($row['name'])); $statement->execute(); $extra_content = $statement->fetch(PDO::FETCH_ASSOC); foreach ($extra_content as $key => $value) { $row[$key] = $value; } } // exceptions $temp = createTableSection($row, $exceptions_to_accordian_content); $accordian_sections[] = createAccordionSection($row[$unique_id], $temp); } $accordian_input = createAccordion('accordion', 'accordion', $accordian_sections); $before_body_input .= getIcons(); $html_input .= $accordian_input; } catch (PDOException $e) { $html_input = '<p style="color:red">ERROR:' . $e . '</p>'; } echo <<<HTML_TEXT <!doctype html> <html> \t{$head_input} \t <body> \t{$before_body_input} \t<div id="extra"></div> \t<div id="status" class="note">{$status_input}</div> \t
function template_edit() { global $colors, $config; foreach ($_POST as $t => $v) { if (substr($t, 0, 4) == 'chk_') { $id = substr($t, 4); break; //only edit one at a time } } $result = mysql_query("select * from `gpsmap_templates` where templateID = " . $id); $template_item_data = mysql_fetch_array($result, MYSQL_BOTH); //get all icons in the icon folder $iconArray = getIcons(); include $config['include_path'] . '/top_header.php'; html_start_box('<strong>Template Edit</strong>', '50%', $colors['header'], '3', 'center', ''); echo '<tr><td><form action="gpstemplates.php" method="post" name="gpsform">'; print '<center><h3>Editing ' . $template_item_data['templateName'] . '</h3></center>'; /* display the template dropdown */ ?> <center><table> <tr> <td width='70' style='white-space:nowrap;'> <b>Host Template:</b> </td> <td style='width:1;'> <select name="hostid"> <?php echo "<option value='" . $template_item_data['templateID'] . "'>" . $template_item_data['templateName'] . "</option>"; ?> </select> </td> </tr> <tr> <td width='70' style='white-space:nowrap;'> <b>Up Image:</b> </td> <td style='width:1;'> <select name="upimage"> <?php echo "<option value='" . $template_item_data['upimage'] . "'>" . $template_item_data['upimage'] . "</option>"; foreach ($iconArray as $icon) { echo "<option value='" . $icon . "'>" . $icon . "</option>"; } ?> </select> </td> </tr> <tr> <td width='70' style='white-space:nowrap;'> <b>Recovering Image:</b> </td> <td style='width:1;'> <select name="recoverimage"> <?php echo "<option value='" . $template_item_data['recoverimage'] . "'>" . $template_item_data['recoverimage'] . "</option>"; foreach ($iconArray as $icon) { echo "<option value='" . $icon . "'>" . $icon . "</option>"; } ?> </select> </td> </tr> <tr> <td width='70' style='white-space:nowrap;'> <b>Down Image:</b> </td> <td style='width:1;'> <select name="downimage"> <?php echo "<option value='" . $template_item_data['downimage'] . "'>" . $template_item_data['downimage'] . "</option>"; foreach ($iconArray as $icon) { echo "<option value='" . $icon . "'>" . $icon . "</option>"; } ?> </select> </td> </tr> <tr> <td width='70' style='white-space:nowrap;'> <b>Device Type an Access Point</b> </td> <td style='width:1;'> <select name="AP"> <?php if ($template_item_data['AP'] == 1) { echo "<option value='1'>True</option>"; } else { echo "<option value='0'>False</option>"; } ?> <option value="0">False</option> <option value="1">True</option> </select> </td> </tr> <?php echo '<tr><td colspan=2><input type=hidden name="action" value="save"><br><center><input type=image src="../../images/button_save.gif" alt="Create"></center></td></tr>'; echo '<tr><td colspan=2><br><br><br></td></tr>'; echo '</table></form></td></tr>'; html_end_box(); }
function view_icons() { global $context, $txt, $smcFunc, $scripturl; checkSession('get'); $context['sub_template'] = 'view_icons'; $context['page_title'] = $txt['adkadmin_name'] . ': ' . $txt['adkadmin_icons']; $context['start'] = !empty($_REQUEST['start']) ? (int) $_REQUEST['start'] : 0; $limit = 10; $total = getTotal('adk_icons'); $context['load_icons'] = getIcons('', array(), 'id_icon ASC', $context['start'], $limit); $context['page_index'] = constructPageIndex($scripturl . '?action=admin;area=adkadmin;sa=manageicons;' . $context['session_var'] . '=' . $context['session_id'], $context['start'], $total, $limit); }
function getIcons($dir) { $dp = @opendir($dir); $allicons = array(); while ($icons = @readdir($dp)) { if ($icons != '.' && $icons != '..') { array_push($allicons, $icons); } } @closedir($dp); sort($allicons); return $allicons; } ## SECTIONS //Flaggen $flags = getIcons('../../../images/flaggen/'); for ($i = 0; $i < count($flags); $i++) { echo " option[value=" . preg_replace("#\\.gif|.jpg#Uis", "", $flags[$i]) . "]:before {"; echo " content: url(\"../../../images/flaggen/" . $flags[$i] . "\");"; echo "}"; } //Gameicons $games = getIcons('../../../images/gameicons/'); for ($i = 0; $i < count($games); $i++) { if (preg_match("=\\.gif|.jpg=Uis", $games[$i])) { echo "option[value=" . preg_replace("#\\.#", "\\.", $games[$i]) . "]:before {"; echo " content: url(\"../../../images/gameicons/" . $games[$i] . "\");"; echo "}"; } } ob_end_flush();