Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Aug 2002
    Thanked 0 Times in 0 Posts

    Rating-widget-unique-id to Turn into BBcode

    I've been searching for a resolution for over a year now for my monthly book of the month rating inside a topic in a forum.

    I have this code below that I want to turn into a bbcode call
    [rating]{rw-ui-container rw-urid-}[/rating]
    I need to be able to update the rw-ui-container rw-urid- for each topic, either automatically or have the user enter a number inside the rating tags. I don't know if it's possible but I want to check with experience coders.
    <div class="rw-ui-container rw-urid-1"></div>
    The above code (1st line has to be unique for each bbcode). Is there a way to change the code so the user can enter the
    rw-ui-container rw-urid-
    which is now 1 and is the rating-widget-unique-id (so i.e., 2, 3, 4 etc.)
    It's being work out this way:
    "rw-ui-container rw-urid-"+rating.urid+" rw-ui-"+rating.type
    Here is the JS file: http://rating-widget.com/js/external.min.php?t=js

    Here is the code:
    <!-- Add this element exactly where you want the Rating-Widget to appear -->
    <div class="rw-ui-container rw-urid-1"></div>
          You can add more Rating-Widgets in your site,
          just pick some new rating-widget-unique-id (must be positive integer).
          For example (rating-widget-unique-id = 38):
          <div class="rw-ui-container rw-urid-38"></div>
    <!-- Add this javascript code immediately before the </body> tag -->
    <div class="rw-js-container">
        <script type="text/javascript">
            // Async Rating-Widget initialization.
            function RW_Async_Init(){
                    size: "medium",
                    theme: "star_red1",
                    advanced: {
                        font: {
                            bold: true,
                            type: "verdana"
                        layout: {
                            align: {
                                hor: "left"
                    type: "star"
            // Append Rating-Widget JavaScript library.
            if (typeof(RW) == "undefined"){
                    var rw = document.createElement("script");
                    rw.type = "text/javascript"; rw.async = true;
                    rw.src = "http://rating-widget.com/js/external.min.php?t=js";
                    var s = document.getElementsByTagName("script")[0];
                    s.parentNode.insertBefore(rw, s);
    Last edited by victory1; 04-15-2012 at 04:26 PM.


Posting Permissions

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