hypweb.net
XOOPSマニア  最新情報のRSS(サイト全体)
[ 自宅サーバーWebRing |ID=54 前後5表示乱移動サイト一覧 ]

18年12月11日(Tue) 6時11分
TOP » UsersWiki » nao-pon » blog » 2004-10-25

フォーラムを静的URLに anchor.png

Tag: プログラミング
PukiWikiModで静的URL*1のSEO効果*2はひしひしと感じているので、フォーラム(newbb)にも静的URLを取り入れてみた。
Page Top

まず mod_rewrite で anchor.png

newbb のディレクトリに以下の内容の .htaccess を置く

1
2
RewriteEngine on
RewriteRule ^(viewforum|viewtopic|index)/(.*)$ /xoops/modules/newbb/$1.php?$2
Page Top

PATH_INFO を使い anchor.png

各 .php で、PATH_INFO を使いパラメータを得る。

1
2
3
4
5
6
7
8
9
if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match))
{
	$val = explode("/",$match[1]);
	for($i=1;$i<=count($val);$i=$i+2)
	{
		if (!empty($val[$i-1]) && !empty($val[$i]))
			$HTTP_GET_VARS[$val[$i-1]]=$_GET[$val[$i-1]] = $val[$i];
	}
}
Page Top

適宜リンクを書き換え anchor.png

あとは、いろんなところで指定されているリンクを適宜書き換えてやればOK

とりあえず、XOOPS 2.0.7 の newbb と、このサイトの newbb の DIFF です。

部分的にこの件とは関係ない改造も含まれていますが、適当に読んでください。 :p

