Changeset 1420 in ExiteCMS
- Timestamp:
- 05/30/08 21:41:54 (4 years ago)
- Location:
- trunk
- Files:
-
- 32 added
- 5 edited
-
administration/images/ranking.gif (added)
-
administration/ranking.php (added)
-
administration/tools/language_pack_English.php (modified) (8 diffs)
-
administration/upgrade/rev01419.php (added)
-
files/locales/en.main.global.php (modified) (2 diffs)
-
forum/viewthread.php (modified) (5 diffs)
-
images/ranking (added)
-
images/ranking/blue_ball.jpg (added)
-
images/ranking/blue_checkmark.jpg (added)
-
images/ranking/blue_exclamation_mark.jpg (added)
-
images/ranking/blue_star.jpg (added)
-
images/ranking/bullseye.jpg (added)
-
images/ranking/checkbox.jpg (added)
-
images/ranking/crown.jpg (added)
-
images/ranking/golden_star.jpg (added)
-
images/ranking/green_checkmark.jpg (added)
-
images/ranking/grey_star.jpg (added)
-
images/ranking/orange_star.jpg (added)
-
images/ranking/red_ball.jpg (added)
-
images/ranking/red_exclamation_mark.jpg (added)
-
images/ranking/red_flower.jpg (added)
-
images/ranking/red_star.jpg (added)
-
images/ranking/sliver_star.jpg (added)
-
images/ranking/small_star.jpg (added)
-
images/ranking/thumbs_up.jpg (added)
-
images/ranking/yellow_ball.jpg (added)
-
images/ranking/yellow_black_star.jpg (added)
-
images/ranking/yellow_flower.jpg (added)
-
images/ranking/yellow_star.jpg (added)
-
images/ranking/yellow_star2.jpg (added)
-
includes/jscripts/tiny_mce/langs/readme.txt (added)
-
includes/jscripts/tiny_mce/plugins/save/images/cancel.gif (added)
-
includes/jscripts/tiny_mce/tiny_mce_dev.js (added)
-
includes/templates/admin.ranking.tpl (added)
-
includes/templates/forum.renderpost.tpl (modified) (1 diff)
-
includes/user_functions.php (modified) (2 diffs)
-
themes/ExiteCMS/images/tooltip.jpg (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/tools/language_pack_English.php
r1407 r1420 491 491 $localestrings['236'] = "Language Settings"; 492 492 $localestrings['237'] = "Webmaster Toolbox for"; 493 $localestrings['238'] = "Forum Ranking"; 493 494 $localestrings['250'] = "Website Statistics"; 494 495 $localestrings['251'] = "Registered Members:"; … … 514 515 $localestrings['309'] = "You can not install this language pack. This pack is for ExiteCMS version"; 515 516 load_localestrings($localestrings, LP_LOCALE, "admin.main", $step); 517 518 $localestrings = array(); 519 $localestrings['400'] = "Forum Rankings"; 520 $localestrings['401'] = "Add a new ranking"; 521 $localestrings['402'] = "Edit a ranking"; 522 $localestrings['408'] = "There are no forum rankings defined"; 523 $localestrings['409'] = "Note: The rankings are processed in the order shown here. Comparison stops at the first hit. If you use group membership filtering, and you have duplicate post ranges, make sure that the order is correct!"; 524 $localestrings['411'] = "Posts range"; 525 $localestrings['412'] = "Rank title"; 526 $localestrings['413'] = "Rank image"; 527 $localestrings['414'] = "Only for members of"; 528 $localestrings['415'] = "Order"; 529 $localestrings['416'] = "Options"; 530 $localestrings['417'] = "Move this rank up"; 531 $localestrings['418'] = "Move this rank down"; 532 $localestrings['419'] = "Edit this rank"; 533 $localestrings['420'] = "Delete this rank"; 534 $localestrings['421'] = "Posts selection range:"; 535 $localestrings['422'] = "From"; 536 $localestrings['423'] = "To"; 537 $localestrings['424'] = "Posts"; 538 $localestrings['425'] = "Rank title:"; 539 $localestrings['426'] = "Rank image:"; 540 $localestrings['427'] = "- none -"; 541 $localestrings['428'] = "Repeat this image:"; 542 $localestrings['429'] = "Times"; 543 $localestrings['430'] = "Available groups:"; 544 $localestrings['431'] = "Selected groups:"; 545 $localestrings['432'] = "Save this ranking"; 546 $localestrings['433'] = "Apply this ranking to the following user groups only:"; 547 $localestrings['434'] = "Rank order:"; 548 $localestrings['435'] = "Rank group comparison using:"; 549 $localestrings['436'] = " and "; 550 $localestrings['437'] = " or "; 551 $localestrings['438'] = "Rank title color:"; 552 $localestrings['439'] = "Show title as tooltip:"; 553 $localestrings['440'] = "No"; 554 $localestrings['441'] = "Yes"; 555 $localestrings['490'] = "The Post selection range must be filled in, and both values most be positive integers!"; 556 $localestrings['491'] = "The Post selection range must be filled in, and From must be lower than To!"; 557 $localestrings['492'] = "Ranking succesfully deleted"; 558 load_localestrings($localestrings, LP_LOCALE, "admin.ranking", $step); 516 559 517 560 $localestrings = array(); … … 889 932 $localestrings['532'] = "Error: The session timeout value should be greater than the extended login timeout!"; 890 933 $localestrings['533'] = "Error: The extended login timeout should be greater than the standard login timeout!"; 934 $localestrings['534'] = "Forum edit timeout:"; 935 $localestrings['535'] = "Hour"; 936 $localestrings['536'] = "Hours"; 891 937 $localestrings['550'] = "Security"; 892 938 $localestrings['551'] = "Enable registration system?"; … … 1212 1258 $localestrings['es'] = "Spain"; 1213 1259 $localestrings['et'] = "Ethiopia"; 1260 $localestrings['eu'] = "European Union"; 1214 1261 $localestrings['fi'] = "Finland"; 1215 1262 $localestrings['fj'] = "Fiji"; … … 1288 1335 $localestrings['mm'] = "Myanmar"; 1289 1336 $localestrings['mn'] = "Mongolia"; 1337 $localestrings['mo'] = "Macau"; 1290 1338 $localestrings['mp'] = "Northern Mariana Islands"; 1291 1339 $localestrings['mq'] = "Martinique"; … … 1321 1369 $localestrings['pm'] = "Saint Pierre And Miquelon"; 1322 1370 $localestrings['pr'] = "Puerto Rico"; 1371 $localestrings['pr'] = "Palestinian Territories"; 1323 1372 $localestrings['pt'] = "Portugal"; 1324 1373 $localestrings['pw'] = "Palau"; … … 1362 1411 $localestrings['tv'] = "Tuvalu"; 1363 1412 $localestrings['tw'] = "Taiwan, Province Of China"; 1413 $localestrings['tz'] = "Tanzania"; 1364 1414 $localestrings['ua'] = "Ukraine"; 1365 1415 $localestrings['ug'] = "Uganda"; … … 2162 2212 $localestrings['517'] = "Toggle smileys"; 2163 2213 $localestrings['518'] = "pixels"; 2214 $localestrings['519'] = ""; 2164 2215 $localestrings['520'] = "Moderator Options:"; 2165 2216 $localestrings['521'] = "Delete Thread"; -
trunk/files/locales/en.main.global.php
r1401 r1420 3 3 // locale : English 4 4 // locale name : main.global 5 // generated on : Thu May 15 2008, 14:39:50CEST5 // generated on : Fri May 30 2008, 20:06:43 CEST 6 6 // translators : ExiteCMS team,WanWizard 7 7 // ---------------------------------------------------------- … … 83 83 $locale['085'] = "%u private message"; 84 84 $locale['086'] = "%u private messages"; 85 $locale['087'] = " ?";85 $locale['087'] = "Downloads"; 86 86 $locale['088'] = "%u new forum post"; 87 87 $locale['089'] = "%u new forum posts"; -
trunk/forum/viewthread.php
r1398 r1420 158 158 } 159 159 // check if this isn't a reload, back-post, or double submit 160 if (isset($_ COOKIE['post_'.$random_id])) {160 if (isset($_SESSION['posts'][$random_id])) { 161 161 redirect("post.php?action=quickreply&forum_id=$forum_id&thread_id=$thread_id&post_id=0&errorcode=3"); 162 162 } else { 163 163 if (!$flood) { 164 setcookie("post_".$random_id, "posted", time() + 60*60, "/", "", "0"); 164 if (!isset($_SESSION['posts']) || !is_array($_SESSION['posts'])) $_SESSION['posts'] = array(); 165 $_SESSION['posts'][$random_id] = time()+60*60*12; 165 166 $sig = ($userdata['user_sig'] ? '1' :'0'); 166 167 $smileys = isset($_POST['disable_smileys']) ? "0" : "1"; … … 268 269 while ($data = dbarray($result)) { 269 270 271 // default, show no ranking information 272 $data['show_ranking'] = false; 273 270 274 // check for a system-post (author = 0 ), use some of the webmasters details for this 271 275 if ($data['post_author'] == 0) { … … 278 282 $data['user_sig'] = ""; 279 283 $data['user_status'] = "0"; 284 } else { 285 // check if a ranking is defined for this poster 286 $result2 = dbquery("SELECT * FROM ".$db_prefix."forum_ranking WHERE rank_posts_from <= '".$data['user_posts']."' AND rank_posts_to >= '".$data['user_posts']."' ORDER BY rank_order"); 287 while ($data2 = dbarray($result2)) { 288 // get the grouplist for this ranking 289 if (strpos($data2['rank_groups'], ",")) { 290 $groups = explode(",", $data2['rank_groups']); 291 } else { 292 if (empty($data2['rank_groups'])) { 293 $groups = ""; 294 } else { 295 $groups = array($data2['rank_groups']); 296 } 297 } 298 if (is_array($groups)) { 299 // check for group matching as well, assume a match will be found 300 $ranking_match = true; 301 foreach($groups as $group) { 302 if ($data2['rank_groups_and']) { 303 // all should match 304 if (!checkusergroup($data['post_author'], $group)) { 305 // bail out if a non-match has been found 306 $ranking_match = false; 307 break; 308 } 309 } else { 310 // one match is sufficient 311 if (checkusergroup($data['post_author'], $group)) { 312 $ranking_match = true; 313 break; 314 } 315 } 316 } 317 } else { 318 // no groups to test, must be a match on posts range 319 $ranking_match = true; 320 } 321 // if we had a match, add the ranking information to the post data 322 if ($ranking_match) { 323 $data['ranking'] = $data2; 324 $data['show_ranking'] = true; 325 break; 326 } 327 } 280 328 } 281 329 … … 301 349 $last_post_datestamp = max($data['post_datestamp'], $data['post_edittime'], $last_post_datestamp); 302 350 303 // check what options to show for this post 304 $data['user_can_edit'] = iMEMBER && $data['post_author'] != 0 && (iMOD || iSUPERADMIN || (!$tdata['thread_locked'] && $userdata['user_id'] == $data['post_author'])); 351 // check if the user can edit this post. Assume the user can't 352 $data['user_can_edit'] = false; 353 if (iMEMBER) { 354 // webmasters and forum moderators may always edit 355 if (iSUPERADMIN || iMOD) { 356 $data['user_can_edit'] = true; 357 } else { 358 // check if this is not a system post 359 if ($data['post_author'] != 0) { 360 // check if the thread is not locked 361 if (!$tdata['thread_locked']) { 362 // check if this is the users own post 363 if ($userdata['user_id'] == $data['post_author']) { 364 // check if the edit time is not expired 365 if ($settings['forum_edit_timeout'] == 0 || ($data['post_datestamp'] + $settings['forum_edit_timeout'] * 3600) > time()) { 366 $data['user_can_edit'] = true; 367 } 368 } 369 } 370 } 371 } 372 } 373 374 // check if we can show the poster's IP address 305 375 $data['show_ip'] = (iMOD || iSUPERADMIN && ($data['post_ip'] != "0.0.0.0" && file_exists(PATH_THEME."images/ip.gif"))); 306 376 … … 324 394 // user & group memberships 325 395 $data['group_names'] = array(); 396 // if a ranking is present, and a rank title is defined, display that first 397 if (isset($data['ranking']) && !empty($data['ranking']['rank_title']) && !$data['ranking']['rank_tooltip']) { 398 $data['group_names'][] = array('type' => 'R', 'color' => $data['ranking']['rank_color'], 'name' => $data['ranking']['rank_title']); 399 } 400 // display the standard user level next 326 401 $data['group_names'][] = array('type' => 'U', 'level' => $data['user_level'], 'name' => getuserlevel($data['user_level'])); 327 402 -
trunk/includes/templates/forum.renderpost.tpl
r1400 r1420 79 79 {/if} 80 80 <br /> 81 {if $posts[pid].show_ranking} 82 {if $posts[pid].ranking.rank_image} 83 {section name=img start=0 loop=$posts[pid].ranking.rank_image_repeat} 84 <img src='{$smarty.const.IMAGES}ranking/{$posts[pid].ranking.rank_image}' alt='' title='{if $posts[pid].ranking.rank_tooltip && $posts[pid].ranking.rank_title != ""}{$posts[pid].ranking.rank_title}{/if}' style='border:0px;' /> 85 {/section} 86 <br /> 87 {/if} 88 {/if} 89 {* show a ranking title first *} 90 {section name=ug loop=$posts[pid].group_names} 91 {if $posts[pid].group_names[ug].type == "R"} 92 {if $posts[pid].group_names[ug].color|default:"" != ""} 93 <span class='small'><font color='{$posts[pid].group_names[ug].color}'>{$posts[pid].group_names[ug].name}</font></span> 94 {else} 95 <span class='small'>{$posts[pid].group_names[ug].name}</span> 96 {/if} 97 <br /> 98 {/if} 99 {/section} 81 100 {* show admin/superadmin level first *} 82 101 {section name=ug loop=$posts[pid].group_names} -
trunk/includes/user_functions.php
r1401 r1420 250 250 } 251 251 252 // Check if user is assigned to the specified user group252 // Check if the current user is assigned to the specified user group 253 253 function checkgroup($group) { 254 254 if (iSUPERADMIN && ($group != "100")) { return true; } … … 262 262 return false; 263 263 } 264 } 265 266 // Check if a user is assigned to the specified user group 267 function checkusergroup($user_id, $group_id) { 268 global $db_prefix; 269 270 // every user is a member 271 if ($group_id == "101") { return true; } 272 // get the group rights from the user record 273 $result = dbquery("SELECT user_groups, user_level FROM ".$db_prefix."users WHERE user_id = '".$user_id."'"); 274 if ($data = dbarray($result)) { 275 // check if the requested group matches a user level 276 if ($group_id == $data['user_level']) { return true; } 277 // if group memberships are defined, get the users own group memberships into an array 278 if (!empty($data['user_groups'])) { 279 $groups = explode(".", substr($data['user_groups'], 1)); 280 foreach ($groups as $group) { 281 // check if this groups has subgroups. If so, add them to the array 282 getsubgroups($group); 283 } 284 // now that we have all groups, check for a match 285 foreach ($groups as $group) { 286 if ($group == $group_id) { return true; } 287 } 288 } 289 } 290 // user not found or no group match 291 return false; 264 292 } 265 293
Note: See TracChangeset
for help on using the changeset viewer.
