[ALFA] - Easy SEO Mod - 0.1.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
yakusha
Registered User
Posts: 71
Joined: Mon Apr 03, 2006 8:30 pm

[ALFA] - Easy SEO Mod - 0.1.0

Post by yakusha » Wed Dec 27, 2006 12:41 pm

İf your server dont using Mod Rewrite! this mod easy seo! dont using mod rewrite and your adress changing

from -> viewforum.php?f=41
to -> viewforum.php?f=41-your-message-or-forum-title.html

and this mod enabling or disabling from acp

initial alfa release

demo: www.yakusha.net forums and topics...

Code: Select all

###################################################
## MOD Title            : Easy SEO Mod
## MOD Author           : yakusha < yakusha@tnn.net > (sabri ünal) < http://www.canver.net >
## MOD Version          : ALFA 0.1.0
## MOD Description      : 
## İf your server dont using Mod Rewrite! this mod easy seo! dont using mod rewrite and your adress changing

from -> viewforum.php?f=41
to -> viewforum.php?f=41-your-message-or-forum-title.html

and this mod enabling or disabling from acp
.
#########################################################
## Installation Level   : easy
## Installation Time    : 5
## Files To Edit        : 7
## Included Files       : n/a
##########################################################
##
## Destek ve Yardım : http://www.canver.net
## Telif Hakkı      : Copyleft © - canver|net, canver|soft - www.canversoft.com
##                  : Copyleft © - yakusha|net, Yakusha Team - www.yakusha.net
## Lisans           : GNU Public License v2 http://opensource.org/licenses/gpl-license.php
##
#########################################################
## Güvenlik Uyarısı:
##
##   Modun son sürümü için lütfen http://www.canver.net adresini kontrol ediniz.
##   Modun stabil sürümü için lütfen http://www.phpBB.com adresini kontrol ediniz.
##   Modu başka siteden indirdiyseniz, içinde art niyetli kod olmadığını garanti edemeyiz.
##   Modu eklemeden önce, güvenlik kopyası amacıyla lütfen dosyalarınızın yedeğini alınız.
##
###########################################################
## Author Notes:
## Mod Rewrite özelliği olmayan sunucular için kendinize basit bir seo özelliği yapabilirsiniz...
## 
###########################################################
## Faydalanılan modlar:
## www.canver.net -> Seo Forums & Seo Mods
##
###########################################################
## Mod Geçmişi:
##
## 27:12:2006 -> initial alfa release
## 
###########################################################
#
#-----[ SQL ]------------------------------------------
#

INSERT INTO phpbb_config (config_name, config_value) VALUES ('basit_seo_open', '1');

#
#-----[ OPEN ]------------------------------------------
#

includes/funtions.php

#
#-----[ FIND ]------------------------------------------
#

function get_db_stat($mode)

#
#-----[ BEFORE, ADD ]------------------------------------------
#

function format_url($url)
{
	$url = trim($url);
	$url = strtolower($url);
	
	$find = array('<b>', '</b>');
	$url = str_replace ($find, '', $url);
	
	$url = preg_replace('/<(\/{0,1})img(.*?)(\/{0,1})\>/', 'image', $url);
	
	$find = array(' ', '"', '&', '&', '\r\n', '\n', '/', '\\', '+', '<', '>');
	$url = str_replace ($find, '-', $url);
	
	$find = array('é', 'è', 'ë', 'ê', 'É', 'È', 'Ë', 'Ê');
	$url = str_replace ($find, 'e', $url);
	
	$find = array('í', 'ı', 'ì', 'î', 'ï', 'I', 'İ', 'Í', 'Ì', 'Î', 'Ï');
	$url = str_replace ($find, 'i', $url);
	
	$find = array('ó', 'ö', 'Ö', 'ò', 'ô', 'Ó', 'Ò', 'Ô');
	$url = str_replace ($find, 'o', $url);
	
	$find = array('á', 'ä', 'â', 'à', 'â', 'Ä', 'Â', 'Á', 'À', 'Â');
	$url = str_replace ($find, 'a', $url);
	
	$find = array('ú', 'ü', 'Ü', 'ù', 'û', 'Ú', 'Ù', 'Û');
	$url = str_replace ($find, 'u', $url);
	
	$find = array('ç', 'Ç');
	$url = str_replace ($find, 'c', $url);
	
	$find = array('ş', 'Ş');
	$url = str_replace ($find, 's', $url);
	
	$find = array('ğ', 'Ğ');
	$url = str_replace ($find, 'g', $url);
	
	$find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/');
	
	$repl = array('', '-', '');
	
	$url = preg_replace ($find, $repl, $url);
	$url = str_replace ('--', '-', $url);

 	$url = $url.'.html';

	return $url;
}

