function homepage_image() { $logo = osc_get_preference('homeimage', 'osclasswizards_theme'); $html = '<img border="0" alt="' . osc_page_title() . '" src="' . osclasswizards_homeimage_url() . '">'; if ($logo != '' && file_exists(osc_uploads_path() . $logo)) { return $html; } else { return false; } }
<?php $logo_prefence = osc_get_preference('homeimage', 'osclasswizards_theme'); if (is_writable(osc_uploads_path())) { ?> <?php if ($logo_prefence) { ?> <h3 class="render-title"><?php _e('Preview', 'osclasswizards'); ?> </h3> <img style="max-width:100%;" border="0" alt="<?php echo osc_esc_html(osc_page_title()); ?> " src="<?php echo osclasswizards_homeimage_url() . '?' . filemtime(osc_uploads_path() . osc_get_preference('homeimage', 'osclasswizards_theme')); ?> " /> <form action="<?php echo osc_admin_render_theme_url('oc-content/themes/osclasswizards/admin/settings.php'); ?> " method="post" enctype="multipart/form-data" class="nocsrf"> <input type="hidden" name="action_specific" value="remove_homeimage" /> <fieldset> <div class="form-horizontal"> <div class="form-actions"> <input id="button_remove" type="submit" value="<?php echo osc_esc_html(__('Remove image', 'osclasswizards')); ?> " class="btn btn-red"> </div>