Advertisement
Guest User

Untitled

a guest
May 20th, 2014
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.16 KB | None | 0 0
  1. ?php
  2.                              global $current_user;
  3.                             get_currentuserinfo();
  4.  
  5.  
  6.  
  7.                              if (get_field('visitors_allowed_to_add_content') && ( is_user_logged_in() ))
  8. {
  9.        echo '
  10.  
  11.                               <br><br><br><br><br><br><br><br>
  12.                               <p><h2>Add to Gallery</h2></P>
  13.                                <form  style="clear:both" id="file-form" enctype="multipart/form-data" action="'.$_SERVER['REQUEST_URI'].'" method="POST">
  14.                                  <p>Add image or mp3</p>
  15.                                  <p id="async-upload-wrap"><label for="async-upload">upload</label>
  16.                                  <input type="file" id="async-upload" name="async-upload"> <input type="submit" value="Upload" name="html-upload"></p>
  17.  
  18.                                  <p><input type="hidden" name="post_id" id="post_id" value="'.$post_id.'" />
  19.                                  '.wp_nonce_field('client-file-upload').'
  20.                                  <input type="hidden" name="redirect_to" value="'.$_SERVER['REQUEST_URI'].'" /></p>
  21.  
  22.                                  <p><input type="submit" value="Save all changes" name="save" style="display: none;"></p>
  23.                                </form>
  24.                                
  25.                                <form  style="clear:both" id="embed-form"  method="POST" enctype="multipart/form-data">
  26.                                  <p>Add video to gallery</p>
  27.                                  <p><label for="embed">YouTube / vimeo url:</label></p>
  28.                                  <p><textarea id="embed" name="embed"></textarea></p>
  29.                                  <p><input name="submit_video" type="submit" value="submit" onclick="MakeLinkSafe()" ><p>
  30.                                  <p>
  31.                                    <input type="hidden" name="post_id" id="post_id" value="'.$post_id.'" />
  32.                                  <input type="hidden" name="redirect_to" value="'.$_SERVER['REQUEST_URI'].'" /></p>
  33.                                </form>';
  34.                                 }
  35.                              elseif (is_user_logged_in() && $current_user->ID == $post->post_author)  {
  36.                             {
  37.                                echo 'br><br><br><br><br><br><br><br>
  38.                               <p><h2>Add to Gallery</h2></P>
  39.                                <form  style="clear:both" id="file-form" enctype="multipart/form-data" action="'.$_SERVER['REQUEST_URI'].'" method="POST">
  40.                                  <p>Add image or mp3</p>
  41.                                  <p id="async-upload-wrap"><label for="async-upload">upload</label>
  42.                                  <input type="file" id="async-upload" name="async-upload"> <input type="submit" value="Upload" name="html-upload"></p>
  43.  
  44.                                  <p><input type="hidden" name="post_id" id="post_id" value="'.$post_id.'" />
  45.                                  '.wp_nonce_field('client-file-upload').'
  46.                                  <input type="hidden" name="redirect_to" value="'.$_SERVER['REQUEST_URI'].'" /></p>
  47.  
  48.                                  <p><input type="submit" value="Save all changes" name="save" style="display: none;"></p>
  49.                                </form>
  50.                                
  51.                                <form  style="clear:both" id="embed-form"  method="POST" enctype="multipart/form-data">
  52.                                  <p>Add video to gallery</p>
  53.                                  <p><label for="embed">YouTube / vimeo url:</label></p>
  54.                                  <p><textarea id="embed" name="embed"></textarea></p>
  55.                                  <p><input name="submit_video" type="submit" value="submit" onclick="MakeLinkSafe()" ><p>
  56.                                  <p>
  57.                                    <input type="hidden" name="post_id" id="post_id" value="'.$post_id.'" />
  58.                                  <input type="hidden" name="redirect_to" value="'.$_SERVER['REQUEST_URI'].'" /></p>
  59.                                </form>';
  60.   }
  61.  
  62.                               ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement