• R/O
  • SSH
  • HTTPS

researchclip: Commit


Commit MetaInfo

Revision32 (tree)
Time2009-03-29 01:20:22
Authorwalgbart

Log Message

libs/html1.php:
sqlの演算子の優先順位が間違っていたバグを修正

libs/db.php:
MySQLのencoding設定をバージョンで振り分け

admin/backup:
MySQLのバックアップファイルをignore設定

templates/wistie/header.tpl:
リサーチクリップとは,見方へのリンクを追加

templates/wistie/footer.tpl:
generalナビを追加
Google Analyticsのkey変更

templates/wistie/css/style.css:
generalナビのスタイル設定をnavと同じに

page.php:
posttitleを表示するように
ページがみつからない場合に404

templates/wistie/story_center.tpl:
被リンク表示処理を別jsへ分離

templates/wistie/js/linkback.js:
被リンク一覧表示

templates/wistie/pligg.tpl:
langをjaに

languages/lang_english.conf:
aboutの文言変更

templates/wistie/link_summary.tpl:
サムネイルの表示ズレを解消

Change Summary

Incremental Difference

--- pligg/trunk/pligg/libs/html1.php (revision 31)
+++ pligg/trunk/pligg/libs/html1.php (revision 32)
@@ -60,8 +60,8 @@
6060 $related_tags="'".str_replace(", ","', '",addslashes($related_tags))."'"; // This gives us the proper string structure for IN SQL statement
6161
6262 // Select 10 stories that share tags with the current story and order them by number of tags they share
63- $sql = "SELECT ".table_links.".link_id, ".table_links.".link_category, ".table_links.".link_title, ".table_links.".link_title_url, COUNT( ".table_tags.".tag_link_id ) AS relevance, ".table_tags.".tag_link_id FROM ".table_tags.", ".table_links." WHERE ".table_tags.".tag_words IN ( ".$related_tags." ) AND ".table_tags.".tag_link_id = ".table_links.".link_id AND ".table_links.".link_status != 'discard' AND NOT ".table_links.".link_id = ".$storyid;
64- $sql.= " GROUP BY ".table_tags.".tag_link_id, ".table_links.".link_title, ".table_links.".link_title_url ORDER BY relevance DESC LIMIT 10";
63+ $sql = "SELECT ".table_links.".link_id, ".table_links.".link_category, ".table_links.".link_title, ".table_links.".link_title_url, COUNT( ".table_tags.".tag_link_id ) AS relevance, ".table_tags.".tag_link_id FROM ".table_tags.", ".table_links." WHERE ".table_tags.".tag_words IN ( ".$related_tags." ) AND ".table_tags.".tag_link_id = ".table_links.".link_id AND ".table_links.".link_status != 'discard' AND NOT (".table_links.".link_id = ".$storyid;
64+ $sql.= ") GROUP BY ".table_tags.".tag_link_id, ".table_links.".link_title, ".table_links.".link_title_url ORDER BY relevance DESC LIMIT 10";
6565
6666 $related_story = $db->get_results($sql);
6767 $related_story = object_2_array($related_story);
--- pligg/trunk/pligg/libs/db.php (revision 31)
+++ pligg/trunk/pligg/libs/db.php (revision 32)
@@ -295,9 +295,18 @@
295295 }
296296
297297 $db = new ezSQL_mysql(EZSQL_DB_USER, EZSQL_DB_PASSWORD, EZSQL_DB_NAME, EZSQL_DB_HOST);
298- $db->query("SET NAMES 'UTF8'");
299- $db->query("SET CHARACTER SET 'UTF8'");
300- $db->query("SET COLLATION_CONNECTION='utf8_general_ci'");
298+$mysql_version = '';
299+foreach (explode('.', preg_replace('/[^\d\.]/', '', $db->get_var("SHOW VARIABLES LIKE 'version'", 1))) as $n) {
300+ $mysql_version .= sprintf('%02d', $n);
301+};
302+if (function_exists('mysql_set_charset')) {
303+ mysql_set_charset('utf8');
304+} elseif (intval($mysql_version) >= 40100) {
305+ $db->query("SET character_set_results = 'utf8', character_set_client = 'utf8', character_set_connection = 'utf8', character_set_database = 'utf8', character_set_server = 'utf8'");
306+}
307+//$db->query("SET NAMES 'UTF8'");
308+//$db->query("SET CHARACTER SET 'UTF8'");
309+//$db->query("SET COLLATION_CONNECTION='utf8_general_ci'");
301310 /*
302311 $db->show_errors = false;
303312 $db->quick_connect(EZSQL_DB_USER, EZSQL_DB_PASSWORD, EZSQL_DB_NAME, EZSQL_DB_HOST);
--- pligg/trunk/pligg/templates/wistie/js/linkback.js (nonexistent)
+++ pligg/trunk/pligg/templates/wistie/js/linkback.js (revision 32)
@@ -0,0 +1,91 @@
1+(function(){
2+ /**
3+ * とてもシンプルに自分自身が属する script 要素を取得
4+ * http://d.hatena.ne.jp/amachang/20061201/1164986067
5+ */
6+ function currentScript(e) {
7+ if(e.nodeName.toLowerCase() == 'script') {
8+ return e;
9+ }
10+ return arguments.callee(e.lastChild);
11+ }
12+ var path = currentScript(document).src.split('?');
13+ path.shift();
14+ if (path.length > 0) {
15+ var url = path.join('?');
16+ google.load("feeds", "1");
17+
18+ /**
19+ * linkbacks_by_google_ajax_feed_api
20+ * http://creazy.net/2009/02/stop_tb_and_start_linkbacks_by_google_ajax_feed_api.html
21+ */
22+ function initialize() {
23+ var num = 100;
24+ var feed = new google.feeds.Feed([
25+ "http://www.google.co.jp/blogsearch_feeds?scoring=d&q=link%3A",
26+ encodeURIComponent(url),
27+ "&output=rss&num=",
28+ num,
29+ "&ie=utf-8"].join(''));
30+ feed.setNumEntries(num);
31+
32+ feed.load(function(result) {
33+ if (!result.error) {
34+ if (result.feed.entries.length > 0) {
35+ var entry = [];
36+ var html = ['<h2>このデータのURLがあるブログ一覧</h2>',
37+ '<ul id="linkback_list">'];
38+ for (var i = 0; i < result.feed.entries.length; i++) {
39+ var entry = result.feed.entries[i];
40+ html.push('<li class="linkback_entries">');
41+ html.push('<a class="linkback_links" href="');
42+ html.push(entry.link);
43+ html.push('" rel>');
44+ html.push(entry.title);
45+ html.push('</a>');
46+ html.push('<span class="linkback_blogs">(');
47+ html.push(entry.author);
48+ html.push(')</sapn>');
49+ html.push('<span class="linkback_dates">');
50+ html.push(prettyDate(entry.publishedDate));
51+ html.push('</sapn>');
52+ html.push('</li>');
53+ }
54+ html.push('</ul>');
55+ document.getElementById("linkbacks").innerHTML = html.join('');
56+ } else {
57+ document.getElementById("linkbacks").innerHTML = '';
58+ }
59+ }
60+ });
61+ }
62+
63+ /*
64+ * JavaScript Pretty Date
65+ * Copyright (c) 2008 John Resig (jquery.com)
66+ * Licensed under the MIT license.
67+ * http://ejohn.org/projects/javascript-pretty-date/
68+ */
69+
70+ function prettyDate(publishedDate){
71+ var date = new Date(publishedDate),
72+ diff = (((new Date()).getTime() - date.getTime()) / 1000),
73+ day_diff = Math.floor(diff / 86400);
74+
75+ if ( isNaN(day_diff) || day_diff < 0 || day_diff >= 31 )
76+ return;
77+
78+ return day_diff == 0 && (
79+ diff < 60 && "just now" ||
80+ diff < 120 && "1 minute ago" ||
81+ diff < 3600 && Math.floor( diff / 60 ) + " minutes ago" ||
82+ diff < 7200 && "1 hour ago" ||
83+ diff < 86400 && Math.floor( diff / 3600 ) + " hours ago") ||
84+ day_diff == 1 && "Yesterday" ||
85+ day_diff < 7 && day_diff + " days ago" ||
86+ day_diff < 31 && Math.ceil( day_diff / 7 ) + " weeks ago";
87+ }
88+
89+ google.setOnLoadCallback(initialize);
90+ }
91+})();
\ No newline at end of file
--- pligg/trunk/pligg/templates/wistie/css/style.css (revision 31)
+++ pligg/trunk/pligg/templates/wistie/css/style.css (revision 32)
@@ -94,27 +94,35 @@
9494 #reg_usernamecheckitvalue {background:#FFFFD3;}
9595 #reg_emailcheckitvalue {background:#FFFFD3;}
9696
97-#nav {
97+#nav,
98+#general {
9899 border-top: 1px solid #dedede;
99100 border-bottom: 1px solid #dedede;
100101 padding: 10px 0px;
101102 margin: 0px;
102103 }
103-#nav li {
104+#general {
105+margin-top:20px;
106+}
107+#nav li,
108+#general li {
104109 list-style: none;
105110 display: inline;
106111 padding: 10px 0px;
107112 }
108-#nav li a {
113+#nav li a,
114+#general li a {
109115 color: #707070;
110116 text-transform: uppercase;
111117 text-decoration: none;
112118 padding: 0px 10px;
113119 }
114-#nav li a:hover{
120+#nav li a:hover,
121+#general li a:hover{
115122 color: #000;
116123 }
117-#nav .current {
124+#nav .current,
125+#general .current {
118126 list-style: none;
119127 display: inline;
120128 background:#EDEDED;
@@ -384,7 +392,7 @@
384392 background-color: #ededed;
385393 border-top: 1px solid #dedede;
386394 border-bottom: 1px solid #dedede;
387-margin: 20px 0px;
395+margin: 0 0px 20px;
388396 }
389397 .footer a:hover {
390398 color:#000;
--- pligg/trunk/pligg/page.php (revision 31)
+++ pligg/trunk/pligg/page.php (revision 32)
@@ -32,8 +32,13 @@
3232 if($page_id){
3333 foreach($page_id as $page_results){
3434 $main_smarty->assign('page_title' , $page_results->link_title);
35+ $main_smarty->assign('posttitle' , $page_results->link_title);
3536 $main_smarty->assign('page_content' , $page_results->link_content);
3637 }
38+ } else {
39+ $main_smarty->assign('tpl_center', '404error');
40+ $main_smarty->display($the_template . '/pligg.tpl');
41+ die();
3742 }
3843 }
3944
Show on old repository browser