Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ?php
- global $current_user;
- get_currentuserinfo();
- if (get_field('visitors_allowed_to_add_content') && ( is_user_logged_in() ))
- {
- echo '
- <br><br><br><br><br><br><br><br>
- <p><h2>Add to Gallery</h2></P>
- <form style="clear:both" id="file-form" enctype="multipart/form-data" action="'.$_SERVER['REQUEST_URI'].'" method="POST">
- <p>Add image or mp3</p>
- <p id="async-upload-wrap"><label for="async-upload">upload</label>
- <input type="file" id="async-upload" name="async-upload"> <input type="submit" value="Upload" name="html-upload"></p>
- <p><input type="hidden" name="post_id" id="post_id" value="'.$post_id.'" />
- '.wp_nonce_field('client-file-upload').'
- <input type="hidden" name="redirect_to" value="'.$_SERVER['REQUEST_URI'].'" /></p>
- <p><input type="submit" value="Save all changes" name="save" style="display: none;"></p>
- </form>
- <form style="clear:both" id="embed-form" method="POST" enctype="multipart/form-data">
- <p>Add video to gallery</p>
- <p><label for="embed">YouTube / vimeo url:</label></p>
- <p><textarea id="embed" name="embed"></textarea></p>
- <p><input name="submit_video" type="submit" value="submit" onclick="MakeLinkSafe()" ><p>
- <p>
- <input type="hidden" name="post_id" id="post_id" value="'.$post_id.'" />
- <input type="hidden" name="redirect_to" value="'.$_SERVER['REQUEST_URI'].'" /></p>
- </form>';
- }
- elseif (is_user_logged_in() && $current_user->ID == $post->post_author) {
- {
- echo 'br><br><br><br><br><br><br><br>
- <p><h2>Add to Gallery</h2></P>
- <form style="clear:both" id="file-form" enctype="multipart/form-data" action="'.$_SERVER['REQUEST_URI'].'" method="POST">
- <p>Add image or mp3</p>
- <p id="async-upload-wrap"><label for="async-upload">upload</label>
- <input type="file" id="async-upload" name="async-upload"> <input type="submit" value="Upload" name="html-upload"></p>
- <p><input type="hidden" name="post_id" id="post_id" value="'.$post_id.'" />
- '.wp_nonce_field('client-file-upload').'
- <input type="hidden" name="redirect_to" value="'.$_SERVER['REQUEST_URI'].'" /></p>
- <p><input type="submit" value="Save all changes" name="save" style="display: none;"></p>
- </form>
- <form style="clear:both" id="embed-form" method="POST" enctype="multipart/form-data">
- <p>Add video to gallery</p>
- <p><label for="embed">YouTube / vimeo url:</label></p>
- <p><textarea id="embed" name="embed"></textarea></p>
- <p><input name="submit_video" type="submit" value="submit" onclick="MakeLinkSafe()" ><p>
- <p>
- <input type="hidden" name="post_id" id="post_id" value="'.$post_id.'" />
- <input type="hidden" name="redirect_to" value="'.$_SERVER['REQUEST_URI'].'" /></p>
- </form>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement