-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodify.php
More file actions
151 lines (131 loc) · 5.02 KB
/
Copy pathmodify.php
File metadata and controls
151 lines (131 loc) · 5.02 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
// include class.secure.php to protect this file and the whole CMS!
if (defined('WB_PATH')) {
include(WB_PATH.'/framework/class.secure.php');
} else {
$oneback = "../";
$root = $oneback;
$level = 1;
while (($level < 10) && (!file_exists($root.'/framework/class.secure.php'))) {
$root .= $oneback;
$level += 1;
}
if (file_exists($root.'/framework/class.secure.php')) {
include($root.'/framework/class.secure.php');
} else {
trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR);
}
}
// end include class.secure.php
$friendly = array('<', '>', '?php');
$raw = array('<', '>', '');
?>
<?php
$query_page_content = $database->query("SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '$page_id'");
$fetch_page_content = $query_page_content->fetchRow();
?>
<h2>View and Edit mp3 Audio Files</h2>
<?php
// include the button to edit the optional module CSS files (function added with WB 2.7)
// Note: CSS styles for the button are defined in backend.css (div class="mod_moduledirectory_edit_css")
// Remember to replace the string helloworld below with the module directory of your module
// Place this call outside of any <form></form> construct!!!
if(function_exists('edit_module_css')) {
edit_module_css('wpaudioplayer');
}
?>
<form name="edit" action="<?php echo WB_URL; ?>/modules/wpaudioplayer/add_mp3.php" method="post">
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
<?php
$query_wpaudioplayer = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_wpaudioplayer WHERE section_id = '".$section_id."'" );
if($query_wpaudioplayer -> numRows() > 0) {
$mp3_num = $query_wpaudioplayer -> numRows();
?>
<table>
<thead>
<tr>
<th>MP3 Audio Title</th>
<th>Visible</th>
<th>Autoplay</th>
<th>Download</th>
<th>Modify</th>
<th>Remove</th>
</tr>
</thead>
<tbody>
<?php
while($mp3 = $query_wpaudioplayer -> fetchRow()) {
?>
<tr>
<td>
<a href="<?php echo WB_URL; ?>/modules/wpaudioplayer/modify_mp3.php?page_id=<?php echo $page_id; ?>§ion_id=<?php echo $section_id; ?>&mp3_id=<?php echo $mp3['mp3_id']; ?>" title="Edit">
<?php echo (($mp3['mp3_title'] != "") ? stripslashes($mp3['mp3_title']) : stripslashes($mp3['mp3_file'])); ?>
</a>
</td>
<td>
<?php
$icon = ($mp3['mp3_visible'] == '1') ? 'ok' : 'minus';
echo '<img src="'.THEME_URL.'/images/'.$icon.'_16.png" alt="'.$icon.'" />';
?>
</td>
<td>
<?php
$icon = ($mp3['mp3_autoplay'] == '1') ? 'ok' : 'minus';
echo '<img src="'.THEME_URL.'/images/'.$icon.'_16.png" alt="'.$icon.'" />';
?>
</td>
<td>
<?php
$icon = ($mp3['mp3_download'] == '1') ? 'ok' : 'minus';
echo '<img src="'.THEME_URL.'/images/'.$icon.'_16.png" alt="'.$icon.'" />';
?>
</td>
<td>
<a href="<?php echo WB_URL; ?>/modules/wpaudioplayer/modify_mp3.php?page_id=<?php echo $page_id; ?>§ion_id=<?php echo $section_id; ?>&mp3_id=<?php echo $mp3['mp3_id']; ?>" title="Edit">
<img src="<?php echo THEME_URL; ?>/images/modify_16.png" alt="Modify" />
</a>
</td>
<td>
<a href="<?php echo WB_URL; ?>/modules/wpaudioplayer/delete_mp3.php?page_id=<?php echo $page_id; ?>§ion_id=<?php echo $section_id; ?>&mp3_id=<?php echo $mp3['mp3_id']; ?>&delete=0" title="Remove">
<img src="<?php echo THEME_URL; ?>/images/delete_16.png" alt="Delete" />
</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} else {
echo "<p>No Audio Found</p>";
}
?>
<div class="buttonrow">
<button name="save" type="submit">Add MP3 Audio File</button>
<button name="cancel" onclick="javascript: window.location = '<?php echo ADMIN_URL; ?>/pages/index.php'; return false;">
<?php echo $TEXT['CANCEL']; ?>
</button>
</div>
</form>
<?php
if($query_wpaudioplayer -> numRows() > 0) {
$query_wpaudioplayer_tracking = $database->query("SELECT tracking_goal_id FROM ".TABLE_PREFIX."mod_wpaudioplayer_tracking WHERE section_id = '".$section_id."'" );
$tracking = $query_wpaudioplayer_tracking -> fetchRow();
?>
<form name="tracking" action="<?php echo WB_URL; ?>/modules/wpaudioplayer/save_tracking.php" method="post">
<input type="hidden" name="page_id" value="<?php echo $page_id; ?>" />
<input type="hidden" name="section_id" value="<?php echo $section_id; ?>" />
<label for="tracking_goal_id">Enter optional Piwik goal ID for tracking player events:</label>
<input type="text" name="tracking_goal_id" value="<?php echo $tracking['tracking_goal_id']; ?>" maxlength="10" />
<div class="buttonrow">
<button type="submit">Change Tracking Goal ID</button>
<button type="button" onclick="javascript: window.location = '<?php echo ADMIN_URL; ?>/pages/index.php'; return false;">
<?php echo $TEXT['CANCEL']; ?>
</button>
</div>
</form>
<?php
} //if($query_wpaudioplayer -> numRows() > 0) {
?>