Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6647467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:32:29+00:00 2026-05-26T00:32:29+00:00

Using xslt and multiple sources I create a XML file with 100 posts. After

  • 0

Using xslt and multiple sources I create a XML file with 100 posts. After this I echo the title of them sorted by date (the latest is the first). I show only 100 titles in the page. When a source post a new post, then it goes first on my list and the last (100 leaves the list).Each post I show has a class like p+number, e.g p1 for the first, p2 for the 2nd.

this is the main part of news.php

$feeds=array('big-file.xml');
$entries = array();
$xml = simplexml_load_file($feed);
$entries = array_merge($entries, $xml->xpath('//item') );

foreach ($entries as $post) {
if(++$i > 100) break;
echo $post->title;
}

I set a cron job that updates that big-file.xml every 2 mins. Also, in the index.php I have a jQuery script that loads every 3 mins the news.php to show updated news at my visitors.

Noting is saved in a database or somewhere. There are only 100 posts shown.

My question is if there is a way to know how many new posts appeared in my list when the news.php was updated?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:32:30+00:00Added an answer on May 26, 2026 at 12:32 am

    You can set a timestamp when you got the entire list. Then ask for new elements after that timestamp. At server side you take news in the xml recent to older until the news date is before the timestamp. You should update your timestamp at client side. LOOP

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am traversing an XML file (that contains multiple tables) using XSLT. Part of
I am using XSLT to transform a XML into a html/php file. In this
I'm using XSLT 1.0 an want to transform an XML file. It works fine
I am trying to create hyperlinks using XML information and XSLT templates. Here is
I have a XSLT which will split large xml file into multiple xml file
I'm using xslt do display Solr response in html, my xsl file is in
Is it possible to merge elements using XSLT. If I have the following XML
I have to create one table using XSLT and CSS. The table should look
I am have trouble converting my xml using XSLT back to xml in the
I'm trying to apply an xlst transformation using the following file. This is very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.