Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (class_exists("BryansAdminOptions")) {
- $wsmAdminSettings = new BryansAdminOptions();
- }
- global $post;
- $custom = get_post_custom($post->ID);
- $contentdownloads = $custom["wsm-content-downloads"];
- ?>
- <div id="downloads-options">
- <div id="contentdownloads" style="width:98%;float:left;">
- <?php
- if ($contentdownloads) {
- $i = 0;
- wsm_log_debug('We\'ve found content downloads for this post, setting the value of $i to 0 to start the loop...',true,false);
- wsm_log_debug_array($contentdownloads,true);
- foreach ($contentdownloads as $element) {
- wsm_log_debug('Begin foreach loop for meta box downloads output: $i ='.$i,true,false);
- if ($i ==3){
- wsm_log_debug('variable $i equals 3, resetting $i to 0...',true,false);
- $i=0;
- wsm_log_debug('variable $i now equals '.$i,true,false);
- }else{
- wsm_log_debug('variable $i is not equal to 3 yet, so not resetting value to 0. $i = '.$i,true,false);
- }
- $i++;
- wsm_log_debug('Incremented value of $i which now equals '.$i,true,false);
- $select_pdf = null;
- $select_video = null;
- $select_zip = null;
- $select_resource = null;
- $select_spread = null;
- $select_other = null;
- if ($element == "PDF"){
- $select_pdf = 'selected="selected"';
- wsm_log_debug('$element == PDF, setting value of $select_pdf to '.$select_pdf,true,false);
- }
- if ($element == "Video"){
- $select_video = 'selected="selected"';
- wsm_log_debug('$element == Video, setting value of $select_video to '.$select_video,true,false);
- }
- if ($element == "Zip File"){
- $select_zip = 'selected="selected"';
- wsm_log_debug('$element == Zip File, setting value of $select_zip to '.$select_zip,true,false);
- }
- if ($element == "Resource Link"){
- $select_resource = 'selected="selected"';
- wsm_log_debug('$element == Resource Link, setting value of $select_resource to '.$select_resource,true,false);
- }
- if ($element == "Spreadsheet"){
- $select_spread = 'selected="selected"';
- wsm_log_debug('$element == Spreadsheet, setting value of $select_spread to '.$select_spread,true,false);
- }
- if ($element == "Other"){
- $select_other = 'selected="selected"';
- wsm_log_debug('$element == Other, setting value of $select_other to '.$select_other,true,false);
- }
- $flag=0;
- if (($i % 1)==0)
- $flag=1;
- if (($i % 2)==0)
- $flag=2;
- if (($i % 3)==0)
- $flag=3;
- if ($flag==1){
- echo "<p><input style=\"width:25%;\" name=\"wsm-content-downloads[]\" value=\"$element\" />";
- wsm_log_debug('$flag=1 outputting first input with the value of '.$element,true,true);
- }
- elseif ($flag==2){
- echo " <input style=\"width:39%;\" name=\"wsm-content-downloads[]\" value=\"$element\" />";
- wsm_log_debug('$flag=2 outputting second input with the value of '.$element,true,true);
- }elseif ($flag==3) {
- echo "
- <select name=\"wsm-content-downloads[]\" class=\"inputSelect\" style=\"margin-right:5px;width:120px;\">
- <option value=\"\">-Remove-</option>
- <option $select_pdf value=\"PDF\">PDF</option>
- <option $select_video value=\"Video\">Video</option>
- <option $select_zip value=\"Zip File\">Zip File</option>
- <option $select_resource value=\"Resource Link\">Resource Link</option>
- <option $select_spread value=\"Spreadsheet\">Spreadsheet</option>
- <option $select_other value=\"Other\">Other</option>
- </select> <a href=\"#zipidey\" class=\"delete_this_download\">[delete]</a></p>";
- wsm_log_debug('$flag=3 outputting third input (download type select list) with the value of '.$element,true,true);
- }
- }
- }
- ?>
- </div>
- </div>
- <div style="clear:both;">
- <a style="text-decoration:none;" href="#zipidey" id="append">[+] Add Download</a>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement