We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38189
    • 31 Posts
    So.. I am currently working on a page that requires me to make an AnythingRating snippet call so I can display the current rating of an item.

    What I don't understand is, why is it that you can only set the tpl and css when you define and can't be change when just making a simple code. I been messing aroudn with the snippet.anythingRating.inc.php and came to the conclusion that if that were to ever function it would be need to be done in this line of code:

    else {
    
    // here are the parameters which are specific to a rated item
    
        // Unique id for this anythingRating instance
        // Any combination of characters a-z, underscores, and numbers 0-9
        $cfg['atrId'] = isset($atrId) ? $atrId : 0;
    	
        $cfg['atrCss'] = ATR_SPATH.'css/'.$atrCss; //what I implemented
    	$cfg['atrTpl'] = "@FILE:".ATR_SPATH.'templates/'.$atrTpl; //what I implemented
        // No votes  [1 | 0]
        // forbid vote for a specific atrId
        $cfg['noVotes'] = isset($noVotes) ? $noVotes : 0;
    
        // Initialize the vote with a rating value or from content of a TV
        $cfg['init'] = isset($init) ? $init : 0;
    
    }
    


    I commented what I implemented, I am new to php and quite frankly I'd like to get this to work but I don't know what I am doing wrong. When I include a "include($atrCss)" or "include($atrTprl)" at the end of that block the information for the files is displayed where the rater is, what I do not understand is why style won't apply.

    Help x.x
      • 38189
      • 31 Posts
      anyone? sad
        • 20413
        • 2,877 Posts
        First some links:
        http://wiki.modxcms.com/index.php/AnythingRating
        https://forums.modx.com/thread/?thread=35851&page=1
        https://forums.modx.com/thread/38448/support-comments-for-anythingrating?page=9#dis-post-219155

        You put that code in an else condition...
        ...can't be change when just making a simple code
        Can you explain this a little more? 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
          • 38189
          • 31 Posts
          Hey Haw thx for replying, I looked at the links and yes I did put it in the else condition because I do not know where to put it! The only time it seems you can apply a tpl is only when you set &define=`1` and I don't want to define, I just want to call it again but with a new tpl and new css.