Haloo! Selamat Datang di Komunitas Private Training Web Development (61355 Members, 697 Products, 4742 Topic, 12274 Comments)

Butuh karyawan baru? atau seorang Web Developer (Part-time/Freelance/Full-time), cari disini : Members Area Jobs!

Swarakalibata V.8.0 share whatsapp gambar tidak muncul

Dibuat
Login Terakhir 4 Hari lalu,
Telah Dilihat 553 Kali
Kafa Noufar Mengatakan : Premium
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2.  
  3. mas roby dan para senior mohon bantuan saya mengunakan Swarakalibata V.8.0 ketika sharing whatsapp tidak muncul gambarnya, saya sudah mencoba mengunakan cara merubah di template dengan script
  4.  
  5. <?php if ($this->uri->segment(1)=='berita' AND $this->uri->segment(2)=='detail'){
  6. $rows = $this->db->query("SELECT * FROM berita where judul_seo='".$this->uri->segment(3)."'")->row_array();
  7. echo '<meta property="og:title" content="'.$title.'" />
  8. <meta property="og:type" content="article" />
  9. <meta property="og:url" content="'.base_url().''.$this->uri->segment(3).'" />
  10. <meta property="og:image" content="'.base_url().'asset/foto_berita/'.$rows['gambar'].'" />
  11. <meta content="'.base_url().'asset/foto_berita/'.$rows['gambar'].'" itemprop="url"/>
  12. <div itemprop="image" itemscope="itemscope" itemtype="https://schema.org/ImageObject">
  13. <meta content="'.base_url().'asset/foto_berita/'.$rows['gambar'].'" itemprop="url"/>
  14. </div>
  15. <meta property="og:description" content="'.$description.'"/>';
  16. } ?>
  17.  
  18. seperti tutorial yang sudah ada tp belum muncul juga gambarny, mohon bantuan dan pencerahannya terima kasih
  19.  
  20.  
  21. ov

Ada 6 Jawaban

Edi Riyanto
commented on 21 Jul 2020 15:30:33
  1. Assalamualaikum,.
  2. Punya saya bisa kok om
  3.  
Hardiansyah
commented on 21 Jul 2020 16:34:51
  1. Assalamualaikum,.. bisa di tricky dengan cara :
  2.  
  3. Buka file controller News.php dan edit function index menjadi :
  4.  
  5. function index($id=null){
  6. $query = $this->model_utama->view_join_two('berita','users','kategori','username','id_kategori',array('judul_seo' => $this->uri->segment(1)),'id_berita','DESC',0,1);
  7. if ($query->num_rows()<=0){
  8. redirect('main');
  9. }else{
  10. $data['cshare'] = 'Y';
  11. $row = $query->row_array();
  12. $data['title'] = cetak($row['judul']);
  13. $data['description'] = cetak_meta($row['isi_berita'],0,500);
  14. $data['keywords'] = cetak($row['tag']);
  15. $data['rows'] = $row;
  16.  
  17. $dataa = array('dibaca'=>$row['dibaca']+1);
  18. $where = array('id_berita' => $row['id_berita']);
  19. $this->model_utama->update('berita', $dataa, $where);
  20.  
  21. $this->load->helper('captcha');
  22. $vals = array(
  23. 'img_path' => './captcha/',
  24. 'img_url' => base_url().'captcha/',
  25. 'font_size' => 17,
  26. 'img_width' => '150',
  27. 'img_height' => 30,
  28. 'border' => 0,
  29. 'word_length' => 5,
  30. 'expiration' => 7200
  31. );
  32.  
  33. $cap = create_captcha($vals);
  34. $data['image'] = $cap['image'];
  35. $this->session->set_userdata('mycaptcha', $cap['word']);
  36. $this->template->load(template().'/template',template().'/detailberita',$data);
  37. }
  38. }
  39.  
  40. kemudian buka file template tersebut dari
  41.  
  42. <?php if ($this->uri->segment(1)=='berita' AND $this->uri->segment(2)=='detail'){
  43.  
  44. menjadi
  45.  
  46. <?php if (isset($cshare) && $cshare == 'Y'){
Hardiansyah
commented on 21 Jul 2020 16:35:56
  1. Assalamualaikum,.. di Controller News.php yg di tambahkan pada function index hanya:
  2. $data['cshare'] = 'Y';
  3.  
Kafa Noufar
commented on 21 Jul 2020 19:00:05
  1. Assalamualaikum,.. terima kasih banyak mas hardiasyah jawabannya, sudah saya coba tambahkan $data['cshare'] = 'Y'; di news.php dan merubah ditemplate menjadi <?php if (isset($cshare) && $cshare == 'Y'){ akan tetapi gambar thumnailnya belum ikut keluar mas he he, ada trik lagi mas ? terima kasih
Donny Indrapati
commented on 11 Apr 2021 17:15:58
  1. Assalamualaikum,.. mungkin link ini bisa membantu...
  2. https://tekno.eksplore.id/2016/03/cara-menampilkan-thumbnail-pada-preview.html
  3.  
  4. saya sudah mencobanya dan berhasil, ini contoh punya saya
  5.  
  6. <title><?php echo $title; ?></title>
  7. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" />
  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  11. <meta name="robots" content="index, follow">
  12. <meta name="description" content="<?php echo $description; ?>">
  13. <meta name="keywords" content="<?php echo $keywords; ?>">
  14. <meta name="author" content="Harapan45Lhokseumawe">
  15. <meta name="robots" content="all,index,follow">
  16. <meta http-equiv="Content-Language" content="id-ID">
  17. <meta NAME="Distribution" CONTENT="Global">
  18. <meta NAME="Rating" CONTENT="General">
  19. <meta property="og:image" content='<?php echo base_url();?>asset/images/favicon1.png'/>
  20.  
  21. <link itemprop="thumbnailUrl" href='<?php echo base_url();?>asset/images/favicon1.png'>
  22. <span itemprop="thumbnail" itemscope itemtype="http://schema.org/ImageObject"/>
  23. <link itemprop="url" href='<?php echo base_url();?>asset/images/favicon1.png'/>
  24. </span>
  25.  
  26. <link rel="canonical" href="<?php echo "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>"/>
  27.  
  28.  
  29. <?php
  30. $berita = $this->model_utama->view_where('berita',array('judul_seo' => $this->uri->segment(1)));
  31. if ($berita->num_rows()>=1){
  32. $rows = $berita->row_array();
  33. echo '<meta property="og:title" content="'.$title.'" />
  34. <meta property="og:type" content="article" />
  35. <meta property="og:url" content="https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'" />
  36. <meta property="og:image" content="'.base_url().'asset/foto_berita/'.$rows['gambar'].'" />
  37. <meta property="og:description" content="'.$description.'"/>';
  38.  
  39. echo '<link itemprop="thumbnailUrl" href="'.base_url().'asset/foto_berita/'.$rows['gambar'].'">
  40. <span itemprop="thumbnail" itemscope itemtype="http://schema.org/ImageObject"/>
  41. <link itemprop="url" href="'.base_url().'asset/foto_berita/'.$rows['gambar'].'"> </span>';
  42. }
  43.  
  44. ?>
  45.  
  46.  
  47.  
Donny Indrapati
commented on 11 Apr 2021 17:16:33
  1. itu letaknya pada template.php
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!