また、この他にテンプレートも相対URLの部分を絶対URLに書き換える必要があります。

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
diff -crN xoops207/modules/newbb/.htaccess xoops/modules/newbb/.htaccess
*** xoops207/modules/newbb/.htaccess	Thu Jan 01 09:00:00 1970
--- xoops/modules/newbb/.htaccess	Mon Oct 25 09:14:06 2004
***************
*** 0 ****
--- 1,4 ----
+ RewriteEngine on
+ #RewriteRule ^(.+)\.php/(([^/]+)/([^/]+))?(/([^/]+)/([^/]+))?(/([^/]+)/([^/]+))?(/([^/]+)/([^/]+))?/([^/]*)$ /xoops/modules/newbb/$1.php?$3=$4&$6=$7&$9=$10&$12=$13$14
+ RewriteRule ^(viewforum&#x7c;viewtopic&#x7c;index)/(.*)$ /xoops/modules/newbb/$1.php?$2
+ 
diff -crN xoops207/modules/newbb/functions.php xoops/modules/newbb/functions.php
*** xoops207/modules/newbb/functions.php	Sun Aug 22 12:54:26 2004
--- xoops/modules/newbb/functions.php	Wed Oct 20 15:19:36 2004
***************
*** 198,204 ****
  {
  	global $xoopsDB;
  	$myts = MyTextSanitizer::getInstance();
! 	$box = '<form action="viewforum.php" method="get">
  	<select name="forum">
  	';
  	$sql = 'SELECT cat_id, cat_title FROM '.$xoopsDB->prefix('bb_categories').' ORDER BY cat_order';
--- 198,204 ----
  {
  	global $xoopsDB;
  	$myts = MyTextSanitizer::getInstance();
! 	$box = '<form action="'.XOOPS_URL.'/modules/newbb/viewforum.php" method="get">
  	<select name="forum">
  	';
  	$sql = 'SELECT cat_id, cat_title FROM '.$xoopsDB->prefix('bb_categories').' ORDER BY cat_order';
diff -crN xoops207/modules/newbb/index.php xoops/modules/newbb/index.php
*** xoops207/modules/newbb/index.php	Sun Aug 22 12:54:26 2004
--- xoops/modules/newbb/index.php	Wed Oct 27 22:53:20 2004
***************
*** 29,34 ****
--- 29,44 ----
  // Project: The XOOPS Project                                                //
  // ------------------------------------------------------------------------- //
  
+ if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match))
+ {
+ 	$val = explode("/",$match[1]);
+ 	for($i=1;$i<=count($val);$i=$i+2)
+ 	{
+ 		if (!empty($val[$i-1]) && !empty($val[$i]))
+ 			$HTTP_GET_VARS[$val[$i-1]]=$_GET[$val[$i-1]] = $val[$i];
+ 	}
+ }
+ 
  include "header.php";
  // this page uses smarty template
  // this must be set before including main header.php
diff -crN xoops207/modules/newbb/viewforum.php xoops/modules/newbb/viewforum.php
*** xoops207/modules/newbb/viewforum.php	Sun Aug 22 12:54:26 2004
--- xoops/modules/newbb/viewforum.php	Wed Oct 27 22:51:03 2004
***************
*** 29,48 ****
  // Project: The XOOPS Project                                                //
  // ------------------------------------------------------------------------- //
  
  include "header.php";
  
  $forum = intval($HTTP_GET_VARS['forum']);
  if ( $forum < 1 ) {
! 	redirect_header("index.php", 2, _MD_ERRORFORUM);
  	exit();
  }
  $sql = 'SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM '.$xoopsDB->prefix('bb_forums').' WHERE forum_id = '.$forum;
  if ( !$result = $xoopsDB->query($sql) ) {
! 	redirect_header("index.php", 2, _MD_ERRORCONNECT);
  	exit();
  }
  if ( !$forumdata = $xoopsDB->fetchArray($result) ) {
! 	redirect_header("index.php", 2, _MD_ERROREXIST);
  	exit();
  }
  // this page uses smarty template
--- 29,61 ----
  // Project: The XOOPS Project                                                //
  // ------------------------------------------------------------------------- //
  
+ if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match))
+ {
+ 	$val = explode("/",$match[1]);
+ 	for($i=1;$i<=count($val);$i=$i+2)
+ 	{
+ 		if (!empty($val[$i-1]) && !empty($val[$i]))
+ 			$HTTP_GET_VARS[$val[$i-1]]=$_GET[$val[$i-1]] = $val[$i];
+ 	}
+ }
+ 
  include "header.php";
  
  $forum = intval($HTTP_GET_VARS['forum']);
  if ( $forum < 1 ) {
! 	//redirect_header("index.php", 2, _MD_ERRORFORUM);
! 	redirect_header($bbUrl['root'], 2, _MD_ERRORFORUM);
  	exit();
  }
  $sql = 'SELECT forum_type, forum_name, forum_access, allow_html, allow_sig, posts_per_page, hot_threshold, topics_per_page FROM '.$xoopsDB->prefix('bb_forums').' WHERE forum_id = '.$forum;
  if ( !$result = $xoopsDB->query($sql) ) {
! 	//redirect_header("index.php", 2, _MD_ERRORCONNECT);
! 	redirect_header($bbUrl['root'], 2, _MD_ERRORCONNECT);
  	exit();
  }
  if ( !$forumdata = $xoopsDB->fetchArray($result) ) {
! 	//redirect_header("index.php", 2, _MD_ERROREXIST);
! 	redirect_header($bbUrl['root'], 2, _MD_ERROREXIST);
  	exit();
  }
  // this page uses smarty template
***************
*** 65,71 ****
  		$accesserror = 1;
  	}
  	if ( $accesserror == 1 ) {
! 		redirect_header("index.php",2,_MD_NORIGHTTOACCESS);
  		exit();
  	}
  	$can_post = 1;
--- 78,85 ----
  		$accesserror = 1;
  	}
  	if ( $accesserror == 1 ) {
! 		//redirect_header("index.php",2,_MD_NORIGHTTOACCESS);
! 		redirect_header($bbUrl['root'],2,_MD_NORIGHTTOACCESS);
  		exit();
  	}
  	$can_post = 1;
