Results 1 to 4 of 4

Thread: Using a comment widget that loads info depending on the URL

  1. #1
    Join Date
    Aug 2005
    Posts
    115
    Thanks
    3
    Thanked 1 Time in 1 Post

    Default Using a comment widget that loads info depending on the URL

    I have been using this comment widget LINK across many pages on my site. However it seems that when it was developed it was only meant to be used on absolute .htm(l) HTML pages. Now since I am converting pertanant sections of my site to a custom flat-file PHP-based CMS, the same comments are displaying on the 'universal display page', regardless of any variables I may pass through the URL.

    I hve it set up so that each new article is displayed on the same page, the article displayed simply depending on a URL variable. However the widget only reads up the the file extension and ignores anything afterward.

    ie: Same comment is displayed here as well as here

    The widget itself is just a simply 4 line code:
    Code:
    <div class="js-kit-rating"></div>
    <script src="http://js-kit.com/ratings.js"></script>
    <div class="js-kit-comments"></div>
    <script src="http://js-kit.com/comments.js"></script>
    I am a noob PHPer but I think there must be some kind of workaround after reading number 4 of their FAQ; something along the lines of:
    Code:
    if $variable = 25; {
         print "<div class="js-kit-comments" path="25"></div>";
    }
    if $variable = 24; {
         print "<div class="js-kit-comments" path="24"></div>";
    }
    I am working on writing my own php script to solve these types of problems once and for all, for as only recently delving into server-side scripting, I have grown accustomed to using various remotely-hosted widgets on my sites. And now I want to gain complete self-sustainability, and server-side solutions fits the bill.

    Best Regards
    ~Ross

  2. #2
    Join Date
    May 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You need to set path and permalink attributes
    div class="js-kit-comments" style="margin: 0px"
    permalink="<?php the_ID; ?>" path="<?php the_permalink(); ?>">
    </div>

    substitute a variable that has a unique value for the_ID and full URL to the page for the_permalink.

  3. #3
    Join Date
    Apr 2008
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post

    Default

    You will want to put a PHP script into the variable that holds the url.
    PS. You could use echo as well as print to write an HTML message.

  4. #4
    Join Date
    May 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Same Problem

    Hi Ross,

    I've got the exact same problem but no of your expertize...

    Please let us all know if you figure something out!

    Jano

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •