Jump to content

"Convert" short rate script into Dropdown


eevan79

Recommended Posts

Hi,

 

I have phpbb3 forum with 5 (or more) star rating mod (image), and I want to "convert" it to dropdown rating system (if possible).

 

This is evaluation script:

<script type="text/javascript">
var clicked = false;

function eval_mouse_over(value, over)
{
	for(var i = 1; i <= {EVALUATION_STARS}; i++)
	{
		var img = document.getElementsByName("evaluate" + i);

		for(var j = 0; j < img.length; j++)
		{
			if(((over) && (i <= value)) || ((!over) && (i <= {EVALUATION_RESULT_FLOOR})))
			{
				img[j].src = "{EVALUATION_IMG_LIGHT}";
			}
			else if((!over) && (i <= {EVALUATION_RESULT_CEIL}) && ({EVALUATION_RESULT_FLOOR} + 0.4 <= {EVALUATION_RESULT}))
			{
				img[j].src = "{EVALUATION_IMG_HALF}";
			}
			else
			{
				img[j].src = "{EVALUATION_IMG_DARK}";
			}
		}
	}
}
function eval_mouse_click(value)
{
	if(!clicked)
	{
		clicked = true;
		window.location.href = "{EVALUATION_LINK}&evaluation=" + value;
	}
}
</script>

EVALUATION_STARS, EVALUATION_IMG_DARK, EVALUATION_LINK are template vars. Can this be done?

 

Thanks in advance.

Link to comment
Share on other sites

I have no doubt it can be done, but there's more code involved than that - that's just functions for event hooks.

 

You'd also need to provide the html that has the evaluate image, and the javascript that attaches those functions to the events (if that's done in js rather than html).

Link to comment
Share on other sites

You are right...but thats lots of work.  :(

I do not believe that someone help me cause of that, but I can attach all mod files.

 

I think that only 2 files need to be edited:

\root\styles\subsilver2\templates\evaluation.html

and

root\mods\viewtopic.php

 

It appears to be more complicated than I thought.

 

[attachment deleted by admin]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.