PDA

View Full Version : Vài Mod cho IBP 2.0.3 phần II


seller.credit
14-03-2006, 09:24 AM
7. Đăng ký đầy đủ
• Mod này cho phép ta thêm những khỏang mà thành viên có thể điền trực tiếp khi đăng ký. Như Website, Yahoo Messenger, MSN Messenger.v..v.
Mở sources/register.php
Tìm:
//-----------------------------------------------
// Time zone...
//-----------------------------------------------
Thêm bên trên:
//-----------------------------------------------
// Optional Profile Fields
//-----------------------------------------------
$date = getdate();
$day = "<option value='0'>--</option>";
$mon = "<option value='0'>--</option>";
$year = "<option value='0'>--</option>";
for ($i = 1; $i < 32; $i++)
{
$day .= ($i == $ibforums->input['bday_day']) ? "<option value='{$i}' selected>{$i}</option>" : "<option value='{$i}'>{$i}</option>";
}
for ($i = 1; $i < 13; $i++)
{
$mon .= ($i == $ibforums->input['bday_month']) ? "<option value='{$i}' selected>{$ibforums->lang['month'.$i]}</option>" : "<option value='{$i}'>{$ibforums->lang['month'.$i]}</option>";
}
$i = $date['year'] - 1;
$j = $date['year'] - 100;
for ($i; $j < $i; $i--)
{
$year .= ($i == $ibforums->input['bday_year']) ? "<option value='{$i}' selected>{$i}</option>" : "<option value='{$i}'>{$i}</option>";
}
$birthday = $this->html->birthday($day, $mon, $year);
$pfields = str_replace("<!--{BIRTHDAY}-->", $birthday, $this->html->profile_fields());
$this->output = str_replace("<!--{PROFILE.FIELDS}-->", $pfields, $this->output);


Tìm:
//--------------------------------------------
// Build up the hashes
//--------------------------------------------


Thêm bên trên:
//--------------------------------------------
// Optional Profile Fields
//--------------------------------------------

if ((strlen($ibforums->input['Interests']) > $ibforums->vars['max_interest_length']) and ($ibforums->vars['max_interest_length']))
{
$std->Error(array('LEVEL' => 1, 'MSG' => 'int_too_long'));
}
if ((strlen($ibforums->input['Location']) > $ibforums->vars['max_location_length']) and ($ibforums->vars['max_location_length']))
{
$std->Error(array('LEVEL' => 1, 'MSG' => 'loc_too_long'));
}
if (strlen($ibforums->input['WebSite']) > 150)
{
$std->Error(array('LEVEL' => 1, 'MSG' => 'web_too_long'));
}
if (strlen($ibforums->input['Photo']) > 150)
{
$std->Error(array('LEVEL' => 1, 'MSG' => 'photo_too_long'));
}
if (($ibforums->input['ICQNumber']) && (!preg_match("/^(?:\d+)$/", $ibforums->input['ICQNumber'])))
{
$std->Error(array('LEVEL' => 1, 'MSG' => 'not_icq_number'));
}
if (!preg_match("#^http://#", $ibforums->input['WebSite']))
{
$ibforums->input['WebSite'] = 'http://'.$ibforums->input['WebSite'];
}
if(!is_object($this->parser))
{
require_once("./sources/lib/post_parser.php");
$this->parser = new post_parser(1);
}
$ibforums->input['Signature'] = $this->parser->convert(array('TEXT' => $ibforums->input['Signature'], 'SMILIES' => 0, 'CODE' => $ibforums->vars['sig_allow_ibc'], 'HTML' => $ibforums->vars['sig_allow_html'], 'SIGNATURE' => 1));
$me_pf = array(
'aim_name' => $ibforums->input['AOLName'],
'icq_number' => $ibforums->input['ICQNumber'],
'msnname' => $ibforums->input['MSNName'],
'yahoo' => $ibforums->input['YahooName'],
'website' => $ibforums->input['WebSite'],
'signature' => $ibforums->input['Signature'],
'location' => $ibforums->input['Location'],
'interests' => $ibforums->input['Interests']
);


Tìm:
'coppa_user' => $coppa,
'language' => $ibforums->vars['default_language'],


