Hallo! Selamat Datang di Marketplace produk digital, Freelancer terbaik di indonesia (62756 Members, 730 Products, 4822 Topic, 12377 Comments)

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

RSS Error di swarakalibata Ci 1.2

Dibuat
Login Terakhir 11 Hari lalu,
Telah Dilihat 191 Kali
Kodirrrrrrrrrrrrrrr Mengatakan : Premium
Assalamualaikum Warahmatullahi Wabarakatuh...

mohonbantuan agan agan semua, RSS di web ane tiba2 error, padahal di lokal baik-baik aja.
notif 
error on line 132 at column 77: xmlParseEntityRef: no name

walau pernah ada di grup ini, tapi ane g pernah lihat yg berhasil perbaikan di file rss tersebut.


isi file RSS ane 

<?php
  $file 
fopen("rss.xml""w");
  
fwrite($file'<?xml version="1.0" encoding="UTF-8"?> 
  <rss version="2.0">'
);
  
fwrite($file"<channel> 
                <title>RSS QOdir 
$iden[nama_website]</title> 
                <description>
$iden[meta_deskripsi]</description>
                <link>
$iden[url]</link> 
                <language>id-id</language>"
);

                foreach (
$rss->result_array() as $row) {
                    
$isi $row['isi_berita']; 
                    
fwrite($file"<item>
                                        <title>"
.cetak_meta($row['judul'],0,255)."</title>
                                        <link>"
.base_url()."berita/detail/$row[judul_seo]</link>
                                        <image>"
.base_url()."berita/detail/$row[gambar]</image>
                                        <description>"
.strip_tags(html_entity_decode($isi))."</description>
                                    </item>"
);
                }
  
fwrite($file"</channel>
      </rss>"
);
  
fclose($file);
?>
1
Ada 1 File Kiriman :
1. xml.png (11 KB)

Ada 5 Jawaban

PHPMU.COM Support
commented on 02 Sep 2021 06:40:26
Waalaikumsalam,.. 
Coba pada bagian ini :

<title>".cetak_meta($row['judul'],0,255)."</title>
<link>".base_url()."berita/detail/$row[judul_seo]</link>
<image>".base_url()."berita/detail/$row[gambar]</image>
 <description>".strip_tags(html_entity_decode($isi))."

ubah menjadi :

<title>".simplexml_load_file($row['judul'])."</title>
<link>".base_url()."berita/detail/$row[judul_seo]</link>
<image>".base_url()."berita/detail/$row[gambar]</image>
 <description>".strip_tags(simplexml_load_file($isi))."
1
Kodirrrrrrrrrrrrrrr
commented on 02 Sep 2021 14:17:24
Assalamualaikum,.. error nya hilang, cuma isi berita di deskripsi nya tidak muncul. 1
Kodirrrrrrrrrrrrrrr
commented on 06 Sep 2021 16:19:04
Assalamualaikum,.. 
masih belum solve nih
1
Kodirrrrrrrrrrrrrrr
commented on 07 Sep 2021 15:57:03
Salah satu jawaban terbaik,..
solved dengan cara ini.
ganti semua isi file rss.php yang ada di view/administrator dengan kode di bawah ini 

<?php
  $iden 
$this->db->query("SELECT * FROM identitas")->row_array();
  
$logo $this->db->query("SELECT * FROM logo")->row_array();
  
$sql  $this->db->query("SELECT * FROM berita ORDER BY id_berita DESC LIMIT 10");
  
$file fopen("rss.xml""w");
  
fwrite($file'<?xml version="1.0"?> 
  <rss version="2.0">'
);

  
fwrite($file"<channel> 
                <title>
$iden[nama_website] RSS</title> 
                <link>
$iden[url]</link> 
                <image>
                <url>
$iden[url]/asset/logo/logo-footer.png</url>
                <link>
$iden[url]</link>
                <width>100</width>
                <height>35</height>
                </image>
                <language>id-id</language>"
);

  foreach (
$sql->result_array() as $r){
  
$isi_berita htmlentities(strip_tags(nl2br($r['isi_berita']))); 
  
$isi   substr($isi_berita,0,500); 
  
$isi   phpmu(substr($isi_berita,0,strrpos($isi," "))); 

  
fwrite($file"<item>
                 <title>"
.phpmu($r['judul'])."</title>
                 <link>
$iden[url]/berita/detail/$r[judul_seo]</link>
                 <image>
$iden[url]/asset/foto_berita/$r[gambar]</image>
                 <description>
$isi ...</description>
                 </item>"
);}

  
fwrite($file"</channel></rss>");
  
fclose($file);
  
?>
1
PHPMU.COM Support
commented on 13 Sep 2021 14:01:09
Assalamualaikum,.. oke mas siap,..  1
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!