***************
*** 108,114 ****
  $xoopsTpl->assign('forum_index_title', sprintf(_MD_FORUMINDEX,$xoopsConfig['sitename']));
  $xoopsTpl->assign('forum_image_folder', $bbImage['folder_topic']);
  $myts =& MyTextSanitizer::getInstance();
! $xoopsTpl->assign('forum_name', $myts->makeTboxData4Show($forumdata['forum_name']));
  $xoopsTpl->assign('lang_moderatedby', _MD_MODERATEDBY);
  
  $forum_moderators = "";
--- 122,132 ----
  $xoopsTpl->assign('forum_index_title', sprintf(_MD_FORUMINDEX,$xoopsConfig['sitename']));
  $xoopsTpl->assign('forum_image_folder', $bbImage['folder_topic']);
  $myts =& MyTextSanitizer::getInstance();
! //nao-pon
! $forumdata['forum_name'] = $myts->makeTboxData4Show($forumdata['forum_name']);
! $xoopsTpl->assign("xoops_pagetitle",$forumdata['forum_name']."-"._MD_FORUM);
! $xoopsTpl->assign('forum_name', $forumdata['forum_name']);
! //$xoopsTpl->assign('forum_name', $myts->makeTboxData4Show($forumdata['forum_name']));
  $xoopsTpl->assign('lang_moderatedby', _MD_MODERATEDBY);
  
  $forum_moderators = "";
***************
*** 153,159 ****
  // assign to template
  $xoopsTpl->assign('forum_selection_order', $forum_selection_order);
  
