[Pro] ColorRating

Hi
I’m trying to implement a simple ratings feature using Color Powered by Jack Moore. I am struggling with getting my head around how the coding integrates with Freeway. My test server has sqlite installed. Can anyone explain how this will work using Freeway - do I create a table, a graphic element or HTML element and use the “extended” feature? Or a markup item??


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

A Markup Item containing this line of code:

<?php rating_form("unique_table_name"); ?>

will be substituted with the entire row of Rating: ★★★☆☆ 324 votes (score this item) in your page.

This looks really neat and tidy! It would be great if it didn’t rely on SQLite, since not every host offers that option, but I can understand why they went that way.

One other caveat – this uses jQuery, which means you can’t mix it in the same page with any of the Freeway FX Actions or any of my Scripty or Carousel Actions.

Walter

On Feb 15, 2012, at 7:51 AM, : : al : : wrote:

Hi
I’m trying to implement a simple ratings feature using Color Powered by Jack Moore. I am struggling with getting my head around how the coding integrates with Freeway. My test server has sqlite installed. Can anyone explain how this will work using Freeway - do I create a table, a graphic element or HTML element and use the “extended” feature? Or a markup item??


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks Walt

Your solution works nicely but it’s too good to be true with it’s incompatibility with Freeway actions.

Do you know of any alternative solutions that won’t require getting lost in oodles of code - I’m no coder, hence my choosing Freeway!


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You can use this on the same page as almost all other Actions. You would just have to forego any of mine that have Scripty in the name, plus Carousel, and any of Softpress’s that have FX in their name or a picker to choose an Effect in their interface. All of these rely on Prototype + Scriptaculous, and so they can’t coexist with jQuery in the same page.

Walter

On Feb 15, 2012, at 12:01 PM, : : al : : wrote:

Thanks Walt

Your solution works nicely but it’s too good to be true with it’s incompatibility with Freeway actions.

Do you know of any alternative solutions that won’t require getting lost in oodles of code - I’m no coder, hence my choosing Freeway!


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks again Walt.

I have managed to include it in my page as a looped item within a WebYep loop. NOw all I need to do is stop the same rating occurring for each item!


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

To do that, you’re going to need to inject some unique attribute into each element in the loop. I’m not the person to tell you how to do this in WebYep, but Max probably could. Basically, you need a simple text element that is unique to each of the loop elements, so you might store that as a WebYep plain text element when you create these entries. Then, inside your PHP, you need a way to “play that back”, and that’s where I have no idea how WY works inside a loop. Basically, if you can imagine [[WebYepGoesHere]] being the variable that you use, your code line would look like this:

<?php rating_form("[[WebYepGoesHere]]"); ?>

Maybe that would work, maybe not. You’re getting into the realm where you need to understand how a scripting language works at a pretty low level in order to pull that off. You might have to wrap it in curly-braces in order to signal to the PHP interpreter that it should process this substitution first before executing the code surrounding it. This end of the pool is spoken of as “meta-programming” – spoken, I might add, in hushed and reverent tones.

Now if I were coding this by hand, and not trying to fiddle this in with WebYep and Actions, the loop would be much simpler.

Walter

On Feb 15, 2012, at 4:26 PM, : : al : : wrote:

Thanks again Walt.

I have managed to include it in my page as a looped item within a WebYep loop. NOw all I need to do is stop the same rating occurring for each item!


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


dynamo mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options