Customizing SMF > Modifications and Packages
Topic Rating Bar
nixlike:
Might be interesting to know whats new in version 0.7.2. Meanwhile I tried to get some insight on the mod regarding the ability to vote again but I see now whats the point in this. Once voted, the stars you voted will be applied to the current vote count in the database while the user ids are being put into the database as well - but totally separated. Whenever a vote got stored in the database, its not possible to find out which user id vote with how many stars, which is actually the important thing for a re-vote.
My coding skills are not good enough to change the entire routine in the code of this modification and neither do I think that Bugo wants this to happen but there is no other way than to rewrite the main part of this mod to get re-votes done. Having topic owners rate their own topics isn't a big deal since that requires only a small modification in the mods source code, but here again I count on Bugo to implement an option to turn it off or on.
Either that or hopefully someone else will come up with a proper topic rating modification. Please see for those important parts in this modification Bugo, it's not just me who is highly interested in this mod. Would donations help you to continue development?
MESWEB:
Where is my "Display mini-rating on the message index"
i have 2 custom template:
First is working fine
Second have missing "mini-rating"
Alb0:
--- Quote from: Ascot on April 18, 2012, 06:21:32 PM ---Is there a way to make a stats block for simple portal of this mod?-
Like "Most rated topics" or something similar (?
thanks in advance.
--- End quote ---
This would actually be pretty useful. Would like to know if it's possible.
Bugo:
MESSSIAH, are you using jQuery in the second template?
Alb0, it's possible, see this code:
--- Code: ---global $smcFunc, $context, $modSettings, $scripturl, $txt;
$context['top_rating'] = array();
$limit = !empty($modSettings['tr_count_topics']) ? (int) $modSettings['tr_count_topics'] : 0;
$ignore_boards = array();
if (!empty($modSettings['tr_ignore_boards']))
$ignore_boards = explode(",", $modSettings['tr_ignore_boards']);
if (!empty($modSettings['recycle_board']))
$ignore_boards[] = $modSettings['recycle_board'];
$query = $smcFunc['db_query']('', '
SELECT tr.id, tr.total_votes, tr.total_value, ms.subject, b.id_board, b.name, m.id_member, m.id_group, m.real_name, mg.group_name
FROM {db_prefix}topic_ratings AS tr
LEFT JOIN {db_prefix}topics AS t ON (t.id_topic = tr.id)
LEFT JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}boards AS b ON (b.id_board = ms.id_board)
LEFT JOIN {db_prefix}members AS m ON (m.id_member = t.id_member_started)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = m.id_group)
WHERE m.id_member != 0' . (empty($ignore_boards) ? '' : '
AND b.id_board NOT IN ({array_int:ignore_boards})') . '
AND {query_wanna_see_board}
AND {query_see_board}
ORDER BY tr.total_votes DESC
LIMIT ' . $limit,
array(
'ignore_boards' => $ignore_boards
)
);
while ($row = $smcFunc['db_fetch_assoc']($query))
$context['top_rating'][$row['id']] = array(
'topic' => '<a href="' . $scripturl . '?topic=' . $row['id'] . '.0" target="_blank">' . $row['subject'] . '</a>',
'board' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0" target="_blank">' . $row['name'] . '</a>',
'author' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" target="_blank">' . $row['real_name'] . '</a>',
'group' => empty($row['id_group']) ? $txt['tr_regular_members'] : $row['group_name'],
'rating' => number_format($row['total_value'] / $row['total_votes'], 2),
'votes' => $row['total_votes']
);
$smcFunc['db_free_result']($query);
print_r($context['top_rating']);
--- End code ---
Paste it into any PHP block and make own design for output.
MESWEB:
--- Quote from: Bugo on April 27, 2012, 11:31:07 PM ---MESSSIAH, are you using jQuery in the second template?
--- End quote ---
I have Extreme6 Final and more custom templates. This mod i working only with Redzone88 template.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version