-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscmaker_change.php
55 lines (47 loc) · 1.44 KB
/
scmaker_change.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/*
$url = $_SERVER['REQUEST_URI'];
$parsed = parse_url($url);
$query = $parsed['query'];
parse_str($query, $params);
unset($params['page_number']);
$string = http_build_query($params);
$stuff = explode( '=', $string);
echo $stuff[1];
*/
$name;
$url;
if ( ! empty( $_POST['name'] && !empty($_POST['content']) ) ) {
$name = $scmaker->stringSafe($_POST['name']);
$content = $scmaker->stringSafe($_POST['content']);
$scmaker->add_Item($name, $content);
}
else if (!empty($_POST['delete']))
{
$scmaker->delete_Item($_POST['delete']);
}
else if (!empty($_POST['name_update']) && !empty($_POST['content_update']))
{
$name = $scmaker->stringSafe($_POST['name_update']);
$content = $scmaker->stringSafe($_POST['content_update']);
$scmaker->update_Item($_POST['update'], $name, $content);
}
?>
<div class="input-box">
<!-- <form method="post" action=""> -->
<h4>Update Shortcode</h4>
<label>Shortcode</label>
<input type="text" name="name_update" />
<label>Content</label>
<input type="text" name="content_update" />
<select id="selecttype" name="update" onchange="scmakerSelection()">
<option value="default">Default</option>
<?php $stuff = $scmaker->read_DB(); ?>
<?php foreach ($stuff as $row): ?>
<option value="<?php echo $row->id ?>"><?php echo $row->name ?></option>
<?php endforeach; ?>
</select>
</br>
<?php submit_button('Change shortcode') ?>
</form>
</div>