Thêm bên dưới:
'bday_day' => intval( $ibforums->input['bday_day'] ),
'bday_month' => intval( $ibforums->input['bday_month'] ),
'bday_year' => intval( $ibforums->input['bday_year'] ),


Tìm:
$DB->do_insert( 'member_extra', array( 'id' => $member_id, 'vdirs' => 'in:Inbox|sent:Sent Items' ) );


Thêm bên dưới:
$DB->do_update( 'member_extra', $me_pf, 'id='.$member_id );

Lưu và đóng lại sources/register.php
Mở lang/**/lang_register.php
Tìm:
<?php

$lang = array (
Hoặc tìm:
<?php
Thêm bên dưới:
optional_fields => "Optional Profile Fields",
yahoo_name => "Yahoo Screen Name",
aim_name => "AOL Screen Name",
msn_name => "MSN Email Address",
icq_number => "ICQ Number",
birthday => "Birthday",
location => "Location",
interests => "Interests",
signature => "Signature",
website => "Website",
web_too_long => "Your website entry is too long.",
sig_too_long => "Your signature is too long.",
int_too_long => "Your Interests entry is too long.",
not_icq_number => "That is not a valid ICQ number",
loc_too_long => "Your Location entry is too long.",

'month1' => "January",
'month2' => "February",
'month3' => "March",
'month4' => "April",
'month5' => "May",
'month6' => "June",
'month7' => "July",
'month8' => "August",
'month9' => "September",
'month10' => "October",
'month11' => "November",
'month12' => "December",


Hoặc thêm bên dưới:
$lang['optional_fields'] = "Optional Profile Fields";
$lang['yahoo_name'] = "Yahoo Screen Name";
$lang['aim_name'] = "AOL Screen Name";
$lang['msn_name'] = "MSN Email Address";
$lang['icq_number'] = "ICQ Number";
$lang['birthday'] = "Birthday";
$lang['location'] = "Location";
$lang['interests'] = "Interests";
$lang['signature'] = "Signature";
$lang['website'] = "Website";
$lang['web_too_long'] = "Your website entry is too long.";
$lang['sig_too_long'] = "Your signature is too long.";
$lang['int_too_long'] = "Your Interests entry is too long.";
$lang['not_icq_number'] = "That is not a valid ICQ number";
$lang['loc_too_long'] = "Your Location entry is too long.";

$lang['month1'] = "January";
$lang['month2'] = "February";
$lang['month3'] = "March";
$lang['month4'] = "April";
$lang['month5'] = "May";
$lang['month6'] = "June";
$lang['month7'] = "July";
$lang['month8'] = "August";
$lang['month9'] = "September";
$lang['month10'] = "October";
$lang['month11'] = "November";
$lang['month12'] = "December";


Lưu và đóng lại lang/**/lang_register.php
Mở Admin CP: Skin & Templates: Skin Manager: Edit HTML: Register: Add New Template
Thêm những khỏang thông tin bên dưới:
Template Name: birthday
Template Variables: $day,$month,$year
Template Bit:
<tr>
<td width='90%' colspan='4'>{ipb.lang['birthday']}: <select name='bday_month' class='forminput'>{$month}</select> <select name='bday_day' class='forminput'>{$day}</select> <select name='bday_year' class='forminput'>{$year}</select></td>
</tr>


Save Template
Mở Admin CP: Skin & Templates: Skin Manager: Edit HTML: Register: Add New Template
Thêm những khỏang thông tin bên dưới:
Template Name: profile_fields
Template Bit:
<br><fieldset align='center' style='width:95%'>
<legend><strong>{ipb.lang['optional_fields']}</strong></legend>
<table width='100%' cellpadding='4' cellspacing='0'>
<!--{BIRTHDAY}-->
<tr>
<td>{ipb.lang['aim_name']}</td>
<td>{ipb.lang['msn_name']}</td>
<td>{ipb.lang['yahoo_name']}</td>
<td>{ipb.lang['icq_number']}</td>
</tr>
<tr>
<td><input type='text' size='23' maxlength='30' name='AOLName' value='{ipb.input['AOLName']}' class='forminput'></td>
<td><input type='text' size='23' maxlength='30' name='MSNName' value='{ipb.input['MSNName']}' class='forminput'></td>
<td><input type='text' size='23' maxlength='30' name='YahooName' value='{ipb.input['YahooName']}' class='forminput'></td>
<td><input type='text' size='23' maxlength='20' name='ICQNumber' value='{ipb.input['ICQNumber']}' class='forminput'></td>
</tr>
<tr>
<td nowrap colspan='4'>{ipb.lang['website']}: <input type='text' size='41' maxlength='1200' name='WebSite' value='{ipb.input['WebSite']}' class='forminput'> {ipb.lang['location']}: <input type='text' size='41' name='Location' value='{ipb.input['Location']}' class='forminput'></td>
</tr>
<tr>
<td nowrap valign='top' colspan='4'>{ipb.lang['interests']}: <textarea cols='40' rows='5' wrap='soft' name='Interests' class='forminput'>{ipb.input['Location']}</textarea> {ipb.lang['signature']}: <textarea cols='40' rows='5' wrap='soft' name='Signature' class='forminput'>{ipb.input['Signature']}</textarea></td>
</tr>
</table>
</fieldset><br>


Save Template
Mở Admin CP: Skin & Templates: Skin Manager: Edit HTML: Register: ShowForm
Tìm:
</div>
</div>
<!--IBF.MODULES.EXTRA-->
</form>


Thêm bên trên:
<!--{PROFILE.FIELDS}-->
Save Template
• Hoàn tất!!!

seller.credit
14-03-2006, 09:27 AM
8.Mod avatar mặc định
Mở file sources/functions.php
Tìm :
//-----------------------------------------
// No avatar?
//-----------------------------------------

if ( ! $member_avatar or $member_view_avatars == 0 or ! $ibforums->vars['avatars_on'] or preg_match ( "/^noavatar/", $member_avatar ) )
{
return "";
}

if ( (preg_match ( "/\.swf/", $member_avatar)) and ($ibforums->vars['allow_flash'] != 1) )
{
return "";
}
thay bằng :
if (!$member_avatar or $member_view_avatars == 0 or !$ibforums->vars['avatars_on'])
{
return "<img src='{$ibforums->vars['img_url']}/nophoto.gif' border='0' alt='No avartar' />";
}

if (preg_match ( "/^noavatar/", $member_avatar ))
{
return "<img src='{$ibforums->vars['img_url']}/nophoto.gif' border='0' alt='No avartar' />";
}

if ( (preg_match ( "/\.swf/", $member_avatar)) and ($ibforums->vars['allow_flash'] != 1) )
{
return "<img src='{$ibforums->vars['img_url']}/nophoto.gif' border='0' alt='No avartar' />";
}

seller.credit
14-03-2006, 09:29 AM
9.Trả lời nhanh luôn mở!
Bật khung trả lời nhanh luôn mở!
Mở ./sources/topic.php
Tìm:
$sqr = $std->my_getcookie("open_qr");

Thay bằng:
$sqr = 1;

seller.credit
14-03-2006, 09:49 AM
10.Mod hiển thị cảnh cáo cho tất cả mọi người
Mod này cho phép tất cả các thành viên được phép xem cảnh cáo của nhau! Ko chỉ cá nhân và admin được xem mà thôi!
Mở sources/topics.php
Tìm :
if ( $ibforums->vars['warn_on'] and ( ! strstr( ','.$ibforums->vars['warn_protected'].',', ','.$member['mgroup'].',' ) ) )
{
if ( ( $ibforums->vars['warn_mod_ban'] AND $ibforums->member['_moderator'][ $this->topic['forum_id'] ]['allow_warn'] )
or ( $ibforums->member['g_is_supmod'] == 1 )
or ( $ibforums->vars['warn_show_own'] and ( $ibforums->member['id'] == $member['id'] ) )
)
{


Thay bằng:
if ( $ibforums->vars['warn_on'] and ( ! strstr( ','.$ibforums->vars['warn_protected'].',', ','.$member['mgroup'].',' ) ) )
{

{


Mở sources/profile.php
Tìm:
if ( $pass == 0 and ( $ibforums->vars['warn_show_own'] and ( $member['id'] == $ibforums->member['id'] ) ) )
{
$pass = 1;
}
Thay bằng:
if ( $pass == 0 )
{
$pass = 1;
}
Done!!!