We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17921
    • 101 Posts
    Hello! I use AnithingRating with Maxigallery.

    I try to display images in the table Top Rated. So I have the following problem: address of my images are not right, in Firebug look like

    <img src="37.jpg" />


    instead of

    <img src="http://site.com/37.jpg" />


    My call:

    [[AnythingRating?  &language=`russian` &getTopRated=`1` &atrGrp=`2d` &topNb=`3`  &topTable=`maxigallery` &topIdField=`id` &topDescrField=`descr` &topImageField=`filename` topLinkField=`gal_id`  ]]
    


    And this img is not a link sad

    Please, help me...
      samurai smiley
      • 5811
      • 1,717 Posts
      Hello Maerrry;

      In the header of your template, add:
      <base href="[(site_url)]" />
        • 17921
        • 101 Posts
        Quote from: coroico at Dec 27, 2009, 01:41 PM

        Hello Maerrry;

        In the header of your template, add:
        <base href="[(site_url)]" />



        It doesn`t work. Sorry smiley
          samurai smiley
          • 5811
          • 1,717 Posts
          On this page of my demo site http://www.modx.wangba.fr/index.php?id=155, the code of the page is:
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=[(mod2_charset)]" />
          <title>Anything Rating | Portraits</title>
          <meta name="keywords" content="rating, contest, vote, evaluation" />
          <link rel="stylesheet" type="text/css" href="assets/templates/anythingRatingB/css/main.css" media="screen" />
          <link rel="stylesheet" type="text/css" href="assets/templates/anythingRatingB/css/search.css" media="screen" />
          <base href="http://modx.wangba.fr/"></base>
          With <base href="http://modx.wangba.fr/"></base> code line in the header of the template.
          In your case <base href="[(site_url)]" /> or <base href="[(site_url)]"></base> should solve your issue. With firebug do you see a difference on the image address ?

          [EDIT] Clear the MODx cache if needed
            • 17921
            • 101 Posts
            Hello smiley

            I`ve done how you said about <base href="http://site.com/"></base>, cleared cache but I still see <img src="37.jpg" /> in Firebug sad Hmm, that`s little strange...
              samurai smiley
              • 5811
              • 1,717 Posts
              Could you add: &topTpl=`@FILE:assets/snippets/anythingRating/templates/anotherTopRated.tpl.html` in the snippet call which display the top rated list. Like for instance:
              [!AnythingRating? &getTopRated=`1` &topDir=`worst` &atrGrp=`travel` &topNb=`3` 
              &topTpl=`@FILE:assets/snippets/anythingRating/templates/anotherTopRated.tpl.html` 
              &topTable=`maxigallery` &topDescrField=`descr` &topImageField=`filename` 
              &topLinkField=`gal_id` &topLabel=`travel photographies`!]

              And create a new template file named anotherTopRated.tpl.html in the anythingRating/templates/ folder.
              [+atr.tpl:is=`result`:then=`<tr id="tr-[+atr.rank+]">
                <td>[+atr.rank+]</td>
                <td>[+atr.rating+]/[+atr.nbstars+] [+atr.lbstars+]</td>
                <td>[+atr.nbvotes+] [+atr.lbvotes+]</td>
                <td><a href="[+atr.baseurl+]index.php?id=[*id*]&pic=[+atr.ratingid+]">[+atr.title+]</a></td>
                [+atr.usedescr:is=`1`:then=`<td>[+atr.descr+]</td>`+]
                [+atr.useimage:is=`1`:then=`<td><img style="vertical-align:center" src="[+atr.baseurl+]assets/galleries/[+atr.link+]/tn_[+atr.image+]" class="thumbnail"></td>`+]
              </tr>`+]
              [+atr.tpl:is=`toprated`:then=`<div id="[+atr.groupid+]" class="topRatedList">
              <p class="topLabel">[+atr.toplabel+]</p>
              <table>
              <tr class="toprated">
                <th>[+atr.hdrank+]</th>
                <th>[+atr.hdscore+]</th>
                <th>[+atr.hdnbvotes+]</th>
                <th class="toptitle">[+atr.hdtitle+]</th>
                [+atr.usedescr:is=`1`:then=`<th class="topdescr">[+atr.hddescr+]</th>`+]
                [+atr.useimage:is=`1`:then=`<th class="topimage">[+atr.hdimage+]</th>`+]
              </tr>
              [+atr.results+]
              </table>
              </div>`+]
              In this example [+atr.baseurl+]assets/galleries/[+atr.link+]/tn_[+atr.image+] point to the thumbail adress of my maxigallery images. You probably need to adapt this image source.
              and then defined or not the classes: thumbnail, topdescr, topimage for a better display.
              Try it and let me know if it is ok.
                • 17921
                • 101 Posts
                Yeees! It works perfectly now!

                coroico, many thanks!!!! smiley smiley smiley
                  samurai smiley
                  • 5811
                  • 1,717 Posts
                  it’s nothing. I know that the anythingRating documentation should be improved ... May be the next year wink

                  Счастливое Новый Год для русской общины
                    • 20413
                    • 2,877 Posts
                    @FireDart - Valid xhtml transitional:
                    anythingRating.class.inc.php

                    Line 259
                                $curl = 'atrGrp='.$grp.'&atrId='.$id.'&rating='.$i*100/$nbs;


                    Line 422
                          if ($qs != '') $qs = $uri[0].'?'.$qs.'&'.$curl;


                    //Another note: I had to change div .star-rating and div .star-rating2 to 100px width. smiley
                      @hawproductions | http://mrhaw.com/

                      Infograph: MODX Advanced Install in 7 steps:
                      http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                      Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                      http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                      • 25551 ☆ A M B ☆
                      • 1,231 Posts
                      Quote from: rossco at Aug 29, 2009, 04:01 AM

                      Quote from: rossco at Apr 25, 2009, 04:43 AM

                      Hello, I want to use this great snippet for several different features on a website but I have one question. Can I put the ratings in to a separate database? The reason I would like a separate database is because this could potentially make the modx database become very large in terms of listings of tables.

                      I want to allow each user their own ratings area which works great but this is creating a whole table per user.

                      modx_atRating_test
                      modx_atRating_test1
                      modx_atRating_test2
                      modx_atRating_test3
                      modx_atRating_test4

                      etc....

                      This will eventually make the modx database a bit annoying to scroll through so I thought that it would be good to have the ratings in a different database, on the same server. Is this possible with little hacking? Thanks!

                      I asked this months ago and wondered if anyone has managed to use a separate DB for the ratings?

                      I can’t seem to find where the info in passed to the database so I can change it to use a separate DB. Anyone know by chance?
                        Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                        AugmentBLU - MODX Partner

                        BLUcart - MODX Revolution E-Commerce & Shopping Cart