System: CPG 1.4.16 – Bridge -> SMF 1.1.4 | PHP 5.2.4
URL: http://foxbox.cc/ (http://foxbox.cc/) (Gallery w/o login is clean and afaik SFW)
Many of my visitors come from 4/7/f-chan and it appears that many of them overlook the Upload button so I'd like to have a file imput box there (see attached picture).
The Themen is based on http://coppermine-gallery.net/demo/cpg14x/index.php?theme=smf_1-1_rc2 (http://coppermine-gallery.net/demo/cpg14x/index.php?theme=smf_1-1_rc2)
Since I have no idear how complex this is going to be, just throw me a number.
If you want to display an upload box from within your theme, just insert
<form method="post" action="upload.php" enctype="multipart/form-data">
<input type="file" name="file_upload_array[]" size="40" class="listbox" />
<input type="hidden" name="control" value="phase_1" />
<input type="submit" value="UPLOAD" class="button" />
</form>
somewhere in it.
If you want to disable this for certain users etc., you'll need to add some more code.
Guests cannot upload anything (no public albums and personal gallery uploads). So it would be cool if the upload box is only shown to those who logged in (Registered and Administrators Group)
1.Edit themes/smf_1-1_rc2/template.html and put this
{UPLOAD}
where ever you want upload box to show
2.Edit themes/smf_1-1_rc2/theme.php and put this code just before php end tag (?>)
function pageheader($section, $meta = '')
{
global $CONFIG, $THEME_DIR;
global $template_header, $lang_charset, $lang_text_dir;
$custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);
$charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];
header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
header("Content-Type: text/html; charset=$charset");
user_save_profile();
$template_vars = array('{LANG_DIR}' => $lang_text_dir,
'{TITLE}' => $CONFIG['gallery_name'] . ' - ' . strip_tags(bb_decode($section)),
'{CHARSET}' => $charset,
'{META}' => $meta,
'{GAL_NAME}' => $CONFIG['gallery_name'],
'{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
'{UPLOAD}' => theme_upload(),
'{SYS_MENU}' => theme_main_menu('sys_menu'),
'{SUB_MENU}' => theme_main_menu('sub_menu'),
'{ADMIN_MENU}' => theme_admin_mode_menu(),
'{CUSTOM_HEADER}' => $custom_header,
);
echo template_eval($template_header, $template_vars);
}
function theme_upload(){
if(USER_ID){
$upload = <<<EOT
<form method="post" action="upload.php" enctype="multipart/form-data">
<input type="file" name="file_upload_array[]" size="40" class="listbox" />
<input type="hidden" name="control" value="phase_1" />
<input type="submit" value="UPLOAD" class="button" />
</form>
EOT;
}else{
$upload = '';
}
return $upload;
}
You're done
Works like a charm. Thank you!