Changeset 939277
- Timestamp:
- 06/26/2014 07:52:28 PM (12 years ago)
- Location:
- oypie/trunk
- Files:
-
- 3 edited
-
oypie.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
shortcode.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
oypie/trunk/oypie.php
r935282 r939277 4 4 Plugin URI: http://sanderonlinemedia.nl/oypie; 5 5 Description: This plugin is for photographers who use the service 'OYPO'. In this plugin you can generate shortcodes for your pages and posts. The shortcode generator can you find under 'Tools' > 'SanderOnline'. 6 Version: 0. 96 Version: 0.10 7 7 Author: SanderOnline Media / Sander Dijkstra 8 8 Author URI: http://sander-dijkstra.nl/ … … 12 12 include("shortcode.php"); 13 13 14 // Add OYPO 15 16 14 17 // Add options page 15 add_action('admin_menu', 'oypie_menu'); 18 //add_action('admin_menu', 'oypie_home'); 19 add_action( 'admin_menu', 'oypie_menu' ); 20 21 16 22 17 23 wp_enqueue_script('jquery'); 18 24 19 25 function oypie_menu() { 20 add_submenu_page('tools.php', 'OYPie', 'OYPie', 'manage_options', 'oypie', 'oypie_settings_page'); 26 add_menu_page("", "OYPie", 'oypie', "oypie", "oypie_home_page",'dashicons-camera', 76 ); 27 add_submenu_page("oypie", "OYPie - Album", "Albumgenerator", 0, "oypie_album", "oypie_album_page"); 28 add_submenu_page("oypie", "OYPie - Prijslijst", "Prijslijstgenerator", 0, "oypie_price", "oypie_price_page"); 29 add_submenu_page("oypie", "OYPie - Help", "Help", 0, "oypie_help", "oypie_help_page"); 30 remove_submenu_page( 'oypie', 'oypie' ); 21 31 } 22 32 23 33 24 function oypie_settings_page() { 25 ?> 34 // Admin Pages 35 36 function oypie_price_page() { 37 require_once("price_page.php"); 38 } 39 40 function oypie_help_page() { 41 require_once("help_page.php"); 42 } 26 43 27 <div class="wrap"> 28 <h2>OYPie Generator</h2> 29 <p>Maak hier uw shortcode voor uw OYPO Gallerij.</p> 30 31 <form id='theForm'> 32 <table> 33 <tr><td class="tabrow"><label>Layout</label></td><td> 34 <input type="radio" name="type" id="bt1" value="user" /> Mappenoverzicht<br /> 35 <input type="radio" name="type" id="bt2" value="map"/> Specifieke fotomap<br /> 36 <input type="radio" name="type" id="bt3" value="school"/> Inlogkaartje 37 </td></tr> 38 <tr id="one" style="display: none;"> 39 <td><label>Gebruikersnaam</label></td> 40 <td><input type="text" name="id" value=''/></td> 41 </tr> 42 <tr id="two" style="display: none;"> 43 <td><label>Map id</label></td> 44 <td><input type="text" name="id" value=''/></td> 45 </tr> 46 <tr id="three" style="display: none;"> 47 <td><label>Mapnavigatie</label></td> 48 <td><input type="checkbox" name="nonav" value="1"/>Inschakelen</td> 49 </tr> 50 <tr> 51 <td><label>Whitelabel verzending</label></td> 52 <td><input type="radio" name="wl_check" id="bt6"/> Ja<br /> 53 <input type="radio" name="wl_check" id="bt7" checked=""/> Nee</td> 54 </tr> 55 <tr id="wl_true" style="display: none;"> 56 <td><label>Whitelabel-id</label></td> 57 <td><input id="wl" type="text" name="wl" value=''/></td> 58 </tr> 59 <tr><td><label>Opmaak</label></td><td> 60 <input type="radio" id="bt4" name="style" value="user" checked=""/> Standaard<br /> 61 <input type="radio" id="bt5" name="style" value="map"/> Eigen css<br /> 62 </td></tr> 63 64 <tr id="css_true" style="display: none;"> 65 <td><label>Eigen css-link</label></td> 66 <td><input id="css" type="text" name="css" value=''/></td> 67 </tr> 68 <tr> 69 <td><label>Transparant</label></td> 70 <td><input type="checkbox" name="trans" value="1"/></td> 71 </tr> 72 73 <tr> 74 <td><label>Uw shortcode</label></td> 75 <td> <div class="well"> 76 [oypo <span id='typeDisplay'></span> 77 <span id='idDisplay'></span> 78 <span id='wlDisplay'></span> 79 <span id='nonavDisplay'></span> 80 <span id='cssDisplay'></span> 81 <span id='transDisplay'></span> 82 ] 83 </div></td> 84 </tr> 85 86 </table> 87 <?php echo file_get_contents('http://apps.sanderonlinemedia.nl/oypie-notices.php') ?> 88 89 <div id="css_no"></div> 90 <div id="wl_no"></div> 91 92 </form> 93 <style> 94 .tabrow { 95 width: 120px; 96 } 97 98 label { 99 font-weight: bold; 100 } 101 102 .well { 103 border: #ddd 1px solid; 104 background: #fff; 105 padding: 5px; 106 font-family: Courier New; 107 font-size: 14px; 108 } 109 110 .alert-message 111 { 112 background: #fff; 113 margin: 20px 0; 114 padding: 1px 1px 1px 5px; 115 border-left: 3px solid #eee; 116 } 117 .alert-message-info 118 { 119 border-color: #5bc0de; 120 } 121 .alert-message-info b { 122 color: #5bc0de; 123 } 124 .alert-message-danger 125 { 126 border-color: #d9534f; 127 } 128 .alert-message-danger b { 129 color: #d9534f; 130 } 131 .alert-message-warning 132 { 133 border-color: #f0ad4e; 134 } 135 .alert-message-warning b { 136 color: #f0ad4e; 137 } 138 </style> 139 140 141 <br style="clear: left;" /><br style="clear: left;" /> 142 <hr /> 143 <h2>Voorbeelden</h2> 144 <strong>Profiel</strong><br /> 145 <input type="text" name="mapid" id="mapid" style="width: 500px;" value='[oypo type="user" id="sanderonline"]'/><br /> 146 <strong>Album</strong><br /> 147 <input type="text" name="mapid" id="mapid" style="width: 500px;" value='[oypo type="map" id="DA3CB45464FF0C4A"]'/><br /> 148 <strong>Inlogkaartjes</strong><br /> 149 <input type="text" name="mapid" id="mapid" style="width: 500px;" value='[oypo type="school"]'/><br /> 150 <strong>Album met transparante achtergrond</strong><br /> 151 <input type="text" name="mapid" id="mapid" style="width: 500px;" value='[oypo type="map" id="DA3CB45464FF0C4A" trans="1"]'/><br /> 152 <strong>Album met whitelabel-verzending</strong><br /> 153 <input type="text" name="mapid" id="mapid" style="width: 500px;" value='[oypo type="map" id="DA3CB45464FF0C4A" wl="sanderonline"]'/><br /> 154 <strong>Album met eigen css-bestand</strong><br /> 155 <input type="text" name="mapid" id="mapid" style="width: 500px;" value='[oypo type="map" id="DA3CB45464FF0C4A" css="http://example.com/style.css"]'/><br /> 156 157 </div> 158 <script type='text/javascript'>//<![CDATA[ 159 window.onload=function(){ 160 function user(one, two, three) { 161 document.getElementById(one).style.display = 'table-row'; 162 document.getElementById(two).style.display = 'none'; 163 document.getElementById(three).style.display = 'none'; 164 } 165 function map(one, two, three) { 166 document.getElementById(one).style.display = 'none'; 167 document.getElementById(two).style.display = 'table-row'; 168 document.getElementById(three).style.display = 'table-row'; 169 } 170 171 function hidden(one, two, three) { 172 document.getElementById(one).style.display = 'none'; 173 document.getElementById(two).style.display = 'none'; 174 document.getElementById(three).style.display = 'none'; 175 } 176 177 function css(one, two) { 178 document.getElementById(one).style.display = 'table-row'; 179 document.getElementById(two).style.display = 'none'; 180 } 181 182 document.getElementById('bt1').addEventListener('click',function(e){ 183 user('one','two', 'three'); 184 }); 185 document.getElementById('bt2').addEventListener('click',function(e){ 186 map('one','two', 'three'); 187 }); 188 document.getElementById('bt3').addEventListener('click',function(e){ 189 hidden('two','one', 'three'); 190 }); 191 192 document.getElementById('bt4').addEventListener('click',function(e){ 193 css('css_no','css_true'); 194 $('#css').removeAttr('value'); 195 }); 196 document.getElementById('bt5').addEventListener('click',function(e){ 197 css('css_true','css_no'); 198 }); 199 200 document.getElementById('bt6').addEventListener('click',function(e){ 201 css('wl_true','wl_no'); 202 }); 203 204 document.getElementById('bt7').addEventListener('click',function(e){ 205 css('wl_no','wl_true'); 206 $('#wl').removeAttr('value'); 207 }); 208 209 }//]]> 210 </script> 211 212 <hr/> 213 214 215 <div id='watchingIndicator'></div> 216 <script> 217 218 jQuery(function($) { 219 var formTimer = 0, 220 currentField, 221 lastValue; 222 223 updateWatchingIndicator(); 224 $('#theForm :input') 225 .focus(startWatching) 226 .blur(stopWatching) 227 .keypress(updateCurrentField); 228 229 function startWatching() { 230 stopWatching(); 231 currentField = this; 232 lastValue = undefined; 233 formTimer = setInterval(updateCurrentField, 100); 234 updateWatchingIndicator(); 235 } 236 237 function stopWatching() { 238 if (formTimer != 0) { 239 clearInterval(formTimer); 240 formTimer = 0; 241 } 242 currentField = undefined; 243 lastValue = undefined; 244 updateWatchingIndicator(); 245 } 246 247 function isEmpty(str) { 248 return (!str || 0 === str.length); 249 } 250 251 function updateCurrentField() { 252 var thisValue; 253 254 if (currentField && currentField.name) { 255 thisValue = currentField.value || ""; 256 if (thisValue != lastValue && !isEmpty(thisValue)) { 257 lastValue = thisValue; 258 $('#' + currentField.name + 'Display').html(currentField.name+'="'+ thisValue +'"'); 259 } 260 } 261 } 262 263 function updateWatchingIndicator() { 264 var msg; 265 266 if (currentField) { 267 msg = "(Watching, field = " + currentField.name + ")"; 268 } 269 else { 270 msg = "(Not watching)"; 271 } 272 $('#watchingIndicator').html(msg); 273 } 274 275 }); 276 </script> 277 <?php 44 function oypie_album_page() { 45 require_once("album_page.php"); 278 46 }?> -
oypie/trunk/readme.txt
r935282 r939277 17 17 1. Installeer de plugin vanuit de plugindatabase. 18 18 2. Activeer de plugin. 19 3. Maak uw shortcodes onder het menu Extra ->OYPie.19 3. Maak uw shortcodes onder het menu OYPie. 20 20 21 21 == Frequently Asked Questions == … … 23 23 = Waar kan ik de shortcodes vinden? = 24 24 25 De shortcode generator is te vinden onder Extra >OYPie.25 De shortcode generator is te vinden onder OYPie. 26 26 27 27 = Ik krijg een inlogpagina te zien in plaats van mijn album. = … … 31 31 32 32 == Changelog == 33 34 = 0.10 = 35 Added new shortcode, shortcode generator and created a new menu. 33 36 34 37 = 0.9 = -
oypie/trunk/shortcode.php
r935282 r939277 90 90 ". $out_id.$out_trans.$out_wl.$out_nav.$out_css.$out_colors['1'].$out_colors['2'].$out_colors['3'].$out_colors['3'].$out_colors['5'].$out_colors['6']." 91 91 </script> 92 <script type=\"text/javascript\" src=\" ".plugins_url()."/oypie/js/1207a.js\"></script>92 <script type=\"text/javascript\" src=\"//www.oypo.nl/pixxer/api/templates/1207a.js\"></script> 93 93 <div id=\"pixxer_iframe\"></div>"; 94 94 … … 97 97 98 98 99 function oypo_price($atts) { 100 extract(shortcode_atts(array( 101 'id' => '', 102 'type' => '', 103 'price' => '', 104 'css' => '' 105 ), $atts)); 106 107 if($css == 1) { 108 function css_price() { 109 wp_enqueue_style('price', plugins_url('/css/price.css', __FILE__)); 110 } 111 add_action( 'wp_enqueue_scripts', 'css_price' ); 112 $output = "<script type=\"text/javascript\"> 113 var profileid='".$id."'; 114 var showtype=".$type."; 115 var prices=".$price."; 116 </script> 117 <script type=\"text/javascript\" src=\"//www.oypo.nl/pixxer/api/templates/productinfo.js\"></script> 118 <div id=\"pixxer_products\"></div> 119 <link rel='stylesheet' href='".plugins_url()."/css/price.css' type='text/css' media='all' /> 120 "; 99 121 122 }else{ 100 123 101 add_shortcode('oypo', 'oypo_output');?> 124 125 $output = " 126 <script type=\"text/javascript\"> 127 var profileid='".$id."'; 128 var showtype=".$type."; 129 var prices=".$price."; 130 </script> 131 <script type=\"text/javascript\" src=\"//www.oypo.nl/pixxer/api/templates/productinfo.js\"></script> 132 <div id=\"pixxer_products\"></div> 133 "; 134 } 135 return $output; 136 137 } 138 139 add_shortcode('oypo', 'oypo_output'); 140 add_shortcode('oypo_price', 'oypo_price'); 141 142 ?>
Note: See TracChangeset
for help on using the changeset viewer.