Beli Planet UI V.3.O ProHarga Promo 75K Hingga November 2024 Beli Sekarang!

Mengaktifkan Realtime Post Views Counter

Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated
Realtime Views
Themepedia | Realtime Views

Selamat datang di Themepedia!

Jika Anda ingin mengaktifkan Realtime Post Views Counter di Blog Anda, ikuti langkah-langkah sederhana ini untuk memulai.

Persyaratan

  1. Firebase Account
  2. Planet UI v.1.1 Template

Mengaktifkan Realtime Post Views Counter 

Langkah 1: Pertama-tama buat proyek di Firebase.

Langkah 2: Buat database untuk proyek anda

Langkah 3: Tempel aturan berikut:

Untuk Blog Tunggal:

{
  "rules": {
    ".read": true,
    "BlogID_0000000000000000000": {
      ".read": true,
      "$post_id": {
        ".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
        ".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
      }
    }
  }
}

For Beberapa Blog:

{
  "rules": {
    ".read": true,
    "BlogID_0000000000000000000": {
      ".read": true,
      "$post_id": {
        ".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
        ".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
      }
    },
    "BlogID_0000000000000000000": {
      ".read": true,
      "$post_id": {
        ".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
        ".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
      }
    },
    "BlogID_0000000000000000000": {
      ".read": true,
      "$post_id": {
        ".write": "newData.exists() && (data.exists() ? newData.val() == data.val() + 1 : newData.val() == 1)",
        ".validate": "newData.isNumber() && newData.val() % 1 === 0.0 && newData.val() <= 99999999"
      }
    }
  }
}

Jangan lupa untuk mengganti bagian yang ditandai dengan ID Blog Anda.

Langkah 4: Salin URL Basis Data.

Langkah 5: Buka Editor HTML Tema.

Langkah 6: Temukan kode berikut:

realViews: {
  databaseUrl: "",
  abbreviation: "false"
}

Langkah 7: Rekatkan URL Database Anda, itu akan terlihat seperti berikut:

realViews: {
  databaseUrl: "https://example-rtdb.firebaseio.com",
  abbreviation: "false"
}

Langkah 8: Simpan Perubahan dan segarkan Halaman Blog Anda.

Menampilkan Penyingkat Views Count

Jika Anda ingin menampilkan jumlah penayangan dalam angka Singkatan, yaitu 53,89K, bukan 53894, Anda hanya perlu mengikuti langkah-langkah sederhana.

Langkah 1: Temukan kode berikut dengan membuka Theme HTML Editor:

realViews: {
  databaseUrl: "",
  abbreviation: "false"
}

Langkah 2: Ganti false dengan true seperti yang ditunjukkan di bawah ini:

Don't make any changes if it is already true.

realViews: {
  databaseUrl: "",
  abbreviation: "true"
}

Langkah 3: Simpan Perubahan dan segarkan Halaman Blog Anda.

realViews: {
  databaseUrl: "https://example-rtdb.firebaseio.com",
  abbreviation: "false"
}

Contacting Us

Feel free to contact us through Contact Page.

Posting Komentar

  • A-
  • A+

© Planet UI ‧ All rights reserved.

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.