Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
Various bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
renlok committed Mar 24, 2017
1 parent 181a879 commit 0f9e5b1
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
27 changes: 15 additions & 12 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,21 @@
}

// version check
switch ($system->SETTINGS['version_check']) {
case 'unstable':
$url = 'http://www.webidsupport.com/version_unstable.txt';
break;
default:
$url = 'http://www.webidsupport.com/version.txt';
break;
}

if (!($realversion = load_file_from_url($url))) {
$ERR = $MSG['error_file_access_disabled'];
$realversion = $MSG['unknown'];
$realversion = '0.0';
$update_available = false;
if ($system->SETTINGS['version_check'] !== "") {
switch ($system->SETTINGS['version_check']) {
case 'unstable':
$url = 'http://raw.githubusercontent.com/renlok/WeBid/dev/install/thisversion.txt';
break;
default:
$url = 'http://raw.githubusercontent.com/renlok/WeBid/master/install/thisversion.txt';
break;
}
if (!($realversion = load_file_from_url($url))) {
$ERR = $MSG['error_file_access_disabled'];
$realversion = $MSG['unknown'];
}
}

$update_available = false;
Expand Down
4 changes: 2 additions & 2 deletions includes/class_email_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public function sendmail()
if (is_array($this->to)) {
for ($i = 0; $i < count($this->to); $i++) {
try {
$mail->setFrom($this->from, $system->SETTINGS['adminmail']);
$mail->setFrom($this->from, $system->SETTINGS['sitename']);
$mail->addAddress($this->to[$i]);
$mail->addReplyTo($this->from, $system->SETTINGS['adminmail']);
$mail->Subject = $this->subject;
Expand All @@ -440,7 +440,7 @@ public function sendmail()
}
} else {
try {
$mail->setFrom($this->from, $system->SETTINGS['adminmail']);
$mail->setFrom($this->from, $system->SETTINGS['sitename']);
if (is_array($this->to)) {
for ($i = 0; $i < count($this->to); $i++) {
$mail->addAddress($this->to[$i]);
Expand Down
2 changes: 1 addition & 1 deletion includes/functions_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function get_hash()

function load_file_from_url($url)
{
if (false !== ($str = file_get_contents($url))) {
if (false !== ($str = @file_get_contents($url))) {
return $str;
} elseif (($handle = @fopen($url, 'r')) !== false) {
$str = fread($handle, 5);
Expand Down
2 changes: 1 addition & 1 deletion install/sql/dump.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
`user` int(11) default NULL,
`title` varchar(70),
`subtitle` varchar(70),
`starts` datetime ,
`starts` datetime,
`ends` datetime,
`description` text,
`pict_url` tinytext,
Expand Down
5 changes: 3 additions & 2 deletions item.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
// get ending time
$showendtime = false;
$has_ended = false;
$difference = null;
if (strtotime($start) > time()) {
$ending_time = '<span class="errfont">' . $MSG['668'] . '</span>';
} elseif (strtotime($ends) - time() > 0) {
Expand Down Expand Up @@ -324,7 +325,7 @@
}
$min_bid = $system->print_money($minimum_bid);
$high_bid = $system->print_money($high_bid);
if (!$difference->invert) {
if ($difference != null && !$difference->invert) {
$next_bid = $system->print_money($next_bidp);
} else {
$next_bid = '--';
Expand Down Expand Up @@ -469,7 +470,7 @@
'YOURBIDCLASS' => (isset($yourbidclass)) ? $yourbidclass : '',

'B_HASENDED' => $has_ended,
'B_CANEDIT' => ($user->logged_in && $user->user_data['id'] == $auction_data['user'] && $num_bids == 0 && !$difference->invert),
'B_CANEDIT' => ($user->logged_in && $user->user_data['id'] == $auction_data['user'] && $num_bids == 0 && !($difference == null || $difference->invert)),
'B_CANCONTACTSELLER' => (($system->SETTINGS['contactseller'] == 'always' || ($system->SETTINGS['contactseller'] == 'logged' && $user->logged_in)) && (!$user->logged_in || $user->user_data['id'] != $auction_data['user'])),
'B_HASIMAGE' => (!empty($auction_data['pict_url'])),
'B_NOTBNONLY' => ($auction_data['bn_only'] == 0),
Expand Down
2 changes: 1 addition & 1 deletion themes/modern/sell.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ $(document).ready(function(){
<div class="duration col-md-4">
{L_022}: {DURATIONS}<br>
<!-- IF B_EDIT_ENDTIME -->
{L_or_custom_end_time}: <input type="text" name="a_ends" id="a_ends" value="{END_TIME}" size="20" maxlength="19">
{L_or_custom_end_time}: <input type="text" name="a_ends" id="a_ends" value="{END_TIME}" size="20" maxlength="19" class="form-control">
<script type="text/javascript">
new tcal ({'id': 'a_ends','controlname': 'a_ends', 'formname': 'sell'});
$('#a_ends').change(function () {
Expand Down

0 comments on commit 0f9e5b1

Please sign in to comment.