• R/O
  • SSH
  • HTTPS

researchclip: Commit


Commit MetaInfo

Revision44 (tree)
Time2009-05-01 00:17:47
Authorwalgbart

Log Message

user_settings.php:
転送先の取得にHTTP_REFERERを使わないように修正

modules/profiles/profiles_init.php:
テンプレートの挿入位置がおかしいため変更

modules/profiles/templates/profile_extend.tpl:
modules/users_extra_fields/templates/profile_center_fields.tpl:
modules/users_extra_fields/templates/profile_extend_country.tpl:
modules/users_extra_fields/templates/profile_extend_bio.tpl:
modules/users_extra_fields/templates/profile_extend_university.tpl:
modules/users_extra_fields/templates/profile_extend_status.tpl:
modules/users_extra_fields/templates/profile_extend_subscription.tpl:
libs/csrf.php:
user.php:
HTMLのvalid化,適切なタグへの書き換え,utf8への保存し直し
タグの閉じ忘れなどの修正

modules/scriptaculous/js/prototype.js:
extjsと組合せたときにIEでエラーが出るのでやむなく修正

topusers.php:
デフォルトの表示順をkarma順に

libs/html1.php:
libs/smartyvariables.php:
upcoming.php:
日本語カテゴリをurlencodeするように修正

htaccess.default:
グループ名が日本語の場合の不具合を修正
足りないアドバンストサーチの定義を追加

advancedsearch.php:
utf8_ucfirstを使うように修正

sidebar_stories.php:
queuedの表示にindexがないのはおかしいので追加
(わざとかもしれない)

edit.php:
return falseしてhrefを無効に

rss.php:
副問合せを使わないように修正

templates/bookmarklet.tpl:
escapeではなくencodeURIComponentを使う

avatars/Gravatar_15.gif:
avatars/Gravatar_30.gif:
デフォルトのavatar画像をresearchclipアイコンに。

page.php:
パン屑設定の追加

story.php:
テンプレートに合わせてやむなく修正

Change Summary

Incremental Difference

