Changeset 51 for trunk/wp-content/plugins/xpressme
- Timestamp:
- Dec 27, 2008, 5:31:55 PM (16 years ago)
- Location:
- trunk/wp-content/plugins/xpressme
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/include/custom_functions.php
r49 r51 80 80 return $ret; 81 81 else 82 echo $ret; 82 echo $ret; 83 83 } 84 84 … … 133 133 echo $ret; 134 134 } 135 136 function xpress_is_author_view_count(){ 137 $config = new XPressME_Class(); 138 return $config->is_author_view_count; 139 } 140 135 141 function xpress_substr($str, $start, $length, $trimmarker = '...') 136 142 { … … 208 214 } 209 215 216 // views count 217 // Set and retrieves post views given a post ID or post object. 218 // Retrieves post views given a post ID or post object. 219 function xpress_post_views_count($post_id=0,$format= '',$show = true) { 220 global $table_prefix; 221 222 static $post_cache_views; 223 224 if ( empty($post_id) ) { 225 if ( isset($GLOBALS['post']) ) 226 $post_id = $GLOBALS['post']->ID; 227 } 228 229 $post_id = intval($post_id); 230 if($post_id==0) return null; 231 if(!isset($post_cache_views[$post_id])){ 232 $sql = "SELECT post_views FROM " . $table_prefix . "views" . " WHERE post_id=$post_id"; 233 if (!$result = $GLOBALS["xoopsDB"]->query($sql)) { 234 $post_cache_views[$post_id] = 0; 235 }else{ 236 $row = $GLOBALS["xoopsDB"]->fetchArray($result); 237 $post_cache_views[$post_id] = $row["post_views"]; 238 } 239 } 240 $v_count = intval($post_cache_views[$post_id]); 241 242 if (empty($format)) $format = __('views :%d','xpressme'); 243 244 $ret = sprintf($format,$v_count); 245 246 if ($show) echo $ret; else return $ret; 247 } 248 249 function set_post_views_count(&$content) { 250 if ( empty($_GET["feed"]) && empty($GLOBALS["feed"]) && empty($GLOBALS["doing_trackback"]) && empty($GLOBALS["doing_rss"]) && empty($_POST) && is_single() ){ 251 post_views_counting(); 252 } 253 return $content; 254 } 255 256 // Set post views given a post ID or post object. 257 function post_views_counting($post_id = 0) { 258 global $table_prefix; 259 static $views; 260 261 $post_id = intval($post_id); 262 if ( empty($post_id) && isset($GLOBALS['post']) ){ 263 $post_id = $GLOBALS['post']->ID; 264 } 265 266 267 $views_db = $table_prefix . "views"; 268 269 if($post_id==0 || !empty($views[$post_id])) return null; 270 271 if(!xpress_is_author_view_count()){ 272 $current_user_id = $GLOBALS['current_user']->ID; 273 $post_author_id = $GLOBALS['post']->post_author; 274 if ($current_user_id ==$post_author_id) return null; 275 } 276 277 $sql = "SELECT post_views FROM " . $views_db . " WHERE post_id=$post_id"; 278 $exist = false; 279 if ($result = $GLOBALS["xoopsDB"]->query($sql)) { 280 while($row = $GLOBALS["xoopsDB"]->fetchArray($result)){ 281 $exist = true; 282 break; 283 } 284 } 285 if($exist){ 286 $sql = "UPDATE " . $views_db . " SET post_views=post_views+1 WHERE post_id=$post_id"; 287 }else{ 288 $sql = "INSERT INTO " . $views_db . " (post_id, post_views) VALUES ($post_id, 1)"; 289 } 290 if ($result = $GLOBALS["xoopsDB"]->queryF($sql)) { 291 $views[$post_id] = 1; 292 } 293 294 return true; 295 } 296 297 210 298 ?> -
trunk/wp-content/plugins/xpressme/language/xpressme-ja.po
r32 r51 3 3 "Project-Id-Version: fckeditor for xpress\n" 4 4 "POT-Creation-Date: \n" 5 "PO-Revision-Date: 2008-12- 17 09:50+0900\n"5 "PO-Revision-Date: 2008-12-27 17:37+0900\n" 6 6 "Last-Translator: toemon <toychee@toemon.com>\n" 7 7 "Language-Team: \n" … … 12 12 "X-Poedit-Country: JAPAN\n" 13 13 "X-Poedit-KeywordsList: _e;__\n" 14 "X-Poedit-Basepath: C:\\xampp\\htdocs\\cube\\modules\\xpress2 \\wp-content\\plugins\\xpressme\n"14 "X-Poedit-Basepath: C:\\xampp\\htdocs\\cube\\modules\\xpress2x\\wp-content\\plugins\\xpressme\n" 15 15 "X-Poedit-SearchPath-0: .\n" 16 16 17 #: xpressme_class.php:2 517 #: xpressme_class.php:26 18 18 msgid "XPressME Settings" 19 19 msgstr "XPressME設定" 20 20 21 #: xpressme_class.php:4 222 #: xpressme_class.php:8 121 #: xpressme_class.php:43 22 #: xpressme_class.php:89 23 23 msgid "to Old Post" 24 24 msgstr "前の投稿へ" 25 25 26 #: xpressme_class.php:4 327 #: xpressme_class.php: 8326 #: xpressme_class.php:44 27 #: xpressme_class.php:91 28 28 msgid "to Newer Post" 29 29 msgstr "次の投稿へ" 30 30 31 #: xpressme_class.php:88 32 #: xpressme_class.php:148 33 #: xpressme_class.php:153 31 #: xpressme_class.php:97 32 #: xpressme_class.php:157 33 #: xpressme_class.php:162 34 #: xpressme_class.php:183 34 35 msgid "YES" 35 36 msgstr "はい" 36 37 37 #: xpressme_class.php:89 38 #: xpressme_class.php:149 39 #: xpressme_class.php:154 38 #: xpressme_class.php:98 39 #: xpressme_class.php:158 40 #: xpressme_class.php:163 41 #: xpressme_class.php:184 40 42 msgid "NO" 41 43 msgstr "いいえ" 42 44 43 #: xpressme_class.php:1 3845 #: xpressme_class.php:147 44 46 msgid "XPressME Configuration Page" 45 47 msgstr "XPressMEの設定ページ" 46 48 47 #: xpressme_class.php:1 4249 #: xpressme_class.php:151 48 50 msgid "Media Upload Base Path" 49 51 msgstr "メディアアップロードのベースパス設定" 50 52 51 #: xpressme_class.php:1 4353 #: xpressme_class.php:152 52 54 msgid "Use XOOPS UPLOAD PATH" 53 55 msgstr "XOOPSのアップロードパスを使用する。" 54 56 55 #: xpressme_class.php:1 4457 #: xpressme_class.php:153 56 58 msgid "USE WordPress BASE_PATH" 57 59 msgstr "WordPressのベースパスを使用する。" 58 60 59 #: xpressme_class.php:1 4761 #: xpressme_class.php:156 60 62 msgid "Thema Sidebar Display" 61 63 msgstr "テーマ表示時にサイドバー表示する。" 62 64 63 #: xpressme_class.php:1 5265 #: xpressme_class.php:161 64 66 msgid "The change tracking of the post is preserved" 65 67 msgstr "投稿の変更履歴を有効にする。" 66 68 67 #: xpressme_class.php:1 5769 #: xpressme_class.php:166 68 70 msgid "Select Display name of PostNavi Link" 69 71 msgstr "投稿記事リンクナビのタイトル設定" 70 72 71 #: xpressme_class.php:1 5873 #: xpressme_class.php:167 72 74 msgid "Title of post" 73 75 msgstr "投稿記事のタイトルを表示" 74 76 75 #: xpressme_class.php:1 5977 #: xpressme_class.php:168 76 78 msgid "Next and Previous" 77 79 msgstr "[次の投稿へ]、[前の投稿]へを表示" 78 80 79 #: xpressme_class.php:1 6281 #: xpressme_class.php:171 80 82 msgid "Adjustment of Navi link display position" 81 83 msgstr "投稿記事ナビリンクの表示位置設定" 82 84 83 #: xpressme_class.php:1 6385 #: xpressme_class.php:172 84 86 msgid "'Old Post Link' is displayed in the left, and 'Newer Post Link' is displayed in the right" 85 87 msgstr "古い記事へのリンクを左に、より新しい記事へのリンクを右に表示" 86 88 87 #: xpressme_class.php:1 6489 #: xpressme_class.php:173 88 90 msgid "'Newer Post Link' is displayed in the left, and 'Old Post Link' is displayed in the right" 89 91 msgstr "より新しい記事へのリンクを左に、古い記事へのリンクを右に表示" 90 92 91 #: xpressme_class.php:1 6793 #: xpressme_class.php:176 92 94 msgid "Display Title of Old Post Link" 93 95 msgstr "古い記事へのリンクタイトルを設定" 94 96 95 #: xpressme_class.php:17 097 #: xpressme_class.php:179 96 98 msgid "Display Title of Newer Post Link" 97 99 msgstr "より新しい記事へのリンクタイトルを設定" 98 100 99 #: xpressme_class.php:178 101 #: xpressme_class.php:182 102 msgid "Is the posts author views counted?" 103 msgstr "投稿者自身の閲覧をカウントしますか?" 104 105 #: xpressme_class.php:190 100 106 msgid "Update Config" 101 107 msgstr "更新" 102 108 103 #: xpressme_class.php:1 79109 #: xpressme_class.php:191 104 110 msgid "Preset Config" 105 111 msgstr "プリセット" 106 112 113 #: include/custom_functions.php:242 114 #, php-format 115 msgid "views :%d" 116 msgstr "閲覧数 :%d" 117 -
trunk/wp-content/plugins/xpressme/xpressme.php
r46 r51 35 35 add_action("wp_set_comment_status" , "block_cache_refresh"); 36 36 37 add_action("the_content", "set_post_views_count"); 38 39 37 40 //require_once('../include/custom_functions.php'); 38 41 ?> -
trunk/wp-content/plugins/xpressme/xpressme_class.php
r32 r51 12 12 var $old_post_link_text; 13 13 var $newer_post_link_text; 14 var $is_author_view_count; 14 15 15 16 //constructor … … 42 43 $this->old_post_link_text = __('to Old Post'); 43 44 $this->newer_post_link_text = __('to Newer Post'); 45 $this->is_author_view_count = false; 44 46 } 45 47 … … 67 69 'is_left_postnavi_old' => $this->is_left_postnavi_old , 68 70 'old_post_link_text' => $this->old_post_link_text , 69 'newer_post_link_text' => $this->newer_post_link_text 71 'newer_post_link_text' => $this->newer_post_link_text, 72 'is_author_view_count' => $this->is_author_view_count 70 73 ); 71 74 if ($mode == 'add_new') { … … 87 90 $this->newer_post_link_text = stripslashes($_POST['ch_newer_post_link_text']); 88 91 if(empty($this->newer_post_link_text)) $this->newer_post_link_text = __('to Newer Post'); 92 $this->is_author_view_count = stripslashes(trim($_POST['ch_is_author_view_count'])); 89 93 90 94 } … … 174 178 echo $this->text_option('newer_post_link_text', 175 179 __('Display Title of Newer Post Link','xpressme') 176 ); 177 178 180 ); 181 echo $this->yes_no_radio_option('is_author_view_count', 182 __('Is the posts author views counted?','xpressme'), 183 __('YES','xpressme'), 184 __('NO','xpressme') 185 ); 179 186 // $this->is_use_xoops_upload_path_html(); 180 187 echo "</table>\n";
Note: See TracChangeset
for help on using the changeset viewer.