コード例 #1
0
ファイル: pv_core.php プロジェクト: wborbajr/TecnodataApp
/**
 * Displays the screen to edit and delete trackbacks.
 *
 * @param string $msg
 * @see submit_trackback()
 */
function edit_trackbacks($msg = "")
{
    global $Cfg, $Pivot_Vars, $Users;
    PageHeader(lang('userbar', 'trackbacks'), 1);
    PageAnkeiler(lang('userbar', 'trackbacks') . ' » ' . lang('userbar', 'trackbacks_title'));
    $id = $Pivot_Vars['id'];
    $db = new db();
    // read entry if it's not in memory yet.
    $db->read_entry($id, true);
    printf("<p><strong>%s</strong>: %s<br />", lang('entries', 'title'), $db->entry['title']);
    printf("<strong>%s</strong>: %s<br />", lang('entries', 'author'), $db->entry['user']);
    printf("<strong>%s</strong>: %s</p><br />", lang('entries', 'date'), $db->entry['date']);
    if ($Pivot_Vars['user'] == $db->entry['user']) {
        // allowed to edit own trackbacks
        MinLevel(2);
    } else {
        // allowed to edit trackbacks on other people's entries
        MinLevel(3);
    }
    if (!$db->entry['trackbacks'] || count($db->entry['trackbacks']) < 1) {
        // print if there are no trackbacks
        echo "<p><B>" . lang('notice', 'trackback_none') . "</b><br /><br /></p>";
    } else {
        // print the trackbacks..
        // perhaps delete a trackback.
        if (isset($Pivot_Vars['del'])) {
            $del_track = $db->entry['trackbacks'][$Pivot_Vars['del']];
            //remove the trackback from last_trackbacks if it's in there..
            if (file_exists("db/ser_lasttrack.php")) {
                $last_tracks = load_serialize("db/ser_lasttrack.php", true, true);
            } else {
                $last_tracks = array();
            }
            if ($last_tracks !== false && count($last_tracks) > 0) {
                foreach ($last_tracks as $key => $last_track) {
                    if ($last_track['code'] == $db->entry['code'] && $last_track['name'] == $del_track['name'] && $last_track['date'] == $del_track['date']) {
                        unset($last_tracks[$key]);
                        save_serialize("db/ser_lasttrack.php", $last_tracks);
                    }
                }
            }
            // *argh* evil hack to directly delete trackbacks.. I should write a
            // proper wrapper
            unset($db->entry['trackbacks'][$Pivot_Vars['del']]);
            unset($db->db_lowlevel->entry['trackbacks'][$Pivot_Vars['del']]);
            $db->save_entry();
            $msg = lang('notice', 'trackback_deleted');
        }
        // perhaps add an ip-block for single ip.
        if (isset($Pivot_Vars['blocksingle'])) {
            $msg = "Added block for IP " . $Pivot_Vars['blocksingle'];
            add_block($Pivot_Vars['blocksingle']);
        }
        // perhaps add an ip-block for single ip.
        if (isset($Pivot_Vars['blockrange'])) {
            $iprange = make_mask($Pivot_Vars['blockrange']);
            $msg = "Added block for IP-range " . $iprange;
            add_block($iprange);
        }
        // perhaps remove an ip-block for single ip.
        if (isset($Pivot_Vars['unblocksingle'])) {
            $msg = "Removed block for IP " . $Pivot_Vars['unblocksingle'];
            rem_block($Pivot_Vars['unblocksingle']);
        }
        // perhaps remove an ip-block for single ip.
        if (isset($Pivot_Vars['unblockrange'])) {
            $iprange = make_mask($Pivot_Vars['unblockrange']);
            $msg = "Removed block for IP-range " . $iprange;
            rem_block($iprange);
        }
        // print a message, if there is one.
        if ($msg != "") {
            echo "<p><B>{$msg}</b><br /><br /></p>";
        }
        // show the edit form, to edit a trackback..
        if (isset($Pivot_Vars['edit'])) {
            StartForm('submittrackback', 0);
            StartTable();
            $mytrack = $db->entry['trackbacks'][$Pivot_Vars['edit']];
            $settings = array();
            $settings[] = array('heading', lang('weblog_config', 'shortentry_template'), '', 8, '', 2, '');
            $settings[] = array('id', '', '', 7, $id, '', '');
            $settings[] = array('count', '', '', 7, $Pivot_Vars['edit'], '', '');
            $settings[] = array('name', lang('weblog_text', 'blog_name'), '', 0, unentify($mytrack['name']), 60, '');
            $settings[] = array('title', lang('weblog_text', 'title'), '', 0, unentify($mytrack['title']), 60, '');
            $settings[] = array('excerpt', lang('weblog_text', 'excerpt'), '', 5, unentify($mytrack['excerpt']), '60', 'rows=5');
            $settings[] = array('url', lang('weblog_text', 'url'), '', 0, $mytrack['url'], 60, '');
            $settings[] = array('ip', lang('weblog_text', 'ip'), '', 0, $mytrack['ip'], 30, '');
            $settings[] = array('date', lang('weblog_text', 'date'), '', 0, $mytrack['date'], 30, '');
            DisplaySettings($settings, 'blog_settings');
            EndForm(lang('weblog_config', 'save_trackback'), 1);
        }
        // print out all the trackbacks..
        foreach ($db->entry['trackbacks'] as $key => $trackback) {
            $myblock = block_type($trackback['ip']);
            if ($myblock == "single" || $myblock == "range") {
                $strike = "style='text-decoration: line-through;'";
            } else {
                $strike = "";
            }
            // strip stuff from lamers' trackbacks..
            $trackback['url'] = strip_tags($trackback['url']);
            printf("<table border=0 cellpadding=2 cellspacing=2 width='95%%' style='border-bottom:" . " 2px solid #999;'><tr><td width='40%%' valign='top'>" . lang('weblog_text', 'title') . ":&nbsp;<b %s>%s</b><br />", $strike, stripslashes($trackback['title']));
            printf(lang('weblog_text', 'blog_name') . ":&nbsp;%s<br />", $trackback['name']);
            printf(lang('weblog_text', 'url') . ":&nbsp;%s<br />", $trackback['url']);
            printf(lang('weblog_text', 'ip') . ":&nbsp;%s<br />", $trackback['ip']);
            printf(lang('weblog_text', 'date') . ":&nbsp;%s<br />", $trackback['date']);
            printf("<td valign='top'><span %s>%s</span></td>", $strike, nl2br(htmlspecialchars($trackback['excerpt'])));
            // only show the option to edit and delete links if the user is an advanced user.
            if ($Users[$Pivot_Vars['user']]['userlevel'] >= 2) {
                $link = sprintf("index.php?session=%s&amp;menu=entries&amp;func=edittrackbacks&amp;", $Pivot_Vars['session']);
                $editlink = sprintf("%sid=%s&amp;edit=%s", $link, $db->entry['code'], $key);
                $dellink = sprintf("%sid=%s&amp;del=%s", $link, $db->entry['code'], $key);
                $reportpopup = sprintf("openReportTrackback('%s', '%s','%s','%s');", $Pivot_Vars['session'], $db->entry['code'], $key, $dellink);
                printf("</tr><tr class='tabular_line_odd'><td><a href='%s'>%s</a> /", $editlink, lang('entries', 'edit_trackback'));
                printf(" <a href='%s'>%s</a> / ", $dellink, lang('entries', 'delete_trackback'));
                // only ping.
                // printf(" <a href='#' onclick=\"%s\">%s</a>&nbsp;&nbsp;", $reportpopup, lang('entries', 'report_trackback') );
                // ping and delete
                printf(" <a href='#' onclick=\"%s\">%s</a>&nbsp;&nbsp;", $reportpopup, lang('entries', 'report_trackback'));
            } else {
                printf("<td>&nbsp;</td>");
            }
            // only show the option to add or remove ip-blocks if the user is an administrator.
            if ($Users[$Pivot_Vars['user']]['userlevel'] >= 3) {
                if ($myblock == "none") {
                    $blocktext1 = str_replace("%s", $trackback['ip'], lang('entries', 'block_single'));
                    $blocklink1 = sprintf("%sid=%s&blocksingle=%s", $link, $db->entry['code'], $trackback['ip']);
                    $blocktext2 = str_replace("%s", make_mask($trackback['ip']), lang('entries', 'block_range'));
                    $blocklink2 = sprintf("%sid=%s&blockrange=%s", $link, $db->entry['code'], $trackback['ip']);
                    printf("<td><a href='%s'>%s</a> / ", $blocklink1, $blocktext1);
                    printf("<a href='%s'>%s</a></td>", $blocklink2, $blocktext2);
                } else {
                    if ($myblock == "single") {
                        $blocktext1 = str_replace("%s", $trackback['ip'], lang('entries', 'unblock_single'));
                        $blocklink1 = sprintf("%sid=%s&unblocksingle=%s", $link, $db->entry['code'], $trackback['ip']);
                        printf("<td><a href='%s'>%s</a></td>", $blocklink1, $blocktext1);
                    } else {
                        $blocktext1 = str_replace("%s", make_mask($trackback['ip']), lang('entries', 'unblock_range'));
                        $blocklink1 = sprintf("%sid=%s&unblockrange=%s", $link, $db->entry['code'], $trackback['ip']);
                        printf("<td><a href='%s'>%s</a></td>", $blocklink1, $blocktext1);
                    }
                }
            } else {
                printf("<td>&nbsp;</td>");
            }
            printf("</td></tr></table><br />");
        }
        // end of printing trackbacks
    }
    // Table for editing the entry / trackbacks (this will be replaced after 1.30,
    // When we put the form-builder in place.
    echo '<table  width="95%"  border="0" cellpadding="5" cellspacing="0">';
    $link = sprintf("index.php?session=%s&amp;menu=entries&amp;func=modify&amp;id=%s", $Pivot_Vars['session'], $db->entry['code']);
    printf('<!-- edit entry --><tr><td width="32" valign="top">');
    print_icon('overview', 'new_entry', "<a href=\"" . $link . "\">");
    printf('</td><td><h3><a href="%s">%s</a></h3><p class="dim">%s</p></td></tr>', $link, lang('entries', 'edit_entry'), lang('entries', 'edit_entry_desc'));
    $link = sprintf("index.php?session=%s&amp;menu=entries&amp;func=editcomments&amp;id=%s", $Pivot_Vars['session'], $db->entry['code']);
    printf('<!-- edit comments --><tr><td width="32" valign="top">');
    print_icon('entry', 'edit_comments', "<a href=\"" . $link . "\">");
    printf('</td><td><h3><a href="%s">%s</a></h3><p class="dim">%s</p></td></tr>', $link, lang('entries', 'edit_comments'), lang('entries', 'edit_comments_desc'));
    $link = sprintf("index.php?session=%s&amp;menu=entries&amp;doaction=1&amp;action=delete&amp;check[%s]=1", $Pivot_Vars['session'], $db->entry['code']);
    printf('<!-- delete entry --><tr><td width="32" valign="top">');
    print_icon('entry', 'del_entry', "<a href=\"" . $link . "\">");
    printf('</td><td><h3><a href="%s">%s</a></h3><p class="dim">%s</p></td></tr>', $link, lang('entries', 'delete_entry'), lang('entries', 'delete_entry_desc'));
    echo "</table>";
    // End of table for editing the entry / trackbacks
    PageFooter();
    echo "<br /><br /><br /><br />";
}
コード例 #2
0
ファイル: pv_admin.php プロジェクト: wborbajr/TecnodataApp
/**
 * The screen to edit a weblog, screen 3
 */
