rating in portal announcement
duhol Offline
Junior Member
**
Posts: 34
Joined: Mar 2011
Post: #3
RE: rating in portal announcement
i put into portal.php

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
	$thread['tid'] = $tid;

		$rating = '';
		if($foruminfo['allowtratings'] != 1)
		{
			if($moved[0] == "moved")
			{
				$rating = "<td class=\"{$bgcolor}\" style=\"text-align: center;\">-</td>";
			}
			else
			{
				$thread['averagerating'] = floatval(round($thread['averagerating'], 2));
				$thread['width'] = intval(round($thread['averagerating']))*20;
				$thread['numratings'] = intval($thread['numratings']);

				$not_rated = '';
				if(!$thread['rated'])
				{
					$not_rated = ' star_rating_notrated';
				}

				$ratingvotesav = $lang->sprintf($lang->rating_votes_average, $thread['numratings'], $thread['averagerating']);
				eval("\$rating = \"".$templates->get("portal_announcement_rating")."\";");
			}
		}


before:

PHP Code:
		$lastpostdate = my_date($mybb->settings['dateformat'], $announcement['lastpost']);


i put everything from "star_ratings.css" into "global.css"

i make global tamplate "portal_announcement_rating" and i put in there:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<div style="margin-top: 6px; padding-right: 10px;" class="float_right">
		<script type="text/javascript" src="jscripts/rating.js?ver=1400"></script>
		<div id="success_rating_{$thread['tid']}" style="float: left; padding-top: 2px; padding-right: 10px;">&nbsp;</div>
		<strong style="float: left; padding-right: 10px;">{$lang->thread_rating}</strong>
		<div class="inline_rating">
			<ul class="star_rating{$not_rated}" id="rating_thread_{$thread['tid']}">
				<li style="width: {$thread['width']}%" class="current_rating" id="current_rating_{$thread['tid']}">{$ratingvotesav}</li>
				<li><a class="one_star" title="{$lang->one_star}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=1&amp;my_post_key={$mybb->post_code}">1</a></li>
				<li><a class="two_stars" title="{$lang->two_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=2&amp;my_post_key={$mybb->post_code}">2</a></li>
				<li><a class="three_stars" title="{$lang->three_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=3&amp;my_post_key={$mybb->post_code}">3</a></li>
				<li><a class="four_stars" title="{$lang->four_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=4&amp;my_post_key={$mybb->post_code}">4</a></li>
				<li><a class="five_stars" title="{$lang->five_stars}" href="./ratethread.php?tid={$thread['tid']}&amp;rating=5&amp;my_post_key={$mybb->post_code}">5</a></li>
			</ul>
		</div>
</div>


and i put "{$rating}" into "portal_announcement" tamplate

It works. Rating for thread works, but after refresh site it doesnt show that rate was done.

Do you know how to fix it?

If you want you can look for yourself. I make test account: login test_user, password: test_user. Forum url: http://www.filmtoks.pl
Can you help with this?

(This post was last modified: 05-15-2011 03:43 PM by duhol.)
05-15-2011 03:39 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
rating in portal announcement - duhol - 05-15-2011, 05:12 AM
RE: rating in portal announcement - duhol - 05-15-2011 03:39 PM
RE: rating in portal announcement - duhol - 05-15-2011, 10:25 PM
RE: rating in portal announcement - RateU - 05-16-2011, 03:30 AM
RE: rating in portal announcement - duhol - 05-16-2011, 06:51 AM
RE: rating in portal announcement - RateU - 05-16-2011, 07:18 AM
RE: rating in portal announcement - duhol - 05-16-2011, 06:09 PM
RE: rating in portal announcement - RateU - 05-17-2011, 05:59 AM
RE: rating in portal announcement - duhol - 05-17-2011, 07:53 PM
RE: rating in portal announcement - RateU - 05-18-2011, 04:51 AM
RE: rating in portal announcement - RateU - 05-19-2011, 02:39 AM

 Standard Tools
Forum Jump: