fluxrewrite-essentials
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:URL rewriting for FluxBB
##
##       		   Title:  FluxRewrite Essentials
##
##   		     Version:  2.0.2
##  	 Works on FluxBB:  1.5.5, 1.5.6
##    				Date:  2014-07-12
##               Authors: adaur (adaur.underground@gmail.com)
##                        Kévin Dunglas (PunRewrite)
##
##      	 Description: FluxRewrite is a mod created to enhance your positioning in search engines.
##						  It rewrites URLs to include the topic title. For example:
##                  	  http://fluxbb.org/forums/viewtopic.php?id=5751
##                   	  https://fluxbb.org/forums/topic-5751-fluxbb-147-released-page-1.html
##                   	  Other features :
##                     		 * Rewrites all the URL seen in index.php, viewtopic.php, viewforum.php, search.php, edit.php, post.php, delete.php
##                    		 * Replaces all special caracters like "é" or "ç" by regular caracters like "e" or "c"
##                    		 * Deletes words of 3 letters or less
##						  It also includes a very cool sitemap, thanks to Smartys (author) and premier.
##
## 		  Affected files: index.php
##                    	  viewforum.php
##                   	  viewtopic.php
##                    	  search.php
##                    	  edit.php
##                    	  delete.php
##                    	  post.php
##                    	  include/functions.php
##
##			  Affects DB: Yes
##
##             	   Notes: You must use Apache with mod_rewrite enabled.
##						  The rules can be translated to Lighttpd or Nginx.
##
##            DISCLAIMER: Please note that "mods" are not officially supported by
##                        FluxBB. Installation of this modification is done at your
##                  	  own risk. Backup your forum database and any and all
##                   	  applicable files before proceeding.
##

#
#---------[ 0. UPLOAD ]-------------------------------------------------------------------------------
#

All files from /files folder

#
#---------[ 1. RUN ]-------------------------------------------------------------------------------
#

install_mod.php

#
#---------[ 2. DELETE ]----------------------------------------------------------------------------
#

install_mod.php

#
#---------[ 3. OPEN ]-------------------------------------------------------
#

include/common.php

#
#---------[ 4. FIND ]----------------------------------------------------
#

require PUN_ROOT.'include/functions.php';

#
#---------[ 5. ADD AFTER ]------------------------------------------------
#

// Load FluxRewrite Essentials
require PUN_ROOT.'include/fluxrewrite.php';

#
#---------[ 6. OPEN ]-------------------------------------------------------
#

include/functions.php

#
#---------[ 7. FIND ]----------------------------------------------------
#

//
// Make sure that HTTP_REFERER matches base_url/script
//
function confirm_referrer($scripts, $error_msg = false)
{
	global $pun_config, $lang_common;

	if (!is_array($scripts))
		$scripts = array($scripts);

	// There is no referrer
	if (empty($_SERVER['HTTP_REFERER']))
		message($error_msg ? $error_msg : $lang_common['Bad referrer']);

	$referrer = parse_url(strtolower($_SERVER['HTTP_REFERER']));
	// Remove www subdomain if it exists
	if (strpos($referrer['host'], 'www.') === 0)
		$referrer['host'] = substr($referrer['host'], 4);

	$valid_paths = array();
	foreach ($scripts as $script)
	{
		$valid = parse_url(strtolower(get_base_url().'/'.$script));
		// Remove www subdomain if it exists
		if (strpos($valid['host'], 'www.') === 0)
			$valid['host'] = substr($valid['host'], 4);

		$valid_host = $valid['host'];
		$valid_paths[] = $valid['path'];
	}

	// Check the host and path match. Ignore the scheme, port, etc.
	if ($referrer['host'] != $valid_host || !in_array($referrer['path'], $valid_paths))
		message($error_msg ? $error_msg : $lang_common['Bad referrer']);
}

#
#---------[ 8. REPLACE WITH ]------------------------------------------------
#

//
// Make sure that HTTP_REFERER matches base_url/script
//
function confirm_referrer($scripts, $error_msg = false)
{
	global $pun_config, $lang_common;
	static $rewrites = array('viewtopic.php' => 'topic-', 'viewforum.php' => 'forum-', 'post.php' => 'topic-');

	if (!is_array($scripts))
		$scripts = array($scripts);

	// There is no referrer
	if (empty($_SERVER['HTTP_REFERER']))
		message($error_msg ? $error_msg : $lang_common['Bad referrer']);

	$referrer = parse_url(strtolower($_SERVER['HTTP_REFERER']));
	// Remove www subdomain if it exists
	if (strpos($referrer['host'], 'www.') === 0)
		$referrer['host'] = substr($referrer['host'], 4);

	$valid_paths = array();
	foreach ($scripts as $script)
	{
		$valid = parse_url(strtolower(get_base_url().'/'.$script));
		// Remove www subdomain if it exists
		if (strpos($valid['host'], 'www.') === 0)
			$valid['host'] = substr($valid['host'], 4);

		$valid_host = $valid['host'];
		$valid_paths[] = $valid['path'];
	}
	
	// Check the host and path match. Ignore the scheme, port, etc.
	if ($referrer['host'] != $valid['host'] || !in_array($referrer['path'], $valid_paths))
	{
		foreach ($scripts as $script)
		{
			if (array_key_exists($script, $rewrites))
			{
				if (!preg_match('#^'.get_base_url().'/'.$rewrites[$script].'[0-9]+-[0-9|a-b|\-|\.]*(.?)#i', strtolower($_SERVER['HTTP_REFERER'])))
					message($error_msg ? $error_msg : $lang_common['Bad referrer']);
			}
			else
				message($error_msg ? $error_msg : $lang_common['Bad referrer']);
		}
	}
}

#
#---------[ 9. FIND ]----------------------------------------------------
#

//
// Update posts, topics, last_post, last_post_id and last_poster for a forum
//
function update_forum($forum_id)
{
	global $db;

	$result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id) or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error());
	list($num_topics, $num_posts) = $db->fetch_row($result);

	$num_posts = $num_posts + $num_topics; // $num_posts is only the sum of all replies (we have to add the topic posts)

	$result = $db->query('SELECT last_post, last_post_id, last_poster FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.' AND moved_to IS NULL ORDER BY last_post DESC LIMIT 1') or error('Unable to fetch last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
	if ($db->num_rows($result)) // There are topics in the forum
	{
		list($last_post, $last_post_id, $last_poster) = $db->fetch_row($result);

		$db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
	}
	else // There are no topics
		$db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post=NULL, last_post_id=NULL, last_poster=NULL WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
}

#
#---------[ 10. REPLACE WITH ]------------------------------------------------
#

//
// Update posts, topics, last_post, last_post_id and last_poster for a forum
//
function update_forum($forum_id)
{
	global $db;

	$result = $db->query('SELECT COUNT(id), SUM(num_replies) FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id) or error('Unable to fetch forum topic count', __FILE__, __LINE__, $db->error());
	list($num_topics, $num_posts) = $db->fetch_row($result);

	$num_posts = $num_posts + $num_topics; // $num_posts is only the sum of all replies (we have to add the topic posts)

	$result = $db->query('SELECT last_post, last_post_id, last_poster, subject, id, num_replies FROM '.$db->prefix.'topics WHERE forum_id='.$forum_id.' AND moved_to IS NULL ORDER BY last_post DESC LIMIT 1') or error('Unable to fetch last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
	if ($db->num_rows($result)) // There are topics in the forum
	{
		list($last_post, $last_post_id, $last_poster, $last_topic, $last_topic_id, $num_replies) = $db->fetch_row($result);

		$db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', num_replies='.$num_replies.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\', last_topic=\''.$db->escape($last_topic).'\', last_topic_id='.$last_topic_id.' WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
	}
	else // There are no topics
		$db->query('UPDATE '.$db->prefix.'forums SET num_topics='.$num_topics.', num_posts='.$num_posts.', last_post=NULL, last_post_id=NULL, last_poster=NULL, last_topic=NULL, last_topic_id=NULL, num_replies=NULL WHERE id='.$forum_id) or error('Unable to update last_post/last_post_id/last_poster/last_topic', __FILE__, __LINE__, $db->error());
}

#
#---------[ 11. OPEN ]---------------------------------------------------------
#

index.php

#
#---------[ 12.FIND ]---------------------------------------------
#

$forum_field = '

'.pun_htmlspecialchars($cur_forum['forum_name']).''.(!empty($forum_field_new) ? ' '.$forum_field_new : '').'

'; # #---------[ 13. REPLACE BY ]------------------------------------------------- # $forum_field = '

'.pun_htmlspecialchars($cur_forum['forum_name']).''.(!empty($forum_field_new) ? ' '.$forum_field_new : '').'

'; # #---------[ 14. FIND ]--------------------------------------------- # f.last_poster # #---------[ 15. ADD AFTER ]------------------------------------------------- # , f.last_topic, f.last_topic_id, f.num_replies # #---------[ 16. FIND ]--------------------------------------------- # if ($cur_forum['last_post'] != '') $last_post = ''.format_time($cur_forum['last_post']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).''; # #---------[ 17. REPLACE BY ]------------------------------------------------- # if ($cur_forum['last_post'] != '') { $num_pages_topic = ceil(($cur_forum['num_replies'] + 1) / $pun_user['disp_posts']); $last_post = ''.format_time($cur_forum['last_post']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).''; } # #---------[ 18. OPEN ]--------------------------------------------------------- # viewforum.php # #---------[ 19. FIND ]--------------------------------------------- # // Should we display the dot or not? :) if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1') { if ($cur_topic['has_posted'] == $pun_user['id']) { $subject = '· '.$subject; $item_status .= ' iposted'; } } $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']); # #---------[ 20. REPLACE BY ]------------------------------------------------- # // Should we display the dot or not? :) if (!$pun_user['is_guest'] && $pun_config['o_show_dot'] == '1') { if ($cur_topic['has_posted'] == $pun_user['id']) { $subject = '· '.$subject; $item_status .= ' iposted'; } } # #---------[ 21. FIND ]--------------------------------------------- # $icon_type = 'icon'; # #---------[ 22. ADD AFTER ]------------------------------------------------- # $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $pun_user['disp_posts']); # #---------[ 23. FIND ]--------------------------------------------- # $last_post = ''.format_time($cur_topic['last_post']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).''; # #---------[ 24. REPLACE BY ]------------------------------------------------- # $last_post = ''.format_time($cur_topic['last_post']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['last_poster']).''; # #---------[ 25. FIND ]--------------------------------------------- # if ($cur_topic['moved_to'] != 0) { $subject = ''.pun_htmlspecialchars($cur_topic['subject']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).''; $status_text[] = ''.$lang_forum['Moved'].''; $item_status .= ' imoved'; } else if ($cur_topic['closed'] == '0') $subject = ''.pun_htmlspecialchars($cur_topic['subject']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).''; else { $subject = ''.pun_htmlspecialchars($cur_topic['subject']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).''; $status_text[] = ''.$lang_forum['Closed'].''; $item_status .= ' iclosed'; } # #---------[ 26. REPLACE BY ]------------------------------------------------- # if ($cur_topic['moved_to'] != 0) { $subject = ''.pun_htmlspecialchars($cur_topic['subject']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).''; $status_text[] = ''.$lang_forum['Moved'].''; $item_status .= ' imoved'; } else if ($cur_topic['closed'] == '0') $subject = ''.pun_htmlspecialchars($cur_topic['subject']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).''; else { $subject = ''.pun_htmlspecialchars($cur_topic['subject']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_topic['poster']).''; $status_text[] = ''.$lang_forum['Closed'].''; $item_status .= ' iclosed'; } # #---------[ 27. FIND ]--------------------------------------------- # $subject_new_posts = '[ '.$lang_common['New posts'].' ]'; # #---------[ 28. REPLACE BY ]------------------------------------------------- # $subject_new_posts = '[ '.$lang_common['New posts'].' ]'; # #---------[ 29. FIND ]--------------------------------------------- # // Generate paging links $paging_links = ''.$lang_common['Pages'].' '.paginate($num_pages, $p, 'viewforum.php?id='.$id); # #---------[ 30. REPLACE BY ]------------------------------------------------- # // Generate paging links $paging_links = ''.$lang_common['Pages'].' '.paginate_rewrited($num_pages, $p, 'forum-'.$id.'-'.clean_url($cur_forum['forum_name'])); # #---------[ 31. FIND ]--------------------------------------------- # $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_topic['id']).' ]'; # #---------[ 32. REPLACE BY ]------------------------------------------------- # $subject_multipage = '[ '.paginate_rewrited($num_pages_topic, -1, 'topic-'.$cur_topic['id'].'-'.clean_url($cur_topic['subject'])).' ]'; # #---------[ 33. FIND ]--------------------------------------------- #
  • » 
  • # #---------[ 34. REPLACE BY ]------------------------------------------------- #
  • » ">
  • # #---------[ 35. FIND ]--------------------------------------------- #
  • » 
  • # #---------[ 36. REPLACE BY ]------------------------------------------------- #
  • » ">
  • # #---------[ 37. OPEN ]--------------------------------------------------------- # viewtopic.php # #---------[ 38. FIND ]--------------------------------------------- #
  • » 
  • » 
  • # #---------[ 39. REPLACE BY ]------------------------------------------------- #
  • » ">
  • » ">
  • # #---------[ 40. FIND ]--------------------------------------------- #
  • » 
  • » 
  • # #---------[ 41. REPLACE BY ]------------------------------------------------- #
  • » ">
  • » ">
  • # #---------[ 42. FIND ]--------------------------------------------- # // Generate paging links $paging_links = ''.$lang_common['Pages'].' '.paginate($num_pages, $p, 'viewtopic.php?id='.$id); # #---------[ 43. REPLACE BY ]------------------------------------------------- # // Generate paging links $paging_links = ''.$lang_common['Pages'].': '.paginate_rewrited($num_pages, $p, 'topic-'.$id.'-'.clean_url($cur_topic['subject'])); # #---------[ 44. FIND ]--------------------------------------------- # if ($first_new_post_id) { header('Location: viewtopic.php?pid='.$first_new_post_id.'#p'.$first_new_post_id); exit; } # #---------[ 45. REPLACE BY ]------------------------------------------------- # $result2 = $db->query('SELECT subject, num_replies FROM '.$db->prefix.'topics WHERE id='.$id) or error('Unable to get subject', __FILE__, __LINE__, $db->error()); list($subject, $num_replies) = $db->fetch_row($result2); $num_pages = ceil(($num_replies + 1) / $pun_user['disp_posts']); if ($first_new_post_id) { header('Location: '.fluxrewrite("topic-", $id, $subject, $num_pages, false, $first_new_post_id)); exit; } # #---------[ 46. FIND ]--------------------------------------------- # if ($last_post_id) { header('Location: viewtopic.php?pid='.$last_post_id.'#p'.$last_post_id); exit; } # #---------[ 47. REPLACE BY ]------------------------------------------------- # $result2 = $db->query('SELECT subject, num_replies FROM '.$db->prefix.'topics WHERE id='.$id) or error('Unable to get subject', __FILE__, __LINE__, $db->error()); list($subject, $num_replies) = $db->fetch_row($result2); $num_pages = ceil(($num_replies + 1) / $pun_user['disp_posts']); if ($last_post_id) { header('Location: '.fluxrewrite("topic-", $id, $subject, $num_pages, false, $last_post_id)); exit; } # #---------[ 48. FIND ]--------------------------------------------- # # #---------[ 49. REPLACE BY ]------------------------------------------------- # "> # #---------[ 50. OPEN ]--------------------------------------------------------- # search.php # #---------[ 51. FIND ]--------------------------------------------------------- # $forum = ''.pun_htmlspecialchars($cur_search['forum_name']).''; # #---------[ 52. REPLACE WITH ]--------------------------------------------------------- # $forum = ''.pun_htmlspecialchars($cur_search['forum_name']).''; # #---------[ 53. FIND ]--------------------------------------------------------- # $cur_search['subject'] = censor_words($cur_search['subject']); # #---------[ 54. ADD AFTER ]--------------------------------------------------------- # $num_pages_topic = ceil(($cur_search['num_replies'] + 1) / $pun_user['disp_posts']); # #---------[ 55. FIND ]--------------------------------------------------------- # $pposter = ''.$pposter.''; } # #---------[ 56. ADD AFTER ]--------------------------------------------------------- # $last_post_h2 = ''.format_time($cur_search['last_post']).''; $last_post_footer = ''.$lang_search['Go to post'].''; # #---------[ 57. FIND ]--------------------------------------------------------- #

    # »  » 

    # #---------[ 58. REPLACE WITH ]--------------------------------------------------------- #

    # » '.pun_htmlspecialchars($cur_search['subject']).''; ?> » 

    # #---------[ 59. FIND ]--------------------------------------------------------- #
  • # #---------[ 60. REPLACE WITH ]--------------------------------------------------------- #
  • '.$lang_search['Go to topic'].''; ?>
  • # #---------[ 61. FIND ]--------------------------------------------------------- # $subject = ''.pun_htmlspecialchars($cur_search['subject']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_search['poster']).''; # #---------[ 62. REPLACE WITH ]--------------------------------------------------------- # $subject = ''.pun_htmlspecialchars($cur_search['subject']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_search['poster']).''; # #---------[ 63. FIND ]--------------------------------------------------------- # $subject_new_posts = '[ '.$lang_common['New posts'].' ]'; # #---------[ 64. REPLACE WITH ]--------------------------------------------------------- # $subject_new_posts = '[ '.$lang_common['New posts'].' ]'; # #---------[ 65. FIND ]--------------------------------------------------------- # // Insert the status text before the subject $subject = implode(' ', $status_text).' '.$subject; $num_pages_topic = ceil(($cur_search['num_replies'] + 1) / $pun_user['disp_posts']); if ($num_pages_topic > 1) $subject_multipage = '[ '.paginate($num_pages_topic, -1, 'viewtopic.php?id='.$cur_search['tid']).' ]'; else $subject_multipage = null; # #---------[ 66. REPLACE WITH ]--------------------------------------------------------- # // Insert the status text before the subject $subject = implode(' ', $status_text).' '.$subject; if ($num_pages_topic > 1) $subject_multipage = '[ '.paginate_rewrited($num_pages_topic, -1, 'topic-'.$cur_search['tid'].'-'.clean_url($cur_search['subject'])).' ]'; else $subject_multipage = null; $last_post = ''.format_time($cur_search['last_post']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_search['last_poster']).''; # #---------[ 67. FIND ]--------------------------------------------------------- # '.format_time($cur_search['last_post']).' '.$lang_common['by'].' '.pun_htmlspecialchars($cur_search['last_poster']) ?> # #---------[ 68. REPLACE WITH ]--------------------------------------------------------- # # #---------[ 69. OPEN ]--------------------------------------------------------- # post.php # #---------[ 70. FIND ]--------------------------------------------- # redirect('viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $lang_post['Post redirect']); # #---------[ 71. REPLACE BY ]------------------------------------------------- # $result = $db->query('SELECT subject, num_replies FROM '.$db->prefix.'topics WHERE id='.$new_tid) or error('Unable to get subject', __FILE__, __LINE__, $db->error()); list($subject, $num_replies) = $db->fetch_row($result); $num_pages = ceil(($num_replies + 1) / $pun_user['disp_posts']); redirect(fluxrewrite("topic-", $new_tid, $subject, $num_pages, false, $new_pid), $lang_post['Post redirect']); # #---------[ 72. FIND ]--------------------------------------------- #
  • » 
  • » 
  • » 
  • # #---------[ 73. REPLACE BY ]------------------------------------------------- #
  • » ">
  • » 
  • » ">
  • # #---------[ 74. FIND ]--------------------------------------------- # $mail_message = str_replace('', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message); # #---------[ 75. REPLACE BY ]------------------------------------------------- # $mail_message = str_replace('', get_base_url().'/'.fluxrewrite("topic-", $tid, $cur_posting['subject'], 1, false, $new_pid), $mail_message); # #---------[ 76. FIND ]--------------------------------------------- # $mail_message = str_replace('', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message); # #---------[ 77. REPLACE BY ]------------------------------------------------- # $mail_message = str_replace('', get_base_url().'/'.fluxrewrite("topic-", $tid, $cur_posting['subject'], 1, false, $new_pid), $mail_message); # #---------[ 78. FIND ]--------------------------------------------- # $mail_message_full = str_replace('', get_base_url().'/viewtopic.php?pid='.$new_pid.'#p'.$new_pid, $mail_message_full); # #---------[ 79. REPLACE BY ]------------------------------------------------- # $mail_message_full = str_replace('', get_base_url().'/'.fluxrewrite("topic-", $tid, $cur_posting['subject'], 1, false, $new_pid), $mail_message_full); # #---------[ 80. FIND ]--------------------------------------------- # $mail_message = str_replace('', get_base_url().'/viewtopic.php?id='.$new_tid, $mail_message); # #---------[ 81. REPLACE BY ]------------------------------------------------- # $mail_message = str_replace('', get_base_url().'/'.fluxrewrite("topic-", $new_tid, $pun_config['o_censoring'] == '1' ? $censored_subject : $subject, 1, false, false), $mail_message); # #---------[ 82. FIND ]--------------------------------------------- # $mail_message_full = str_replace('', get_base_url().'/viewtopic.php?id='.$new_tid, $mail_message_full); # #---------[ 83. REPLACE BY ]------------------------------------------------- # $mail_message_full = str_replace('', get_base_url().'/'.fluxrewrite("topic-", $new_tid, $pun_config['o_censoring'] == '1' ? $censored_subject : $subject, 1, false, false), $mail_message_full); # #---------[ 84. OPEN ]--------------------------------------------------------- # edit.php # #---------[ 85. FIND ]--------------------------------------------- # redirect('viewtopic.php?pid='.$id.'#p'.$id, $lang_post['Edit redirect']); # #---------[ 86. REPLACE BY ]------------------------------------------------- # if (!$can_edit_subject) { $result = $db->query('SELECT subject FROM '.$db->prefix.'topics WHERE id='.$cur_post['tid']) or error('Unable to get subject', __FILE__, __LINE__, $db->error()); $subject = $db->result($result); } $result2 = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE id BETWEEN '.$cur_post['first_post_id'].' AND '.$id.' AND topic_id='.$cur_post['tid']) or error('Unable to get num_replies', __FILE__, __LINE__, $db->error()); $num_replies = $db->result($result2); $num_pages = ceil(($num_replies + 1) / $pun_user['disp_posts']); redirect(fluxrewrite("topic-", $cur_post['tid'], $subject, $num_pages, false, $id), $lang_post['Edit redirect']); # #---------[ 87. FIND ]--------------------------------------------- #
  • » 
  • » 
  • # #---------[ 88. REPLACE BY ]------------------------------------------------- #
  • » ">
  • » ">
  • # #---------[ 89. OPEN ]--------------------------------------------------------- # delete.php # #---------[ 90. FIND ]--------------------------------------------- # redirect('viewforum.php?id='.$cur_post['fid'], $lang_delete['Topic del redirect']); # #---------[ 91. REPLACE BY ]------------------------------------------------- # redirect(fluxrewrite("forum-", $cur_post['fid'], $cur_post['forum_name'], 1, false, false), $lang_delete['Topic del redirect']); # #---------[ 92. FIND ]--------------------------------------------- # redirect('viewtopic.php?pid='.$post_id.'#p'.$post_id, $lang_delete['Post del redirect']); # #---------[ 93. REPLACE BY ]---------------------------------------- # $result2 = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE id BETWEEN '.$cur_post['first_post_id'].' AND '.$post_id.' AND topic_id='.$cur_post['tid']) or error('Unable to get num_replies', __FILE__, __LINE__, $db->error()); $num_replies = $db->result($result2); $num_pages = ceil(($num_replies + 1) / $pun_user['disp_posts']); redirect(fluxrewrite("topic-", $cur_post['tid'], $cur_post['subject'], $num_pages, false, $post_id), $lang_delete['Post del redirect']); # #---------[ 94. FIND ]--------------------------------------------- #
  • » 
  • » 
  • # #---------[ 95. REPLACE BY ]------------------------------------------------- #
  • » ">
  • » ">
  • # #---------[ 96. Save your files and upload them; you're done! ]----------------- #

    本源码包内暂不包含可直接显示的源代码文件,请下载源码包。