--- pligg/trunk/pligg/user_settings.php (revision 43)
+++ pligg/trunk/pligg/user_settings.php (revision 44)
@@ -50,6 +50,7 @@
5050 $Get_URL = str_replace($vowels, "", $geturl); */
5151 $geturl = $_SERVER['HTTP_REFERER'];
5252 $url = strtolower(end(explode('/', $geturl)));
53+$geturl = getmyurl('user2', $login, 'setting');
5354 if($select_check == true)
5455 {
5556 $select_checked = $db->escape(implode(",",$select_check));
@@ -56,13 +57,13 @@
5657 $sql = "UPDATE " . table_users . " set user_categories='$select_checked' WHERE user_id = '$sqlGetiUserId'";
5758 $query = mysql_query($sql);
5859 $to_page = preg_replace("/&err=.+$/","",$_SERVER['HTTP_REFERER']);
59- header("location:".$to_page."");
60+ header("location:".$geturl."");
6061 }
6162 else
6263 {
6364 //$d = str_replace('&err=1','',$_SERVER['HTTP_REFERER'],)
6465 $to_page = preg_replace("/&err=.+$/","",$_SERVER['HTTP_REFERER']);
65- header("location:".$to_page."&err=1");
66+ header("location:".$geturl."&err=1");
6667 }
6768
6869 ?>
--- pligg/trunk/pligg/modules/profiles/profiles_init.php (revision 43)
+++ pligg/trunk/pligg/modules/profiles/profiles_init.php (revision 44)
@@ -9,7 +9,7 @@
99 $do_not_include_in_pages = array();
1010
1111 if( do_we_load_module() ) {
12- module_add_action_tpl('tpl_pligg_profile_info_middle', profiles_tpl_path . 'profile_extend.tpl');
12+ module_add_action_tpl('tpl_show_extra_profile', profiles_tpl_path . 'profile_extend.tpl');
1313 //include_once(mnmmodules . 'profiles/profiles_main.php');
1414 }
1515
--- pligg/trunk/pligg/modules/scriptaculous/js/prototype.js (revision 43)
+++ pligg/trunk/pligg/modules/scriptaculous/js/prototype.js (revision 44)
@@ -3858,7 +3858,7 @@
38583858 && currentTarget.type === 'radio'))
38593859 node = currentTarget;
38603860 }
3861- if (node.nodeType == Node.TEXT_NODE) node = node.parentNode;
3861+ if (node && node.nodeType == Node.TEXT_NODE) node = node.parentNode;
38623862 return Element.extend(node);
38633863 },
38643864
--- pligg/trunk/pligg/topusers.php (revision 43)
+++ pligg/trunk/pligg/topusers.php (revision 44)
@@ -38,7 +38,7 @@
3838 case 0: // sort users alphabetically
3939 $select = "SELECT user_id";
4040 $from_where = " FROM " . table_users . " where user_level<>'god'";
41- $order_by = " ORDER BY user_login ";
41+ $order_by = " ORDER BY user_karma DESC ";
4242 break;
4343 case 1: // sort users by number of submitted linkd
4444 $select = "SELECT user_id, count(*) as count ";
--- pligg/trunk/pligg/libs/csrf.php (revision 43)
+++ pligg/trunk/pligg/libs/csrf.php (revision 44)
@@ -102,7 +102,7 @@
102102 function create_hidden_field($name, $assign = false){
103103 // creates the HTML for a hidden text field with the token
104104 // assigns to smarty if $assign == true
105- $field = '<input type="hidden" name="token" value="' . $this->get_value($name) . '">';
105+ $field = '<input type="hidden" name="token" value="' . $this->get_value($name) . '" />';
106106 $this->log('created hidden field for token: ' . $name);
107107 if($assign == true){
108108 global $main_smarty;
--- pligg/trunk/pligg/libs/html1.php (revision 43)
+++ pligg/trunk/pligg/libs/html1.php (revision 44)
@@ -395,7 +395,7 @@
395395 $query=preg_replace('(order)', '', $query);
396396 $query=preg_replace('/page=[0-9]+/', '', $query); //remove page arguments to because its hardcoded in html //
397397 $query=preg_replace('/tag=true/', '', $query); //remove tag=true in tag query because its handled in .htaccess and hidden for a cleaner look//
398- $query=preg_replace('/(.*)=(.*)/', '$1/$2', $query); //main line to recompose arg to place in url //
398+ $query=preg_replace('/(.*)=(.*)/e', "'\\1/'.urlencode(urldecode('\\2'))", $query); //main line to recompose arg to place in url //
399399 $query=preg_replace('/&/', '', $query); //whack any ampersands //
400400 $query=preg_replace('/module\/pagestatistics/', '', $query);
401401 $query=preg_replace('/search\/(.*)/', 'search=$1', $query);
@@ -664,7 +664,7 @@
664664 If ($x == "index") {return my_pligg_base."/published/";}
665665 If ($x == "index_sort") {return my_pligg_base."/published/" . $var1 . "/".$var2;}
666666 If ($x == "search") {return my_pligg_base."/search/" . $var1;}
667- If ($x == "search") {return my_pligg_base."/advanced-search/" . $var1;}
667+ If ($x == "advancedsearch") {return my_pligg_base."/advanced-search/" . $var1;}
668668 If ($x == "search_url") {return my_pligg_base."/searchurl/" . $var1;}
669669 If ($x == "login") {return my_pligg_base."/login.php?return=" . $var1;}
670670 If ($x == "logout") {return my_pligg_base."/login.php?op=logout&return=index.php";}
@@ -779,12 +779,12 @@
779779 $main_smarty->assign('URL_topusers', getmyurl("topusers"));
780780 $main_smarty->assign('URL_about', getmyurl("about", $dblang));
781781 if(isset($_GET['category']) && sanitize($_GET['category'],1) != '' && strpos($_SERVER['PHP_SELF'], "upcoming.php") === false) {
782- $main_smarty->assign('URL_upcoming', getmyurl("queuedcategory").sanitize(sanitize($_GET['category'],1),3));
782+ $main_smarty->assign('URL_upcoming', getmyurl("queuedcategory").urlencode(sanitize(sanitize($_GET['category'],1),3)));
783783 } else {
784784 $main_smarty->assign('URL_upcoming', getmyurl("upcoming"));
785785 }
786786 if(isset($_GET['category']) && sanitize($_GET['category'],1) != '' && strpos($_SERVER['PHP_SELF'], "index.php") === false) {
787- $main_smarty->assign('URL_base', getmyurl("maincategory",sanitize(sanitize($_GET['category'],1),3)));
787+ $main_smarty->assign('URL_base', getmyurl("maincategory",urlencode(sanitize(sanitize($_GET['category'],1),3))));
788788 } else {
789789 $main_smarty->assign('URL_base', getmyurl("index"));
790790 }
--- pligg/trunk/pligg/libs/smartyvariables.php (revision 43)
+++ pligg/trunk/pligg/libs/smartyvariables.php (revision 44)
@@ -96,21 +96,21 @@
9696 $pligg_category = isset($_GET['category']) ? sanitize($_GET['category'], 3) : '';
9797 if($pligg_category != ''){
9898 if (urlmethod == 1) {
99- $main_smarty->assign('index_url_recent', getmyurl('index_sort', 'recent', '&amp;category='.$pligg_category));
100- $main_smarty->assign('index_url_today', getmyurl('index_sort', 'today', '&amp;category='.$pligg_category));
101- $main_smarty->assign('index_url_yesterday', getmyurl('index_sort', 'yesterday', '&amp;category='.$pligg_category));
102- $main_smarty->assign('index_url_week', getmyurl('index_sort', 'week', '&amp;category='.$pligg_category));
103- $main_smarty->assign('index_url_month', getmyurl('index_sort', 'month', '&amp;category='.$pligg_category));
104- $main_smarty->assign('index_url_year', getmyurl('index_sort', 'year', '&amp;category='.$pligg_category));
99+ $main_smarty->assign('index_url_recent', getmyurl('index_sort', 'recent', '&amp;category='.urlencode($pligg_category)));
100+ $main_smarty->assign('index_url_today', getmyurl('index_sort', 'today', '&amp;category='.urlencode($pligg_category)));
101+ $main_smarty->assign('index_url_yesterday', getmyurl('index_sort', 'yesterday', '&amp;category='.urlencode($pligg_category)));
102+ $main_smarty->assign('index_url_week', getmyurl('index_sort', 'week', '&amp;category='.urlencode($pligg_category)));
103+ $main_smarty->assign('index_url_month', getmyurl('index_sort', 'month', '&amp;category='.urlencode($pligg_category)));
104+ $main_smarty->assign('index_url_year', getmyurl('index_sort', 'year', '&amp;category='.urlencode($pligg_category)));
105105 $main_smarty->assign('cat_url', getmyurl("maincategory"));
106106 }
107107 else {
108- $main_smarty->assign('index_url_recent', getmyurl('index_sort', 'recent', 'category/'.$pligg_category));
109- $main_smarty->assign('index_url_today', getmyurl('index_sort', 'today', 'category/'.$pligg_category));
110- $main_smarty->assign('index_url_yesterday', getmyurl('index_sort', 'yesterday', 'category/'.$pligg_category));
111- $main_smarty->assign('index_url_week', getmyurl('index_sort', 'week', 'category/'.$pligg_category));
112- $main_smarty->assign('index_url_month', getmyurl('index_sort', 'month', 'category/'.$pligg_category));
113- $main_smarty->assign('index_url_year', getmyurl('index_sort', 'year', 'category/'.$pligg_category));
108+ $main_smarty->assign('index_url_recent', getmyurl('index_sort', 'recent', 'category/'.urlencode($pligg_category)));
109+ $main_smarty->assign('index_url_today', getmyurl('index_sort', 'today', 'category/'.urlencode($pligg_category)));
110+ $main_smarty->assign('index_url_yesterday', getmyurl('index_sort', 'yesterday', 'category/'.urlencode($pligg_category)));
111+ $main_smarty->assign('index_url_week', getmyurl('index_sort', 'week', 'category/'.urlencode($pligg_category)));
112+ $main_smarty->assign('index_url_month', getmyurl('index_sort', 'month', 'category/'.urlencode($pligg_category)));
113+ $main_smarty->assign('index_url_year', getmyurl('index_sort', 'year', 'category/'.urlencode($pligg_category)));
114114 $main_smarty->assign('cat_url', getmyurl("maincategory"));
115115 }
116116 }
--- pligg/trunk/pligg/user.php (revision 43)
+++ pligg/trunk/pligg/user.php (revision 44)
@@ -534,19 +534,19 @@
534534 $output = "<h2>Your Friends</h2>";
535535
536536 if ($friends){
537- $output .= '<table><th width="250px">Username</th><th width="60px">Message</th><th width="60px">Remove</th>';
537+ $output .= '<table><tr><th>Username</th><th>Message</th><th>Remove</th></tr>';
538538 foreach($friends as $myfriend) {
539539 $friend_avatar = get_avatar('small', $myfriend->user_avatar_source, $myfriend->user_login, $myfriend->user_email);
540540 $output .= '<tr>';
541- $output .= '<td><img src="'.$friend_avatar.'" align="absmiddle"/> <a href="'.getmyurl('user2', $myfriend->user_login, 'profile').'">' . $myfriend->user_login.'</a></td>';
542- $output .= '<td align="center"><a href="' . my_pligg_base . '/module.php?module=simple_messaging&view=compose&return=' . urlencode($_SERVER['REQUEST_URI']) .'&to=' .$myfriend->user_login . '"><img src="'.my_pligg_base.'/templates/'.$the_template.'/images/user_message.png" border="0"></a></td>';
543- $output .= '<td align="center"><a href = "'.getmyurl('user_add_remove', $myfriend->user_login, 'removefriend').'"><img src='.my_pligg_base.'/templates/'.$the_template.'/images/user_delete.png border=0></a></td>';
544- $output .= '</tr>';
541+ $output .= '<td><img src="'.$friend_avatar.'" /> <a href="'.getmyurl('user2', $myfriend->user_login, 'profile').'">' . $myfriend->user_login.'</a></td>';
542+ $output .= '<td><a href="' . my_pligg_base . '/module.php?module=simple_messaging&amp;view=compose&amp;return=' . urlencode($_SERVER['REQUEST_URI']) .'&amp;to=' .$myfriend->user_login . '"><img src="'.my_pligg_base.'/templates/'.$the_template.'/images/user_comment.png" /></a></td>';
543+ $output .= '<td><a href = "'.getmyurl('user_add_remove', $myfriend->user_login, 'removefriend').'"><img src='.my_pligg_base.'/templates/'.$the_template.'/images/user_delete.png /></a></td>';
544+ $output .= '</tr>';
545545 }
546546 $output .= '</table>';
547547 }
548548 else {
549- $output .= "<br /><br /><center><h2>You don't have any Friends yet.</h2></center>";
549+ $output .= "<p>You don't have any Friends yet.</p>";
550550 }
551551 $main_smarty->assign('user_page', $output);
552552 }
@@ -559,18 +559,18 @@
559559 $output = "<h2>People who have added you as a friend</h2>";
560560
561561 if ($friends){
562- $output .= '<table><th width="250px">Username</th><th width="500px">Message</th>';
562+ $output .= '<table><tr><th>Username</th><th>Message</th></tr>';
563563 foreach($friends as $myfriend) {
564564 $friend_avatar = get_avatar('small', $myfriend->user_avatar_source, $myfriend->user_login, $myfriend->user_email);
565565 $output .= '<tr>';
566- $output .= '<td><img src="'.$friend_avatar.'" align="absmiddle"/> <a href="'.getmyurl('user2', $myfriend->user_login, 'profile'). '">' . $myfriend->user_login.'</a></td>';
567- $output .= '<td><a href="' . my_pligg_base . '/module.php?module=simple_messaging&view=compose&to=' .$myfriend->user_login . '&return=' . urlencode($_SERVER['REQUEST_URI']) .'"><img src="'.my_pligg_base.'/templates/'.$the_template.'/images/user_message.png" border="0"></a></td>';
566+ $output .= '<td><img src="'.$friend_avatar.'" /><a href="'.getmyurl('user2', $myfriend->user_login, 'profile'). '">' . $myfriend->user_login.'</a></td>';
567+ $output .= '<td><a href="' . my_pligg_base . '/module.php?module=simple_messaging&amp;view=compose&amp;to=' .$myfriend->user_login . '&amp;return=' . urlencode($_SERVER['REQUEST_URI']) .'"><img src="'.my_pligg_base.'/templates/'.$the_template.'/images/user_comment.png" /></a></td>';
568568 $output .= '</tr>';
569569 }
570570 $output .= '</table>';
571571 }
572572 else {
573- $output .= "<br /><br /><center><h2>No one has added you as a friend yet.</h2>";
573+ $output .= "<p>No one has added you as a friend yet.</p>";
574574 }
575575 $main_smarty->assign('user_page', $output);
576576 }
--- pligg/trunk/pligg/upcoming.php (revision 43)
+++ pligg/trunk/pligg/upcoming.php (revision 44)
@@ -63,10 +63,10 @@
6363 $main_smarty->assign('cat_url', getmyurl("queuedcategory"));
6464 }
6565 else{
66- $main_smarty->assign('upcoming_url_newest', getmyurl('upcoming_sort', 'newest', 'category/'.sanitize($_GET['category'],2)));
67- $main_smarty->assign('upcoming_url_oldest', getmyurl('upcoming_sort', 'oldest', 'category/'.sanitize($_GET['category'],2)));
68- $main_smarty->assign('upcoming_url_mostpopular', getmyurl('upcoming_sort', 'mostpopular', 'category/'.sanitize($_GET['category'],2)));
69- $main_smarty->assign('upcoming_url_leastpopular', getmyurl('upcoming_sort', 'leastpopular', 'category/'.sanitize($_GET['category'],2)));
66+ $main_smarty->assign('upcoming_url_newest', getmyurl('upcoming_sort', 'newest', 'category/'.urlencode(sanitize($_GET['category'],2))));
67+ $main_smarty->assign('upcoming_url_oldest', getmyurl('upcoming_sort', 'oldest', 'category/'.urlencode(sanitize($_GET['category'],2))));
68+ $main_smarty->assign('upcoming_url_mostpopular', getmyurl('upcoming_sort', 'mostpopular', 'category/'.urlencode(sanitize($_GET['category'],2))));
69+ $main_smarty->assign('upcoming_url_leastpopular', getmyurl('upcoming_sort', 'leastpopular', 'category/'.urlencode(sanitize($_GET['category'],2))));
7070 $main_smarty->assign('cat_url', getmyurl("queuedcategory"));
7171 }
7272 }
--- pligg/trunk/pligg/advancedsearch.php (revision 43)
+++ pligg/trunk/pligg/advancedsearch.php (revision 44)
@@ -8,6 +8,7 @@
88 include(mnminclude.'tags.php');
99 include(mnminclude.'user.php');
1010 include(mnminclude.'smartyvariables.php');
11+include(mnminclude.'utf8/ucfirst.php');
1112
1213 // -------------------------------------------------------------------------------------
1314
@@ -24,7 +25,7 @@
2425 $result = mysql_query( $query );
2526
2627 while( $row = mysql_fetch_array( $result ) ){
27- $category_option .= '<option value="'.$row['category_id'].'">'.ucfirst( $row['category_name'] ).'</option>'."\n";
28+ $category_option .= '<option value="'.$row['category_id'].'">'.utf8_ucfirst( $row['category_name'] ).'</option>'."\n";
2829 }
2930
3031 $main_smarty->assign('category_option', $category_option );
--- pligg/trunk/pligg/sidebar_stories.php (revision 43)
+++ pligg/trunk/pligg/sidebar_stories.php (revision 44)
@@ -31,7 +31,7 @@
3131
3232 $ss->TitleLengthLimit = 26;
3333
34- if(pagename == "published"){
34+ if(pagename == "index" or pagename == "published"){
3535 $ss->filterToStatus = "queued";
3636 $ss->header = $main_smarty->get_config_vars("PLIGG_Visual_Pligg_Queued");
3737 $ss->link = getmyurl("upcoming");
--- pligg/trunk/pligg/edit.php (revision 43)
+++ pligg/trunk/pligg/edit.php (revision 44)
@@ -67,7 +67,7 @@
6767 $main_smarty->assign('comment_form', print_comment_form(true));
6868 }
6969 if($current_user->user_level == "admin" or $current_user->user_level == "god"){
70- $main_smarty->assign('removed_link', '<a href="#" onclick=(document.getElementById("comment").value="'.$main_smarty->get_config_vars("PLIGG_Visual_EditComment_Removed").'")>'.$main_smarty->get_config_vars("PLIGG_Visual_EditComment_Removed").'</a>');
70+ $main_smarty->assign('removed_link', '<a href="#" onclick="document.getElementById(\'comment\').value=\''.$main_smarty->get_config_vars("PLIGG_Visual_EditComment_Removed").'\';return false;">'.$main_smarty->get_config_vars("PLIGG_Visual_EditComment_Removed").'</a>');
7171 }
7272 }
7373
--- pligg/trunk/pligg/rss.php (revision 43)
+++ pligg/trunk/pligg/rss.php (revision 44)
@@ -82,7 +82,7 @@
8282 $where .= " AND link_status='$status' ";
8383 }
8484 if(($cat=check_integer('category'))) {
85- $where .= " AND link_category IN (SELECT category_ID from ". table_categories ." where category_id=$cat OR category_parent=$cat )";
85+ $where .= " AND link_category IN (" . join(', ', $db->get_col("SELECT category_ID from ". table_categories ." where category_id=$cat OR category_parent=$cat", 0)). ")";
8686 $category_name = $db->get_var("SELECT category_name FROM " . table_categories . " WHERE category_id = $cat AND category_lang='$dblang'");
8787 $title .= " | " . htmlspecialchars($category_name);
8888 }
--- pligg/trunk/pligg/page.php (revision 43)
+++ pligg/trunk/pligg/page.php (revision 44)
@@ -31,6 +31,9 @@
3131 $page_id=$db->get_results($sql);
3232 if($page_id){
3333 foreach($page_id as $page_results){
34+ $navwhere['text1'] = $page_results->link_title;
35+ $main_smarty->assign('navbar_where', $navwhere);
36+
3437 $main_smarty->assign('page_title' , $page_results->link_title);
3538 $main_smarty->assign('posttitle' , $page_results->link_title);
3639 $main_smarty->assign('page_content' , $page_results->link_content);
--- pligg/trunk/pligg/story.php (revision 43)
+++ pligg/trunk/pligg/story.php (revision 44)
@@ -179,7 +179,7 @@
179179 // get all child comments
180180 $comments2 = $db->get_results("SELECT * FROM " . table_comments . " WHERE comment_parent={$dbcomment->comment_id} ORDER BY " . $CommentOrderBy);
181181 if ($comments2) {
182- $output .= '<div style="margin-left:40px">';
182+ //$output .= '<div style="margin-left:40px">';
183183 require_once(mnminclude.'comment.php');
184184 $comment2 = new Comment;
185185 foreach($comments2 as $dbcomment2) {
@@ -188,7 +188,7 @@
188188 $comment2->read();
189189 $output .= $comment2->print_summary($link, true);
190190 }
191- $output .= "</div>\n";
191+ //$output .= "</div>\n";
192192 }
193193
194194 }
Show on old repository browser