Hallo! Selamat Datang di Marketplace produk digital, Freelancer terbaik di indonesia (65337 Members, 764 Products, 5083 Topic, 12753 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 7 Bulan lalu,
Telah Dilihat 955 Kali
Kodirrrrrrrrrrrrrrr Mengatakan : Sultan Account
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2.  
  3. mohonbantuan agan agan semua, RSS di web ane tiba2 error, padahal di lokal baik-baik aja.
  4. notif
  5. error on line 132 at column 77: xmlParseEntityRef: no name
  6.  
  7. walau pernah ada di grup ini, tapi ane g pernah lihat yg berhasil perbaikan di file rss tersebut.
  8.  
  9.  
  10. isi file RSS ane
  11.  
  12. <?php
  13. $file = fopen("rss.xml", "w");
  14. fwrite($file, '<?xml version="1.0" encoding="UTF-8"?>
  15. <rss version="2.0">');
  16. fwrite($file, "<channel>
  17. <title>RSS QOdir $iden[nama_website]</title>
  18. <description>$iden[meta_deskripsi]</description>
  19. <link>$iden[url]</link>
  20. <language>id-id</language>");
  21.  
  22. foreach ($rss->result_array() as $row) {
  23. $isi = $row['isi_berita'];
  24. fwrite($file, "<item>
  25. <title>".cetak_meta($row['judul'],0,255)."</title>
  26. <link>".base_url()."berita/detail/$row[judul_seo]</link>
  27. <image>".base_url()."berita/detail/$row[gambar]</image>
  28. <description>".strip_tags(html_entity_decode($isi))."</description>
  29. </item>");
  30. }
  31. fwrite($file, "</channel>
  32. </rss>");
  33. fclose($file);
  34. ?>
Ada 1 File Kiriman :
1. xml.png (11 KB)

Ada 5 Jawaban

PHPMU.COM Support
commented on 02 Sep 2021 06:40:26
  1. Waalaikumsalam,..
  2. Coba pada bagian ini :
  3.  
  4. <title>".cetak_meta($row['judul'],0,255)."</title>
  5. <link>".base_url()."berita/detail/$row[judul_seo]</link>
  6. <image>".base_url()."berita/detail/$row[gambar]</image>
  7. <description>".strip_tags(html_entity_decode($isi))."
  8.  
  9. ubah menjadi :
  10.  
  11. <title>".simplexml_load_file($row['judul'])."</title>
  12. <link>".base_url()."berita/detail/$row[judul_seo]</link>
  13. <image>".base_url()."berita/detail/$row[gambar]</image>
  14. <description>".strip_tags(simplexml_load_file($isi))."
Kodirrrrrrrrrrrrrrr
commented on 02 Sep 2021 14:17:24
  1. Assalamualaikum,.. error nya hilang, cuma isi berita di deskripsi nya tidak muncul.
Kodirrrrrrrrrrrrrrr
commented on 06 Sep 2021 16:19:04
  1. Assalamualaikum,..
  2. masih belum solve nih
Kodirrrrrrrrrrrrrrr
commented on 07 Sep 2021 15:57:03
Salah satu jawaban terbaik,..
  1. solved dengan cara ini.
  2. ganti semua isi file rss.php yang ada di view/administrator dengan kode di bawah ini
  3.  
  4. <?php
  5. $iden = $this->db->query("SELECT * FROM identitas")->row_array();
  6. $logo = $this->db->query("SELECT * FROM logo")->row_array();
  7. $sql = $this->db->query("SELECT * FROM berita ORDER BY id_berita DESC LIMIT 10");
  8. $file = fopen("rss.xml", "w");
  9. fwrite($file, '<?xml version="1.0"?>
  10. <rss version="2.0">');
  11.  
  12. fwrite($file, "<channel>
  13. <title>$iden[nama_website] RSS</title>
  14. <link>$iden[url]</link>
  15. <image>
  16. <url>$iden[url]/asset/logo/logo-footer.png</url>
  17. <link>$iden[url]</link>
  18. <width>100</width>
  19. <height>35</height>
  20. </image>
  21. <language>id-id</language>");
  22.  
  23. foreach ($sql->result_array() as $r){
  24. $isi_berita = htmlentities(strip_tags(nl2br($r['isi_berita'])));
  25. $isi = substr($isi_berita,0,500);
  26. $isi = phpmu(substr($isi_berita,0,strrpos($isi," ")));
  27.  
  28. fwrite($file, "<item>
  29. <title>".phpmu($r['judul'])."</title>
  30. <link>$iden[url]/berita/detail/$r[judul_seo]</link>
  31. <image>$iden[url]/asset/foto_berita/$r[gambar]</image>
  32. <description>$isi ...</description>
  33. </item>");}
  34.  
  35. fwrite($file, "</channel></rss>");
  36. fclose($file);
  37. ?>
PHPMU.COM Support
commented on 13 Sep 2021 14:01:09
Salah satu jawaban terbaik,..
  1. Assalamualaikum,.. oke mas siap,..
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!