! $sortsince = !empty($HTTP_GET_VARS['sortsince']) ? intval($HTTP_GET_VARS['sortsince']) : 100;
  $sel_since_array = array(1, 2, 5, 10, 20, 30, 40, 60, 75, 100);
  $forum_selection_since = '<select name="sortsince">';
  foreach ($sel_since_array as $sort_since_v) {
--- 171,179 ----
  // assign to template
  $xoopsTpl->assign('forum_selection_order', $forum_selection_order);
  
! //nao-pon
! $sortsince = !empty($HTTP_GET_VARS['sortsince']) ? intval($HTTP_GET_VARS['sortsince']) : 1000;
! //$sortsince = !empty($HTTP_GET_VARS['sortsince']) ? intval($HTTP_GET_VARS['sortsince']) : 100;
  $sel_since_array = array(1, 2, 5, 10, 20, 30, 40, 60, 75, 100);
  $forum_selection_since = '<select name="sortsince">';
  foreach ($sel_since_array as $sort_since_v) {
***************
*** 182,193 ****
  $xoopsTpl->assign('h_date_link', "viewforum.php?forum=$forum&amp;sortname=p.post_time&amp;sortsince=$sortsince&amp;sortorder=". (($sortname == "p.post_time" && $sortorder == "DESC") ? "ASC" : "DESC"));
  $xoopsTpl->assign('lang_date', _MD_DATE);
  
! $startdate = time() - (86400* $sortsince);
  $start = !empty($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0;
  
  $sql = 'SELECT t.*, u.uname, u2.uname as last_poster, p.post_time as last_post_time, p.icon FROM '.$xoopsDB->prefix("bb_topics").' t LEFT JOIN '.$xoopsDB->prefix('users').' u ON u.uid = t.topic_poster LEFT JOIN '.$xoopsDB->prefix('bb_posts').' p ON p.post_id = t.topic_last_post_id LEFT JOIN '.$xoopsDB->prefix('users').' u2 ON  u2.uid = p.uid WHERE t.forum_id = '.$forum.' AND (p.post_time > '.$startdate.' OR t.topic_sticky=1) ORDER BY topic_sticky DESC, '.$sortname.' '.$sortorder;
  if ( !$result = $xoopsDB->query($sql,$forumdata['topics_per_page'],$start) ) {
! 	redirect_header('index.php',2,_MD_ERROROCCURED);
  	exit();
  }
  
--- 202,216 ----
  $xoopsTpl->assign('h_date_link', "viewforum.php?forum=$forum&amp;sortname=p.post_time&amp;sortsince=$sortsince&amp;sortorder=". (($sortname == "p.post_time" && $sortorder == "DESC") ? "ASC" : "DESC"));
  $xoopsTpl->assign('lang_date', _MD_DATE);
  
! //nao-pon
! $startdate = ($sortsince == 1000)? 0 : time() - (86400* $sortsince);
! //$startdate = time() - (86400* $sortsince);
  $start = !empty($HTTP_GET_VARS['start']) ? intval($HTTP_GET_VARS['start']) : 0;
  
  $sql = 'SELECT t.*, u.uname, u2.uname as last_poster, p.post_time as last_post_time, p.icon FROM '.$xoopsDB->prefix("bb_topics").' t LEFT JOIN '.$xoopsDB->prefix('users').' u ON u.uid = t.topic_poster LEFT JOIN '.$xoopsDB->prefix('bb_posts').' p ON p.post_id = t.topic_last_post_id LEFT JOIN '.$xoopsDB->prefix('users').' u2 ON  u2.uid = p.uid WHERE t.forum_id = '.$forum.' AND (p.post_time > '.$startdate.' OR t.topic_sticky=1) ORDER BY topic_sticky DESC, '.$sortname.' '.$sortorder;
  if ( !$result = $xoopsDB->query($sql,$forumdata['topics_per_page'],$start) ) {
! 	//redirect_header('index.php',2,_MD_ERROROCCURED);
! 	redirect_header($bbUrl['root'],2,_MD_ERROROCCURED);
  	exit();
  }
  
***************
*** 219,225 ****
  	}
  	$pagination = '';
  	$addlink = '';
! 	$topiclink = 'viewtopic.php?topic_id='.$myrow['topic_id'].'&amp;forum='.$forum;
  	$totalpages = ceil(($myrow['topic_replies'] + 1) / $forumdata['posts_per_page']);
  	if ( $totalpages > 1 ) {
  		$pagination .= '&nbsp;&nbsp;&nbsp;<img src="'.XOOPS_URL.'/images/icons/posticon.gif" /> ';
--- 242,249 ----
  	}
  	$pagination = '';
  	$addlink = '';
! 	//$topiclink = 'viewtopic.php?topic_id='.$myrow['topic_id'].'&amp;forum='.$forum;
! 	$topiclink = 'viewtopic/topic_id/'.$myrow['topic_id'].'/forum/'.$forum.'/';
  	$totalpages = ceil(($myrow['topic_replies'] + 1) / $forumdata['posts_per_page']);
  	if ( $totalpages > 1 ) {
  		$pagination .= '&nbsp;&nbsp;&nbsp;<img src="'.XOOPS_URL.'/images/icons/posticon.gif" /> ';
***************
*** 228,235 ****
  			if ( $i > 3 && $i < $totalpages ) {
  				$pagination .= "...";
  			} else {
! 				$addlink = '&start='.(($i - 1) * $forumdata['posts_per_page']);
! 				$pagination .= '[<a href="'.$topiclink.$addlink.'">'.$i.'</a>]';
  			}
  		}
  	}
--- 252,260 ----
  			if ( $i > 3 && $i < $totalpages ) {
  				$pagination .= "...";
  			} else {
! 				//$addlink = '&start='.(($i - 1) * $forumdata['posts_per_page']);
! 				$addlink = 'start/'.(($i - 1) * $forumdata['posts_per_page']).'/';
! 				$pagination .= '[<a href="'.$bbUrl['root'].$topiclink.$addlink.'">'.$i.'</a>]';
  			}
  		}
  	}