#
#-----[ OPEN ]------------------------------------------
#

index.php

#
#-----[ FIND ]------------------------------------------
#

	'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id")

#
#-----[ REPLACE ]------------------------------------------
#

	//---[+]---- easy seo mod ----------
	'U_VIEWFORUM' => ($board_config['basit_seo_open']) ? append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . "=$forum_id .'-'. format_url($forum_data['forum_name'])) : append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . "=$forum_id)
	//---[-]---- easy seo mod ----------

#
#-----[ OPEN ]------------------------------------------
#

viewforum.php

#
#-----[ FIND ]------------------------------------------
#

	'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id")

#
#-----[ REPLACE ]------------------------------------------
#

	//---[+]---- easy seo mod ----------
	'U_VIEW_FORUM' => ($board_config['basit_seo_open']) ? append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id" .'-'. format_url($forum_row['forum_name'])) : append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),
	//---[-]---- easy seo mod ----------

#
#-----[ OPEN ]------------------------------------------
#

viewtopic.php

#
#-----[ FIND ]------------------------------------------
#

	'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=$highlight"),#

#
#-----[ REPLACE ]------------------------------------------
#
	'U_VIEW_TOPIC' => ($board_config['basit_seo_open']) ? append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id" .'-'. format_url($topic_title)) : append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"),
#
#-----[ OPEN ]------------------------------------------
#

templates/subSilver/admin/board_config_body.tpl

#
#-----[ FIND ]------------------------------------------
#

<tr>
	<td width="60%" class="row1">{L_SERVER_NAME}</td>
	<td class="row2"><input class="post" type="text" maxlength="255" size="40" name="server_name" value="{SERVER_NAME}" /></td>
</tr>
#
#-----[ BEFORE, ADD ]------------------------------------------
#

   <tr>
      <td class="row1">{L_BASIT_SEO_OPEN}</td>
      <td class="row2"><input type="radio" name="basit_seo_open" value="1" {BASIT_SEO_OPEN_YES} /> {L_YES}&nbsp;&nbsp;<input type="radio" name="basit_seo_open" value="0" {BASIT_SEO_OPEN_NO} /> {L_NO}</td>
   </tr>

#
#-----[ OPEN ]------------------------------------------
#

admin/admin_board.php

#
#-----[ FIND ]------------------------------------------
#

$namechange_yes = ( $new['allow_namechange'] ) ? "checked=\"checked\"" : "";
$namechange_no = ( !$new['allow_namechange'] ) ? "checked=\"checked\"" : "";

#
#-----[ AFTER, ADD ]------------------------------------------
#

$basit_seo_open_yes = ( $new['basit_seo_open'] ) ? "checked=\"checked\"" : "";
$basit_seo_open_no = ( !$new['basit_seo_open'] ) ? "checked=\"checked\"" : "";

#
#-----[ FIND ]------------------------------------------
#

   "L_MAX_SIG_LENGTH_EXPLAIN" => $lang['Max_sig_length_explain'],

#
#-----[ AFTER, ADD ]------------------------------------------
#

   "L_BASIT_SEO_OPEN" => $lang['Basit_seo_open'],

#
#-----[ FIND ]------------------------------------------
#

   "NAMECHANGE_YES" => $namechange_yes,
   "NAMECHANGE_NO" => $namechange_no,

#
#-----[ AFTER, ADD ]------------------------------------------
#

   "BASIT_SEO_OPEN_YES" => $basit_seo_open_yes,
   "BASIT_SEO_OPEN_NO" => $basit_seo_open_no,

#
#-----[ OPEN ]------------------------------------------
#

language/lang_****/lang_admin.php

#
#-----[ FIND ]------------------------------------------
#

?>

#
#-----[ BEFORE, ADD ]------------------------------------------
#
@@@ English
$lang['Basit_seo_open']              = 'Easy Seo Mod Open?';

@@@ Turkish
$lang['Basit_seo_open']              = 'Basit Seo Özelliği Kullanılsın mı?';


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

deejaybet
Registered User
Posts: 1814
Joined: Thu Dec 08, 2005 2:01 pm
Location: Derry, Northern Ireland
Contact:

Post by deejaybet » Wed Dec 27, 2006 1:30 pm

think you need to make the mod file respect the mod template

plus some symbols in the file are not normal letters

Post Reply

Return to “[2.0.x] MODs in Development”