Plugin Directory

Changeset 939277


Ignore:
Timestamp:
06/26/2014 07:52:28 PM (12 years ago)
Author:
sanderonline
Message:

Great new functions

Location:
oypie/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • oypie/trunk/oypie.php

    r935282 r939277  
    44Plugin URI: http://sanderonlinemedia.nl/oypie;
    55Description: 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.9
     6Version: 0.10
    77Author: SanderOnline Media / Sander Dijkstra
    88Author URI: http://sander-dijkstra.nl/
     
    1212include("shortcode.php");
    1313
     14// Add OYPO
     15
     16
    1417// Add options page
    15 add_action('admin_menu', 'oypie_menu');
     18//add_action('admin_menu', 'oypie_home');
     19add_action( 'admin_menu', 'oypie_menu' );
     20
     21
    1622
    1723wp_enqueue_script('jquery');
    1824
    1925function 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' );
    2131}
    2232
    2333
    24 function oypie_settings_page() {
    25 ?>
     34// Admin Pages
     35   
     36function oypie_price_page() {
     37    require_once("price_page.php");
     38    }
     39   
     40function oypie_help_page() {
     41    require_once("help_page.php");
     42    }
    2643
    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
     44function oypie_album_page() {
     45    require_once("album_page.php");
    27846}?>
  • oypie/trunk/readme.txt

    r935282 r939277  
    17171. Installeer de plugin vanuit de plugindatabase.
    18182. Activeer de plugin.
    19 3. Maak uw shortcodes onder het menu Extra -> OYPie.
     193. Maak uw shortcodes onder het menu OYPie.
    2020
    2121== Frequently Asked Questions ==
     
    2323= Waar kan ik de shortcodes vinden? =
    2424
    25 De shortcode generator is te vinden onder Extra > OYPie.
     25De shortcode generator is te vinden onder OYPie.
    2626
    2727= Ik krijg een inlogpagina te zien in plaats van mijn album. =
     
    3131
    3232== Changelog ==
     33
     34= 0.10 =
     35Added new shortcode, shortcode generator and created a new menu.
    3336
    3437= 0.9 =
  • oypie/trunk/shortcode.php

    r935282 r939277  
    9090        ". $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']."
    9191        </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>
    9393        <div id=\"pixxer_iframe\"></div>";
    9494       
     
    9797
    9898
     99function 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\">
     113var profileid='".$id."';
     114var showtype=".$type.";
     115var 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";
    99121
     122}else{
    100123
    101 add_shortcode('oypo', 'oypo_output');?>
     124   
     125   $output = "
     126   <script type=\"text/javascript\">
     127var profileid='".$id."';
     128var showtype=".$type.";
     129var 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
     139add_shortcode('oypo', 'oypo_output');
     140add_shortcode('oypo_price', 'oypo_price');
     141
     142?>
Note: See TracChangeset for help on using the changeset viewer.