Archive for php scripts

Need RSS feed parser for a wordpress site?

Importing and displaying external RSS feeds on your site is a great way to share your online activity with your visitors. If you are active on Flickr, Delicious, Twitter, or Tumblr, your visitors will enjoy staying current with your updates. Many social media sites provide exclusive feeds for user-generated content that may be imported and displayed on virtually any web page. In this article, you will learn three ways to import and display feed content on your WordPress-powered website — without installing yet another plugin.

  • Importing and displaying feeds with WordPress & Magpie
  • What is magpie?
    MagpieRSS is an XML-based (expat) RSS parser in PHP. WordPress uses Magpie to parse RSS and Atom feeds and display them on your website. Magpie parses feeds for two different WordPress functions.

    • wp_rss() – fetches and parses feeds for instant
    • fetch_rss() – fetches and parses feeds for advanced

    Ref Site: Readmore

    ADDING ADDITIONAL IMAGES IN THE PRODUCT DETAILS PAGES -Virtuemart tips

    If you are new to the virtue mart shopping cart software, the following steps will help you to add additional product images in Product details page.

    Assumptions:
    You are using,

    • Joomla 1.5 or Joomla 1.0.x
    • Virtue Mart 1.1.0 stable.

    Steps to add additional images in Product details page:

    1. Go  to  virtue mart  admin panel
    2. Choose “choose extended layout” <helps easy navigation>
    3. List out your products.
    4. Click on media button. A new popup will be opened.
    5. Click the new button to add additional images
    6. Choose additional image s as option, give appropriate height and width for the image
    7. Click on save button. That’s all

    I  am not sure about, it will work for lower version of virtue mart also. Please check and gimme a feed back to this post.

    The following pictures help you for easy understanding.

    ImageShack

    ImageShack

    ImageShack

    ImageShack

    ImageShack

    ImageShack

    Part of Page refresh using AJAX with timed delay

    <head>
    <script type=”text/javascript”>
    function makAx() // this function to activate XMLHttpRequest Object
    {
    try
    {
    xm = new ActiveXObject(“Msxml2.XMLHTTP”);
    return true;
    }
    catch (e)
    {
    try
    {
    xm = new ActiveXObject(“Microsoft.XMLHTTP”);
    return true;
    }
    catch (e2)
    {
    xm = false;
    }
    }
    if (!xm && typeof XMLHttpRequest != ‘undefined’)
    {
    xm = new XMLHttpRequest();
    return true;
    }
    }
    function showImages()
    {
    if(makAx()) // XMLHttpRequest checked here
    {
    url = “external-page-for-db-query.php”; // this file will contains your db query
    callavail();
    }
    }
    function callavail()
    {
    xm.open(“GET”,url,true); // This is ajax functionality. It may have true(for synchronous request) or false(for asynchronous request)
    xm.onreadystatechange = cavail;
    xm.send(null);
    }
    function cavail()
    {
    if(xm.readyState == 4) // If ready state reached
    {
    var response = xm.responseText;
    var str = document.getElementById(“showResult”); // result of “external-page-for-db-query.php” will come here
    str.innerHTML = response;
    setTimeout(“showImages()”,1000); // here 1000 represents one second for time delay. showImage() function will be called with the specified time delay
    }
    }
    </script>
    </head>

    <body>
    <div id=”showResult”></div> <!–page result will be displayed here–>
    </body>
    </html>