function main_blogs_edit3()
{
    global $Pivot_Vars, $blog_settings, $Weblogs;
    PageHeader(lang('weblog_config', 'create_3'));
    PageAnkeiler(lang('userbar', 'admin') . ' &raquo; ' . lang('weblog_config', 'create_3'));
    if (isset($Pivot_Vars['orig_name']) && strlen($Pivot_Vars['orig_name']) > 1) {
        $blog_settings = $Weblogs[$Pivot_Vars['orig_name']];
        $orig_name = $Pivot_Vars['orig_name'];
        MidHeading(sprintf(lang('weblog_config', 'edit_weblog') . ' \'%s\'', $Weblogs[$Pivot_Vars['orig_name']]['name']));
    } else {
        $blog_settings = get_tempweblog();
        $orig_name = "";
        MidHeading(lang('weblog_config', 'create_new'));
    }
    $temp_subweblogs = $Pivot_Vars['sub_weblog'];
    foreach ($temp_subweblogs as $subweblog => $dummy) {
        // fix the subweblogs' categories..
        if (count($temp_subweblogs[$subweblog]['categories']) > 0) {
            foreach ($temp_subweblogs[$subweblog]['categories'] as $cat => $dummy) {
                unset($temp_subweblogs[$subweblog]['categories'][$cat]);
                $temp_subweblogs[$subweblog]['categories'][] = $cat;
            }
        } else {
            // you are an idiot if you did not select any categories..
            $temp_subweblogs[$subweblog]['categories'] = array();
        }
    }
    // unserialize the parsed temp_weblog..
    $temp_weblog = unserialize(urldecode($Pivot_Vars['temp_weblog']));
    // merge temp_weblog with temp_subweblogs
    $temp_weblog['sub_weblog'] = $temp_subweblogs;
    StartForm('blog_save', 1);
    StartTable();
    EndForm(lang('weblog_config', 'create'), 2);
    $settings = get_weblog_config3();
    $settings[] = array('orig_name', 'originalname', '', 7, $orig_name);
    $settings[] = array('temp_weblog', 'tempweblog', '', 7, urlencode(serialize($temp_weblog)));
    DisplaySettings($settings, 'blog_settings');
    EndForm(lang('weblog_config', 'create'), 1);
    PageFooter();
}
コード例 #3
0
ファイル: setup.php プロジェクト: wborbajr/TecnodataApp
	$Cfg['encode_email_addresses'] = $Pivot_Vars['encode_email_addresses'];

}
*/
$var = "Setupstep{$setupstepn}";
if ($setupstepn == 1) {
    $next = 'proceed to login';
} else {
    // Set several options in Config.
    $Cfg['installed'] = 1;
    $Cfg['sitename'] = $Pivot_Vars['sitename'];
    $Cfg['deflang'] = $Pivot_Vars['deflang'];
    // Set the language for the default weblog.
    $Weblogs['my_weblog']['language'] = $Pivot_Vars['deflang'];
    // Save the settings..
    SaveSettings();
    // Save the weblog..
    save_serialize('pv_cfg_weblogs.php', $Weblogs);
    // Go to the index page to log in.
    redirect('index.php');
}
//it's nice to use it as a variable so we can look at $BigAssArray[$i][0] for a list of variables to save in config.
echo "<div style='padding: 20px;'>";
StartForm('setup');
StartTable($caption);
DisplaySettings(${$var});
EndForm($next, 1);
PageFooter();
?>

