Exemplo n.º 1
0
$var = "Setupstep{$setupstepn}";
if ($setupstepn == 1) {
    $next = lang('general', 'go');
} else {
    SaveSettings();
    redirect('index.php');
}
$selfurl = $Paths['pivot_url'] . 'selfreg.php';
if (isset($_GET['w']) && !empty($_GET['w'])) {
    $selfurl .= '?w=' . $_GET['w'];
}
// Printing out the form - not using the StartForm function
// since we need this file as the action URL.
echo "<h2>" . lang('userinfo', 'selfreg') . "</h2>\n";
echo '<form method="post" action="' . $selfurl . '" class="nopadding">' . "\n";
GenSetting('step', '', '', 7, $setupstepn);
StartTable($caption);
DisplaySettings(${$var});
EndForm($next, 1);
$form = ob_get_contents();
ob_end_clean();
$db = new db();
// Use the extra template for the current weblog
if (isset($Weblogs[$Current_weblog]['extra_template']) && $Weblogs[$Current_weblog]['extra_template'] != "") {
    $template_html = load_template($Weblogs[$Current_weblog]['extra_template']);
} else {
    $template_html = load_template($Weblogs[$Current_weblog]['archive_template']);
}
// Match and replace the [[weblog]] tags for the form output
if (preg_match_all('/\\[\\[(sub)?weblog:(.*)?(:[0-9]*)?\\]\\]/siU', $template_html, $match)) {
    if (count($match[1]) == 1) {
Exemplo n.º 2
0
/**
 * Upload a file
 *
 */
function uploadfile()
{
    global $Cfg, $Paths, $Users, $Pivot_Vars, $qual, $local;
    MinLevel(2);
    include_once 'includes/fileupload-class.php';
    $lang = str_replace("_utf8", "", $Users[$Pivot_Vars['user']]['language']);
    $my_uploader = new uploader($lang);
    // OPTIONAL: set the max filesize of uploadable files in bytes
    $my_uploader->max_filesize($Cfg['max_filesize']);
    // UPLOAD the file
    if ($my_uploader->upload('userfile', $Cfg['upload_accept'], $Cfg['upload_extension'])) {
        debug($my_uploader->file['name']);
        $success = $my_uploader->save_file($Paths['upload_path'], $Cfg['upload_save_mode'], 1);
    }
    if ($success) {
        error_reporting(E_ALL);
        include_once "modules/module_imagefunctions.php";
        PageHeader(lang('userbar', 'main'), 1);
        PageAnkeiler(lang('userbar', 'files') . ' &raquo; ' . lang('userbar', 'uploaded_success'));
        printf('<script type="text/javascript">function pop(a){
			window.open("modules/module_image.php?image="+a,"",
				"toolbar=no,resizable=yes,scrollbars=yes,width=940,height=570");
			self.location="index.php?menu=files";}
                        </script>');
        echo '<tr><td align="center" colspan="2">';
        $fullentry = $Paths['upload_url'] . $my_uploader->file['name'];
        echo '<img src="' . $fullentry . '" border="0" alt="new image">';
        echo '</td></tr><tr><td align="right" width="48%"><br /><br />';
        if (auto_thumbnail($my_uploader->file['name'])) {
            echo "<p><b>Thumbnail:</b><br>";
            $thumbfilename = $Paths['upload_url'] . make_thumbname(basename($my_uploader->file['name']));
            printf('<p><img src="%s" />', $thumbfilename);
            printf('<p><a href="javascript:pop(\'%s\')">' . lang('upload', 'edit_thumbnail') . '</a></td>', $my_uploader->file['name']);
        } else {
            printf('<p><a href="javascript:pop(\'%s\');">' . lang('upload', 'create_thumb') . '</a></td>', $my_uploader->file['name']);
        }
        GenSetting('', lang('upload', 'thisfile'), '', 8, '', 6);
        StartForm('file_upload', 0, 'enctype="multipart/form-data"');
        printf('<input name="%s" type="file"  class="input"><br />', $Cfg['upload_file_name']);
        printf('<input type="submit" value="%s" class="button" /></form>', lang('upload', 'button'));
        PageFooter();
    } else {
        if ($my_uploader->errors) {
            files_main($my_uploader->errors);
        }
    }
}
Exemplo n.º 3
0
/**
 * Shows image preview.
 */
function show_image_preview($fileArray, $thumbArray)
{
    global $Cfg, $Pivot_Vars, $Paths;
    printf("\n\n<script language='javascript' type='text/javascript'>\nfunction pop(a){\r\n\twindow.open('modules/module_image.php?image='+a,'','toolbar=no,resizable=yes,scrollbars=yes,width=940,height=570');\n}\n</script>\n\n");
    $myurl = sprintf("index.php?session=%s&amp;menu=files&amp;doaction=1", $Pivot_Vars['session']);
    printf("<form name='form1' method='post' action='%s'>", $myurl);
    echo "\n\n<div style='margin:0px; padding:0px;'>\n\n";
    foreach ($fileArray as $file) {
        $ext = getextension(strtolower($file['name']));
        if ($ext != "gif" && $ext != "jpg" && $ext != "jpeg" && $ext != "png" && $ext != "swf") {
            continue;
        }
        $thumb = checkThumbAvailable($file['name']);
        $fullentry = fixpath(sprintf('%s../%s%s', $Paths['pivot_url'], $Cfg['upload_path'], $file['name']));
        $thumbententry = urldecode(fixpath(sprintf('%s../%s%s', $Paths['pivot_url'], $Cfg['upload_path'], $thumb)));
        list($thumbwidth, $thumbheight) = getimagesize(urldecode("../" . $Cfg['upload_path'] . $thumb));
        // Calculate rescaling factor for
        // showing thumbnail in table/div
        // for wide thumbnails, take two 'cells', otherwise one..
        if ($thumbwidth / $thumbheight < 2) {
            $mw = 130;
        } else {
            $mw = 268;
            // * 2 , + 8
        }
        $mh = 80;
        $scalew = $thumbwidth / $mw;
        $scaleh = $thumbheight / $mh;
        $factor = max($scalew, $scaleh);
        $dw = $thumbwidth / $factor;
        $dh = $thumbheight / $factor;
        // get the image's witdh and height
        list($file['width'], $file['height']) = getimagesize(urldecode(sprintf('../%s%s', $Cfg['upload_path'], $file['name'])));
        // if filesize is bigger than 9999 KB
        // then filesize comment is changed, this
        // is just for not f*****g up the tables/divs
        if (strlen($file['size']) > 4) {
            // see!? no more than 4 chars,
            // please change size of file
            $fs = 'BIGASS';
        } else {
            // show actual filesize + string KB
            $fs = $file['size'] . 'KB';
        }
        echo "\n<div style='float:left; border:1px solid #2D5A5A; margin:3px;'>\n";
        printf('<table cellpadding="0" cellspacing="0" width="%d" border="0">', $mw);
        printf("\n\n<tr>\n<td align='center' valign='middle' bgcolor='#BBBBBB' height='%d' colspan='2'>", $mh);
        // make the 'view' link
        $url = sprintf($Paths['pivot_url'] . "includes/photo.php?img=%s&amp;w=%s&amp;h=%s&amp;t=%s", urlencode(base64_encode($fullentry)), $file['width'], $file['height'], $file['name']);
        $view_html = sprintf("\n<a href='%s' onclick=\"window.open('%s', 'imagewindow', 'width=%s, height=%s, directories=no, location=no, menubar=no, scrollbars=no, status=no, toolbar=no, resizable=no');return false\" target='_self' title='%s (%s)'>", urldecode($fullentry), $url, $file['width'], $file['height'], $file['name'], $fs);
        if ($thumbententry != $file['name']) {
            printf("\n%s<img src='%s' width='%d' height='%d' border='0' alt='%s' /></a>\n", $view_html, $thumbententry, $dw, $dh, $file['name']);
        } else {
            printf("\n%s<small>%s <br /><br />(No Thumbnail)</small></a>\n", $view_html, wordwrap(urldecode($file['name']), 14, ' ', 1));
        }
        echo "</td>\n</tr>\n\n<tr>\n<td bgcolor='#B6CCCC'>\n";
        printf("<input type='checkbox' name='check[%s]' /></td>", $file['name']);
        printf('<td align="center" bgcolor="#B6CCCC" height="17">%sview</a>&nbsp;/&nbsp;', $view_html);
        if ($thumb != $file['name']) {
            printf('<a href="javascript:pop(\'%s\');">edit</a></td>', $file['name']);
        } else {
            printf('<a href="javascript:pop(\'%s\');">create</a></td>', $file['name']);
        }
        echo '</tr></table></div>';
    }
    echo "\n</div>\n<br clear='all' />\n\n";
    printf("<table cellpadding='2'><tr><td bgcolor='#B6CCCC'>");
    echo '<a href="#" onclick=\'setCheckboxes("form1", true); return false;\'>' . lang('forms', 'c_all') . '</a> / ';
    echo '<a href="#" onclick=\'setCheckboxes("form1", false); return false;\'>' . lang('forms', 'c_none') . '</a>';
    echo '&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;' . lang('forms', 'with_checked_files');
    echo '<select name="action" class="input"><option value="" selected="selected">' . lang('forms', 'choose') . '</option><option value="delete">' . lang('forms', 'delete') . '</option></select>';
    echo '&nbsp;&nbsp;<input type="submit" value="' . lang('go') . '" class="button" />';
    printf("</td></tr></table></form>");
    flush();
    StartForm('file_upload', 0, 'enctype="multipart/form-data"');
    echo "<br /><table border='0'>";
    GenSetting('', lang('upload', 'thisfile'), '', 8, '', 6);
    printf('<tr><td><input name="%s" type="file"  class="input" /></td><td>', $Cfg['upload_file_name']);
    printf('<input type="submit" value="%s" class="button" /></td></tr></table>', lang('go'));
    PageFooter();
}
Exemplo n.º 4
0
/**
 * Display the spam log.
 */
function view_spamlog()
{
    PageHeader(lang('adminbar', 'viewspamlog_title'), 1);
    PageAnkeiler(lang('userbar', 'admin') . ' &raquo; ' . lang('adminbar', 'viewspamlog_title'));
    $log = get_spamlog();
    if (empty($log)) {
        echo "<p>" . lang('spam', 'empty_log') . "<p>\n";
    } else {
        echo $log;
        StartForm('reset_spamlog', 1);
        StartTable();
        GenSetting('heading', lang('spam', 'reset_log'), '', 8, '', '2', 'yes');
        GenSetting('reset_spamlog', '', '', 7, '');
        EndForm(lang('go'), 1);
    }
    PageFooter();
}
Exemplo n.º 5
0
function DisplaySettings($settingsArray, $cfgVar = 'Cfg', $pertytable = 0)
{
    if (is_array($settingsArray)) {
        $arraycount = count($settingsArray);
        for ($i = 0; $i < $arraycount; $i++) {
            /* echo '<b>' . $settingsArray[$i][2] . '</b>'; */
            GenSetting($settingsArray[$i][0], $settingsArray[$i][1], $settingsArray[$i][2], $settingsArray[$i][3], $settingsArray[$i][4], $settingsArray[$i][5], $settingsArray[$i][6], $cfgVar);
        }
    } else {
        //my god you are an idiot for not sending an array.
    }
}