Skip to content

Commit

Permalink
finish commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Dalloway committed Dec 21, 2011
2 parents 0b7b4f1 + 549290f commit eb7edd1
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .htaccess
Expand Up @@ -115,7 +115,10 @@ RewriteRule ^merge/?([0-9]+)$ merge.php?id=$1 [L]
RewriteRule ^undo_merge/?([0-9]+)$ action.php?action=undo_merge&id=$1 [L]
RewriteRule ^revert_change/?([0-9]+)$ action.php?action=revert_change&id=$1 [L]
RewriteRule ^message_manager$ message_manager.php [L]
<<<<<<< HEAD
RewriteRule ^edit_message/(.+)$ message_edit.php?key=$1 [L]
=======
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d

# Content management.
RewriteRule ^CMS$ cms.php [L]
Expand Down
4 changes: 4 additions & 0 deletions drop_id.php
Expand Up @@ -5,7 +5,11 @@
if($_POST['drop_ID'] && check_token()) {
unset($_SESSION['UID']);
unset($_SESSION['ID_activated']);
<<<<<<< HEAD
load_settings();
=======
unset($_SESSION['settings']);
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
setcookie('UID', '', $_SERVER['REQUEST_TIME'] - 3600, '/');
setcookie('password', '', $_SERVER['REQUEST_TIME'] - 3600, '/');
$_SESSION['notice'] = 'Your ID has been dropped.';
Expand Down
10 changes: 10 additions & 0 deletions includes/template.default.php
Expand Up @@ -13,8 +13,18 @@
<link rel="icon" type="image/png" href="<?php echo DIR ?>favicon.png" />

<link rel="stylesheet" type="text/css" media="screen" href="<?php echo DIR ?>style/main.css?14" />
<<<<<<< HEAD
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo DIR . 'style/themes/' . $this->get_stylesheet() . '.css?9' ?>" />
<?php
=======
<?php
if( ! empty($_SESSION['settings']['style'])):
?>
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo DIR . 'style/themes/' . $this->get_stylesheet() . '.css?9' ?>" />
<?php
endif;

>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
if($_SESSION['settings']['custom_style'] && $this->style_override === false):
?>
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo DIR; ?>custom_style/<?php echo $_SESSION['settings']['custom_style'] ?>/<?php echo (int) $_SESSION['style_last_modified'] ?>" />
Expand Down
5 changes: 5 additions & 0 deletions install.php
Expand Up @@ -491,8 +491,13 @@
foreach($config_defaults as $key => $value) {
$config_values .= '(' . $db->quote($key) . ', ' . $db->quote($value) . '), ';
}
<<<<<<< HEAD
$config_values = rtrim($config_values, ' ,');

=======
$config_values = rtrim($config_values, ',');

>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
/* Insert config */
$db->query
(
Expand Down
16 changes: 16 additions & 0 deletions message_edit.php
Expand Up @@ -7,6 +7,7 @@

$current_message = $lang->get_raw($_GET['key']);

<<<<<<< HEAD
if($current_message === false) {
error::fatal('No message with that key was found.');
}
Expand All @@ -17,10 +18,21 @@
$db->q('INSERT INTO messages (`key`, `message`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `message` = ?', $_GET['key'], $_POST['message'], $_POST['message']);
cache::clear('lang');
redirect('Message updated', 'message_manager');
=======
if( ! $current_message)) {
error::fatal('No message with that key was found.');
}
$template->title = 'Edit message: ' . htmlspecialchars($_GET['key']);
if(isset($_POST['form_sent'])) {
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
}
?>
<<<<<<< HEAD
<p>Messages use the following syntax:</p>
<ul>
<li><kbd>$1</kbd>, <kbd>$2</kbd>, and so on translate to the message parameters, which are provided by the script.</li>
Expand All @@ -31,6 +43,10 @@

<form action="" method="post">
<textarea name="message" rows="10"><?php echo htmlspecialchars($current_message) ?></textarea>
=======
<form action="" method="post">

>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
<input type="submit" name="form_sent" value="Update" />
</form>

Expand Down
4 changes: 4 additions & 0 deletions profile.php
Expand Up @@ -65,7 +65,11 @@
$post_count = $topic_count + $reply_count;

/* Do we have permission to view this user's IP? */
<<<<<<< HEAD
if( ! $perm->get('limit_ip') || $perm->get('limit_ip_max') > $post_count || $uid->first_seen > $_SERVER['REQUEST_TIME'] - 86400) {
=======
if($uid->ip_address && $perm->get('view_ip') && ($perm->get('view_ip_max') > $post_count || $perm->get('view_ip_max') == 0 || $uid->first_seen > $_SERVER['REQUEST_TIME'] - 86400)) {
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
$view_ip = true;

$id_hostname = @gethostbyaddr($uid->ip_address);
Expand Down
31 changes: 31 additions & 0 deletions style_edit.php
Expand Up @@ -11,7 +11,11 @@
error::fatal('Invalid style ID.');
}

<<<<<<< HEAD
$res = $db->q('SELECT title, style AS css, name, trip, uid, public, basis, original FROM user_styles WHERE id = ?', $_GET['edit']);
=======
$res = $db->q('SELECT title, style AS css, name, trip, uid, public, basis FROM user_styles WHERE id = ?', $_GET['edit']);
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
$style = $res->fetchObject();
if( ! $style) {
Expand All @@ -33,14 +37,21 @@
$set_name = $_POST['name'];
$style = (object) $_POST['style'];
<<<<<<< HEAD
$style->css = super_trim($style->css);
$style->md5 = md5($style->css);
=======
$style->css = strip_tags(super_trim($style->css));
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
$style->title = super_trim($style->title);
$style->public = (isset($style->public) ? '1' : '0');
$style->basis = str_replace(array('/', '\\', '.', "\0"), '', $style->basis);
$style->color = '';
list($style->name, $style->trip) = tripcode($set_name);
<<<<<<< HEAD
$style->original = (isset($style->original) ? (int) $style->original : 0);
=======
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
if(isset($_POST['preview']) && check_token()) {
$template->style_override = $style->basis;
Expand All @@ -59,7 +70,11 @@
/* Uncheck the public switch if a style identical to this already exists*/
if($style->public && ! $editing) {
<<<<<<< HEAD
$res = $db->q('SELECT 1 FROM user_styles WHERE md5 = ? AND basis = ?', $style->md5, $style->basis);
=======
$res = $db->q('SELECT 1 FROM user_styles WHERE style = ? AND basis = ?', $style->css, $style->basis);
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
if($res->fetchColumn()) {
$style->public = '0';
}
Expand Down Expand Up @@ -99,9 +114,15 @@
$db->q
(
'UPDATE user_styles
<<<<<<< HEAD
SET title = ?, style = ?, md5 = ?, public = ?, basis = ?, color = ?, name = ?, trip = ?, modified = ?
WHERE id = ? AND uid = ?',
$style->title, $style->css, $style->md5, $style->public, $style->basis, $style->color, $style->name, $style->trip, $_SERVER['REQUEST_TIME'],
=======
SET title = ?, style = ?, public = ?, basis = ?, color = ?, name = ?, trip = ?, modified = ?
WHERE id = ? AND uid = ?',
$style->title, $style->css, $style->public, $style->basis, $style->color, $style->name, $style->trip, $_SERVER['REQUEST_TIME'],
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
$_GET['edit'], $_SESSION['UID']
);

Expand All @@ -111,9 +132,15 @@
$db->q
(
'INSERT INTO user_styles
<<<<<<< HEAD
(title, style, md5, public, basis, color, name, trip, modified, original, uid) VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)',
$style->title, $style->css, $style->md5, $style->public, $style->basis, $style->color, $style->name, $style->trip, $_SERVER['REQUEST_TIME'], $style->original, $_SESSION['UID']
=======
(title, style, public, basis, color, name, trip, modified, uid) VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?)',
$style->title, $style->css, $style->public, $style->basis, $style->color, $style->name, $style->trip, $_SERVER['REQUEST_TIME'], $_SESSION['UID']
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
);

$new_id = $db->lastInsertId();
Expand Down Expand Up @@ -152,7 +179,11 @@
</div>

<div>
<<<<<<< HEAD
<textarea id="custom_style" name="style[css]" cols="80" rows="29"><?php echo htmlspecialchars($style->css) ?></textarea>
=======
<textarea id="custom_style" name="style[css]" cols="80" rows="26"><?php echo htmlspecialchars($style->css) ?></textarea>
>>>>>>> 549290f098d657f40dbdf2a86f845badd4fec54d
</div>
<div class="row">
<label for="style_basis" class="inline">Basis: </label>
Expand Down

0 comments on commit eb7edd1

Please sign in to comment.