コード例 #4
0
ファイル: pvlib.php プロジェクト: wborbajr/TecnodataApp
/**
 * 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();
}
コード例 #5
0
ファイル: pvdisp.php プロジェクト: wborbajr/TecnodataApp
function ConfirmPage($title, $params, $message)
{
    global $Pivot_Vars;
    PageHeader($title, 1);
    if ($Pivot_Vars['func'] == 'admin') {
        StartForm($Pivot_Vars['do']);
    } else {
        StartForm($Pivot_Vars['func']);
    }
    if (is_array($params)) {
        $acount = count($params) / 2;
        for ($i = 0; $i < $acount; $i++) {
            $j = 1 + 2 * $i;
            echo '<input type="hidden" name="' . $params[$j - 1] . '" value=\'' . $params[$j] . '\' />' . "\n";
            //echo '<br />(input type="hidden" name="'.$params[$j-1].'" value=\''.$params[$j].'\')'."\n";
        }
    }
    echo '<div style="padding:20px 10px"><input type="hidden" name="confirmed" value="1" />' . "\n";
    Paragraph(wordwrap($message, 80, "<br />") . '<br /><br /><br /><input type="submit" value="' . lang('general', 'continue') . '" class="button" />');
    echo '</div></form>' . "\n";
    PageFooter();
    exit;
}