Changeset 705
- Timestamp:
- 03/18/11 13:00:51 (14 months ago)
- Location:
- trunk
- Files:
-
- 10 added
- 51 edited
-
admin/applets/menu.php (modified) (12 diffs)
-
admin/applets/modules.php (modified) (7 diffs)
-
admin/applets/tree.php (modified) (1 diff)
-
admin/components/blogs/backend.php (modified) (3 diffs)
-
admin/components/clubs/backend.php (modified) (3 diffs)
-
admin/components/forms/backend.php (modified) (1 diff)
-
admin/components/photos/backend.php (modified) (1 diff)
-
admin/dbstructure.php (modified) (2 diffs)
-
admin/js/menu.js (modified) (1 diff)
-
admin/js/modules.js (modified) (1 diff)
-
admin/modules/mod_menu/backend.xml (modified) (1 diff)
-
components/blogs/frontend.php (modified) (7 diffs)
-
components/blogs/model.php (modified) (5 diffs)
-
components/clubs/frontend.php (modified) (6 diffs)
-
components/clubs/model.php (modified) (2 diffs)
-
components/comments/frontend.php (modified) (1 diff)
-
components/forum/frontend.php (modified) (2 diffs)
-
components/forum/includes/forumcore.php (modified) (1 diff)
-
components/photos/frontend.php (modified) (10 diffs)
-
components/photos/model.php (modified) (2 diffs)
-
components/photos/router.php (modified) (1 diff)
-
components/search/frontend.php (modified) (1 diff)
-
components/users/ajax/status.php (modified) (1 diff)
-
components/users/frontend.php (modified) (10 diffs)
-
components/users/model.php (modified) (4 diffs)
-
components/users/router.php (modified) (1 diff)
-
core/classes/page.class.php (modified) (7 diffs)
-
core/classes/photo.class.php (added)
-
core/classes/upload_photo.class.php (added)
-
core/classes/user.class.php (modified) (4 diffs)
-
core/cms.php (modified) (7 diffs)
-
core/lib_karma.php (modified) (1 diff)
-
images/.htaccess (modified) (1 diff)
-
index.php (modified) (2 diffs)
-
install/sqldumpdemo.sql (modified) (1 diff)
-
install/sqldumpempty.sql (modified) (1 diff)
-
languages/ru/components/clubs.php (modified) (1 diff)
-
languages/ru/components/photos.php (modified) (2 diffs)
-
languages/ru/components/users.php (modified) (2 diffs)
-
languages/ru/lang.php (modified) (1 diff)
-
migrate/index.php (modified) (2 diffs)
-
migrate/previous/170 (added)
-
migrate/previous/170/index170.php (added)
-
migrate/previous/170/step1.php (added)
-
migrate/previous/170/step2.php (added)
-
migrate/previous/170/step3.php (added)
-
migrate/previous/170/step4.php (added)
-
migrate/previous/170/step5.php (added)
-
migrate/previous/170/step6.php (added)
-
modules/mod_menu/module.php (modified) (3 diffs)
-
modules/mod_uc_random/module.php (modified) (3 diffs)
-
modules/mod_user_friend/module.php (modified) (1 diff)
-
templates/_default_/components/com_photos_add1.tpl (modified) (1 diff)
-
templates/_default_/components/com_photos_add2.tpl (modified) (1 diff)
-
templates/_default_/components/com_photos_edit.tpl (modified) (3 diffs)
-
templates/_default_/components/com_photos_view.tpl (modified) (1 diff)
-
templates/_default_/components/com_users_photo_submit.tpl (modified) (1 diff)
-
templates/_default_/components/com_users_photos.tpl (modified) (2 diffs)
-
templates/_default_/css/styles.css (modified) (1 diff)
-
templates/_default_/modules/mod_menu.tpl (modified) (1 diff)
-
upload/.htaccess (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/applets/menu.php
r625 r705 202 202 $id = (int)$_REQUEST['id']; 203 203 204 $title = $ _REQUEST['title'];204 $title = $inCore->request('title', 'str', ''); 205 205 $menu = $_REQUEST['menu']; 206 206 $link = $inCore->getMenuLink($_REQUEST['mode'], $_REQUEST[$_REQUEST['mode']], $id); … … 210 210 $published = $_REQUEST['published']; 211 211 $template = $_REQUEST['template']; 212 $allow_group = $_REQUEST['allow_group']; 212 213 $is_public = $inCore->request('is_public', 'int', ''); 214 if (!$is_public){ 215 $access_list = $inCore->request('allow_group', 'array_int'); 216 $access_list = $inCore->arrayToYaml($access_list); 217 } 218 213 219 $iconurl = $_REQUEST['iconurl']; 214 220 … … 230 236 linkid='$linkid', 231 237 target='$target', 232 published= $published,238 published='$published', 233 239 template='$template', 234 a llow_group='$allow_group',240 access_list='$access_list', 235 241 iconurl='$iconurl' 236 WHERE id = $id242 WHERE id = '$id' 237 243 LIMIT 1"; 238 244 dbQuery($sql) ; … … 253 259 254 260 $menu = $_REQUEST['menu']; 255 $title = $ _REQUEST['title'];261 $title = $inCore->request('title', 'str', ''); 256 262 $target = $_REQUEST['target']; 257 263 $link = $inCore->getMenuLink($_REQUEST['mode'], $_REQUEST[$_REQUEST['mode']], $id); … … 260 266 $template = $_REQUEST['template']; 261 267 $iconurl = $_REQUEST['iconurl']; 262 $allow_group = $_REQUEST['allow_group']; 268 $is_public = $inCore->request('is_public', 'int', ''); 269 if (!$is_public){ 270 $access_list = $inCore->request('allow_group', 'array_int'); 271 $access_list = $inCore->arrayToYaml($access_list); 272 } 263 273 $parent_id = $_REQUEST['parent_id']; 264 274 … … 283 293 published='$published', 284 294 template='$template', 285 a llow_group='$allow_group',295 access_list='$access_list', 286 296 iconurl='$iconurl' 287 WHERE id = $myid";297 WHERE id = '$myid'"; 288 298 289 299 dbQuery($sql) or die(mysql_error().$sql); … … 300 310 301 311 $menu = $_REQUEST['menu']; 302 $title = $ _REQUEST['title'];312 $title = $inCore->request('title', 'str', ''); 303 313 $position = $_REQUEST['position']; 304 314 $published = $_REQUEST['published']; 305 315 $css_prefix = $_REQUEST['css_prefix']; 306 $allow_group = $_REQUEST['allow_group']; 307 308 $cfg['showtype'] = $menu; 316 $is_public = $inCore->request('is_public', 'int', ''); 317 if (!$is_public){ 318 $access_list = $inCore->request('allow_group', 'array_int'); 319 $access_list = $inCore->arrayToYaml($access_list); 320 } 321 322 $cfg['menu'] = $menu; 309 323 $cfg_str = $inCore->arrayToYaml($cfg); 310 324 311 $sql = "INSERT INTO cms_modules (position, name, title, is_external, content, ordering, showtitle, published, user, config, css_prefix, a llow_group)325 $sql = "INSERT INTO cms_modules (position, name, title, is_external, content, ordering, showtitle, published, user, config, css_prefix, access_list) 312 326 VALUES ('".$position."', 313 327 'Ìåíþ', … … 321 335 '$cfg_str', 322 336 '$css_prefix', 323 '$a llow_group')";337 '$access_list')"; 324 338 325 339 dbQuery($sql) ; … … 331 345 332 346 if ($do == 'addmenu'){ 347 $GLOBALS['cp_page_head'][] = '<script language="JavaScript" type="text/javascript" src="js/menu.js"></script>'; 348 349 333 350 $toolmenu = array(); 334 351 $toolmenu[0]['icon'] = 'save.gif'; … … 346 363 347 364 echo '<h3>Äîáàâèòü ìåíþ</h3>'; 348 365 349 366 ?> 350 <form action="index.php?view=menu&do=submitmenu" method="post">367 <form id="addform" name="addform" action="index.php?view=menu&do=submitmenu" method="post"> 351 368 <table class="proptable" width="650" cellspacing="10" cellpadding="10"> 352 369 <tr> … … 417 434 </td> 418 435 <td valign="top"> 419 <select name="allow_group" id="allow_group" style="width:200px"> 420 <option value="-1" <?php if (@$mod['allow_group']==-1 || !isset($mod['allow_group'])) { echo 'selected="selected"'; } ?>>-- Âñå ãðóïïû --</option> 436 <table width="100%" cellpadding="0" cellspacing="0" border="0" class="checklist" style="margin-top:5px"> 437 <tr> 438 <td width="20"> 439 <?php 440 441 $groups = cmsUser::getGroups(); 442 443 $style = 'disabled="disabled"'; 444 $public = 'checked="checked"'; 445 446 if ($do == 'edit'){ 447 448 if ($mod['access_list']){ 449 $public = ''; 450 $style = ''; 451 452 $access_list = $inCore->yamlToArray($mod['access_list']); 453 454 } 455 } 456 ?> 457 <input name="is_public" type="checkbox" id="is_public" onclick="checkAccesList()" value="1" <?php echo $public?> /> 458 </td> 459 <td><label for="is_public"><strong>Îáùèé äîñòóï</strong></label></td> 460 </tr> 461 </table> 462 <div style="padding:5px"> 463 <span class="hinttext"> 464 Åñëè îòìå÷åíî, íàçíà÷åíèå ïóíêòà ìåíþ áóäåò âèäíî âñåì ïîëüçîâàòåëÿì. Ñíèìèòå ãàëî÷êó, ÷òîáû âðó÷íóþ âûáðàòü ðàçðåøåííûå ãðóïïû ïîëüçîâàòåëåé. 465 </span> 466 </div> 467 468 <div style="margin-top:10px;padding:5px;padding-right:0px;" id="grp"> 469 <div> 470 <strong>Ïîêàçûâàòü ãðóïïàì:</strong><br /> 471 <span class="hinttext"> 472 Ìîæíî âûáðàòü íåñêîëüêî, óäåðæèâàÿ CTRL. 473 </span> 474 </div> 475 <div> 421 476 <?php 422 if (isset($mod['allow_group'])) { 423 echo $inCore->getListItems('cms_user_groups', $mod['allow_group']); 424 } else { 425 echo $inCore->getListItems('cms_user_groups'); 477 echo '<select style="width: 99%" name="allow_group[]" id="allow_group" size="6" multiple="multiple" '.$style.'>'; 478 479 if ($groups){ 480 foreach($groups as $group){ 481 echo '<option value="'.$group['id'].'"'; 482 if ($do=='edit'){ 483 if (inArray($access_list, $group['id'])){ 484 echo 'selected'; 485 } 486 } 487 488 echo '>'; 489 echo $group['title'].'</option>'; 490 } 491 426 492 } 493 494 echo '</select>'; 427 495 ?> 428 </select> 496 </div> 497 </div> 429 498 </td> 430 499 </tr> … … 738 807 739 808 {tab=Äîñòóï} 740 741 <div> 742 <strong>Ãðóïïà ïîëüçîâàòåëåé</strong> 743 </div> 744 <div> 745 <select name="allow_group" id="allow_group" style="width:100%"> 746 <option value="-1" <?php if (@$mod['allow_group']==-1 || !isset($mod['allow_group'])) { echo 'selected="selected"'; } ?>>-- Âñå ãðóïïû --</option> 809 <table width="100%" cellpadding="0" cellspacing="0" border="0" class="checklist" style="margin-top:5px"> 810 <tr> 811 <td width="20"> 747 812 <?php 748 if (isset($mod['allow_group'])) { 749 echo $inCore->getListItems('cms_user_groups', $mod['allow_group']); 750 } else { 751 echo $inCore->getListItems('cms_user_groups'); 752 } 753 ?> 754 </select> 755 </div> 813 814 $groups = cmsUser::getGroups(); 815 816 $style = 'disabled="disabled"'; 817 $public = 'checked="checked"'; 818 819 if ($do == 'edit'){ 820 821 if ($mod['access_list']){ 822 $public = ''; 823 $style = ''; 824 825 $access_list = $inCore->yamlToArray($mod['access_list']); 826 827 } 828 } 829 ?> 830 <input name="is_public" type="checkbox" id="is_public" onclick="checkAccesList()" value="1" <?php echo $public?> /> 831 </td> 832 <td><label for="is_public"><strong>Îáùèé äîñòóï</strong></label></td> 833 </tr> 834 </table> 835 <div style="padding:5px"> 836 <span class="hinttext"> 837 Åñëè îòìå÷åíî, íàçíà÷åíèå ïóíêòà ìåíþ áóäåò âèäíî âñåì ïîëüçîâàòåëÿì. Ñíèìèòå ãàëî÷êó, ÷òîáû âðó÷íóþ âûáðàòü ðàçðåøåííûå ãðóïïû ïîëüçîâàòåëåé. 838 </span> 839 </div> 840 841 <div style="margin-top:10px;padding:5px;padding-right:0px;" id="grp"> 842 <div> 843 <strong>Ïîêàçûâàòü ãðóïïàì:</strong><br /> 844 <span class="hinttext"> 845 Ìîæíî âûáðàòü íåñêîëüêî, óäåðæèâàÿ CTRL. 846 </span> 847 </div> 848 <div> 849 <?php 850 echo '<select style="width: 99%" name="allow_group[]" id="allow_group" size="6" multiple="multiple" '.$style.'>'; 851 852 if ($groups){ 853 foreach($groups as $group){ 854 echo '<option value="'.$group['id'].'"'; 855 if ($do=='edit' && $mod['access_list']){ 856 if (inArray($access_list, $group['id'])){ 857 echo 'selected'; 858 } 859 } 860 861 echo '>'; 862 echo $group['title'].'</option>'; 863 } 864 865 } 866 867 echo '</select>'; 868 ?> 869 </div> 870 </div> 756 871 757 872 {/tabs} -
trunk/admin/applets/modules.php
r531 r705 380 380 $published = $inCore->request('published', 'int', 0); 381 381 $css_prefix = $inCore->request('css_prefix', 'str', ''); 382 $allow_group = $inCore->request('allow_group', 'int', 0);383 382 $is_strict_bind = $inCore->request('is_strict_bind', 'int', 0); 383 384 $is_public = $inCore->request('is_public', 'int', ''); 385 if (!$is_public){ 386 $access_list = $inCore->request('allow_group', 'array_int'); 387 $access_list = $inCore->arrayToYaml($access_list); 388 } 384 389 385 390 $template = $inCore->request('template', 'str', ''); … … 403 408 published=$published, 404 409 css_prefix='$css_prefix', 405 a llow_group='$allow_group',410 access_list='$access_list', 406 411 cachetime = '$cachetime', 407 412 cacheint = '$cacheint', … … 457 462 $published = $inCore->request('published', 'int', 0); 458 463 $css_prefix = $inCore->request('css_prefix', 'str', ''); 459 $allow_group = $inCore->request('allow_group', 'int', 0); 464 465 $is_public = $inCore->request('is_public', 'int', ''); 466 if (!$is_public){ 467 $access_list = $inCore->request('allow_group', 'array_int'); 468 $access_list = $inCore->arrayToYaml($access_list); 469 } 460 470 461 471 $template = $inCore->request('template', 'str', ''); … … 470 480 471 481 if ($operate == 'user'){ //USER MODULE 472 $sql = "INSERT INTO cms_modules (id, position, name, title, is_external, content, ordering, showtitle, published, original, css_prefix, a llow_group, cache, cachetime, cacheint, template, is_strict_bind)473 VALUES ('', '$position', '$name', '$title', 0, '$content', $maxorder, $showtitle, $published, 1, '$css_prefix', '$a llow_group', 0, 24, 'HOUR', '$template', '$is_strict_bind')";482 $sql = "INSERT INTO cms_modules (id, position, name, title, is_external, content, ordering, showtitle, published, original, css_prefix, access_list, cache, cachetime, cacheint, template, is_strict_bind) 483 VALUES ('', '$position', '$name', '$title', 0, '$content', $maxorder, $showtitle, $published, 1, '$css_prefix', '$access_list', 0, 24, 'HOUR', '$template', '$is_strict_bind')"; 474 484 dbQuery($sql) ; 475 485 } … … 486 496 content, ordering, showtitle, published, 487 497 original, user, config, css_prefix, template, 488 a llow_group, is_strict_bind,498 access_list, is_strict_bind, 489 499 cache, cachetime, cacheint) 490 500 VALUES ( … … 502 512 '$css_prefix', 503 513 '{$template}', 504 '{$a llow_group}',514 '{$access_list}', 505 515 '{$is_strict_bind}', 506 516 0, 24, 'HOUR' … … 882 892 883 893 {tab=Äîñòóï} 884 885 <div style="margin-top:4px"> 886 <strong>Êîìó ïîêàçûâàòü ýòîò ìîäóëü</strong> 887 </div> 888 <div> 889 <select name="allow_group" id="allow_group" style="width:100%"> 890 <option value="-1" <?php if (@$mod['allow_group']==-1 || !isset($mod['allow_group'])) { echo 'selected="selected"'; } ?>>-- Âñå ãðóïïû --</option> 894 <table width="100%" cellpadding="0" cellspacing="0" border="0" class="checklist" style="margin-top:5px"> 895 <tr> 896 <td width="20"> 891 897 <?php 892 if (isset($mod['allow_group'])) { 893 echo $inCore->getListItems('cms_user_groups', $mod['allow_group']); 894 } else { 895 echo $inCore->getListItems('cms_user_groups'); 898 899 $groups = cmsUser::getGroups(); 900 901 $style = 'disabled="disabled"'; 902 $public = 'checked="checked"'; 903 904 if ($do == 'edit'){ 905 906 if ($mod['access_list']){ 907 $public = ''; 908 $style = ''; 909 910 $access_list = $inCore->yamlToArray($mod['access_list']); 911 912 } 896 913 } 897 914 ?> 898 </select> 899 </div> 915 <input name="is_public" type="checkbox" id="is_public" onclick="checkAccesList()" value="1" <?php echo $public?> /> 916 </td> 917 <td><label for="is_public"><strong>Îáùèé äîñòóï</strong></label></td> 918 </tr> 919 </table> 920 <div style="padding:5px"> 921 <span class="hinttext"> 922 Åñëè îòìå÷åíî, ìîäóëü âèäåí âñåì ïîñåòèòåëÿì. Ñíèìèòå ãàëî÷êó, ÷òîáû âðó÷íóþ âûáðàòü ðàçðåøåííûå ãðóïïû ïîëüçîâàòåëåé. 923 </span> 924 </div> 925 926 <div style="margin-top:10px;padding:5px;padding-right:0px;" id="grp"> 927 <div> 928 <strong>Ïîêàçûâàòü ãðóïïàì:</strong><br /> 929 <span class="hinttext"> 930 Ìîæíî âûáðàòü íåñêîëüêî, óäåðæèâàÿ CTRL. 931 </span> 932 </div> 933 <div> 934 <?php 935 echo '<select style="width: 99%" name="allow_group[]" id="allow_group" size="6" multiple="multiple" '.$style.'>'; 936 937 if ($groups){ 938 foreach($groups as $group){ 939 echo '<option value="'.$group['id'].'"'; 940 if ($do=='edit' && $mod['access_list']){ 941 if (inArray($access_list, $group['id'])){ 942 echo 'selected'; 943 } 944 } 945 946 echo '>'; 947 echo $group['title'].'</option>'; 948 } 949 950 } 951 952 echo '</select>'; 953 ?> 954 </div> 955 </div> 900 956 901 957 {/tabs} -
trunk/admin/applets/tree.php
r505 r705 57 57 $title_part = $inCore->request('title', 'str', ''); 58 58 59 $def_order = $category_id ? 'con.ordering' : ' title';59 $def_order = $category_id ? 'con.ordering' : 'pubdate'; 60 60 $orderby = $inCore->request('orderby', 'str', $def_order); 61 $orderto = $inCore->request('orderto', 'str', ' asc');61 $orderto = $inCore->request('orderto', 'str', 'desc'); 62 62 $page = $inCore->request('page', 'int', 1); 63 63 $perpage = 20; -
trunk/admin/components/blogs/backend.php
r496 r705 122 122 $cfg['rss_one'] = $inCore->request('rss_one', 'int'); 123 123 $cfg['j_code'] = $inCore->request('j_code', 'int'); 124 $cfg['update_seo_link_blog'] = $inCore->request('update_seo_link_blog', 'int'); 124 125 125 126 $inCore->saveComponentConfig('blogs', $cfg); … … 137 138 if (!isset($cfg['update_date'])) { $cfg['update_date'] = 1; } 138 139 if (!isset($cfg['update_seo_link'])) { $cfg['update_seo_link'] = 0; } 140 if (!isset($cfg['update_seo_link_blog'])) { $cfg['update_seo_link_blog'] = 0; } 139 141 140 142 if (!isset($cfg['watermark'])) { $cfg['watermark'] = 1; } … … 243 245 <input name="update_date" type="radio" value="1" <?php if (@$cfg['update_date']) { echo 'checked="checked"'; } ?> /> Äà 244 246 <input name="update_date" type="radio" value="0" <?php if (@!$cfg['update_date']) { echo 'checked="checked"'; } ?>/> Íåò 247 </td> 248 </tr> 249 <tr> 250 <td valign="top"> 251 <strong>Îáíîâëÿòü ññûëêó áëîãà ïîñëå ðåäàêòèðîâàíèÿ ïðè ñìåíå çàãîëîâêà:</strong><br /> 252 <span class="hinttext"> 253 Åñëè âêëþ÷åíî, ïîñëå ðåäàêòèðîâàíèÿ áëîãà åãî ññûëêà, à òàê æå âñå ññûëêè ïîñòîâ â áëîãå, áóäóò èçìåíåíû ñîãëàñíî íîâîãî çàãîëîâêà áëîãà. 254 </span> 255 </td> 256 <td valign="top"> 257 <input name="update_seo_link_blog" type="radio" value="1" <?php if (@$cfg['update_seo_link_blog']) { echo 'checked="checked"'; } ?> /> Äà 258 <input name="update_seo_link_blog" type="radio" value="0" <?php if (@!$cfg['update_seo_link_blog']) { echo 'checked="checked"'; } ?>/> Íåò 245 259 </td> 246 260 </tr> -
trunk/admin/components/clubs/backend.php
r580 r705 35 35 if(!isset($cfg['notify_out'])) { $cfg['notify_out'] = 1; } 36 36 if(!isset($cfg['seo_club'])) { $cfg['seo_club'] = 'title'; } 37 if(!isset($cfg['every_karma'])) { $cfg['every_karma'] = 100; } 37 38 38 39 if (isset($_REQUEST['opt'])) { $opt = $_REQUEST['opt']; } else { $opt = 'list'; } … … 102 103 $cfg['notify_in'] = $inCore->request('notify_in', 'int'); 103 104 $cfg['notify_out'] = $inCore->request('notify_out', 'int'); 105 $cfg['every_karma'] = $inCore->request('every_karma', 'int', 100); 104 106 105 107 $inCore->saveComponentConfig('clubs', $cfg); … … 615 617 </tr> 616 618 <tr> 619 <td><strong>Øàã êàðìû äëÿ ñîçäàíèÿ íîâîãî êëóáà:</strong><br /> 620 <span class="hinttext">0 - ìîæíî ñîçäàâàòü òîëüêî îäèí êëóá</span></td> 621 <td valign="top"><input name="every_karma" type="text" id="every_karma" style="width:300px" value="<?php echo @$cfg['every_karma'];?>"/></td> 622 </tr> 623 <tr> 617 624 <td><strong>Îãðàíè÷åíèå ïî êàðìå íà ñîçäàíèå êëóáîâ:</strong><br /> 618 625 <span class="hinttext">Ïîëüçîâàòåëü äîëæåí èìåòü êàðìó íå íèæå óêàçàííîé, ÷òîáû èìåòü âîçìîæíîñòü ñîçäàâàòü êëóáû </span></td> -
trunk/admin/components/forms/backend.php
r465 r705 151 151 if ($opt == 'submit'){ 152 152 153 if (!empty($_REQUEST['title'])) { $title = $_REQUEST['title']; } else { error("Óêàæèòå íàçâàíèå ôîðìû!"); }153 $title = $inCore->request('title', 'str', 'Ôîðìà áåç íàçâàíèÿ'); 154 154 $description = $_REQUEST['description']; 155 155 -
trunk/admin/components/photos/backend.php
r645 r705 618 618 619 619 //Print table 620 cpListTable('cms_photo_files', $fields, $actions, '', ' pubdateDESC');620 cpListTable('cms_photo_files', $fields, $actions, '', 'id DESC'); 621 621 } 622 622 -
trunk/admin/dbstructure.php
r458 r705 1938 1938 $tables['#_menu']['10']['Default'] = ''; 1939 1939 $tables['#_menu']['10']['Extra'] = ''; 1940 $tables['#_menu']['11']['Field'] = 'a llow_group';1940 $tables['#_menu']['11']['Field'] = 'access_list'; 1941 1941 $tables['#_menu']['11']['Type'] = 'int(11)'; 1942 1942 $tables['#_menu']['11']['Null'] = 'NO'; … … 2064 2064 $tables['#_modules']['12']['Default'] = ''; 2065 2065 $tables['#_modules']['12']['Extra'] = ''; 2066 $tables['#_modules']['13']['Field'] = 'a llow_group';2066 $tables['#_modules']['13']['Field'] = 'access_list'; 2067 2067 $tables['#_modules']['13']['Type'] = 'int(11)'; 2068 2068 $tables['#_modules']['13']['Null'] = 'NO'; -
trunk/admin/js/menu.js
r458 r705 1 function checkAccesList(){ 2 3 if(document.addform.is_public.checked){ 4 $('select#allow_group').attr('disabled', 'disabled'); 5 } else { 6 $('select#allow_group').attr('disabled', ''); 7 } 8 9 } 10 1 11 function selectIcon(file){ 2 12 document.addform.iconurl.value = file; -
trunk/admin/js/modules.js
r458 r705 2 2 checkGroupList(); 3 3 }); 4 function checkAccesList(){ 4 5 6 if(document.addform.is_public.checked){ 7 $('select#allow_group').attr('disabled', 'disabled'); 8 } else { 9 $('select#allow_group').attr('disabled', ''); 10 } 11 12 } 5 13 // JavaScript Document 6 14 function checkDiv(){ -
trunk/admin/modules/mod_menu/backend.xml
r458 r705 7 7 <params> 8 8 9 <param type="list" name=" showtype" title="Ìåíþ äëÿ îòîáðàæåíèÿ">9 <param type="list" name="menu" title="Ìåíþ äëÿ îòîáðàæåíèÿ"> 10 10 <option title="Ãëàâíîå ìåíþ" value="mainmenu" /> 11 11 <option title="Äîïîëíèòåëüíîå ìåíþ 1" value="menu1" /> -
trunk/components/blogs/frontend.php
r625 r705 46 46 if (!isset($cfg['update_date'])) { $cfg['update_date'] = 1; } 47 47 if (!isset($cfg['j_code'])) { $cfg['j_code'] = 1; } 48 if (!isset($cfg['update_seo_link'])) { $cfg['update_seo_link'] = 0; } 49 if (!isset($cfg['update_seo_link_blog'])) { $cfg['update_seo_link_blog'] = 0; } 48 50 49 51 //Ïîëó÷àåì ïàðàìåòðû … … 251 253 $model->updateBlogAuthors($blog['id'], $authors); 252 254 //ñîõðàíÿåì íàñòðîéêè áëîãà 253 $blog['seolink '] = $model->updateBlog($blog['id'], array('title'=>$title, 'allow_who'=>$allow_who, 'showcats'=>$showcats, 'ownertype'=>$ownertype, 'premod'=>$premod, 'forall'=>$forall));255 $blog['seolink_new'] = $model->updateBlog($blog['id'], array('title'=>$title, 'allow_who'=>$allow_who, 'showcats'=>$showcats, 'ownertype'=>$ownertype, 'premod'=>$premod, 'forall'=>$forall), $cfg['update_seo_link_blog']); 254 256 //Ïåðåíàïðàâëÿåì íà ãëàâíóþ ñòðàíèöó áëîãà 255 $inCore->redirect($model->getBlogURL(null, $blog['seolink'])); 257 $blog_url = $cfg['update_seo_link_blog'] ? $model->getBlogURL(null, $blog['seolink_new']) : $model->getBlogURL(null, $blog['seolink']); 258 $inCore->redirect($blog_url); 256 259 } 257 260 … … 520 523 if ($user_id){ 521 524 if ($owner=='user'){ 522 $myblog = ($user_id == $blog['user_id']);525 $myblog = $blog['user_id'] == $user_id; 523 526 $is_admin = $inCore->userIsAdmin($user_id); 524 527 } elseif ($owner=='club') { … … 639 642 //Îïðåäåëÿåì óðîâåíü äîñòóïà ê áëîãó (àäìèí, õîçÿèí, àâòîð) â çàâèñèìîñòè îò òèïà âëàäåëüöà 640 643 if ($owner=='user'){ 641 $myblog = ($user_id == $blog['user_id']); 644 if ($do=='newpost'){ 645 $myblog = $blog['user_id'] ==$user_id ; 646 } 647 if ($do=='editpost'){ 648 $myblog = $model->isUserBlogAuthor($blog['id'], $post_id, $blog['user_id']); 649 } 642 650 $is_author = $model->isUserAuthor($blog['id'], $user_id) || ($blog['ownertype']=='multi' && $blog['forall']); 643 651 $is_admin = $inCore->userIsAdmin($user_id); … … 1060 1068 1061 1069 if ($owner=='user'){ 1062 $myblog = ($user_id ==$blog['user_id']);1070 $myblog = $model->isUserBlogAuthor($blog['id'], $post_id, $blog['user_id']); 1063 1071 $is_author = (((!$myblog) && $inDB->get_field('cms_blog_authors', 'blog_id='.$id.' AND user_id='.$user_id, 'id')) || ($blog['forall'] && $post['user_id'] == $user_id)); 1064 1072 } … … 1115 1123 if ($user_id){ 1116 1124 if ($owner=='user'){ 1117 $myblog = ($user_id == $blog['user_id']);1125 $myblog = $blog['user_id'] == $user_id; 1118 1126 $is_admin = $inCore->userIsAdmin($user_id); 1119 1127 } elseif ($owner=='club') { … … 1174 1182 1175 1183 if ( $inCore->inRequest('confirm') ){ 1176 if ( $user_id == $blog['user_id']|| $inUser->is_admin){1184 if (($blog['user_id'] == $user_id) || $inUser->is_admin){ 1177 1185 $model->deleteBlog($id); 1178 1186 $inCore->redirect('/blogs'); -
trunk/components/blogs/model.php
r645 r705 111 111 $result = $this->inDB->query($sql); 112 112 113 $blog = $this->inDB->num_rows($result) ? $this->inDB->fetch_assoc($result) : false; 114 $blog = cmsCore::callEvent('GET_BLOG', $blog); 115 $blog['pubdate'] = cmsCore::dateFormat($blog['pubdate']); 113 if ($this->inDB->num_rows($result)) { 114 $blog = $this->inDB->fetch_assoc($result); 115 $blog = cmsCore::callEvent('GET_BLOG', $blog); 116 $blog['pubdate'] = cmsCore::dateFormat($blog['pubdate']); 117 } 116 118 117 119 return $blog; … … 326 328 /* ==================================================================================================== */ 327 329 328 public function updateBlog($id, $item ){330 public function updateBlog($id, $item, $update_seo_link = 0){ 329 331 330 332 if (!$item['forall']) { $item['forall'] = 0; } … … 332 334 333 335 $item['id'] = $id; 334 335 $item['seolink'] = $this->getBlogSeoLink($item); 336 337 if ($update_seo_link){ 338 $item['seolink'] = $this->getBlogSeoLink($item); 339 $seo_sql = ', seolink = "'.$item['seolink'].'"'; 340 } 336 341 337 342 $item = cmsCore::callEvent('UPDATE_BLOG', $item); … … 345 350 premod={$item['premod']}, 346 351 forall={$item['forall']}, 347 owner='{$item['owner']}', 348 seolink='{$item['seolink']}' 349 WHERE id = $id"; 352 owner='{$item['owner']}'{$seo_sql} 353 WHERE id = '$id'"; 350 354 351 355 $this->inDB->query($sql); 352 356 353 //îáíîâëÿåì ññûëêè ìåíþ 354 $menuid = $this->inDB->get_field('cms_menu', "linktype='blog' AND linkid={$id}", 'id'); 355 if ($menuid){ 356 $inCore = cmsCore::getInstance(); 357 $menulink = $inCore->getMenuLink('blog', $id, $menuid); 358 $this->inDB->query("UPDATE cms_menu SET link='{$menulink}' WHERE id={$menuid}"); 359 } 360 361 //îáíîâëÿåì ññûëêè íà êîììåíòàðèè ïîñòîâ áëîãà 362 $comments_sql = "UPDATE cms_comments c, 363 cms_blog_posts p, 364 cms_blogs b 365 SET c.target_link = CONCAT('/blogs/', b.seolink, '/', p.seolink, '.html') 366 WHERE b.id = {$id} AND 367 p.blog_id = b.id AND 368 c.target = 'blog' AND c.target_id = p.id"; 369 370 $this->inDB->query($comments_sql); 371 372 return $item['seolink']; 357 if ($update_seo_link){ 358 //îáíîâëÿåì ññûëêè ìåíþ 359 $menuid = $this->inDB->get_field('cms_menu', "linktype='blog' AND linkid={$id}", 'id'); 360 if ($menuid){ 361 $inCore = cmsCore::getInstance(); 362 $menulink = $inCore->getMenuLink('blog', $id, $menuid); 363 $this->inDB->query("UPDATE cms_menu SET link='{$menulink}' WHERE id={$menuid}"); 364 } 365 366 //îáíîâëÿåì ññûëêè íà êîììåíòàðèè ïîñòîâ áëîãà 367 $comments_sql = "UPDATE cms_comments c, 368 cms_blog_posts p, 369 cms_blogs b 370 SET c.target_link = CONCAT('/blogs/', b.seolink, '/', p.seolink, '.html') 371 WHERE b.id = {$id} AND 372 p.blog_id = b.id AND 373 c.target = 'blog' AND c.target_id = p.id"; 374 375 $this->inDB->query($comments_sql); 376 } 377 378 return $item['seolink'] ? $item['seolink'] : true; 373 379 374 380 } … … 747 753 /* ==================================================================================================== */ 748 754 755 public function isUserBlogAuthor($blog_id, $post_id, $blog_user_id){ 756 757 $inUser = cmsUser::getInstance(); 758 759 $blog_id_sql = $this->inDB->get_field('cms_blog_posts', "id='$post_id'", 'blog_id'); 760 761 $this_blog_post = ($blog_id_sql == $blog_id) ? true : false; 762 763 $is_my_blog = ($blog_user_id == $inUser->id) ? true : false; 764 765 return ($this_blog_post && $is_my_blog) ? true : false; 766 } 767 768 /* ==================================================================================================== */ 769 /* ==================================================================================================== */ 770 749 771 public function isUserPostAuthor($post_id, $user_id){ 750 772 return $this->inDB->get_field('cms_blog_posts', 'id='.$post_id.' AND user_id='.$user_id, 'id'); -
trunk/components/clubs/frontend.php
r645 r705 49 49 if(!isset($cfg['notify_in'])) { $cfg['notify_in'] = 1; } 50 50 if(!isset($cfg['notify_out'])) { $cfg['notify_out'] = 1; } 51 if(!isset($cfg['every_karma'])) { $cfg['every_karma'] = 100; } 51 52 52 53 //Îïðåäåëÿåì àäðåñ äëÿ ðåäèðåêòà íàçàä … … 61 62 ////////// VIEW ALL CLUBS //////////////////////////////////////////////////////////////////////////////////////// 62 63 if ($do=='view'){ 63 64 $user_id = $inUser->id;65 64 66 65 //PAGINATION … … 86 85 } 87 86 88 $can_create = $user_id ? $user_id && ( $inUser->is_admin || ($cfg['cancreate'] && !$inDB->get_field('cms_clubs', 'admin_id='.$user_id, 'id') && cmsUser::getKarma($user_id)>=$cfg['create_min_karma'] && $inUser->rating >= $cfg['create_min_rating'])): false;89 90 87 $smarty = $inCore->initSmarty('components', 'com_clubs_view.tpl'); 91 88 $smarty->assign('pagetitle', $pagetitle); 92 89 $smarty->assign('clubid', $id); 93 $smarty->assign('can_create', $can_create); 90 // Ññûëêó íà ñîçäàíèå êëóáà ïîêàçûâàåì âñåì àâòîðèçîâàííûì 91 $smarty->assign('can_create', $inUser->id); 94 92 $smarty->assign('clubs', $clubs); 95 93 $smarty->assign('total', $total); … … 104 102 $club = $model->getClub($id); 105 103 if(!$club){ cmsCore::error404(); } 104 $club = cmsCore::callEvent('GET_SINGLE_CLUB', $club); 106 105 107 106 //TITLES … … 199 198 200 199 $inPage->backButton(false); 201 202 $user_id = $inUser->id; 203 204 if (!$user_id){ return; } 200 201 if (!$inUser->id){ cmsUser::goToLogin(); } 202 203 $can_create = $model->canCreate($cfg, true); 204 205 if (!$can_create){ $inCore->redirectBack(); } 205 206 206 207 $inPage->addPathway($_LANG['CREATE_CLUB']); 207 208 $can_create = $user_id && ( $inUser->is_admin || ($cfg['cancreate'] && !$inDB->get_field('cms_clubs', 'admin_id='.$user_id, 'id') && cmsUser::getKarma($user_id)>=$cfg['create_min_karma'] && $inUser->rating>=$cfg['create_min_rating']));209 210 if (!$can_create){ $inCore->redirect('/'); }211 208 212 209 if ( !$inCore->inRequest('create') ){ … … 239 236 240 237 if(!$errors){ 241 $created_id = $model->addClub(array('user_id'=>$ user_id, 'title'=>$title, 'clubtype'=>$clubtype));238 $created_id = $model->addClub(array('user_id'=>$inUser->id, 'title'=>$title, 'clubtype'=>$clubtype)); 242 239 if($created_id){ setClubRating($created_id); } 243 240 //ðåãèñòðèðóåì ñîáûòèå -
trunk/components/clubs/model.php
r514 r705 117 117 //create blog 118 118 $blog_seolink = cmsCore::strToURL($item['title']); 119 $is_exists = $this->inDB->rows_count('cms_blogs', "seolink = '{$blog_seolink}'"); 120 if ($is_exists) { $blog_seolink .= '-' . date("d-i"); } 119 121 120 122 $sql = "INSERT INTO cms_blogs (user_id, title, pubdate, allow_who, view_type, showcats, ownertype, premod, forall, owner, seolink) … … 202 204 /* ==================================================================================================== */ 203 205 206 public function hasUserClub(){ 207 208 $inUser = cmsUser::getInstance(); 209 210 $is_has_club = $inUser->id ? $this->inDB->get_fields('cms_clubs', "admin_id = '{$inUser->id}'", 'id, create_karma', 'id DESC') : true; 211 212 return $is_has_club; 213 214 } 215 216 /* ==================================================================================================== */ 217 /* ==================================================================================================== */ 218 219 public function canCreate($cfg, $is_mes = false){ 220 221 global $_LANG; 222 223 $inUser = cmsUser::getInstance(); 224 225 // íåàâòîðèçîâàííûå íå ìîãóò ñîçäàâàòü êëóáû 226 if (!$inUser->id) { return false; } 227 // àäìèíèñòðàòîðû ìîãóò ñîçäàâàòü êëóáû 228 if ($inUser->is_admin) { return true; } 229 230 $is_has_club = $this->hasUserClub(); 231 232 $u_karma = cmsUser::getKarma($inUser->id); 233 234 // êëóá ìîæíî ñîçäàâàòü êàæäûå $cfg['every_karma'] 235 if ($is_has_club) { 236 if (!$cfg['every_karma']) { 237 238 cmsCore::addSessionMessage($_LANG['USER_HAS_ONE_CLUB'], 'error'); 239 return false; 240 241 } 242 if ($cfg['every_karma'] && ($is_has_club['create_karma'] + $cfg['every_karma']) > $u_karma) { 243 244 $message = $_LANG['USER_HAS_CLUB']; 245 $message = str_replace('%create_karma%', $is_has_club['create_karma'], $message); 246 $message = str_replace('%every_karma%', $cfg['every_karma'], $message); 247 $message = str_replace('%karma%', $u_karma, $message); 248 $message = str_replace('%new_karma%', ($is_has_club['create_karma']+$cfg['every_karma']), $message); 249 250 cmsCore::addSessionMessage($message, 'error'); 251 return false; 252 253 } 254 } 255 256 if($cfg['cancreate'] && $u_karma >= $cfg['create_min_karma'] && $inUser->rating >= $cfg['create_min_rating']){ 257 258 return true; 259 260 } elseif($is_mes) { 261 262 if($u_karma < $cfg['create_min_karma']){ 263 $message = $_LANG['NEED_KARMA_TEXT_ACCESS']; 264 $message = str_replace('%karma%', $u_karma, $message); 265 $message = str_replace('%min_karma%', $cfg['create_min_karma'], $message); 266 cmsCore::addSessionMessage($message, 'error'); 267 } 268 if($inUser->rating < $cfg['create_min_rating']){ 269 $message = $_LANG['NEED_RATING_TEXT_ACCESS']; 270 $message = str_replace('%rating%', $inUser->rating, $message); 271 $message = str_replace('%min_rating%', $cfg['create_min_rating'], $message); 272 cmsCore::addSessionMessage($message, 'error'); 273 } 274 275 } 276 277 return false; 278 279 } 280 281 /* ==================================================================================================== */ 282 /* ==================================================================================================== */ 283 204 284 } -
trunk/components/comments/frontend.php
r609 r705 265 265 // 2. ïîäêëþ÷èì ìîäåëü ýòîãî êîìïîíåíòà 266 266 $inCore->loadModel($target_component); 267 eval('$target_model = new cms_model_'.$target_component.'();'); 267 $model_class = 'cms_model_'.$target_component; 268 $target_model = new $model_class(); 269 268 270 if (!$target_model) { $error = $_LANG['ERR_UNKNOWN_TARGET'] . ' #2'; } 269 271 -
trunk/components/forum/frontend.php
r664 r705 483 483 $psql = "SELECT p.*, u.id as uid, u.nickname author, u.login author_login, u.is_deleted deleted, up.imageurl imageurl, up.signature signature 484 484 FROM cms_forum_posts p 485 INNERJOIN cms_users u ON u.id = p.user_id485 LEFT JOIN cms_users u ON u.id = p.user_id 486 486 LEFT JOIN cms_user_profiles up ON up.user_id = u.id 487 487 WHERE p.thread_id = $id … … 677 677 } else { 678 678 if ($do == 'newpost'){ 679 $sql = "SELECT * FROM cms_forum_threads WHERE id = $id";679 $sql = "SELECT * FROM cms_forum_threads WHERE id = '$id'"; 680 680 $res = $inDB->query($sql); 681 681 if ($inDB->num_rows($res)){ 682 682 $t = $inDB->fetch_assoc($res); 683 if($t['closed'] == 1) { $inCore->halt(); } 683 684 $inPage->setTitle($_LANG['NEW_POST']); 684 685 $inPage->addPathway($_LANG['NEW_POST'], $_SERVER['REQUEST_URI']); -
trunk/components/forum/includes/forumcore.php
r465 r705 205 205 foreach($answers_title as $key=>$value){ 206 206 $html .= '<tr>'; 207 $html .= '<td><input name="answer" type="radio" value="'. $value.'"></td>';207 $html .= '<td><input name="answer" type="radio" value="'.htmlspecialchars($value).'"></td>'; 208 208 $html .= '<td class="mod_poll_answer">'.$value; 209 209 $html .= '</td>'; -
trunk/components/photos/frontend.php
r645 r705 43 43 $model = new cms_model_photos(); 44 44 45 $root = $inDB->get_fields('cms_photo_albums', "parent_id=0 AND NSDiffer=''", 'id, title');46 47 $id = $inCore->request('id', 'int', $root['id']);48 $user_id = $inCore->request('userid', 'int');49 $do = $inCore->request('do', 'str', 'view');45 $root = $inDB->get_fields('cms_photo_albums', "parent_id=0 AND NSDiffer=''", 'id, title'); 46 47 $id = $inCore->request('id', 'int', $root['id']); 48 $user_id = $inCore->request('userid', 'int'); 49 $do = $inCore->request('do', 'str', 'view'); 50 50 51 51 /////////////////////////////// Ïðîñìîòð àëüáîìà /////////////////////////////////////////////////////////////////////////////////////////// … … 60 60 61 61 if(strstr($album['NSDiffer'],'club')) { 62 62 63 $owner = 'club'; 63 64 $club = $inDB->get_fields('cms_clubs', 'id='.$album['user_id'], '*'); 64 65 $club['root_album_id'] = $inDB->get_field('cms_photo_albums', "parent_id=0 AND NSDiffer='club".$club['id']."' AND user_id = ".$club['id'], 'id'); 65 66 if ($inCore->userIsAdmin($inUser->id) || clubUserIsAdmin($club['id'], $inUser->id) || clubUserIsRole($club['id'], $inUser->id, 'moderator')) { $show_hidden = 1; } //ïîêàçûâàòü ñêðûòûå ôîòêè àäìèíàì è ìîäåðàòîðàì êëóáà 67 66 68 } else { 69 67 70 if ($inCore->userIsAdmin($inUser->id)) { $show_hidden = 1; } //ïîêàçûâàòü ñêðûòûå ôîòêè àäìèíàì 71 68 72 } 69 73 … … 123 127 $today1 = date("d-m-Y"); 124 128 foreach($subcats_list as $cat){ 125 $sub = $inDB->rows_count('cms_photo_albums', 'NSLeft > '.$cat['NSLeft'].' AND NSRight < '.$cat['NSRight']);129 $sub = $inDB->rows_count('cms_photo_albums', 'NSLeft > '.$cat['NSLeft'].' AND NSRight < '.$cat['NSRight']); 126 130 if ($sub>1) { $cat['subtext'] = '/'.$sub; } else { $cat['subtext'] = ''; } 127 131 if ($cfg['is_today']) { 128 132 $cat['today_count'] = (int)$inDB->get_field('cms_photo_files', "DATE_FORMAT(pubdate, '%d-%m-%Y') = '$today1' AND album_id={$cat['id']}", 'COUNT(id)'); 129 }133 } 130 134 if ($cfg['tumb_view'] == 2 && $cfg['tumb_from'] == 2) { 131 135 $cat['iconurl'] = $model->randPhoto($cat['id'], true); … … 200 204 201 205 if(!$show_hidden) { $totsql = ' AND published = 1'; } else { $totsql = ''; } 206 202 207 $total = $inDB->rows_count('cms_photo_files', "album_id = $id $totsq"); 203 208 204 if ($album['showtype'] == 'lightbox'){ 205 $inPage->addHeadJS('includes/jquery/lightbox/js/jquery.lightbox.js'); 206 $inPage->addHeadCSS('includes/jquery/lightbox/css/jquery.lightbox.css'); 207 } 209 if ($album['showtype'] == 'lightbox'){ 210 $inPage->addHeadJS('includes/jquery/lightbox/js/jquery.lightbox.js'); 211 $inPage->addHeadCSS('includes/jquery/lightbox/css/jquery.lightbox.css'); 212 } 213 208 214 if ($show_hidden){ 209 215 $inPage->addHeadJS('components/photos/js/photos.js'); … … 211 217 $cons = array(); 212 218 $is_poto_yes = false; 213 while($con = $inDB->fetch_assoc($result)){219 while($con = $inDB->fetch_assoc($result)){ 214 220 $con['fpubdate'] = $inCore->dateformat($con['pubdate']); 215 221 $con['commentscount'] = $album['showdate'] ? $inCore->getCommentsCount('photo', $con['id']) : 0; 216 if ($album['showtype'] == 'lightbox'){ 217 $con['photolink'] = '/images/photos/medium/'.$con['file']; 222 if ($album['showtype'] == 'lightbox'){ 223 $con['photolink'] = '/images/photos/medium/'.$con['file']; 224 $con['photolink2'] = '/photos/photo'.$con['id'].'.html'; 225 } else { 226 if ($album['showtype']!='fast'){ 227 $con['photolink'] = '/photos/photo'.$con['id'].'.html'; 218 228 $con['photolink2'] = '/photos/photo'.$con['id'].'.html'; 219 229 } else { 220 if ($album['showtype']!='fast'){ 221 $con['photolink'] = '/photos/photo'.$con['id'].'.html'; 222 $con['photolink2'] = '/photos/photo'.$con['id'].'.html'; 223 } else { 224 $con['photolink'] = '/images/photos/'.$con['file']; 225 $con['photolink2'] = '/images/photos/'.$con['file']; 230 $con['photolink'] = '/images/photos/'.$con['file']; 231 $con['photolink2'] = '/images/photos/'.$con['file']; 226 232 } 227 233 } … … 230 236 $is_poto_yes = true; 231 237 } else { 232 if(!$subcats_list && $owner == 'club' && $album['parent_id']==0){ echo '<p>'.$_LANG['NO_SUB_ALBUMS'].'</p>'; }233 $is_poto_yes = false;234 }238 if(!$subcats_list && $owner == 'club' && $album['parent_id']==0){ echo '<p>'.$_LANG['NO_SUB_ALBUMS'].'</p>'; } 239 $is_poto_yes = false; 240 } 235 241 236 242 }//END - ALBUM CONTENT … … 249 255 $smarty->assign('cons', $cons); 250 256 $smarty->assign('is_poto_yes', $is_poto_yes); 257 $smarty->assign('messages', cmsCore::getSessionMessages()); 251 258 $smarty->assign('pagebar', cmsPage::getPagebar($total, $page, $perpage, '/photos/%catid%-%page%', array('catid'=>$id))); 252 259 $smarty->assign('is_subcats', $is_subcats); … … 280 287 281 288 if (!$photo['published']) { echo '<div class="con_heading">'.$_LANG['WAIT_MODERING'].'</div>'; return; } 289 290 $photo = cmsCore::callEvent('GET_PHOTO', $photo); 282 291 283 292 $can_view = true; … … 369 378 } 370 379 /////////////////////////////// PHOTO UPLOAD ///////////////////////////////////////////////////////////////////////////////////////// 380 if ($do=='uploadphotos'){ 381 382 $album = $model->getAlbum($id); 383 384 // Code for Session Cookie workaround 385 if ($inCore->inRequest("PHPSESSID")) { 386 $sess_id = $inCore->request("PHPSESSID", 'str'); 387 if ($sess_id != session_id()) { session_destroy(); } 388 session_id($sess_id); 389 session_start(); 390 } 391 392 $user_id = $_SESSION['user']['id']; 393 394 if (!$user_id) { header("HTTP/1.1 500 Internal Server Error"); exit(0); } 395 396 if(!$model->checkAccess($album)) { header("HTTP/1.1 500 Internal Server Error"); exit(0); } 397 398 $photo = cmsUser::sessionGet('mod'); 399 if (!$photo) { header("HTTP/1.1 500 Internal Server Error"); exit(0); } 400 401 if ($album['NSDiffer']=='') { 402 403 $club['id'] = false; 404 $differ = ''; 405 406 } elseif (strstr($album['NSDiffer'],'club')){ 407 408 $club = $inDB->get_fields('cms_clubs', 'id='.$album['user_id'], '*'); 409 $differ = 'club'.$club['id']; 410 411 } 412 413 $file = $model->uploadPhoto($album); 414 415 if ($file) { 416 417 if ($album['NSDiffer'] == ''){ 418 419 if ($album['public']==2 || $inCore->userIsAdmin($inUser->id)) { $published = 1; } else { $published = 0; } 420 421 } elseif (strstr($album['NSDiffer'], 'club')){ 422 423 if ($club['photo_premod'] && !clubUserIsAdmin($club['id'], $inUser->id) && !clubUserIsRole($club['id'], $inUser->id, 'moderator')) { 424 $published = 0; 425 } else { 426 $published = 1; 427 } 428 $photo['is_hidden'] = $club['clubtype'] == 'private' ? true : false; 429 430 } 431 432 $photo['published'] = $published; 433 $photo['showdate'] = 1; 434 $photo['album_id'] = $id; 435 $photo['filename'] = $file['filename']; 436 $photo['title'] = $photo['title'] ? $photo['title'] : $file['realfile']; 437 438 $photo_id = $model->addPhoto($photo, $differ); 439 440 if ($inCore->inRequest('upload')) { $inCore->redirect('/photos/'.$album['id'].'/uploaded.html'); } 441 442 } else { 443 444 header("HTTP/1.1 500 Internal Server Error"); 445 echo $inCore->uploadError(); 446 447 } 448 449 exit(0); 450 451 } 452 /////////////////////////////// PHOTO UPLOAD STEP 1 ///////////////////////////////////////////////////////////////////////////////////////// 371 453 if ($do=='addphoto'){ 372 454 373 $album = $model->getAlbum($id); 374 375 $uid = $inUser->id; 376 $user_karma = cmsUser::getKarma($uid); 377 378 //check add photos permission 379 if (!$uid) { $can_add = false; } 380 else { 381 if ($album['NSDiffer']=='') { 382 $can_add = $uid; 383 $min_karma = false; 384 $club['id'] = false; 385 $differ = ''; 386 } elseif (strstr($album['NSDiffer'],'club')){ 387 $club = $inDB->get_fields('cms_clubs', 'id='.$album['user_id'], '*'); 388 $can_add = clubUserIsMember($club['id'], $uid) || clubUserIsAdmin($club['id'], $uid) || $inUser->is_admin; 389 $differ = 'club'.$club['id']; 455 if (!$inUser->id) { cmsUser::goToLogin(); } 456 457 $inPage->backButton(false); 458 459 $album = ($id == 100 )|| !$id ? '' : $model->getAlbum($id); 460 461 if(!$model->checkAccess($album)) { $inCore->redirect('/photos/'.$album['id']); } 462 463 if (!$inCore->inRequest('submit')){ 464 465 $mod = cmsUser::sessionGet('mod'); 466 if ($mod) { cmsUser::sessionDel('mod'); } 467 468 $inPage->initAutocomplete(); 469 $autocomplete_js = $inPage->getAutocompleteJS('tagsearch', 'tags'); 470 471 $inPage->setTitle($_LANG['ADD_PHOTO'].' - '.$_LANG['STEP'].' 1'); 472 if (strstr($album['NSDiffer'],'club')) { 473 $club = $inDB->get_fields('cms_clubs', 'id='.$album['user_id'], 'id, title'); 390 474 $inPage->addPathway($club['title'], '/clubs/'.$club['id']); 391 $inPage->addPathway($_LANG['PHOTOALBUMS']); 392 $min_karma = $club['photo_min_karma']; 393 } 394 } 395 475 } 476 $inPage->addPathway($album['title'], '/photos/'.$album['id']); 477 $inPage->addPathway($_LANG['ADD_PHOTO'].' - '.$_LANG['STEP'].' 1'); 478 479 $form_action = '/photos/'.$album['id'].'/addphoto.html'; 480 481 $smarty = $inCore->initSmarty('components', 'com_photos_add1.tpl'); 482 $smarty->assign('form_action', $form_action); 483 $smarty->assign('mod', $mod); 484 $smarty->assign('album', $album); 485 $smarty->assign('autocomplete_js', $autocomplete_js); 486 $smarty->display('com_photos_add1.tpl'); 487 488 } 489 490 if ($inCore->inRequest('submit')){ 491 492 $errors = false; 493 494 $mod = array(); 495 496 //Ïðîâåðÿåì âõîäíûå äàííûå 497 498 $mod['title'] = $inCore->request('title', 'str', ''); 499 500 $mod['description'] = $inCore->request('description', 'str'); 501 502 $mod['tags'] = $inCore->request('tags', 'str'); 503 504 $mod['is_multi'] = $inCore->request('only_mod', 'int', 0); 505 506 cmsUser::sessionPut('mod', $mod); 507 $inCore->redirect('/photos/'.$album['id'].'/submit_photo.html'); 508 509 } 510 511 } 512 /////////////////////////////// PHOTO UPLOAD STEP 2 ///////////////////////////////////////////////////////////////////////////////////////// 513 if ($do=='submit_photo'){ 514 515 if (!$inUser->id) { cmsUser::goToLogin(); } 516 517 $inPage->backButton(false); 518 519 $album = $model->getAlbum($id); 520 521 if(!$model->checkAccess($album)) { $inCore->redirect('/photos/'.$album['id']); } 522 523 $mod = cmsUser::sessionGet('mod'); 524 if (!$mod) { cmsCore::error404(); } 525 526 $uload_type = $mod['is_multi'] ? 'multi' : 'single'; 527 528 if (strstr($album['NSDiffer'],'club')){ 529 530 $club = $inDB->get_fields('cms_clubs', 'id='.$album['user_id'], '*'); 531 $inPage->addPathway($club['title'], '/clubs/'.$club['id']); 532 $inPage->addPathway($_LANG['PHOTOALBUMS']); 533 534 } 535 536 $photo_count = $model->loadedByUser24h($inUser->id, $album['id']); 537 538 if($album['uplimit'] != 0 && !$inCore->userIsAdmin($inUser->id)) { 539 540 $max_limit = true; 541 $max_files = $album['uplimit'] - $photo_count; 542 $stop_photo = $photo_count >= $album['uplimit']; 543 544 } else { 545 546 $max_limit = false; 547 $max_files = 0; 548 $stop_photo = false; 549 550 } 551 552 $inPage->setTitle($_LANG['ADD_PHOTO']); 396 553 $inPage->addPathway($album['title'], '/photos/'.$album['id']); 397 554 $inPage->addPathway($_LANG['ADD_PHOTO']); 398 399 if ($uid){ 400 if ($model->loadedByUser24h($uid, $album['id'])<$album['uplimit'] || $album['uplimit'] == 0){ 401 if ($album['public'] && $can_add){ 402 if ($min_karma === false || $user_karma>=$min_karma || clubUserIsAdmin($club['id'], $uid) || clubUserIsRole($club['id'], $uid, 'moderator')){ 403 $inPage->printHeading($_LANG['ADD_PHOTO']); 404 if ($inCore->inRequest('upload')) { 405 //first upload step 406 if (isset($_POST['userid'])){ 407 $userid = $inCore->request('userid', 'int'); 408 if ($userid == $inUser->id){ 409 $uploaddir = $_SERVER['DOCUMENT_ROOT'].'/images/photos/'; 410 $realfile = $_FILES['picture']['name']; 411 $path_parts = pathinfo($realfile); 412 $ext = strtolower($path_parts['extension']); 413 if ($ext != 'jpg' && $ext != 'jpeg' && $ext != 'gif' && $ext != 'png' && $ext != 'bmp') { cmsCore::error404(); } 414 415 $lid = $inDB->get_fields('cms_photo_files', 'id>0', 'id', 'id DESC'); 416 $lastid = $lid['id']+1; 417 $filename = md5($lastid . time() . $inUser->id).'.jpg'; 418 419 $source = $_FILES['picture']['tmp_name']; 420 $destination = $uploaddir . $filename; 421 $uploadthumb['small'] = $uploaddir . 'small/' . $filename; 422 $uploadthumb['medium'] = $uploaddir . 'medium/' . $filename; 423 424 $errorCode = $_FILES['picture']['error']; 425 426 if ($inCore->moveUploadedFile($source, $destination, $errorCode)) { 427 @img_resize($destination, $uploadthumb['small'], $album['thumb1'], $album['thumb1'], $album['thumbsqr']); 428 @img_resize($destination, $uploadthumb['medium'], $album['thumb2'], $album['thumb2'], false, $cfg['watermark']); 429 430 if ( !isset($cfg['watermark']) ) { $cfg['watermark'] = 0; } 431 if ( $cfg['watermark'] ) { @img_add_watermark($destination); } 432 if ( @!$cfg['saveorig'] ) { @unlink($destination); } 433 434 $inPage->initAutocomplete(); 435 $autocomplete_js = $inPage->getAutocompleteJS('tagsearch', 'tags'); 436 437 $inPage->setTitle($_LANG['ADD_PHOTO'].' - '.$_LANG['STEP'].' 2'); 438 439 $form_action = '/photos/'.$album['id'].'/addphoto.html'; 440 441 $smarty = $inCore->initSmarty('components', 'com_photos_add2.tpl'); 442 $smarty->assign('form_action', $form_action); 443 $smarty->assign('filename', $filename); 444 $smarty->assign('autocomplete_js', $autocomplete_js); 445 $smarty->display('com_photos_add2.tpl'); 446 } else { 447 echo '<p><strong>'.$_LANG['ERROR'].':</strong> '.$inCore->uploadError().'!</p>'; 448 } 449 450 } else { die($_LANG['ACCESS_DENIED']); } 451 } else { die($_LANG['ACCESS_DENIED']); } 452 453 } else { 454 if (isset($_POST['submit'])){ 455 //final upload step 456 457 $photo['album_id'] = $id; 458 $photo['title'] = $inCore->request('title', 'str', $_LANG['PHOTO_WITHOUT_NAME']); 459 $photo['description'] = $inCore->request('description', 'str'); 460 $photo['tags'] = $inCore->request('tags', 'str'); 461 462 $imageurl = $inCore->request('imageurl', 'str'); 463 $imageurl = str_replace("*", '', $imageurl); 464 $photo['filename'] = $imageurl; 465 466 if ($album['NSDiffer'] == ''){ 467 if ($album['public']==2 || $inCore->userIsAdmin($inUser->id)) { $published = 1; } else { $published = 0; } 468 } elseif (strstr($album['NSDiffer'], 'club')){ 469 if ($club['photo_premod'] && !clubUserIsAdmin($club['id'], $inUser->id) && !clubUserIsRole($club['id'], $inUser->id, 'moderator')) { 470 $published = 0; 471 } else { 472 $published = 1; 473 } 474 $photo['is_hidden'] = $club['clubtype'] == 'private' ? true : false; 475 } 476 477 $photo['published'] = $published; 478 $photo['showdate'] = 1; 479 480 //ADD TO ALBUM 481 $photo_id = $model->addPhoto($photo, $differ); 482 483 $inCore->redirect('/photos/'.$photo_id.'/uploaded.html'); 484 485 } else { 486 //upload form 487 $inPage->setTitle($_LANG['ADD_PHOTO'].' - '.$_LANG['STEP'].' 1'); 488 489 $form_action = '/photos/'.$id.'/addphoto.html'; 490 491 $smarty = $inCore->initSmarty('components', 'com_photos_add1.tpl'); 492 $smarty->assign('form_action', $form_action); 493 $smarty->assign('user_id', $uid); 494 $smarty->display('com_photos_add1.tpl'); 495 } 496 } 497 } else { 498 $inPage->printHeading($_LANG['NEED_KARMA']); 499 echo '<p><strong>'.$_LANG['NEED_KARMA_TEXT'].'</strong></p>'; 500 echo '<p>'.$_LANG['NEEDED'].' '.$min_karma.', '.$_LANG['HAVE_ONLY'].' '.$user_karma.'.</p>'; 501 echo '<p>'.$_LANG['WANT_SEE'].' <a href="/users/'.$uid.'/karma.html">'.$_LANG['HISTORY_YOUR_KARMA'].'</a>?</p>'; 502 } 503 } else { echo '<p>'.$_LANG['YOU_CANT_ADD_PHOTO'].'</p>'; } 504 } else { 505 echo '<div class="con_heading">'.$_LANG['ADD_PHOTO'].'</div>'; 506 echo '<div><strong>'.$_LANG['MAX_UPLOAD_IN_DAY'].'</strong> '.$_LANG['CAN_UPLOAD_TOMORROW'].'</div>'; 507 } 508 } else { 509 cmsUser::goToLogin(); 510 } 511 } 512 555 556 $smarty = $inCore->initSmarty('components', 'com_photos_add2.tpl'); 557 $smarty->assign('user_id', $inUser->id); 558 $smarty->assign('album', $album); 559 $smarty->assign('sess_id', session_id()); 560 $smarty->assign('max_limit', $max_limit); 561 $smarty->assign('max_files', $max_files); 562 $smarty->assign('uload_type', $uload_type); 563 $smarty->assign('stop_photo', $stop_photo); 564 $smarty->display('com_photos_add2.tpl'); 565 566 } 513 567 /////////////////////////////// PHOTO UPLOADED //////////////////////////////////////////////////////////////////////////////////////// 514 568 if ($do=='uploaded'){ 515 569 516 $id = $inCore->request('id', 'int', 0); 570 if (!$inUser->id) { cmsUser::goToLogin(); } 571 572 $album = $model->getAlbum($id); 573 574 $photo = cmsUser::sessionGet('mod'); 575 if ($photo) { cmsUser::sessionDel('mod'); } 576 577 $inCore->redirect('/photos/'.$album['id']); 578 579 } 580 581 /////////////////////////////// PHOTO EDIT /////////////////////////////////////////////////////////////////////////////////////////// 582 if ($do=='editphoto'){ 583 584 if (!$inUser->id) { cmsUser::goToLogin(); } 585 586 $photoid = $inCore->request('id', 'int', ''); 587 588 $photo = $model->getPhoto($photoid); 589 if (!$photo) { cmsCore::error404(); } 590 591 $album = $model->getAlbum($photo['album_id']); 592 593 if (strstr($album['NSDiffer'],'club')){ 594 595 $club = $inDB->get_fields('cms_clubs', 'id='.$album['user_id'], 'id, title'); 596 $inPage->addPathway($club['title'], '/clubs/'.$club['id']); 597 $is_admin = $inCore->userIsAdmin($inUser->id) || clubUserIsAdmin($club['id'], $inUser->id) || clubUserIsRole($club['id'], $inUser->id, 'moderator'); 598 } else { 599 600 $is_admin = $inUser->is_admin; 601 602 } 603 604 $is_author = ($inUser->id == $photo['user_id']); 605 606 if (!$is_admin && !$is_author) { cmsCore::error404(); } 607 608 $inPage->addPathway($_LANG['EDIT_PHOTO']); 609 610 if ($inCore->inRequest('save')){ 611 612 $photo['title'] = $inCore->request('title', 'str', $photo['title']); 613 $photo['description'] = $inCore->request('description', 'str'); 614 $photo['tags'] = $inCore->request('tags', 'str'); 615 616 // Ìåíÿåì ôàéë ôîòî åñëè åñòü 617 $file = $model->uploadPhoto($album, $photo['file']); 618 // åñëè ôàéë íå áûë çàãðóæåí, èìÿ ôàéëà îñòàâëÿåì ñòàðîå 619 $photo['filename'] = $file['filename'] ? $file['filename'] : $photo['file']; 620 621 $model->updatePhoto($photo['id'], $photo); 622 623 $inCore->redirect('/photos/photo'.$photo['id'].'.html'); 624 625 } else { 626 627 $smarty = $inCore->initSmarty('components', 'com_photos_edit.tpl'); 628 $smarty->assign('photo', $photo); 629 $smarty->assign('action', '/photos/editphoto'.$photo['id'].'.html'); 630 $smarty->assign('images', '/images/photos/small/'.$photo['file'].''); 631 $smarty->assign('photo_tag', cmsTagLine('photo', $photo['id'], false)); 632 $smarty->display('com_photos_edit.tpl'); 633 634 } 635 636 } 637 /////////////////////////////// PHOTO MOVE ///////////////////////////////////////////////////////////////////////////////////////// 638 if ($do=='movephoto'){ 639 640 if (!$inUser->id) { cmsUser::goToLogin(); } 517 641 518 642 $photo = $model->getPhoto($id); 519 643 if (!$photo) { cmsCore::error404(); } 520 521 $inPage->addPathway($_LANG['PHOTO_ADDED']);522 523 $smarty = $inCore->initSmarty('components', 'com_photos_added_f.tpl');524 $smarty->assign('id', $id);525 $smarty->assign('photo', $photo);526 $smarty->display('com_photos_added_f.tpl');527 528 }529 530 /////////////////////////////// PHOTO EDIT ///////////////////////////////////////////////////////////////////////////////////////////531 if ($do=='editphoto'){532 $max_mb = 2; //max filesize in Mb533 534 $inCore->includeFile('components/users/includes/usercore.php');535 536 $photoid = $inCore->request('id', 'int', '');537 538 $photo = $model->getPhoto($photoid);539 if (!$photo) { cmsCore::error404(); }540 644 541 645 $album = $model->getAlbum($photo['album_id']); 542 543 if (strstr($album['NSDiffer'],'club')){ 646 647 if(strstr($album['NSDiffer'],'club')) { 648 544 649 $club = $inDB->get_fields('cms_clubs', 'id='.$album['user_id'], 'id, title'); 545 650 $inPage->addPathway($club['title'], '/clubs/'.$club['id']); 546 $is_admin = $inCore->userIsAdmin($inUser->id) || clubUserIsAdmin($club['id'], $inUser->id) || clubUserIsRole($club['id'], $inUser->id, 'moderator'); 651 $is_admin = $inCore->userIsAdmin($inUser->id) || clubUserIsAdmin($club['id'], $inUser->id) || clubUserIsRole($club['id'], $inUser->id, 'moderator'); 652 547 653 } else { 548 $is_admin = $inCore->userIsAdmin($inUser->id); 549 } 550 551 $is_author = ($inUser->id == $photo['user_id']); 552 553 if ($inUser->id && ($is_admin || $is_author)){ 554 555 $sql = "SELECT * FROM cms_users WHERE id = ".$photo['user_id']; 556 $result = $inDB->query($sql) ; 557 558 if ($inDB->num_rows($result)){ 559 $usr = $inDB->fetch_assoc($result); 560 561 $inPage->addPathway($_LANG['EDIT_PHOTO']); 562 563 if ($inCore->inRequest('save')){ 564 $photo['title'] = $inCore->request('title', 'str', $_LANG['PHOTO_WITHOUT_NAME']); 565 $photo['description'] = $inCore->request('description', 'str'); 566 $photo['tags'] = $inCore->request('tags', 'str'); 567 $photo['filename'] = $inCore->request('file', 'str'); 568 569 //replace file 570 if (isset($_FILES['picture']['name'])){ 571 //upload new 572 $uploaddir = $_SERVER['DOCUMENT_ROOT'].'/images/photos/'; 573 $realfile = $_FILES['picture']['name']; 574 $filename = md5($realfile.time()).'.jpg'; 575 $uploadfile = $uploaddir . $realfile; 576 $uploadphoto = $uploaddir . $filename; 577 $uploadthumb = $uploaddir . 'small/' . $filename; 578 $uploadthumb2 = $uploaddir . 'medium/' . $filename; 579 580 if ($_FILES['picture']['size'] <= $max_mb*1024*1024){ 581 if (@move_uploaded_file($_FILES['picture']['tmp_name'], $uploadphoto)) { 582 if(!isset($cfg['watermark'])) { $cfg['watermark'] = 0; } 583 @img_resize($uploadphoto, $uploadthumb, $album['thumb1'], $album['thumb1'], $album['thumbsqr']); 584 @img_resize($uploadphoto, $uploadthumb2, $album['thumb2'], $album['thumb2'], false, $cfg['watermark']); 585 586 $photo['filename'] = $filename; 587 588 //delete old 589 $file = $photo['filename']; 590 $result = $inDB->query("SELECT id FROM cms_photo_files WHERE user_id = ".$inUser->id." AND file = '$file'") ; 591 if ($inDB->num_rows($result)){ //delete only if user is owner 592 @unlink($_SERVER['DOCUMENT_ROOT'].'/images/photos/'.$file); 593 @unlink($_SERVER['DOCUMENT_ROOT'].'/images/photos/small/'.$file); 594 @unlink($_SERVER['DOCUMENT_ROOT'].'/images/photos/medium/'.$file); 595 } 596 } 597 } 598 } 599 600 //UPDATE 601 $model->updatePhoto($photo['id'], $photo); 602 603 echo '<p><strong>'.$_LANG['PHOTO_SAVED'].'</strong></p>'; 604 echo '<p>← <a href="/photos/photo'.$photo['id'].'.html">'.$_LANG['BACK_TO_PHOTO'].'</a><br/> 605 ← <a href="/photos/'.$photo['album_id'].'">'.$_LANG['BACK_TO_PHOTOALBUM'].'</a></p>'; 606 607 } else { 608 if(isset($_REQUEST['id'])){ 609 $photo = $model->getPhoto($photoid); 610 if (!$photo) { cmsCore::error404(); } 611 612 $photo_max_size = ($max_mb * 1024 * 1024); 613 614 $smarty = $inCore->initSmarty('components', 'com_photos_edit.tpl'); 615 $smarty->assign('photo', $photo); 616 $smarty->assign('input_poto', '<input type="hidden" name="file" value="'.$photo['file'].'" />'); 617 $smarty->assign('action', '/photos/editphoto'.$photoid.'.html'); 618 $smarty->assign('images', '/images/photos/small/'.$photo['file'].''); 619 $smarty->assign('photo_tag', cmsTagLine('photo', $photo['id'], false)); 620 $smarty->assign('photo_max_size', $photo_max_size); 621 $smarty->display('com_photos_edit.tpl'); 622 623 } //isset photo id 624 else { echo usrAccessDenied(); } 625 }//print form 626 } else { echo usrAccessDenied(); } //user exists 627 } else { cmsUser::goToLogin(); } 628 } 629 /////////////////////////////// PHOTO MOVE ///////////////////////////////////////////////////////////////////////////////////////// 630 if ($do=='movephoto'){ 631 632 $photo = $model->getPhoto($id); 633 if (!$photo) { cmsCore::error404(); } 634 635 $album = $model->getAlbum($photo['album_id']); 636 637 if(strstr($album['NSDiffer'],'club')) { 638 $club = $inDB->get_fields('cms_clubs', 'id='.$album['user_id'], 'id, title'); 639 $inPage->addPathway($club['title'], '/clubs/'.$club['id']); 640 $is_admin = $inCore->userIsAdmin($inUser->id) || clubUserIsAdmin($club['id'], $inUser->id) || clubUserIsRole($club['id'], $inUser->id, 'moderator'); 654 655 $is_admin = $inUser->is_admin; 656 657 } 658 659 if (!$is_admin) { cmsCore::error404(); } 660 661 if (!$inCore->inRequest('gomove')){ 662 663 $inPage->setTitle($_LANG['MOVE_PHOTO']); 664 $inPage->addPathway($_LANG['MOVE_PHOTO']); 665 666 if ($album['NSDiffer'] == '') { 667 668 $where = "NSDiffer = ''"; 669 670 } elseif ($album['NSDiffer'] == 'club'.$club['id'].'') { 671 672 $where = "NSDiffer = 'club{$club['id']}' AND parent_id > 0 AND user_id = '{$club['id']}'"; 673 674 } 675 676 $album_options = $inCore->getListItems('cms_photo_albums', $photo['album_id'], 'title', 'ASC', $where); 677 678 $smarty = $inCore->initSmarty('components', 'com_photos_move.tpl'); 679 $smarty->assign('photo', $photo); 680 $smarty->assign('html', $album_options); 681 $smarty->display('com_photos_move.tpl'); 682 641 683 } else { 642 $is_admin = $inCore->userIsAdmin($inUser->id); 643 } 644 645 if (!$is_admin) { cmsCore::error404(); } 646 647 if (!isset($_POST['gomove'])){ //SHOW MOVE FORM 648 649 $inPage->setTitle($_LANG['MOVE_PHOTO']); 650 $inPage->addPathway($_LANG['MOVE_PHOTO'], $_SERVER['REQUEST_URI']); 651 652 if ($album['NSDiffer'] == '') { 653 $fsql = "SELECT id, title FROM cms_photo_albums WHERE NSDiffer='' ORDER BY title"; 654 } elseif ($album['NSDiffer'] == 'club'.$club['id'].'') { 655 $fsql = "SELECT id, title FROM cms_photo_albums WHERE NSDiffer='club{$club['id']}' AND parent_id>0 AND user_id = ".$club['id']." ORDER BY title"; 656 } 657 $fresult = $inDB->query($fsql) ; 658 if ($inDB->num_rows($fresult)){ 659 $html = ''; 660 while ($f = $inDB->fetch_assoc($fresult)){ 661 $html .= '<option value="'.$f['id'].'" '; 662 if ($photo['album_id'] == $f['id']) { $html .= 'selected'; } 663 $html .= '>--- '.$f['title'].'</option>'; 664 } 665 } 666 $smarty = $inCore->initSmarty('components', 'com_photos_move.tpl'); 667 $smarty->assign('photo', $photo); 668 $smarty->assign('html', $html); 669 $smarty->display('com_photos_move.tpl'); 670 671 } else { //DO MOVE 672 673 if ($_POST['album_id']){ 674 $fid = $inCore->request('album_id', 'int'); 675 $inDB->query("UPDATE cms_photo_files SET album_id = '$fid' WHERE id = '$id'") ; 676 } 677 header('location:/photos/'.$fid); 684 685 if ($inCore->inRequest('album_id')){ 686 687 $album_id = $inCore->request('album_id', 'int'); 688 689 $inDB->query("UPDATE cms_photo_files SET album_id = '$album_id' WHERE id = '{$photo['id']}'"); 690 691 cmsCore::addSessionMessage($_LANG['PHOTO_MOVED'], 'info'); 692 693 } else { 694 695 cmsCore::addSessionMessage($_LANG['PHOTO_MOVED_ERR'], 'error'); 696 678 697 } 698 699 $inCore->redirect('/photos/'.$album_id); 700 701 } 679 702 680 703 } 681 704 /////////////////////////////// PHOTO DELETE ///////////////////////////////////////////////////////////////////////////////////////// 682 705 if ($do=='delphoto'){ 706 707 if (!$inUser->id) { cmsUser::goToLogin(); } 683 708 684 709 $photo_id = $inCore->request('id', 'int', ''); … … 690 715 691 716 if (strstr($album['NSDiffer'],'club')){ 717 692 718 $club = $inDB->get_fields('cms_clubs', 'id='.$album['user_id'], 'id, title'); 693 719 $inPage->addPathway($club['title'], '/clubs/'.$club['id']); 694 $is_admin = $inCore->userIsAdmin($inUser->id) || clubUserIsAdmin($club['id'], $inUser->id) || clubUserIsRole($club['id'], $inUser->id, 'moderator'); 720 $is_admin = $inCore->userIsAdmin($inUser->id) || clubUserIsAdmin($club['id'], $inUser->id) || clubUserIsRole($club['id'], $inUser->id, 'moderator'); 721 695 722 } else { 696 $is_admin = $inCore->userIsAdmin($inUser->id); 723 724 $is_admin = $inUser->is_admin; 725 697 726 } 698 727 699 728 $is_author = ($inUser->id == $photo['user_id']); 700 729 701 if ($inUser->id && ($is_admin || $is_author)){ 702 703 if (!isset($_POST['godelete'])){ 704 705 $inPage->addPathway($_LANG['DELETE_PHOTOGALLERY'], $_SERVER['REQUEST_URI']); 706 $confirm['title'] = $_LANG['DELETING_PHOTO']; 707 $confirm['text'] = ''.$_LANG['YOU_REALLY_DELETE_PHOTO'].' "'.$photo['title'].'"?'; 708 $confirm['action'] = $_SERVER['REQUEST_URI']; 709 $confirm['yes_button'] = array(); 710 $confirm['yes_button']['type'] = 'submit'; 711 $confirm['yes_button']['name'] = 'godelete'; 712 $smarty = $inCore->initSmarty('components', 'action_confirm.tpl'); 713 $smarty->assign('confirm', $confirm); 714 $smarty->display('action_confirm.tpl'); 715 716 } else { 717 $model->deletePhoto($photo_id); 718 header('location:/photos/'.$photo['album_id']); 719 } 720 } else { cmsUser::goToLogin(); } 730 if (!$is_admin && !$is_author) { cmsCore::error404(); } 731 732 if (!$inCore->inRequest('godelete')){ 733 734 $inPage->addPathway($_LANG['DELETE_PHOTOGALLERY']); 735 736 $confirm['title'] = $_LANG['DELETING_PHOTO']; 737 $confirm['text'] = ''.$_LANG['YOU_REALLY_DELETE_PHOTO'].' "'.$photo['title'].'"?'; 738 $confirm['action'] = $_SERVER['REQUEST_URI']; 739 $confirm['yes_button'] = array(); 740 $confirm['yes_button']['type'] = 'submit'; 741 $confirm['yes_button']['name'] = 'godelete'; 742 $smarty = $inCore->initSmarty('components', 'action_confirm.tpl'); 743 $smarty->assign('confirm', $confirm); 744 $smarty->display('action_confirm.tpl'); 745 746 } else { 747 748 $model->deletePhoto($photo_id); 749 cmsCore::addSessionMessage($_LANG['PHOTO_DELETED'], 'info'); 750 $inCore->redirect('/photos/'.$photo['album_id']); 751 752 } 721 753 } 722 754 /////////////////////////////// VIEW LATEST PHOTOS /////////////////////////////////////////////////////////////////////////////////// -
trunk/components/photos/model.php
r645 r705 59 59 if (!$file){ return false; } 60 60 61 @chmod($_SERVER['DOCUMENT_ROOT'].'/images/photos/'.$file, 0777); 62 @chmod($_SERVER['DOCUMENT_ROOT'].'/images/photos/small/'.$file, 0777); 63 @chmod($_SERVER['DOCUMENT_ROOT'].'/images/photos/medium/'.$file, 0777); 64 65 @unlink($_SERVER['DOCUMENT_ROOT'].'/images/photos/'.$file); 66 @unlink($_SERVER['DOCUMENT_ROOT'].'/images/photos/small/'.$file); 67 @unlink($_SERVER['DOCUMENT_ROOT'].'/images/photos/medium/'.$file); 61 $this->deletePhotoFile($file, PATH.'/images/photos/'); 68 62 69 63 $inCore->deleteComments('photo', $id); … … 380 374 /* ==================================================================================================== */ 381 375 376 public function deletePhotoFile($file = false, $dir = false){ 377 378 if (!($file && $dir)) { return false; } 379 380 @chmod($dir . $file, 0777); 381 @unlink($dir . $file); 382 @chmod($dir.'small/'.$file, 0777); 383 @unlink($dir.'small/'.$file); 384 @chmod($dir.'medium/'.$file, 0777); 385 @unlink($dir.'medium/'.$file); 386 387 return true; 388 389 } 390 391 /* ==================================================================================================== */ 392 /* ==================================================================================================== */ 393 394 public function uploadPhoto($album, $photo_file = false) { 395 396 if (!$album) { return false; } 397 398 $inCore = cmsCore::getInstance(); 399 400 if ($_FILES['Filedata']['name']){ 401 402 $cfg = $inCore->loadComponentConfig('photos'); 403 if (!isset($cfg['watermark'])) { $cfg['watermark'] = 0; } 404 405 $inCore->includeGraphics(); 406 407 $file = array(); 408 409 $uploaddir = PATH.'/images/photos/'; 410 $realfile = $this->inDB->escape_string($_FILES['Filedata']['name']); 411 412 $path_parts = pathinfo($realfile); 413 $ext = strtolower($path_parts['extension']); 414 415 // óáèðàåì ðàñøèðåíèå ôàéëà âìåñòå ñ òî÷êîé 416 $realfile = substr($realfile, 0, strrpos($realfile, '.')); 417 418 if ($ext != 'jpg' && $ext != 'jpeg' && $ext != 'gif' && $ext != 'png' && $ext != 'bmp') { return false; } 419 420 $lid = $this->inDB->get_fields('cms_photo_files', 'id>0', 'id', 'id DESC'); 421 $lastid = $lid['id']+1; 422 $filename = md5($lastid.$realfile).'.jpg'; 423 424 $uploadfile = $uploaddir . $realfile; 425 $uploadphoto = $uploaddir . $filename; 426 $uploadthumb['small'] = $uploaddir . 'small/' . $filename; 427 $uploadthumb['medium'] = $uploaddir . 'medium/' . $filename; 428 429 $source = $_FILES['Filedata']['tmp_name']; 430 $errorCode = $_FILES['Filedata']['error']; 431 432 if ($inCore->moveUploadedFile($source, $uploadphoto, $errorCode)) { 433 434 // åñëè óæå åñòü ôîòî, òî óäàëÿåì åãî 435 $this->deletePhotoFile($photo_file, $uploaddir); 436 437 @img_resize($uploadphoto, $uploadthumb['small'], $album['thumb1'], $album['thumb1'], $album['thumbsqr']); 438 @img_resize($uploadphoto, $uploadthumb['medium'], $album['thumb2'], $album['thumb2'], false, false); 439 440 if ($cfg['watermark']) { @img_add_watermark($uploadphoto); @img_add_watermark($uploadthumb['medium']); } 441 if (@!$cfg['saveorig']) { @unlink($uploadphoto);} 442 443 $file['filename'] = $filename; 444 445 $file['realfile'] = $inCore->inRequest('upload') ? $realfile : iconv('utf-8', 'cp1251', $realfile); 446 447 448 } else { 449 450 return false; 451 452 } 453 454 455 } else { 456 457 return false; 458 459 } 460 461 return $file; 462 463 } 464 465 /* ==================================================================================================== */ 466 /* ==================================================================================================== */ 467 468 public function checkAccess($album){ 469 470 $inCore = cmsCore::getInstance(); 471 $inUser = cmsUser::getInstance(); 472 473 $user_karma = cmsUser::getKarma($inUser->id); 474 475 global $_LANG; 476 477 if ($album['NSDiffer']=='') { 478 479 $can_add = $inUser->id; 480 $min_karma = false; 481 482 } elseif (strstr($album['NSDiffer'],'club')){ 483 484 $club =$this->inDB->get_fields('cms_clubs', 'id='.$album['user_id'], '*'); 485 486 $can_add = clubUserIsMember($club['id'], $inUser->id) || clubUserIsAdmin($club['id'], $inUser->id) || $inUser->is_admin; 487 $min_karma = $club['photo_min_karma']; 488 489 } 490 491 if ($album['public'] && $can_add){ 492 493 if ($this->loadedByUser24h($inUser->id, $album['id'])<$album['uplimit'] || $album['uplimit'] == 0){ 494 495 if ($min_karma === false || $user_karma>=$min_karma || clubUserIsRole($club['id'], $inUser->id, 'moderator')){ 496 497 return true; 498 499 } else { 500 501 cmsCore::addSessionMessage('<p><strong>'.$_LANG['NEED_KARMA_TEXT'].'</strong></p><p>'.$_LANG['NEEDED'].' '.$min_karma.', '.$_LANG['HAVE_ONLY'].' '.$user_karma.'.</p><p>'.$_LANG['WANT_SEE'].' <a href="/users/'.$inUser->id.'/karma.html">'.$_LANG['HISTORY_YOUR_KARMA'].'</a>?</p>', 'error'); 502 503 return false; 504 505 } 506 507 } else { 508 509 cmsCore::addSessionMessage('<div><strong>'.$_LANG['MAX_UPLOAD_IN_DAY'].'</strong> '.$_LANG['CAN_UPLOAD_TOMORROW'].'</div>', 'error'); 510 return false; 511 512 } 513 514 } else { 515 516 return false; 517 518 } 519 520 } 521 522 /* ==================================================================================================== */ 523 /* ==================================================================================================== */ 524 382 525 } -
trunk/components/photos/router.php
r458 r705 39 39 '_uri' => '/^photos\/([0-9]+)\/addphoto.html$/i', 40 40 'do' => 'addphoto', 41 1 => 'id' 42 ); 43 44 $routes[] = array( 45 '_uri' => '/^photos\/([0-9]+)\/submit_photo.html$/i', 46 'do' => 'submit_photo', 47 1 => 'id' 48 ); 49 50 $routes[] = array( 51 '_uri' => '/^photos\/([0-9]+)\/upload$/i', 52 'do' => 'uploadphotos', 41 53 1 => 'id' 42 54 ); -
trunk/components/search/frontend.php
r645 r705 170 170 if (in_array($component['link'], $cfg['comp'])){ 171 171 include $spfile; 172 eval('search_'.$component['link'].'("'.$against.'", "'.$look.'", "'.$mode.'");'); 172 $search_func = 'search_' . $component['link']; 173 call_user_func($search_func, $against, $look, $mode); 173 174 } 174 175 } 175 176 } 176 177 } 177 178 178 179 //OUTPUT SEARCH RESULTS 179 180 $sql = "SELECT DISTINCT * -
trunk/components/users/ajax/status.php
r458 r705 24 24 25 25 $status = $inCore->request('status', 'str', ''); 26 $status = @iconv('UTF-8', 'CP1251', $status); 26 27 if (strlen($status)>140){ $status = substr($status, 0, 140); } 27 28 $status = @iconv('UTF-8', 'CP1251', $status);29 28 30 29 $sql = "UPDATE cms_users 31 30 SET status = '{$status}', status_date = NOW() 32 WHERE id = {$inUser->id}31 WHERE id = '{$inUser->id}' 33 32 LIMIT 1"; 34 33 -
trunk/components/users/frontend.php
r645 r705 660 660 $login = $inCore->request('login', 'str', ''); 661 661 $login = urldecode($login); 662 $id = $inDB->get_field('cms_users', "login='{$login}' ", 'id');662 $id = $inDB->get_field('cms_users', "login='{$login}' ORDER BY is_deleted ASC", 'id'); 663 663 } 664 664 … … 762 762 $usr['board_count'] = $cfg['sw_board'] ? (int)$inDB->rows_count('cms_board_items', "user_id={$usr['id']} AND published=1") : false; 763 763 $usr['comments_count'] = $cfg['sw_comm'] ? (int)$inDB->rows_count('cms_comments', "user_id={$usr['id']} AND published=1") : false; 764 $usr['invites_count'] = ($inUser->id && $myprofile) ? $model->getUserInvitesCount($inUser->id) : 0; 764 765 765 766 if($cfg['sw_forum']){ … … 1380 1381 } else { echo usrAccessDenied(); } 1381 1382 } 1383 1384 /////////////////////////////// ALBUM EDIT ///////////////////////////////////////////////////////////////////////////////////////// 1385 if ($do=='editalbum'){ 1386 1387 if (!$cfg['sw_photo']) { cmsCore::error404(); } 1388 1389 $usr = $model->getUserShort($id); 1390 if (!$usr) { cmsCore::error404(); } 1391 1392 $album_id = $inCore->request('album_id', 'int', ''); 1393 1394 $album = $model->getPhotoAlbum('private', $album_id); 1395 1396 if (!$album) { cmsCore::error404(); } 1397 1398 if ($album['user_id'] != $inUser->id && !$inUser->is_admin){ cmsCore::error404(); } 1399 1400 unset($album); 1401 1402 $album['title'] = $inCore->request('album_title', 'str', $_LANG['PHOTOALBUM'].' '.date('d.m.Y')); 1403 $album['allow_who'] = $inCore->request('album_allow_who', 'str', 'all'); 1404 $album['description'] = $inCore->request('description', 'str', ''); 1405 $album['id'] = $album_id; 1406 1407 $model->updatePhotoAlbum($album); 1408 1409 $inCore->redirect('/users/'.$usr['login'].'/photos/private'.$album_id.'.html'); 1410 1411 } 1412 1382 1413 /////////////////////////////// PHOTO EDIT ///////////////////////////////////////////////////////////////////////////////////////// 1383 1414 if ($do=='editphoto'){ … … 1394 1425 if (!$photo) { cmsCore::error404(); } 1395 1426 1396 if ($photo['user_id'] != $i d && !$inUser->is_admin){ cmsCore::error404(); }1427 if ($photo['user_id'] != $inUser->id && !$inUser->is_admin){ cmsCore::error404(); } 1397 1428 1398 1429 cmsUser::sessionPut('photos_list', array($photo['id'])); … … 1424 1455 $photo = $model->getPhoto($photo_id); 1425 1456 1426 if ($photo['user_id'] != $i d && !$inUser->is_admin){ cmsCore::error404(); exit; }1457 if ($photo['user_id'] != $inUser->id && !$inUser->is_admin){ cmsCore::error404(); exit; } 1427 1458 1428 1459 } … … 1516 1547 1517 1548 if (!$album){ cmsCore::error404(); } 1518 1549 1550 if ($album_type != 'private') { $album['allow_who'] = 'all'; } 1551 1519 1552 $inPage->setTitle($album['title']); 1520 1553 $inPage->addPathway($usr['nickname'], cmsUser::getProfileURL($usr['login'])); … … 1768 1801 cmsUser::clearSessionFriends(); 1769 1802 1770 if (!usrCheckAuth() &&$inUser->id == $id) { cmsCore::error404(); }1803 if (!usrCheckAuth() || $inUser->id == $id) { cmsCore::error404(); } 1771 1804 1772 1805 if(!usrIsFriends($id, $inUser->id)){ … … 2734 2767 'target_url' => '', 2735 2768 'target_id' => 0, 2736 'description' => str ip_tags( strlen(strip_tags($message))>100 ? substr($message, 0, 100) : $message)2769 'description' => strlen(strip_tags($message))>100 ? substr(strip_tags($message), 0, 100) : strip_tags($message) 2737 2770 )); 2738 2771 } elseif($author_id == $user_id) { … … 2744 2777 'target_url' => '', 2745 2778 'target_id' => 0, 2746 'description' => str ip_tags( strlen(strip_tags($message))>100 ? substr($message, 0, 100) : $message)2779 'description' => strlen(strip_tags($message))>100 ? substr(strip_tags($message), 0, 100) : strip_tags($message) 2747 2780 )); 2748 2781 } … … 2782 2815 'target_url' => '', 2783 2816 'target_id' => 0, 2784 'description' => str ip_tags( strlen(strip_tags($message))>100 ? substr($message, 0, 100) : $message)2817 'description' => strlen(strip_tags($message))>100 ? substr(strip_tags($message), 0, 100) : strip_tags($message) 2785 2818 )); 2786 2819 break; -
trunk/components/users/model.php
r645 r705 64 64 b.user_id as banned, 65 65 IFNULL(ui.login, '') as inv_login, 66 IFNULL(ui.nickname, '') as inv_nickname, 67 IFNULL(COUNT(i.id), 0) as invites_count 66 IFNULL(ui.nickname, '') as inv_nickname 68 67 FROM cms_users u 69 68 INNER JOIN cms_user_profiles p ON p.user_id = u.id … … 72 71 LEFT JOIN cms_banlist b ON b.user_id = u.id 73 72 LEFT JOIN cms_users ui ON ui.id = u.invited_by 74 LEFT JOIN cms_user_invites i ON i.owner_id = u.id AND i.is_used = 0 AND i.is_sended = 075 73 WHERE u.is_locked = 0 AND u.id = '$user_id' 76 GROUP BY u.id77 74 LIMIT 1"; 78 75 … … 485 482 486 483 } 484 485 public function updatePhotoAlbum($album) { 486 487 if (!$album['allow_who']) { $album['allow_who'] = 'all'; } 488 489 $sql = "UPDATE cms_user_albums 490 SET title = '{$album['title']}', 491 description = '{$album['description']}', 492 allow_who = '{$album['allow_who']}' 493 WHERE id = '{$album['id']}' 494 LIMIT 1"; 495 496 $this->inDB->query($sql); 497 498 return true; 499 500 } 487 501 488 502 public function getPhotoAlbum($type, $id) { … … 491 505 492 506 if ($type == 'private'){ 493 $album = $this->inDB->get_fields('cms_user_albums', "id='{$id}'", 'id, user_id, title, allow_who ');507 $album = $this->inDB->get_fields('cms_user_albums', "id='{$id}'", 'id, user_id, title, allow_who, description'); 494 508 } 495 509 -
trunk/components/users/router.php
r458 r705 144 144 '_uri' => '/^users\/([0-9]+)\/delalbum([0-9]+).html$/i', 145 145 'do' => 'delalbum', 146 1 => 'id', 147 2 => 'album_id' 148 ); 149 150 $routes[] = array( 151 '_uri' => '/^users\/([0-9]+)\/editalbum([0-9]+).html$/i', 152 'do' => 'editalbum', 146 153 1 => 'id', 147 154 2 => 'album_id' -
trunk/core/classes/page.class.php
r604 r705 278 278 $already = false; 279 279 foreach($this->pathway as $key => $val){ 280 if ($this->pathway[$key][' title'] == $title && $this->pathway[$key]['link'] == $link){280 if ($this->pathway[$key]['link'] == $link){ 281 281 $already = true; 282 282 } … … 300 300 301 301 //Ïîëó÷àåì ïóòü ê ïóíêòó ìåíþ 302 $rs_item = $inDB->query("SELECT * FROM cms_menu WHERE id = $menuid");302 $rs_item = $inDB->query("SELECT NSLeft, NSRight FROM cms_menu WHERE id = '$menuid'"); 303 303 304 304 if ($inDB->num_rows($rs_item)){ … … 440 440 441 441 public function countModules($position){ 442 $inCore = cmsCore::getInstance(); 443 $in DB = cmsDatabase::getInstance();444 $in User = cmsUser::getInstance();442 443 $inCore = cmsCore::getInstance(); 444 $inDB = cmsDatabase::getInstance(); 445 445 446 if ($inUser->id) {447 //if authorized, but not admin, get group_id448 if (!$inCore->userIsAdmin($inUser->id)){449 $gid = $_SESSION['user']['group_id'];450 } else {451 $gid = false;452 }453 } else {454 $gid = cmsUser::getGuestGroupId();455 }456 457 //if not admin, add access check to sql458 if ($gid !== false) { $group_sql = "AND ((m.allow_group=-1) OR (m.allow_group=$gid))"; } else { $group_sql = ""; }459 460 446 if (!$inCore->isMenuIdStrict()){ $strict_sql = "AND (m.is_strict_bind = 0)"; } else { $strict_sql = ""; } 461 447 462 448 $menuid = $inCore->menuId(); 463 $sql = "SELECT m.id 449 450 $sql = "SELECT m.access_list 464 451 FROM cms_modules m, cms_modules_bind mb 465 452 WHERE mb.position = '$position' AND 466 453 m.published = 1 AND 467 454 m.id = mb.module_id AND 468 (mb.menu_id = $menuidOR mb.menu_id = 0)455 (mb.menu_id = '$menuid' OR mb.menu_id = 0) 469 456 $strict_sql 470 $group_sql471 457 "; 472 458 473 474 $result = $inDB->query($sql) ; 475 return $inDB->num_rows($result); 459 $result = $inDB->query($sql); 460 461 if (!$inDB->num_rows($result)){ return 0; } 462 463 $mods = array(); 464 465 while($mod = $inDB->fetch_assoc($result)){ 466 467 // Ïðîâåðÿåì ïðàâà äîñòóïà 468 if (!$inCore->checkContentAccess($mod['access_list'])) { continue; } 469 $mods[] = $mod; 470 471 } 472 473 return sizeof($mods); 476 474 } 477 475 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 483 481 */ 484 482 public function printModules($position){ 485 $inCore = cmsCore::getInstance(); 486 $inDB = cmsDatabase::getInstance(); 487 $inUser = cmsUser::getInstance(); 483 484 $inCore = cmsCore::getInstance(); 485 $inDB = cmsDatabase::getInstance(); 486 $inUser = cmsUser::getInstance(); 487 488 488 global $_CFG; 489 489 global $_LANG; 490 //check menu item number 490 491 //Ïîëó÷àåì id ïóíêòà ìåíþ 491 492 $menuid = $inCore->menuId(); 492 //check position 493 494 // Ïðîâåðÿåì ïîçèöèè 493 495 if (!$position) { return false; } 494 496 if ($position=='top' && @$_REQUEST['view']=='search') { return true; } 495 497 496 if ($inUser->id) {497 //if authorized, but not admin, get group_id498 if (!$inCore->userIsAdmin($inUser->id)){ $gid = $_SESSION['user']['group_id']; } else { $gid = false; }499 } else { $gid = cmsUser::getGuestGroupId(); }500 501 //if not admin, add access check to sql502 if ($gid !== false) { $group_sql = "AND ((m.allow_group=-1) OR (m.allow_group=$gid))"; } else { $group_sql = ""; }503 504 498 if (!$inCore->isMenuIdStrict()){ $strict_sql = "AND (m.is_strict_bind = 0)"; } else { $strict_sql = ""; } 505 499 506 // get modules info500 // Ïîëó÷àåì âñå ìîäóëè íà ïîçèöèþ 507 501 $sql = "SELECT *, m.id as mid, m.template as tpl 508 502 FROM cms_modules m, cms_modules_bind mb … … 510 504 m.published = 1 AND 511 505 m.id = mb.module_id AND 512 (mb.menu_id = $menuidOR mb.menu_id = 0)506 (mb.menu_id = '$menuid' OR mb.menu_id = 0) 513 507 $strict_sql 514 $group_sql515 508 ORDER BY m.ordering ASC 516 509 "; 517 510 518 511 $result = $inDB->query($sql); 519 //draw module 512 520 513 if($inDB->num_rows($result)){ 521 514 while ($mod = $inDB->fetch_assoc($result)){ 515 516 // Ïðîâåðÿåì ïðàâà äîñòóïà 517 if (!$inCore->checkContentAccess($mod['access_list'])) { continue; } 522 518 523 519 $modulefile = PATH.'/modules/'.$mod['content'].'/module.php'; … … 545 541 546 542 if ($mod['cache'] && $inCore->isCached('module', $mod['mid'], $mod['cachetime'], $mod['cacheint'])){ 543 547 544 $modulebody = $inCore->getCache('module', $mod['mid']); 548 545 $callback = true; 546 549 547 } else { 550 $config = $inCore->yamlToArray($mod['config']); 551 $inCore->cacheModuleConfig($mod['module_id'], $config); 552 553 ob_start(); 554 $callback = $mod['content']($mod['module_id']); 555 $modulebody = ob_get_clean(); 556 if($mod['cache']) { $inCore->saveCache('module', $mod['mid'], $modulebody); } 557 } 548 549 $config = $inCore->yamlToArray($mod['config']); 550 $inCore->cacheModuleConfig($mod['module_id'], $config); 551 552 ob_start(); 553 $callback = $mod['content']($mod['module_id']); 554 $modulebody = ob_get_clean(); 555 if($mod['cache']) { $inCore->saveCache('module', $mod['mid'], $modulebody); } 556 } 557 558 558 } 559 559 } … … 989 989 global $_LANG; 990 990 991 $html = '<div class="pagebar">';991 $html = '<div class="pagebar">'; 992 992 $html .= '<span class="pagebar_title"><strong>'.$_LANG['PAGES'].': </strong></span>'; 993 993 -
trunk/core/classes/user.class.php
r647 r705 68 68 } 69 69 70 if (!file_exists(PATH.'/images/users/avatars/small/'.$this->imageurl) ){ $this->imageurl = 'nopic.jpg'; }70 if (!file_exists(PATH.'/images/users/avatars/small/'.$this->imageurl) || !$this->imageurl){ $this->imageurl = 'nopic.jpg'; } 71 71 72 72 $this->id = (int)$user_id; … … 1019 1019 public static function getOnlineCount(){ 1020 1020 1021 $inDB = cmsDatabase::getInstance(); 1022 $people = array(); 1023 1024 $sql = "SELECT user_id, id FROM cms_online WHERE user_id = '0' OR user_id = ''"; 1021 $inDB = cmsDatabase::getInstance(); 1022 1023 $sql = "SELECT user_id FROM cms_online"; 1025 1024 $result = $inDB->query($sql); 1026 $people['guests'] = $inDB->num_rows($result); 1027 $sql = "SELECT user_id, id FROM cms_online WHERE user_id > 0 GROUP BY user_id"; 1028 $result = $inDB->query($sql); 1029 $people['users'] = $inDB->num_rows($result); 1025 1026 $guests = 0; 1027 1028 $online = array(); 1029 1030 while($o = $inDB->fetch_assoc($result)){ 1031 if ($o['user_id'] == 0 || $o['user_id'] == ''){ 1032 $guests++; 1033 } else { 1034 $online[$o['user_id']][] = $o; 1035 } 1036 } 1037 1038 $people['guests'] = $guests; 1039 $people['users'] = sizeof($online); 1030 1040 1031 1041 return $people; … … 1325 1335 $gender_img = '/components/users/images/male.png'; 1326 1336 if (!$gender){ 1327 $user = $inDB->get_field('cms_user_profiles', 'user_id='.$user_id, 'gender');1337 $user = $inDB->get_field('cms_user_profiles', "user_id = '$user_id'", 'gender'); 1328 1338 } 1329 1339 if ($gender){ … … 1335 1345 } 1336 1346 if (!$nickname || !$login){ 1337 $user = $inDB->get_fields('cms_users', 'id='.$user_id, 'nickname, login');1347 $user = $inDB->get_fields('cms_users', "id = '$user_id'", 'nickname, login'); 1338 1348 $nickname = $user['nickname']; 1339 1349 $login = $user['login']; -
trunk/core/cms.php
r663 r705 803 803 `content`, `ordering`, `showtitle`, `published`, 804 804 `user`, `config`, `original`, `css_prefix`, 805 `a llow_group`, `cache`, `cachetime`, `cacheint`,805 `access_list`, `cache`, `cachetime`, `cacheint`, 806 806 `template`, `is_strict_bind`, `version`) 807 807 VALUES ('{$module['position']}', '{$module['name']}', '{$module['title']}', '1', 808 808 '{$module['link']}', '1', '1', '1', 809 809 '0', '{$config_yaml}', '1', '', 810 ' -1', '0', '1', 'HOUR',810 '', '0', '1', 'HOUR', 811 811 'module.tpl', '0', '{$module['version']}')"; 812 812 … … 1053 1053 1054 1054 return true; 1055 1056 } 1057 1058 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1059 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1060 /** 1061 * Ïðîâåðÿåò äîñòóï (ìîäóëÿ, ìåíþ) ê ãðóïïå ïîëüçîâàòåëÿ 1062 * @param string $access_list 1063 * @return bool 1064 */ 1065 public function checkContentAccess($access_list){ 1066 1067 $inUser = cmsUser::getInstance(); 1068 1069 // åñëè $access_list ïóñòà, òî ñ÷èòàåì ÷òî äîñòóï äëÿ âñåõ 1070 if (!$access_list) { return true; } 1071 1072 // àäìèíèñòðàòîðàì âñåãäà ïîêàçûâàåì ìîäóëü 1073 if ($inUser->is_admin) { return true; } 1074 1075 $access_list = $this->yamlToArray($access_list); 1076 1077 // åñëè ïî êàêèì-òî ïðè÷èíàì $access_list íå ìàññèâ, òî ñ÷èòàåì ÷òî äîñòóï äëÿ âñåõ 1078 if (!is_array($access_list)) { return true; } 1079 1080 // id ãðóïïû òåêóùåãî ïîëüçîâàòåëÿ 1081 $group_id = $inUser->group_id; 1082 1083 return in_array($group_id, $access_list); 1055 1084 1056 1085 } … … 2125 2154 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2126 2155 /** 2127 * Ïðîâåðÿåò äîñòóï ãðóïïû ïîëüçîâàòåëåé ê ïóíêòó ìåíþ 2128 * @param int $menuid 2129 * @param int $groupid 2130 * @return bool 2131 */ 2132 public function isMenuAccess($menuid, $groupid=-1){ 2133 2134 if (!$this->menu_item) { $this->menu_item = $this->getMenuItem($menuid); } 2135 2136 $allow = $this->menu_item['allow_group']; 2137 2138 if ($allow == -1 || $menuid==0 || $allow == $groupid){ 2139 return true; 2140 } else { 2141 return false; 2142 } 2143 2144 } 2145 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2146 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2147 /** 2148 * Îïðåäåëÿåò ãðóïïó òåêóùåãî ïîëüçîâàòåëÿ è ïåðåòèðàåò ñîäåðæàíèå ñòðàíèöû 2156 * Ïåðåòèðàåò ñîäåðæàíèå ñòðàíèöû 2149 2157 * â ñëó÷àå îñòóòñòâèÿ ó ãðóïïû äîñòóïà ê òåêóùåìó ïóíêòó ìåíþ 2150 2158 */ 2151 public function ñheckMenuAccess(){ 2152 $inPage = cmsPage::getInstance(); 2153 $inUser = cmsUser::getInstance(); 2154 global $menuid; 2155 $group_id = $inUser->group_id; 2156 if ($menuid!=0){ 2157 if(!$this->isMenuAccess($menuid, $group_id)){ 2158 if (!$inUser->id){ 2159 $inPage->page_body = '<p>Äîñòóï çàïðåùåí</p>'; 2160 } else { 2161 if (!$inUser->is_admin){ 2162 $inPage->page_body = '<p>Äîñòóï çàïðåùåí</p>'; 2163 } 2164 } 2165 } 2166 } 2159 public function checkMenuAccess(){ 2160 2161 $inPage = cmsPage::getInstance(); 2162 2163 global $menuid; 2164 2165 if (!$this->menu_item) { $this->menu_item = $this->getMenuItem($menuid); } 2166 2167 $access_list = $this->menu_item['access_list']; 2168 2169 if (!$this->checkContentAccess($access_list) && $menuid != 0) { 2170 2171 $inPage->page_body = '<p>Äîñòóï çàïðåùåí</p>'; 2172 2173 } else { 2174 2175 return true; 2176 2177 } 2178 2167 2179 } 2168 2180 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 2903 2915 } 2904 2916 2917 /** 2918 * Âîçâðàùàåò äåíü íåäåëè ïî äàòå 2919 * @param string $date 2920 * @return string 2921 */ 2922 static function dateToWday($date){ 2923 2924 $inConf = cmsConfig::getInstance(); 2925 2926 global $_LANG; 2927 2928 $date = date('Y-m-d H:i:s', strtotime($date)+($inConf->timediff*3600)); 2929 2930 // ïîëó÷àåì çíà÷åíèå äàòû è âðåìåíè 2931 list($day, $time) = explode(' ', $date); 2932 list($h, $min, $s) = explode(':', $time); 2933 list($y, $m, $d) = explode('-', $day); 2934 2935 $days_week = array($_LANG['SUNDAY'], $_LANG['MONDAY'], $_LANG['TUESDAY'], $_LANG['WEDNESDAY'], $_LANG['THURSDAY'], $_LANG['FRIDAY'], $_LANG['SATURDAY']); 2936 2937 $arr = getdate(mktime($h, $min, $s, $m, $d, $y)); 2938 2939 $wday = $days_week[$arr['wday']]; 2940 2941 return $wday; 2942 2943 } 2944 2905 2945 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 2906 2946 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// … … 3594 3634 $str = trim($str); 3595 3635 $str = mb_strtolower($str, 'cp1251'); 3596 $str ing = str_replace(' ', '-', $string);3636 $str = str_replace(' ', '-', $str); 3597 3637 $string = preg_replace ('/[^a-zA-Zà-ÿÀ-ß0-9\-]/i', '-', $str); 3598 3638 $string = rtrim($string, '-'); … … 3606 3646 'í'=>'n','î'=>'o','ï'=>'p','ð'=>'r','ñ'=>'s', 3607 3647 'ò'=>'t','ó'=>'u','ô'=>'f','õ'=>'h','ö'=>'c', 3608 '÷'=>'ch','ø'=>'sh','ù'=>'s h','ú'=>'','û'=>'y',3648 '÷'=>'ch','ø'=>'sh','ù'=>'sch','ú'=>'','û'=>'y', 3609 3649 'ü'=>'','ý'=>'ye','þ'=>'yu','ÿ'=>'ja' 3610 3650 ); … … 3618 3658 return $string; 3619 3659 3620 }3660 } 3621 3661 3622 3662 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -
trunk/core/lib_karma.php
r465 r705 176 176 $inCore->loadModel($info['component']); 177 177 if (class_exists('cms_model_'.$info['component'])){ 178 eval('$model = new cms_model_'.$info['component'].'();'); 178 $model_class = 'cms_model_'.$info['component']; 179 $model = new $model_class(); 179 180 if (method_exists($model, 'updateRatingHook')){ 180 181 $model->updateRatingHook($target, $item_id, $points); -
trunk/images/.htaccess
r626 r705 1 Options -Indexes 1 # Ïåðå÷èñëåííûå íèæå âàðèàíòû èñïîëüçóþòñÿ äëÿ îáåñïå÷åíèÿ áåçîïàñíîñòè 2 # â äèðåêòîðèÿõ çàãðóçêè. Ïî óìîë÷àíèþ ýòè îïöèè çàêîììåíòèðîâàíû 3 # â öåëÿõ îáåñïå÷åíèÿ ïîëíîé ñîâìåñòèìîñòè ñî âñåìè õîñòèíãàìè 4 # åñëè âû óâåðåíû, ÷òî äàííûå îïöèè íà âàøåì õîñòèíãå ðàáîòàþò, ñíèìèòå 5 # çíàêè êîììåíòàðèåâ ñ íóæíîãî âàðèàíòà 2 6 3 7 # Ïåðâûé âàðèàíò çàïðåòà âûïîëíåíèÿ php 4 php_flag engine 05 AddType "text/html" .php .cgi .pl .fcgi .fpl .phtml .shtml .php2 .php3 .php4 .php5 .asp .jsp6 RemoveType php8 # php_flag engine 0 9 # AddType "text/html" .php .cgi .pl .fcgi .fpl .phtml .shtml .php2 .php3 .php4 .php5 .asp .jsp 10 # RemoveType php 7 11 8 12 # Âòîðîé âàðèàíò çàïðåòà âûïîëíåíèÿ php 9 13 # èñïîëüçóéòå åãî, åñëè ïðè ïåðâîì âàðèàíòå êàðòèíêè èç äèðåêòîðèé íå îòîáðàæàþòñÿ 10 # çàêîììåíòèðóéòå ñòðî÷êè ïåðâîãî âàðèàíòà, ñî ñòðî÷åê íèæå êîììåíòàðèè ñíèìèòå11 14 # RemoveHandler .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml 12 15 # AddType application/x-httpd-php-source .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml -
trunk/index.php
r663 r705 19 19 ////////////////////////////// Ïðîâåðÿåì ÷òî ñèñòåìà óñòàíîâëåíà ///////////////////////////// 20 20 21 //if(is_dir('install')||is_dir('migrate')) {22 //if (!file_exists(PATH.'/includes/config.inc.php')){23 //header('location:/install/');24 //} else {25 //include(PATH.'/core/messages/installation.html');26 //die();27 //}28 //}21 if(is_dir('install')||is_dir('migrate')) { 22 if (!file_exists(PATH.'/includes/config.inc.php')){ 23 header('location:/install/'); 24 } else { 25 include(PATH.'/core/messages/installation.html'); 26 die(); 27 } 28 } 29 29 30 30 /////////////////////////////////// Ïîäãîòîâêà ////////////////////////////////////////////// … … 108 108 //Åñëè ïðîâåðêà çàâåðøèòñÿ íåóäà÷åé, òî âûâîä êîìïîíåíòà áóäåò 109 109 //çàìåùåí ñîîáùåíèåì "Äîñòóï çàïðåùåí" 110 $inCore-> ñheckMenuAccess();110 $inCore->checkMenuAccess(); 111 111 112 112 //////////////////////////////////// Âûâîä øàáëîíà ///////////////////////////// -
trunk/install/sqldumpdemo.sql
r647 r705 1167 1167 `session_id` varchar(100) NOT NULL, 1168 1168 `title` varchar(250) NOT NULL, 1169 `link` varchar( 100) NOT NULL,1169 `link` varchar(200) NOT NULL, 1170 1170 `place` varchar(100) NOT NULL, 1171 1171 `placelink` varchar(100) NOT NULL -
trunk/install/sqldumpempty.sql
r647 r705 1042 1042 `session_id` varchar(100) NOT NULL, 1043 1043 `title` varchar(250) NOT NULL, 1044 `link` varchar( 100) NOT NULL,1044 `link` varchar(200) NOT NULL, 1045 1045 `place` varchar(100) NOT NULL, 1046 1046 `placelink` varchar(100) NOT NULL -
trunk/languages/ru/components/clubs.php
r645 r705 104 104 $_LANG['NOT_POSTS_ON_WALL_TEXT'] ='Íà ñòåíå íåò çàïèñåé. Âàøà áóäåò ïåðâîé!'; 105 105 $_LANG['WRITE_ON_WALL'] ='Íàïèñàòü íà ñòåíå'; 106 $_LANG['CLUB_NOT_FOUND_TEXT'] ='Êëóá íå íàéäåí. Âîçìîæíî îí íå àêòèâåí èëè óäàëåí.';107 106 $_LANG['CREATE'] ='Ñîçäàòü'; 108 107 $_LANG['ONLY_REG_USER_CAN_WALL'] ='Çàïèñè íà ñòåíå ìîãóò îñòàâëÿòü òîëüêî çàðåãèñòðèðîâàííûå ïîëüçîâàòåëè.'; 109 108 $_LANG['CLUB_EXISTS'] ='Êëóá ñ òàêèì íàçâàíèåì óæå ñóùåñòâóåò'; 110 109 $_LANG['CLUB_REQ_TITLE'] ='Íåëüçÿ ñîçäàòü êëóá áåç íàçâàíèÿ!'; 110 111 $_LANG['USER_HAS_CLUB'] ='Âû óæå ñîçäàëè êëóá ñ êàðìîé %create_karma% è ÿâëÿåòåñü åãî àäìèíèñòðàòîðîì. Âû ìîæåòå ñîçäàâàòü êëóáû êàæäûå %every_karma% ïóíêòîâ ñâîåé êàðìû. Âàøà êàðìà ñåé÷àñ: %karma%, íîâûé êëóá Âû ìîæåòå ñîçäàòü íàáðàâ %new_karma% ïóíêòîâ êàðìû.'; 112 $_LANG['USER_HAS_ONE_CLUB'] ='Âû óæå ñîçäàëè êëóá è ÿâëÿåòåñü åãî àäìèíèñòðàòîðîì. Âû íå ìîæåòå ñîçäàòü áîëåå îäíîãî êëóáà.'; 113 $_LANG['NEED_KARMA_TEXT_ACCESS'] ='Ó âàñ íå õâàòàåò êàðìû(%karma%). Äëÿ ñîçäàíèÿ êëóáà, íåîáõîäèìî íå ìåíåå %min_karma% ïóíêòîâ.'; 114 $_LANG['NEED_RATING_TEXT_ACCESS'] ='Ó âàñ íå õâàòàåò ðåéòèíãà(%rating%). Äëÿ ñîçäàíèÿ êëóáà, íåîáõîäèìî íå ìåíåå %min_rating% ïóíêòîâ.'; 111 115 ?> -
trunk/languages/ru/components/photos.php
r465 r705 76 76 $_LANG['WAIT_MODERING'] ='Îæèäàåò ìîäåðàöèè.'; 77 77 78 $_LANG['PHOTO_TITLE'] ='Íàçâàíèå ôîòî'; 78 $_LANG['PHOTO_TITLE'] ='Íàçâàíèå ôîòîãðàôèè'; 79 $_LANG['PHOTO_TITLES'] ='Íàçâàíèå ôîòîãðàôèé'; 79 80 $_LANG['PHOTO_DESCRIPTION'] ='Îïèñàíèå ôîòî'; 80 81 $_LANG['REPLACE_FILE'] ='Çàìåíèòü ôàéëîì'; 81 82 82 $_LANG['SHOW'] ='Ïîêàçûâàòü';83 $_LANG['EVERYBODY'] ='Âñåì';84 $_LANG['REGISTERED'] ='Çàðåãèñòðèðîâàííûì';85 $_LANG['MY_FRIENDS'] ='Ìîèì äðóçüÿì';83 $_LANG['SHOW'] ='Ïîêàçûâàòü'; 84 $_LANG['EVERYBODY'] ='Âñåì'; 85 $_LANG['REGISTERED'] ='Çàðåãèñòðèðîâàííûì'; 86 $_LANG['MY_FRIENDS'] ='Ìîèì äðóçüÿì'; 86 87 87 88 $_LANG['MOVE_PHOTO'] ='Ïåðåíåñòè ôîòî'; … … 102 103 $_LANG['LOAD'] ='Çàãðóçèòü'; 103 104 $_LANG['PHOTO_DESC'] ='Îïèñàíèå ôîòîãðàôèè'; 105 $_LANG['PHOTO_DESCS'] ='Îïèñàíèå ôîòîãðàôèé'; 104 106 $_LANG['SHOW'] ='Ïîêàçûâàòü'; 105 107 $_LANG['TO_ALL'] ='Âñåì'; 106 108 $_LANG['TO_REGISTERED'] ='Çàðåãèñòðèðîâàííûì'; 107 109 $_LANG['TO_MY_FRIEND'] ='Ìîèì äðóçüÿì'; 110 $_LANG['YOU_CAN_UPLOAD'] ='Âû ìîæåòå çàãðóçèòü ìàêñèìóì'; 111 $_LANG['UPLOAD_QUEUE'] ='Î÷åðåäü çàãðóçêè'; 112 $_LANG['UPLOADED'] ='Çàãðóæåíî'; 113 $_LANG['GO_TO_UPLOAD'] ='ïåðåéòè ê çàãðóçêå'; 114 $_LANG['ADD_MULTY'] ='äîáàâèòü ìíîãî ôîòîãðàôèé çà ðàç - ìóëüòèçàãðóçêà ôîòî'; 115 $_LANG['PHOTO_DELETED'] ='Ôîòîãðàôèÿ óñïåøíî óäàëåíà'; 116 $_LANG['PHOTO_MOVED'] ='Ôîòîãðàôèÿ óñïåøíî ïåðåíåñåíà'; 117 $_LANG['PHOTO_MOVED_ERR'] ='Ôîòîãðàôèÿ íå ïåðåíåñåíà, óêàæèòå àëüáîì'; 118 108 119 ?> -
trunk/languages/ru/components/users.php
r645 r705 108 108 $_LANG['REALLY_DELETE_PHOTO'] ='Âû äåéñòâèòåëüíî æåëàåòå óäàëèòü ôîòî'; 109 109 $_LANG['EDIT_PHOTO'] ='Ðåäàêòèðîâàòü ôîòîãðàôèþ'; 110 $_LANG['EDIT_ALBUM'] ='Ðåäàêòèðîâàòü àëüáîì'; 110 111 $_LANG['PHOTO_SAVED'] ='Ôîòîãðàôèÿ óñïåøíî cîõðàíåíà.'; 111 112 $_LANG['BACK_TO_PHOTOALBUM'] ='Âåðíóòüñÿ ê ôîòîàëüáîìó'; … … 113 114 $_LANG['PHOTO_TITLE'] ='Íàçâàíèå ôîòî'; 114 115 $_LANG['PHOTO_DESCRIPTION'] ='Îïèñàíèå ôîòî'; 116 $_LANG['ALBUM_TITLE'] ='Íàçâàíèå àëüáîìà'; 117 $_LANG['ALBUM_DESCRIPTION'] ='Îïèñàíèå àëüáîìà'; 115 118 $_LANG['TAGS'] ='Òåãè'; 116 119 $_LANG['KEYWORDS'] ='êëþ÷åâûå ñëîâà, ÷åðåç çàïÿòóþ'; -
trunk/languages/ru/lang.php
r524 r705 93 93 $_LANG['MONTH_11_SHORT'] ='íîÿ'; 94 94 $_LANG['MONTH_12_SHORT'] ='äåê'; 95 $_LANG['MONDAY'] ='Ïîíåäåëüíèê'; 96 $_LANG['TUESDAY'] ='Âòîðíèê'; 97 $_LANG['WEDNESDAY'] ='Ñðåäà'; 98 $_LANG['THURSDAY'] ='×åòâåðã'; 99 $_LANG['FRIDAY'] ='Ïÿòíèöà'; 100 $_LANG['SATURDAY'] ='Ñóááîòà'; 101 $_LANG['SUNDAY'] ='Âîñêðåñåíüå'; 95 102 $_LANG['SHOW'] = 'Ïîêàçàòü'; 96 103 $_LANG['HIDE'] = 'Ñêðûòü'; -
trunk/migrate/index.php
r521 r705 28 28 $inDB = cmsDatabase::getInstance(); 29 29 30 $steps_count = 6; 31 32 $version_prev = '1.6'; 33 $version_next = '1.7'; 34 35 $step = $inCore->request('step', 'int', 0); 36 37 $locker = file_exists('locker'); 30 $version_prev = '1.7'; 31 $version_next = '1.7.1'; 32 33 $is_was_migrate = false; 38 34 39 35 // ========================================================================== // … … 75 71 echo "<h2>Ìèãðàöèÿ InstantCMS {$version_prev} → {$version_next}</h2>"; 76 72 77 if ($step){ 73 // ========================================================================== // 74 // ========================================================================== // 75 if (!$inDB->isFieldExists('cms_modules', 'access_list')){ 76 $inDB->query("ALTER TABLE `cms_modules` ADD `access_list` TINYTEXT NOT NULL AFTER `css_prefix`"); 77 echo '<p>Ïîëå <strong>access_list</strong> äîáàâëåíî â òàáëèöó <strong>cms_modules</strong></p>'; 78 $is_was_migrate = true; 79 } 80 // ========================================================================== // 81 // ========================================================================== // 82 if ($inDB->isFieldExists('cms_modules', 'allow_group')){ 83 $sql = "SELECT id, allow_group 84 FROM cms_modules"; 85 86 $result = $inDB->query($sql); 87 88 if ($inDB->num_rows($result)){ 89 while($mod = $inDB->fetch_assoc($result)){ 90 if($mod['allow_group'] != -1) { 91 92 $access_list[] = $mod['allow_group']; 93 $access_list_ya = $inCore->arrayToYaml($access_list); 94 $inDB->query("UPDATE cms_modules SET `access_list` = '{$access_list_ya}' WHERE id = '{$mod['id']}'"); 95 unset ($access_list); 96 97 } 98 } 99 } 100 101 echo '<p>Ìóëüòèäîñòóï ãðóïï ê ìîäóëÿì âûïîëíåí.</p>'; 102 $is_was_migrate = true; 103 } 104 // ========================================================================== // 105 // ========================================================================== // 106 if ($inDB->isFieldExists('cms_modules', 'allow_group')){ 107 $inDB->query("ALTER TABLE `cms_modules` DROP `allow_group`"); 108 echo '<p>Ïîëå <strong>allow_group</strong> óäàëåíî èç òàáëèöû <strong>cms_modules</strong></p>'; 109 $is_was_migrate = true; 110 } 111 // ========================================================================== // 112 // ========================================================================== // 113 if (!$inDB->isFieldExists('cms_menu', 'access_list')){ 114 $inDB->query("ALTER TABLE `cms_menu` ADD `access_list` TINYTEXT NOT NULL AFTER `template`"); 115 echo '<p>Ïîëå <strong>access_list</strong> äîáàâëåíî â òàáëèöó <strong>cms_menu</strong></p>'; 116 $is_was_migrate = true; 117 } 118 // ========================================================================== // 119 // ========================================================================== // 120 if ($inDB->isFieldExists('cms_menu', 'allow_group')){ 121 $sql = "SELECT id, allow_group 122 FROM cms_menu"; 123 124 $result = $inDB->query($sql); 125 126 if ($inDB->num_rows($result)){ 127 while($mod = $inDB->fetch_assoc($result)){ 128 if($mod['allow_group'] != -1) { 129 130 $access_list[] = $mod['allow_group']; 131 $access_list_ya = $inCore->arrayToYaml($access_list); 132 $inDB->query("UPDATE cms_menu SET `access_list` = '{$access_list_ya}' WHERE id = '{$mod['id']}'"); 133 unset ($access_list); 134 135 } 136 } 137 } 138 139 echo '<p>Ìóëüòèäîñòóï ãðóïï ê ïóíêòàì ìåíþ âûïîëíåí.</p>'; 140 $is_was_migrate = true; 141 } 142 // ========================================================================== // 143 // ========================================================================== // 144 if ($inDB->isFieldExists('cms_menu', 'allow_group')){ 145 $inDB->query("ALTER TABLE `cms_menu` DROP `allow_group`"); 146 echo '<p>Ïîëå <strong>allow_group</strong> óäàëåíî èç òàáëèöû <strong>cms_menu</strong></p>'; 147 $is_was_migrate = true; 148 } 149 // ========================================================================== // 150 // ========================================================================== // 151 if ($inDB->isFieldExists('cms_clubs', 'create_karma')){ 152 $inDB->query("ALTER TABLE `cms_clubs` ADD `create_karma` INT( 11 ) NOT NULL AFTER `join_karma_limit`"); 153 echo '<p>Ïîëå <strong>create_karma</strong> äîáàâëåíî â òàáëèöó <strong>cms_clubs</strong></p>'; 154 $is_was_migrate = true; 155 } 156 // ========================================================================== // 157 // ========================================================================== // 78 158 79 echo "<h4>Øàã {$step} èç {$steps_count}</h4>"; 80 echo '<div class="migrate">'; include "step{$step}.php"; echo '</div>'; 159 $inDB->query("ALTER TABLE `cms_search` CHANGE `link` `link` VARCHAR( 200 ) CHARACTER SET cp1251 COLLATE cp1251_general_ci NOT NULL"); 81 160 82 if ($step < $steps_count){ 83 echo '<div class="nextlink"><a href="?step='.($step+1).'">Äàëåå →</a></div>'; 84 } else { 85 //COMPLETED 86 echo '<p><strong>Ñîçäàéòå çàäàíèå äëÿ CRON!</strong></p>'; 87 88 echo '<p> 89 Äîáàâüòå ôàéë <strong>/cron.php</strong> â ðàñïèñàíèå çàäàíèé CRON â ïàíåëè âàøåãî õîñòèíãà.<br/> 90 Èíòåðâàë âûïîëíåíèÿ 24 ÷àñà. Ýòî ïîçâîëèò ñèñòåìå âûïîëíÿòü ïåðèîäè÷åñêèå ñåðâèñíûå çàäà÷è. 91 </p>'; 92 93 echo '<div style="margin:15px 0px 15px 0px;font-weight:bold">Ìèãðàöèÿ çàâåðøåíà. Óäàëèòå ïàïêó /migrate/ ïðåæäå ÷åì ïðîäîëæèòü!</div>'; 94 echo '<div class="nextlink"><a href="/">Ïåðåéòè íà ñàéò</a></div>'; 95 } 96 97 } else { 98 99 echo "<p> 100 Áàçà äàííûõ ñàéòà áóäåò îáíîâëåíà äî íîâîé âåðñèè.<br/> 101 ×òîáû íå ïðåâûñèòü ìàêñèìàëüíîå âðåìÿ âûïîëíåíèÿ ñêðèïòà<br/> 102 ïðîöåññ ìèãðàöèè ðàçáèò íà {$steps_count} øàãîâ. 103 </p>"; 104 105 echo '<p>Îò âàñ òðåáóåòñÿ òîëüêî íàæèìàòü ññûëêó "Äàëåå" ïîñëå êàæäîãî øàãà.</p>'; 106 107 echo '<p> 108 Ïðåæäå ÷åì íà÷àòü ñäåëàéòå áåêàï áàçû äàííûõ è óáåäèòåñü<br/> 109 ÷òî ñàéò íåäîñòóïåí äëÿ ïîñåòèòåëåé íà âðåìÿ ìèãðàöèè. 110 </p>'; 111 112 if (is_writable(dirname(__FILE__))){ 113 echo '<div class="nextlink"><a href="?step=1">Íà÷àòü ìèãðàöèþ</a></div>'; 114 } else { 115 echo '<p style="color:red">Ïàïêà /migrate/ íå äîñòóïíà äëÿ çàïèñè</p>'; 116 } 117 118 } 119 161 // ========================================================================== // 162 // ========================================================================== // 163 if ($is_was_migrate) { 164 echo '<div style="margin:15px 0px 15px 0px;font-weight:bold">Ìèãðàöèÿ çàâåðøåíà. Óäàëèòå ïàïêó /migrate/ ïðåæäå ÷åì ïðîäîëæèòü!</div>'; 165 } else { 166 echo '<div style="margin:15px 0px 15px 0px;font-weight:bold">Âû óæå ïðîøëè ìèãðàöèþ.</div>'; 167 } 168 echo '<div class="nextlink"><a href="/">Ïåðåéòè íà ñàéò</a></div>'; 120 169 echo '</div>'; 121 170 -
trunk/modules/mod_menu/module.php
r465 r705 19 19 if (!isset($cfg['show_home'])) { $cfg['show_home'] = 1; } 20 20 21 $sql = "SELECT NSLeft, NSRight, NSLevel FROM cms_menu WHERE id = $menuid";21 $sql = "SELECT NSLeft, NSRight, NSLevel FROM cms_menu WHERE id = '$menuid'"; 22 22 $result = $inDB->query($sql); 23 23 $currentmenu = $inDB->fetch_assoc($result); 24 24 25 $root_id = dbGetField('cms_menu', 'parent_id=0', 'id');25 $root_id = $inDB->get_field('cms_menu', 'parent_id=0', 'id'); 26 26 27 27 $nested_sets = $inCore->nestedSetsInit('cms_menu'); … … 32 32 while ($row = $inDB->fetch_assoc($rs_rows)){ 33 33 if ($row['menu'] == $menu){ 34 $item = $row; 35 $item['url'] = $inCore->menuSeoLink($row['link'], $row['linktype'], $row['id']); 36 $items[] = $item; 34 $item = $row; 35 $item['url'] = $inCore->menuSeoLink($row['link'], $row['linktype'], $row['id']); 36 $item['is_allow'] = $inCore->checkContentAccess($item['access_list']); 37 $items[] = $item; 37 38 } 38 39 } … … 48 49 $smarty->assign('hide_parent', 0); 49 50 $smarty->assign('user_id', $inUser->id); 50 $smarty->assign('user_group', $inUser->group_id);51 51 $smarty->assign('is_admin', $inUser->is_admin); 52 52 $smarty->assign('root_id', $root_id); -
trunk/modules/mod_uc_random/module.php
r465 r705 10 10 11 11 function mod_uc_random($module_id){ 12 12 13 $inCore = cmsCore::getInstance(); 13 $inDB = cmsDatabase::getInstance(); 14 $cfg = $inCore->loadModuleConfig($module_id); 14 $inDB = cmsDatabase::getInstance(); 15 16 $cfg = $inCore->loadModuleConfig($module_id); 15 17 16 18 if ($cfg['cat_id']>0){ … … 32 34 FROM cms_uc_items i 33 35 LEFT JOIN cms_uc_cats c ON c.id = i.category_id 34 WHERE i. imageurl != '' AND i.published = 1 ".$catsql."36 WHERE i.published = 1 ".$catsql." 35 37 ORDER BY RAND() 36 38 LIMIT ".$cfg['count']; … … 48 50 } elseif (!file_exists(PATH.'/images/catalog/small/'.$item['imageurl'].'.jpg')) { 49 51 $item['imageurl'] = 'nopic'; 50 }52 } 51 53 52 54 if ($item['viewtype']=='shop'){ -
trunk/modules/mod_user_friend/module.php
r647 r705 55 55 56 56 if ($total){ 57 $friends = array(); 57 58 while($friend = $inDB->fetch_assoc($result)){ 58 59 $friend['avatar'] = ($cfg['view_type'] == 'table') ? usrLink(usrImageNOdb($friend['user_id'], 'small', $friend['imageurl'], $friend['is_deleted']), $friend['login']) : false; 59 60 $friend['user_link'] = cmsUser::getProfileLink($friend['login'], $friend['nickname']); 60 $friends[$friend['id']] = $friend;61 $friends[$friend['user_id']] = $friend; 61 62 } 62 63 } -
trunk/templates/_default_/components/com_photos_add1.tpl
r458 r705 2 2 {* ========================= Çàãðóçêà ôîòî, Øàã 1 ================================= *} 3 3 {* ================================================================================ *} 4 {literal} 5 <script type="text/javascript"> 6 $(document).ready(function() { 7 $('#title').focus(); 8 9 $("#id").change(function () { 10 11 var cat_id = ""; 12 $("#id option:selected").each(function () { 13 cat_id = $(this).val(); 14 }); 15 if(cat_id != 0) { 16 $("#add_form").attr("action", '/photos/'+cat_id+'/addphoto.html'); 17 } else { 18 $("#add_form").attr("action", ""); 19 } 20 21 }) 22 .change(); 23 24 }); 25 function mod_text(){ 26 if ($('#only_mod').attr('checked')){{/literal} 27 $('#text_mes').html('<strong>{$LANG.STEP} 1</strong>: {$LANG.PHOTO_DESCS}.'); 28 $('#text_title').html('{$LANG.PHOTO_TITLES}:'); 29 $('#text_desc').html('{$LANG.PHOTO_DESCS}:');{literal} 30 } else {{/literal} 31 $('#text_mes').html('<strong>{$LANG.STEP} 1</strong>: {$LANG.PHOTO_DESC}.'); 32 $('#text_title').html('{$LANG.PHOTO_TITLE}:'); 33 $('#text_desc').html('{$LANG.PHOTO_DESC}:');{literal} 34 } 35 } 4 36 5 <h3 style="border-bottom: solid 1px gray"> 6 <strong>{$LANG.STEP} 1</strong>: {$LANG.FILE_UPLOAD} 37 </script> 38 {/literal} 39 40 <h3 style="border-bottom: solid 1px gray" id="text_mes"> 41 <strong>{$LANG.STEP} 1</strong>: {$LANG.PHOTO_DESC}. 7 42 </h3> 8 43 9 <form enctype="multipart/form-data" action="{$form_action}" method="POST"> 10 <input name="upload" type="hidden" value="1"/> 11 <input name="userid" type="hidden" value="{$user_id}"/> 12 13 <p>{$LANG.SELECT_FILE_TO_UPLOAD}: </p> 14 <input name="picture" type="file" id="picture" size="30" /> 15 16 <div style="margin-top:5px"> 17 <strong>{$LANG.ALLOW_FILE_TYPE}:</strong> gif, jpg, jpeg, png 18 </div> 19 20 <p> 21 <input type="submit" value="{$LANG.LOAD}"> 22 <input type="button" onclick="window.history.go(-1);" value="{$LANG.CANCEL}"/> 23 </p> 44 <form action="{$form_action}" method="POST"> 45 <input type="hidden" name="imageurl" value="{$filename}"/> 46 <table width="500"> 47 <tr> 48 <td width="140" id="text_title">{$LANG.PHOTO_TITLE}: </td> 49 <td> 50 <input name="title" type="text" id="title" class="text-input" style="width:350px;" maxlength="250" value="{$mod.title|escape:'html'}" /> 51 </td> 52 </tr> 53 <tr> 54 <td valign="top" id="text_desc">{$LANG.PHOTO_DESC}: </td> 55 <td valign="top"> 56 <textarea name="description" style="width:350px;" rows="5" id="description">{$mod.description}</textarea> 57 </td> 58 </tr> 59 <tr> 60 <td>Òýãè:</td> 61 <td> 62 <input name="tags" type="text" id="tags" class="text-input" style="width:350px;" value="{$mod.tags|escape:'html'}"/> 63 <div><small>{$LANG.KEYWORDS}</small></div> 64 <script type="text/javascript"> 65 {$autocomplete_js} 66 </script> 67 </td> 68 </tr> 69 <tr> 70 <td colspan="2" valign="top"> 71 <input id="only_mod" name="only_mod" type="checkbox" value="1" onclick="mod_text()" /> <label for="only_mod">{$LANG.ADD_MULTY}</label></td> 72 </tr> 73 <tr> 74 <td colspan="2" valign="top"><input type="submit" name="submit" id="text_subm" value="{$LANG.GO_TO_UPLOAD}" /></td> 75 </tr> 76 </table> 24 77 </form> -
trunk/templates/_default_/components/com_photos_add2.tpl
r458 r705 4 4 5 5 <h3 style="border-bottom: solid 1px gray"> 6 <strong>{$LANG.STEP} 2</strong>: {$LANG. PHOTO_DESC}6 <strong>{$LANG.STEP} 2</strong>: {$LANG.FILE_UPLOAD} 7 7 </h3> 8 {if !$stop_photo} 9 {if $uload_type == 'multi'} 10 {add_js file='includes/swfupload/swfupload.js'} 11 {add_js file='includes/swfupload/swfupload.queue.js'} 12 {add_js file='includes/swfupload/fileprogress.js'} 13 {add_js file='includes/swfupload/handlers.js'} 14 {add_css file='includes/swfupload/swfupload.css'} 8 15 9 <form action="{$form_action}" method="POST"> 10 <input type="hidden" name="imageurl" value="{$filename}"/> 11 <table width="500"> 12 <tr> 13 <td width="140">{$LANG.PHOTO_TITLE}: </td> 14 <td> 15 <input name="title" type="text" id="title" style="width:350px;" maxlength="250" /> 16 </td> 17 </tr> 18 <tr> 19 <td valign="top">{$LANG.PHOTO_DESCRIPTION}: </td> 20 <td valign="top"> 21 <textarea name="description" style="width:350px;" rows="5" id="description"></textarea> 22 </td> 23 </tr> 24 <tr> 25 <td>Òýãè:</td> 26 <td> 27 <input name="tags" type="text" id="tags" style="width:350px;"/> 28 <div><small>{$LANG.KEYWORDS}</small></div> 29 <script type="text/javascript"> 30 {$autocomplete_js} 31 </script> 32 </td> 33 </tr> 34 {if isset($allow_who)} 35 <tr> 36 <td>{$LANG.SHOW}:</td> 37 <td> 38 <select name="allow_who" id="allow_who" style="width:350px;"> 39 <option value="all">{$LANG.TO_ALL}</option> 40 <option value="registered">{$LANG.TO_REGISTERED}</option> 41 <option value="friends">{$LANG.TO_MY_FRIEND}</option> 42 </select> 43 </td> 44 </tr> 45 {/if} 46 <tr> 47 <td valign="top"> </td> 48 <td valign="top"><input type="submit" name="submit" value="{$LANG.SAVE}" /></td> 49 </tr> 50 </table> 16 <script type="text/javascript"> 17 {literal} 18 var swfu; 19 var uploadedCount = 0; 20 21 window.onload = function() { 22 var settings = { 23 flash_url : "/includes/swfupload/swfupload.swf", 24 upload_url: "/photos/{/literal}{$album.id}{literal}/upload", 25 post_params: {"PHPSESSID" :{/literal} "{$sess_id}"{literal}}, 26 file_size_limit : "20 MB", 27 file_types : "*.jpg;*.png;*.gif;*.jpeg;*.JPG;*.PNG;*.GIF;*.JPEG", 28 file_types_description : "Ôîòîãðàôèè", 29 {/literal} 30 file_upload_limit : {if $max_limit}{$max_files}{else}100{/if}, 31 {literal} 32 file_queue_limit : 0, 33 custom_settings : { 34 progressTarget : "fsUploadProgress", 35 cancelButtonId : "btnCancel" 36 }, 37 debug: false, 38 39 // Button settings 40 button_image_url: "/includes/swfupload/uploadbtn199x36.png", 41 button_width: "199", 42 button_height: "36", 43 button_placeholder_id: "spanButtonPlaceHolder", 44 45 // The event handler functions are defined in handlers.js 46 file_queued_handler : fileQueued, 47 file_queue_error_handler : fileQueueError, 48 file_dialog_complete_handler : fileDialogComplete, 49 upload_start_handler : uploadStart, 50 upload_progress_handler : uploadProgress, 51 upload_error_handler : uploadError, 52 upload_success_handler : uploadSuccess, 53 upload_complete_handler : uploadComplete, 54 queue_complete_handler : queueComplete // Queue plugin event 55 }; 56 57 swfu = new SWFUpload(settings); 58 }; 59 60 function queueComplete(numFilesUploaded) { 61 if (numFilesUploaded>0){ 62 uploadedCount += numFilesUploaded; 63 $('#divStatus').show(); 64 $('#continue').show(); 65 $("#files_count").html(uploadedCount); 66 } 67 } 68 69 {/literal} 70 </script> 71 72 <form id="usr_photos_upload_form" action="" method="post" enctype="multipart/form-data"> 73 74 {if $max_limit} 75 <p class="usr_photos_add_limit">{$LANG.YOU_CAN_UPLOAD} <strong>{$max_files}</strong> {$LANG.PHOTO}</p> 76 {/if} 77 78 <div class="fieldset flash" id="fsUploadProgress" style="display:none"> 79 <span class="legend">{$LANG.UPLOAD_QUEUE}</span> 80 </div> 81 82 <div> 83 <span id="spanButtonPlaceHolder"></span> 84 <input id="btnCancel" type="button" value="Îòìåíèòü âñå" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 36px;" /> 85 </div> 86 87 <div id="divStatus" style="display:none"> 88 {$LANG.UPLOADED} <span id="files_count"><strong>0</strong></span> {$LANG.PHOTO}. 89 <a href="/photos/{$album.id}/uploaded.html" id="continue">{$LANG.CONTINUE}</a> 90 </div> 91 51 92 </form> 93 94 {elseif $uload_type == 'single'} 95 {if $max_limit} 96 <p class="usr_photos_add_limit">{$LANG.YOU_CAN_UPLOAD} <strong>{$max_files}</strong> {$LANG.PHOTO}</p> 97 {/if} 98 99 <form enctype="multipart/form-data" action="/photos/{$album.id}/upload" method="POST"> 100 101 <p>{$LANG.SELECT_FILE_TO_UPLOAD}: </p> 102 <input name="Filedata" type="file" id="picture" size="30" /> 103 <input name="upload" type="hidden" value="1"/> 104 105 <div style="margin-top:5px"> 106 <strong>{$LANG.ALLOW_FILE_TYPE}:</strong> gif, jpg, jpeg, png 107 </div> 108 109 <p> 110 <input type="submit" value="{$LANG.LOAD}"> 111 <input type="button" onclick="window.history.go(-1);" value="{$LANG.CANCEL}"/> 112 </p> 113 </form> 114 {/if} 115 {else} 116 <p class="usr_photos_add_limit">{$LANG.MAX_UPLOAD_IN_DAY}</p> 117 {/if} -
trunk/templates/_default_/components/com_photos_edit.tpl
r458 r705 4 4 <div class="con_heading">{$LANG.EDIT_PHOTO}</div> 5 5 <form action="{$action}" method="POST" enctype="multipart/form-data"> 6 {$input_poto} 6 7 7 <table border="0" cellspacing="0" cellpadding="0"> 8 8 <tr> … … 21 21 </tr> 22 22 <tr> 23 <td valign="top"><strong>{$LANG.PHOTO_DESC RIPTION}:</strong> </td>23 <td valign="top"><strong>{$LANG.PHOTO_DESC}:</strong> </td> 24 24 </tr> 25 25 <tr> … … 38 38 </tr> 39 39 <tr> 40 <td valign="top"><input name="MAX_FILE_SIZE" type="hidden" value="{$photo_max_size}"/> 41 <input name="picture" type="file" size="30" /></td> 40 <td valign="top"><input name="Filedata" type="file" size="30" /></td> 42 41 </tr> 43 {if $user_foto}44 <tr>45 <td valign="top"><strong>{$LANG.SHOW}:</strong></td>46 </tr>47 <tr>48 <td valign="top">49 <select name="allow_who" id="allow_who">50 <option value="all" {if $photo.allow_who==all} selected {/if}>{$LANG.EVERYBODY}</option>51 <option value="registered" {if $photo.allow_who==registered} selected {/if}>{$LANG.REGISTERED}</option>52 <option value="friends" {if $photo.allow_who==friends} selected {/if}>{$LANG.MY_FRIENDS}</option>53 </select>54 </td>55 </tr>56 {/if}57 42 <tr> 58 43 <td valign="top"> -
trunk/templates/_default_/components/com_photos_view.tpl
r597 r705 81 81 <a class="photo_add_link" href="/photos/{$album.id}/addphoto.html">{$LANG.ADD_PHOTO_TO_ALBUM}</a> 82 82 {/if} 83 83 {if $messages} 84 <div class="sess_messages"> 85 {foreach key=id item=message from=$messages} 86 {$message} 87 {/foreach} 88 </div> 89 {/if} 84 90 85 91 {if $cons} -
trunk/templates/_default_/components/com_users_photo_submit.tpl
r645 r705 75 75 <tr> 76 76 <td width="100" height="30">{$LANG.TITLE}:</td> 77 <td><input type="text" name="title[{$photo.id}]" value="{$photo.title }" class="text-input" /></td>77 <td><input type="text" name="title[{$photo.id}]" value="{$photo.title|escape:'html'}" class="text-input" /></td> 78 78 </tr> 79 79 <tr> 80 80 <td height="30">{$LANG.DESCRIPTION}:</td> 81 <td><input type="text" name="desc[{$photo.id}]" value="{$photo.description }" class="text-input" /></td>81 <td><input type="text" name="desc[{$photo.id}]" value="{$photo.description|escape:'html'}" class="text-input" /></td> 82 82 </tr> 83 83 <tr> -
trunk/templates/_default_/components/com_users_photos.tpl
r532 r705 9 9 {/if} 10 10 {if $album_type == 'private'} 11 <a href="javascript:void(0)" onclick="$('#usr_photos_upload_album').show();" class="usr_edit_album">{$LANG.EDIT_ALBUM}</a> 11 12 <a href="/users/{$user_id}/delalbum{$album.id}.html" onclick="if(!confirm('{$LANG.DELETE_ALBUM_CONFIRM}')){literal}{ return false; }{/literal}" class="usr_del_album">{$LANG.DELETE_ALBUM}</a> 12 13 {/if} … … 17 18 <a href="{profile_url login=$usr.login}">{$usr.nickname}</a> → {$page_title} 18 19 </div> 19 20 {if ($my_profile || $is_admin) && $album_type == 'private'} 21 <div id="usr_photos_upload_album" style="display:none;"> 22 <form action="/users/{$usr.id}/editalbum{$album.id}.html" method="post"> 23 <table border="0" cellspacing="0" cellpadding="2"> 24 <tr> 25 <td><label for="album_title">{$LANG.ALBUM_TITLE}:</label></td> 26 <td><input type="text" class="text-input" name="album_title" value="{$album.title|escape:'html'}" /></td> 27 <td>{$LANG.SHOW}: 28 <select name="album_allow_who" id="album_allow_who"> 29 <option value="all" {if $album.allow_who=='all'}selected="selected"{/if}>{$LANG.EVERYBODY}</option> 30 <option value="registered" {if $album.allow_who=='registered'}selected="selected"{/if}>{$LANG.REGISTERED}</option> 31 <option value="friends" {if $album.allow_who=='friends'}selected="selected"{/if}>{$LANG.MY_FRIENDS}</option> 32 </select> 33 </td> 34 </tr> 35 <tr> 36 <td><label for="description">{$LANG.ALBUM_DESCRIPTION}:</label></td> 37 <td colspan="2"><textarea name="description" style="width:465px; height:45px;">{$album.description}</textarea></td> 38 </tr> 39 </table> 40 <div class="usr_photo_sel_bar bar"> 41 <input type="submit" name="save_album" value="{$LANG.SAVE}"/> 42 <input name="Button" type="button" value="{$LANG.CANCEL}" onclick="{literal}$('#usr_photos_upload_album').hide();{/literal}"/> 43 </div> 44 </form> 45 </div> 46 {/if} 20 47 {if $album_type == 'public'} 21 48 <div class="usr_photos_notice">{$LANG.IS_PUBLIC_ALBUM} <a href="/photos/{$album.id}">{$LANG.ALL_PUBLIC_PHOTOS}</a></div> 22 49 {/if} 23 50 {if $album_type == 'private' && $album.description} 51 <div id="usr_photos_upload_album">{$album.description|nl2br}</div> 52 {/if} 24 53 {if $photos} 25 54 -
trunk/templates/_default_/css/styles.css
r624 r705 3127 3127 padding-left:20px; 3128 3128 background:url(../images/icons/deletecat.png) no-repeat left center; 3129 margin-left:6px; 3130 } 3131 .usr_edit_album{ 3132 padding:1px; 3133 padding-left:20px; 3134 background:url(../images/icons/edit.png) no-repeat left center; 3129 3135 margin-left:6px; 3130 3136 } -
trunk/templates/_default_/modules/mod_menu.tpl
r458 r705 11 11 12 12 {foreach key=key item=item from=$items} 13 {if $item. allow_group == -1 || $item.allow_group == $user_group || $is_admin}13 {if $item.is_allow} 14 14 {if $item.published} 15 15 {if $item.parent_id != $hide_parent} -
trunk/upload/.htaccess
r625 r705 1 Options -Indexes 1 # Ïåðå÷èñëåííûå íèæå âàðèàíòû èñïîëüçóþòñÿ äëÿ îáåñïå÷åíèÿ áåçîïàñíîñòè 2 # â äèðåêòîðèÿõ çàãðóçêè. Ïî óìîë÷àíèþ ýòè îïöèè çàêîììåíòèðîâàíû 3 # â öåëÿõ îáåñïå÷åíèÿ ïîëíîé ñîâìåñòèìîñòè ñî âñåìè õîñòèíãàìè 4 # åñëè âû óâåðåíû, ÷òî äàííûå îïöèè íà âàøåì õîñòèíãå ðàáîòàþò, ñíèìèòå 5 # çíàêè êîììåíòàðèåâ ñ íóæíîãî âàðèàíòà 2 6 3 7 # Ïåðâûé âàðèàíò çàïðåòà âûïîëíåíèÿ php 4 php_flag engine 05 AddType "text/html" .php .cgi .pl .fcgi .fpl .phtml .shtml .php2 .php3 .php4 .php5 .asp .jsp6 RemoveType php8 # php_flag engine 0 9 # AddType "text/html" .php .cgi .pl .fcgi .fpl .phtml .shtml .php2 .php3 .php4 .php5 .asp .jsp 10 # RemoveType php 7 11 8 12 # Âòîðîé âàðèàíò çàïðåòà âûïîëíåíèÿ php 9 13 # èñïîëüçóéòå åãî, åñëè ïðè ïåðâîì âàðèàíòå êàðòèíêè èç äèðåêòîðèé íå îòîáðàæàþòñÿ 10 # çàêîììåíòèðóéòå ñòðî÷êè ïåðâîãî âàðèàíòà, ñî ñòðî÷åê íèæå êîììåíòàðèè ñíèìèòå11 14 # RemoveHandler .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml 12 # AddType application/x-httpd-php-source .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml 15 # AddType application/x-httpd-php-source .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml
Note: See TracChangeset
for help on using the changeset viewer.
