WebsiteBaker 2.13.9 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
pullRatingSnip();
mod_ajaxstarratting_question mod_ajaxstarratting_ratinginsteadmod_ajaxsurvey_question mod_ajaxsurvey_rating
function Show_Top_Rating($count = 5, $title = "Top rated:", $show_title = 1, $show_totals = 0, $ShowRatingStars = 1, $ShowOutOfFive = 1, $ShowRating = 1, $ShowVotes = 1 ) { global $database; $tbl_counter = TABLE_PREFIX ."mod_ajaxsurvey_question"; $tbl_pages = TABLE_PREFIX ."pages"; $pagelist = $database->query("SELECT sum(question_id) as total, r.page_id, p.page_title, p.menu_title, p.link, question_id as question FROM $tbl_counter r INNER JOIN $tbl_pages p on (p.page_id = r.page_id) GROUP BY page_id ORDER BY total ASC"); $inner_count = 0; if ($pagelist->numRows() > 0){ echo "<div class=\"ajaxTopRatingTitle\"><h3>$title</h3></div><div class=\"ajaxTopRatingBox\"><ul>"; while(($res = $pagelist->fetchRow()) && ($inner_count++ < $count)) { if ($ShowOutOfFive == 1) { $OutOfFiveEcho = ' ,Rated <span id="outOfFive_'.$res['question'].'" class="out5Class">'.outOfFiveSnip($res['question']).'</span>/5'; } else { $OutOfFiveEcho = ''; } if ($ShowVotes == 1) { $ShowVotesEcho = ' ,<span id="percentage_'.$res['question'].'" class="percentClass">'.getVotesSnip($res['question']).'</span>'; } else { $ShowVotesEcho = ''; } if ($ShowRating == 1) { $ShowRatingEcho = ' (<span id="showvotes_'.$res['question'].'" class="votesClass">'.getRatingSnip($res['question']).'</span>)'; } else { $ShowRatingEcho = ''; } if ($ShowRatingStars == 1) { $ShowRatingStarsEcho = pullRating($res['question']); } else { $ShowRatingStarsEcho = ''; } if ($show_title == 1) { $TopRatedTitle = showQuestionTitle($res['question']); } else if ( $show_title == 2) { $TopRatedTitle = $res['menu_title']; } else if ( $show_title == 3) { $TopRatedTitle = $res['page_title']; } echo "<li><a href=\"".page_link($res['link'])."\""; echo ">".$TopRatedTitle.$ShowRatingStarsEcho.$OutOfFiveEcho.$ShowRatingEcho.$ShowVotesEcho."</a></li>" ; } echo "</ul></div>"; }}
$count = 5 ---- shows number of items in list$title = "Top rated:" ---- Title text$show_title = 1 ---- Shows title for list item: 1 = Question title, 2 = Menu title, 3 = Page title$ShowRatingStars = 1 ---- Displays stars$ShowOutOfFive = 1 --- Shows: Rated 5/5$ShowRating = 1 ---- Shows: (100%)$ShowVotes = 1 ---- Shows: 1 time vodet