Ejemplo n.º 1
0
 function generateDo($view = FALSE)
 {
     $datajson = optionGet('captcha_data');
     $savepath = jsonDataDecode($datajson, 'folderci', 'captchafolder');
     $length = jsonDataDecode($datajson, 'lengthci', '5');
     $path = locationUpload('path') . $savepath;
     fileDirCreate($path);
     $this->CI->load->helper('captcha');
     $vals = array('img_path' => $path . '/', 'img_width' => 200, 'img_height' => 60, 'img_url' => locationUpload('url') . $savepath . '/', 'word_length' => $length, 'font_path' => './system/fonts/texb.ttf', 'pool' => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'img_id' => 'cicaptcha', 'font_size' => 16, 'colors' => array('background' => array(255, 255, 255), 'border' => array(135, 5, 0), 'text' => array(0, 0, 0), 'grid' => array(255, 255, 255)));
     $cap = create_captcha($vals);
     $data = array('captcha_time' => $cap['time'], 'ip_address' => $this->CI->input->ip_address(), 'word' => $cap['word']);
     $query = $this->CI->db->insert_string($this->tbl, $data);
     $this->CI->db->query($query);
     $urlCaptcha = locationUpload('path') . $savepath;
     return $urlCaptcha . '/' . $cap['time'] . '.jpg';
 }
Ejemplo n.º 2
0
}
</script>
<div class="cicaptcha">
	<div class="captcha-header">
		<div class="captcha-image"><img src="<?php 
echo base_url();
?>
service/login/captcha/refreshcaptcha" id="cicaptcha"/></div>		
	</div>
	<div class="captcha-body">
		<div class="captcha-div-input">
			<input type="text" name="cicaptcha" class="captcha-input" id="captcha-input" autocomplete="off" placeholder="Enter captcha here" required=""/>
		</div>
		<div class="captcha-div-tool">
			<button type="button" class="btn btn-danger btn-sm captcha-refresh" onclick="javascript:reloadcicaptcha();"><img src="<?php 
echo locationUpload('url');
?>
refresh.png" style="width: 20px"/></button>			
		</div>		
	</div>
</div>
<style>
.cicaptcha{
	padding: 10px;
	width: 210px;
	height: 100px;	
	float:left;	
	text-align:left;		
	border-radius: 10px;
	background-color:#870500;
}
Ejemplo n.º 3
0
 function mc_gallery($id, $thumbsize = 200)
 {
     $CI =& get_instance();
     $s = array('album_id' => $id, 'term_key' => "gallery_list");
     $item = $CI->m_database->fieldRow('albumtaxonomy', $s, 'term_value');
     $s2 = array('gallery_id' => $item);
     $dG = $CI->m_database->fetchData('gallery_images', $s2);
     $j = array();
     $galName = dbField('gallery', 'gallery_id', $item, 'gallery_title');
     foreach ($dG as $rG) {
         $j[] = array('image_id' => $rG->gallery_images_id, 'image_file' => locationUpload('url') . 'gallery/' . $galName . '/' . $rG->gallery_file, 'image_file_thumb' => locationUpload('url') . 'gallery/' . $galName . '/thumbs/' . $thumbsize . '/' . $rG->gallery_file);
     }
     return $j;
 }
Ejemplo n.º 4
0
 function uploadimages()
 {
     $gambar = $_FILES['photo']['name'];
     $ext = pathinfo($gambar, PATHINFO_EXTENSION);
     $fileName = $gambar;
     $mime = $_FILES['photo']['type'];
     $galleryid = $this->input->post('galleryid');
     $altinfo = $this->input->post('altinfo');
     $galleryslug = $this->input->post('galleryslug');
     $path = locationUpload('path') . 'gallery/' . $galleryslug . '/';
     $this->load->library('m_file');
     $type = "jpeg|jpg|png|jpe|bmp|gif";
     $sizelimit = (int) ini_get('upload_max_filesize');
     $proses = $this->m_file->uploadImageSingle(TRUE, TRUE, $gambar, $path, $type, $sizelimit, 0, 0, 'photo');
     if ($proses == TRUE) {
         $this->load->model('media_model', 'mm');
         $this->mm->addGalleryFile($galleryid, $fileName, $mime, $altinfo);
     }
     redirect(base_url(roleURIUser() . 'media/gallery/uploadgallery') . '?gallery=' . $galleryid, 'refresh');
 }
Ejemplo n.º 5
0
 function deleteGalleryFile($imgID, $galleryID)
 {
     $s = array('gallery_images_id' => $imgID, 'gallery_id' => $galleryID);
     if ($this->m_database->isBOF('gallery_images', $s) == TRUE) {
         return false;
     } else {
         $img = $this->m_database->fieldRow('gallery_images', $s, 'gallery_file');
         $galleryName = dbField('gallery', 'gallery_id', $galleryID, 'gallery_title');
         $slug = stringCreateSlug($galleryName);
         $this->load->library('m_file');
         $path = locationUpload('path') . 'gallery/' . $slug . '/';
         $this->m_file->deleteImage($path, $img);
         $this->m_database->deleteRow('gallery_images', $s);
         return true;
     }
 }
Ejemplo n.º 6
0
 function noImageBig()
 {
     $url = locationUpload('url');
     return $url . 'no-image-big.jpg';
 }
Ejemplo n.º 7
0
 function deleteTempFile($file)
 {
     unlink(locationUpload('path') . $this->folderTemp . '/' . $file);
 }
Ejemplo n.º 8
0
	<th>Tanggal</th>
	<th>Alt</th>
	<th>Tipe</th>
	<th>#</th>
</thead>
<tbody>
<?php 
$s = array('gallery_id' => $galleryID);
$c = $this->m_database->countData('gallery_images', $s);
if ($c > 0) {
    $d = $this->m_database->fetchData('gallery_images', $s, 'gallery_date DESC');
    foreach ($d as $r) {
        $slugFolder = stringCreateSlug($row->gallery_title);
        $path = locationUpload('url') . 'gallery/' . $slugFolder . '/' . $r->gallery_file;
        $pathX = locationUpload('path') . 'gallery/' . $slugFolder . '/' . $r->gallery_file;
        $url = locationUpload('url') . 'gallery/' . $slugFolder . '/thumbs/64/' . $r->gallery_file;
        ?>
		<tr>
			<td width="64px">
			<a href="<?php 
        echo $path;
        ?>
" rel="prettyPhoto[<?php 
        echo $r->gallery_images_id;
        ?>
]">
			<img class="lazy" data-original="<?php 
        echo $url;
        ?>
" style="height: 64px;width:64px;"/>
			</a>