Clicking on the received eQSL icon will redisplay the card (rate limited)

这个提交包含在:
Peter Goodhall 2020-03-01 16:59:03 +00:00
父节点 f526eb4078
当前提交 94219f3b62
共有 4 个文件被更改,包括 46 次插入15 次删除

查看文件

@ -568,5 +568,31 @@ class eqsl extends CI_Controller {
$this->load->view('eqsl/export');
$this->load->view('interface_assets/footer');
}
function image($callsign, $mode, $band, $hour, $minute, $day, $month, $year) {
$this->load->library('eqsl_library');
$query = $this->user_model->get_by_id($this->session->userdata('user_id'));
$q = $query->row();
$username = $q->user_eqsl_name;
$password = $q->user_eqsl_password;
$image_url = $this->eqsl_library->card_image($username, $password, $callsign, $band, $mode, $year, $month, $day, $hour, $minute);
$file = file_get_contents($image_url, true);
$dom = new domDocument;
$dom->loadHTML($file);
$dom->preserveWhiteSpace = false;
$images = $dom->getElementsByTagName('img');
foreach ($images as $image)
{
header('Content-Type: image/jpg');
readfile ("https://www.eqsl.cc".$image->getAttribute('src'));
}
}
} // end class

查看文件

@ -1,14 +0,0 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Eqsl {
/*
Communicates with the eQSL.cc API functions
*/
public function send(){}
public function receive(){}
public function check(){}
}
/* End of file eQSL.php */

查看文件

@ -0,0 +1,13 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class eqsl_library {
// Return formatted URL to get the eQSL card image
public function card_image($username, $password, $callsign, $band, $mode, $year, $month, $day, $hour, $minute)
{
$url = "https://www.eqsl.cc/qslcard/GeteQSL.cfm?Username=".$username."&Password=".$password."&CallsignFrom=".$callsign."&QSOBand=".$band."&QSOMode=".$mode."&QSOYear=".$year."&QSOMonth=".$month."&QSODay=".$day."&QSOHour=".$hour."&QSOMinute=".$minute;
return $url;
}
}

查看文件

@ -71,7 +71,13 @@
<?php if ($this->session->userdata('user_eqsl_name') != ""){ ?>
<td class="eqsl">
<span class="eqsl-<?php echo ($row->COL_EQSL_QSL_SENT=='Y')?'green':'red'?>">&#9650;</span>
<span class="eqsl-<?php echo ($row->COL_EQSL_QSL_RCVD=='Y')?'green':'red'?>">&#9660;</span>
<span class="eqsl-<?php echo ($row->COL_EQSL_QSL_RCVD=='Y')?'green':'red'?>">
<?php if($row->COL_EQSL_QSL_RCVD =='Y') { ?>
<a style="color: green" data-fancybox="gallery" href="<?php echo site_url("eqsl/image/".$row->COL_CALL."/".$row->COL_MODE."/".$row->COL_BAND."/".date('H', $timestamp)."/".date('i', $timestamp)."/".date('d', $timestamp)."/".date('m', $timestamp)."/".date('Y', $timestamp)); ?>">&#9660;</a>
<?php } else { ?>
<a style="color: green" data-fancybox="gallery" href="<?php echo site_url("eqsl/image/".$row->COL_CALL."/".$row->COL_MODE."/".$row->COL_BAND."/".date('H', $timestamp)."/".date('i', $timestamp)."/".date('d', $timestamp)."/".date('m', $timestamp)."/".date('Y', $timestamp)); ?>">&#9660;</a>
<?php } ?>
</span>
</td>
<?php } ?>