diff -crN xoops207/modules/newbb/viewtopic.php xoops/modules/newbb/viewtopic.php
*** xoops207/modules/newbb/viewtopic.php	Sun Aug 22 12:54:26 2004
--- xoops/modules/newbb/viewtopic.php	Wed Oct 27 22:53:08 2004
***************
*** 29,42 ****
  // Project: The XOOPS Project                                                //
  // ------------------------------------------------------------------------- //
  
  include 'header.php';
  $forum = isset($HTTP_GET_VARS['forum']) ? intval($HTTP_GET_VARS['forum']) : 0;
  $topic_id = isset($HTTP_GET_VARS['topic_id']) ? intval($HTTP_GET_VARS['topic_id']) : 0;
  if ( empty($forum) ) {
! 	redirect_header('index.php',2,_MD_ERRORFORUM);
  	exit();
  } elseif ( empty($topic_id) ) {
! 	redirect_header('viewforum.php?forum='.$forum,2,_MD_ERRORTOPIC);
  	exit();
  }
  $topic_time = (isset($HTTP_GET_VARS['topic_time'])) ? intval($HTTP_GET_VARS['topic_time']) : 0;
--- 29,52 ----
  // Project: The XOOPS Project                                                //
  // ------------------------------------------------------------------------- //
  
+ if(!empty($_SERVER["PATH_INFO"]) && preg_match("/^\/(.*)\/$/",$_SERVER["PATH_INFO"],$match))
+ {
+ 	$val = explode("/",$match[1]);
+ 	for($i=1;$i<=count($val);$i=$i+2)
+ 	{
+ 		if (!empty($val[$i-1]) && !empty($val[$i]))
+ 			$HTTP_GET_VARS[$val[$i-1]]=$_GET[$val[$i-1]] = $val[$i];
+ 	}
+ }
+ 
  include 'header.php';
  $forum = isset($HTTP_GET_VARS['forum']) ? intval($HTTP_GET_VARS['forum']) : 0;
  $topic_id = isset($HTTP_GET_VARS['topic_id']) ? intval($HTTP_GET_VARS['topic_id']) : 0;
  if ( empty($forum) ) {
! 	redirect_header($bbUrl['root'],2,_MD_ERRORFORUM);
  	exit();
  } elseif ( empty($topic_id) ) {
! 	redirect_header($bbUrl['root'].'viewforum/forum/'.$forum,2,_MD_ERRORTOPIC);
  	exit();
  }
  $topic_time = (isset($HTTP_GET_VARS['topic_time'])) ? intval($HTTP_GET_VARS['topic_time']) : 0;
***************
*** 82,93 ****
  }
  
  if ( !$result = $xoopsDB->query($sql) ) {
! 	redirect_header('viewforum.php?forum='.$forum,2,_MD_ERROROCCURED);
  	exit();
  }
  
  if ( !$forumdata = $xoopsDB->fetchArray($result) ) {
! 	redirect_header('viewforum.php?forum='.$forum,2,_MD_FORUMNOEXIST);
  	exit();
  }
  $xoopsTpl->assign('topic_id', $forumdata['topic_id']);
--- 92,103 ----
  }
  
  if ( !$result = $xoopsDB->query($sql) ) {
! 	redirect_header($bbUrl['root'].'viewforum/forum/'.$forum,2,_MD_ERROROCCURED);
  	exit();
  }
  
  if ( !$forumdata = $xoopsDB->fetchArray($result) ) {
! 	redirect_header($bbUrl['root'].'viewforum/forum/'.$forum.'/',2,_MD_FORUMNOEXIST);
  	exit();
  }
  $xoopsTpl->assign('topic_id', $forumdata['topic_id']);
***************
*** 111,117 ****
  		$accesserror = 1;
  	}
  	if ( $accesserror == 1 ) {
! 		redirect_header("index.php",2,_MD_NORIGHTTOACCESS);
  		exit();
  	}
  	$can_post = 1;
--- 121,127 ----
  		$accesserror = 1;
  	}
  	if ( $accesserror == 1 ) {
! 		redirect_header($bbUrl['root'],2,_MD_NORIGHTTOACCESS);
  		exit();
  	}
  	$can_post = 1;
