We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8895
    • 76 Posts

    it works! fuc*** sweet u guys! thanks!!! grin
      • 8895
      • 76 Posts
      sorry i gotta bother you again.
      lets say i want to make another include (for a rating) in the snippet file, how can i do that?
      i tried this - yet it wont show (seems illogic to me actually, but i still tried) =P

      // Output
      $output=$simplevideoshow->render();
      
      // media head
      $medhd="</font><table cellspacing='0' cellpadding='0' border='0'>
      	<tr><td align='center'><b>$med_name</b></td></tr>
      	<tr><td align='center' height='0'>";
      
      // media foot
      $medft1="</td></tr>
      	<tr><td width='100%'>
      		<table border='0' cellspacing='0' cellpadding='2' width='100%'>
      		<tr><td>
      			Comment: 
      		</td><td>
      			$med_comments
      		</td></tr>
      		<tr><td>
      			Rating: 
      		</td><td>";
      			include_once('assets/snippets/rating/rate.php');
      $medft2="	</td></tr>
      
      	</td></tr>
      	</table></table><br /><br />";
      
      $medft=$medft1.$medft2;
      $output=$medhd.$output.$medft;
      // ---------------------------------------------------------------------------------------------------------
      
      return $output;


      rating is in the snippets dir, yet it isnt a snippet - which made me think:
      can i call a snippet in a snippet?
      so instead of including it, make a rating snippet and just call that with [!rate!] or so?
        • 10746
        • 126 Posts
        I don’t have "rating" in my default snippets directory so I can’t be sure what you’ve got there..

        Possibly the CSS star rating snippet

        http://modxcms.com/CSS-Star-Rating-547.html

        in which case you would need to follow the instructions for that, including how it is called (usually with a snippet-style call which AFAIK you can include in existing snippets).


        BUT, I think that this accumulates ratings on a per-document basis, whereas you seem to want a rating module for your individual media items - this would require some special code that would interact with your DB of media items, and store and update ratings..

          • 8895
          • 76 Posts

          hmm, the code i want to include for the rating (so far) is
          $x = 5;
          
          while ($x >= 1)
          {
          	if ($rating >= 1)
          	{
          		print "<img src='assets/snippets/img/1.jpg'>";
          	}
          	else
          	{
          		print "<img src='assets/snippets/img/0.jpg'>";
          	}
          
          $rating--;
          $x--;
          }


          thats practicly the basics. i want to extend this code to give it some special features
          (like public user rating and reguistered user rating, which is then shown as a summary of both.
          so i dont want to use an existing snippet...

          thats why i asked if its possible including a snippet into a snippet