***************
*** 140,146 ****
  }
  $myts =& MyTextSanitizer::getInstance();
  $forumdata['topic_title'] = $myts->makeTboxData4Show($forumdata['topic_title']);$forumdata['forum_name'] = $myts->makeTboxData4Show($forumdata['forum_name']);
! $xoopsTpl->assign(array('topic_title' => '<a href="'.$bbUrl['root'].'viewtopic.php?viewmode='.$viewmode.'&amp;topic_id='.$topic_id.'&amp;forum='.$forum.'">'.$forumdata['topic_title'].'</a>', 'forum_name' => $forumdata['forum_name'], 'topic_time' => $forumdata['topic_time'], 'lang_nexttopic' => _MD_NEXTTOPIC, 'lang_prevtopic' => _MD_PREVTOPIC));
  
  // add image links to admin page if the user viewing this page is a forum admin
  if ( $xoopsUser ) {
--- 150,159 ----
  }
  $myts =& MyTextSanitizer::getInstance();
  $forumdata['topic_title'] = $myts->makeTboxData4Show($forumdata['topic_title']);$forumdata['forum_name'] = $myts->makeTboxData4Show($forumdata['forum_name']);
! $xoopsTpl->assign(array('topic_title' => '<a href="'.$bbUrl['root'].'viewtopic/topic_id/'.$topic_id.'/forum/'.$forum.'/viewmode/'.$viewmode.'/">'.$forumdata['topic_title'].'</a>', 'forum_name' => $forumdata['forum_name'], 'topic_time' => $forumdata['topic_time'], 'lang_nexttopic' => _MD_NEXTTOPIC, 'lang_prevtopic' => _MD_PREVTOPIC));
! 
! //nao-pon
! $xoopsTpl->assign("xoops_pagetitle",$forumdata['topic_title']."-".$forumdata['forum_name']."-"._MD_FORUM);
  
  // add image links to admin page if the user viewing this page is a forum admin
  if ( $xoopsUser ) {
***************
*** 205,211 ****
  			$post_image =  '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />';
  		}
  		if ($current != $key) {
! 			$subject = '<a href="viewtopic.php?viewmode=thread&amp;topic_id='.$arr[$key]['obj']->topic().'&amp;forum='.$arr[$key]['obj']->forum().'&amp;post_id='.$arr[$key]['obj']->postid().'#'.$arr[$key]['obj']->postid().'">'.$arr[$key]['obj']->subject().'</a>';
  			$GLOBALS['xoopsTpl']->append("topic_trees", array_merge($posterarr, array("post_id" => $arr[$key]['obj']->postid(), "post_parent_id" => $arr[$key]['obj']->parent(), "post_date" => formatTimestamp($arr[$key]['obj']->posttime(), "m"), "post_image" => $post_image, "post_title" => $subject, "post_prefix" => $prefix)));
  		} else {
  			$subject = '<b>'.$arr[$key]['obj']->subject().'</b>';
--- 218,225 ----
  			$post_image =  '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />';
  		}
  		if ($current != $key) {
! 			//$subject = '<a href="viewtopic.php?viewmode=thread&amp;topic_id='.$arr[$key]['obj']->topic().'&amp;forum='.$arr[$key]['obj']->forum().'&amp;post_id='.$arr[$key]['obj']->postid().'#'.$arr[$key]['obj']->postid().'">'.$arr[$key]['obj']->subject().'</a>';
! 			$subject = '<a href="'.$bbUrl['root'].'viewtopic/viewmode/thread/topic_id/'.$arr[$key]['obj']->topic().'/forum/'.$arr[$key]['obj']->forum().'/post_id/'.$arr[$key]['obj']->postid().'/#'.$arr[$key]['obj']->postid().'">'.$arr[$key]['obj']->subject().'</a>';
  			$GLOBALS['xoopsTpl']->append("topic_trees", array_merge($posterarr, array("post_id" => $arr[$key]['obj']->postid(), "post_parent_id" => $arr[$key]['obj']->parent(), "post_date" => formatTimestamp($arr[$key]['obj']->posttime(), "m"), "post_image" => $post_image, "post_title" => $subject, "post_prefix" => $prefix)));
  		} else {
  			$subject = '<b>'.$arr[$key]['obj']->subject().'</b>';
***************
*** 242,248 ****
  }
  
  if ( $can_post == 1 ) {
! 	$xoopsTpl->assign(array('viewer_can_post' => true, 'forum_post_or_register' => "<a href=\"newtopic.php?forum=".$forum."\"><img src=\"".$bbImage['post']."\" alt=\""._MD_POSTNEW."\" /></a>"));
  } else {
  	$xoopsTpl->assign('viewer_can_post', false);
  	if ( $show_reg == 1 ) {
--- 256,262 ----
  }
  
  if ( $can_post == 1 ) {
! 	$xoopsTpl->assign(array('viewer_can_post' => true, 'forum_post_or_register' => "<a href=\"{$bbUrl['root']}newtopic.php?forum=".$forum."\"><img src=\"".$bbImage['post']."\" alt=\""._MD_POSTNEW."\" /></a>"));
  } else {
  	$xoopsTpl->assign('viewer_can_post', false);
  	if ( $show_reg == 1 ) {

しかし、自分ではいいと思っていても不具合はあるもの。なにか、おかしなところを発見したら、ぜひお知らせください。 :p

Page Top

コメント anchor.png

  • 素晴らしい!!「各 .php で、PATH_INFO を使いパラメータを得る。」、モジュール内の全ての「.php」ファイルですか?ご教示下さい -- yshima 2004-10-26 (火) 11:40:51
  • 「適宜リンクを書き換え」、スミマセン、もう少しだけ具体的に教えて下さい :D お願いします :) -- yshima 2004-10-26 (火) 11:47:52
    • とりあえず DIFF を示しておきました。 :) -- nao-pon 2004-10-27 (水) 23:23:02
  • NEWSモジュールもご教示くださると幸せです [heart] :D -- yshima 2004-10-26 (火) 11:54:11
    • NEWS のほうは全く見てないので、この次ということで :p -- nao-pon 2004-10-27 (水) 23:24:08
  • 新規トピックが作成できない問題があったので DIFF を修正しました。 -- nao-pon 2004-10-28 (木) 13:51:20


*1 静的ページ風URL
*2 IT用語:SEO

新しくコメントをつける

題名
ゲスト名
投稿本文

より詳細なコメント入力フォームへ

トップ   凍結 差分 バックアップ 複製 名前変更 リロード印刷に適した表示   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ   最新ページのRSS 1.0 最新ページのRSS 2.0 最新ページのRSS Atom Powered by xpWiki
Counter: 11384, today: 3, yesterday: 7
初版日時: 2004-10-28 (木) 13:51:21
最終更新: 2004-10-28 (木) 13:51:21 (JST) (5156d) by nao-pon
このページのTopへ
ログイン
ユーザ名:

パスワード:

オートログイン

Basic 認証

新規登録 | パスワード紛失



メインメニュー
UsersWiki メニュー
付箋メニュー
付箋メニュー 
付箋の編集
文字色: 背景色:
お名前:  線接続id:
 
ブックマーク
オンサイトブックマークは
ログインするとご利用になれます
[ログインする]
サイト内 Wiki
☆ 検索 ☆



高度な検索(サイト内)
FireFox検索プラグイン
オンライン状況
合計 88 人がオンライン中 :-)
(UsersWiki : 4 人)

登録ユーザ: 0 & ゲスト: 88

もっと...
サイト情報
管理人

nao-pon
 

登録ユーザ数: 4580


Web Services by Yahoo! JAPAN
楽天ウェブサービスセンター
Amazon.co.jpアソシエイト
現在ページのQRコード
現在ページのQRコード
[携帯対応]
参照元情報
参照なし