Parašė Enzo· 2007 Gru. 7 17:12:01
#8
Negi taip sunku? Va lietuviškai paaiškinsiu:
Atsisiųsk šiuos failus
# administration/forums.php
# forum/index.php
# forum/options.php
# forum/post.php
# forum/postedit.php
# forum/postnewthread.php
# forum/postreply.php
# forum/viewthread.php
# locale/Lithuanian/admin/forums.php
Pasidaryk jų kopijas
Eini į administration/forums.php
Surandi: opentable($locale['408']);
Apačioje jo dedi:
$result = dbquery("SELECT group_id, group_name FROM ".$db_prefix."user_groups ORDER BY group_name");
while ($data3 = dbarray($result)) {
$group_id = $data3['group_id'];
if (!preg_match("(^G{$group_id}$|^G{$group_id}\.|\.G{$group_id}\.|\.G{$group_id}$)", $data['forum_moderators'])) {
$mods3_group_id[] = "G".$data3['group_id'];
$mods3_group_name[] = $data3['group_name'];
} else {
$mods4_group_id[] = "G".$data3['group_id'];
$mods4_group_name[] = $data3['group_name'];
}
unset($group_id);
}
Surandi <table align='center' cellpadding='0' cellspacing='0' class='tbl'>
Ʋemiau jo dedi: <tr>
<td>".$locale['UGM_400']."</td>
</tr>
<tr>
<td>
<select multiple size='15' name='modlist3' id='modlist3' class='textbox' style='width:150' onChange=\"addUser('modlist4','modlist3');\">\n";
for ($i=0;$i < count($mods3_group_id);$i++) echo "<option value='".$mods3_group_id[$i]."'>".$mods3_group_name[$i]."</option>\n";
echo "</select>
</td>
<td align='center' valign='middle'>
</td>
<td>
<select multiple size='15' name='modlist4' id='modlist4' class='textbox' style='width:150' onChange=\"addUser('modlist3','modlist4');\">\n";
for ($i=0;$i < count($mods4_group_id);$i++) echo "<option value='".$mods4_group_id[$i]."'>".$mods4_group_name[$i]."</option>\n";
echo "</select>
</td>
</tr>
<tr>
<td><br />".$locale['UGM_401']."</td>
</tr>
Surandi: var strValues = \"\";
var boxLength = document.getElementById('modlist2').length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues = document.getElementById('modlist2').options.value;
} else {
strValues = strValues + \".\" + document.getElementById('modlist2').options[i].value;
}
count++;
}
}
Pakeiti jį: var strValuesG = \"\";
var boxLength = document.getElementById('modlist4').length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValuesG = document.getElementById('modlist4').options[i].value;
} else {
strValuesG = strValuesG + \".\" + document.getElementById('modlist4').options[i].value;
}
count++;
}
}
var strValuesU = \"\";
var boxLength = document.getElementById('modlist2').length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValuesU = document.getElementById('modlist2').options[i].value;
} else {
strValuesU = strValuesU + \".\" + document.getElementById('modlist2').options[i].value;
}
count++;
}
}
if (strValuesG.length == 0) {
strValues = strValuesU;
} else if(strValuesU.length == 0) {
strValues = strValuesG;
} else {
strValues = strValuesG + \".\" + strValuesU;
}
Išsaugai ir uždarai
Atsidarai forum/index.php
Surandi $res = "user_id='".str_replace(".", "' OR user_id='", $data['forum_moderators'])."'";
$result2 = dbquery("SELECT user_id,user_name FROM ".$db_prefix."users WHERE (".$res.")");
while ($data2 = dbarray($result2)) {
if ($moderators) $moderators .= ", ";
$moderators .= "<a href='".BASEDIR."profile.php?lookup=".$data2['user_id']."'>".$data2['user_name']."</a>";
}
Keiti į: $groupmods = array(); $usermods = array();
$forum_mods = explode(".", $data['forum_moderators']);
for($i = 0; $i < count($forum_mods); $i ++) {
if (!isnum($forum_mods[$i])) { $groupmods[] = substr($forum_mods[$i], 1); }
else { $usermods[] = $forum_mods[$i]; }
}
if (count($groupmods) != 0) {
$res = "group_id='".implode("' OR group_id='", $groupmods)."'";
$result2 = dbquery("SELECT group_id, group_name FROM ".$db_prefix."user_groups WHERE (".$res.") ORDER BY group_name");
while ($data2 = dbarray($result2)) {
if ($moderators) $moderators .= ", ";
$moderators .= "<a href='".BASEDIR."profile.php?group_id=".$data2['group_id']."'>".$data2['group_name']."</a>";
}
}
if (count($usermods) != 0) {
$res = "user_id='".implode("' OR user_id='", $usermods)."'";
$result2 = dbquery("SELECT user_id, user_name FROM ".$db_prefix."users WHERE (".$res.") ORDER BY user_level DESC, user_name ASC");
while ($data2 = dbarray($result2)) {
if ($moderators) $moderators .= ", ";
$moderators .= "<a href='".BASEDIR."profile.php?lookup=".$data2['user_id']."'>".$data2['user_name']."</a>";
}
}
Išsaugai ir uždarai
Atsidarai forum/options.php
Surandi: if (in_array($userdata['user_id'], $forum_mods)) { define("iMOD", true); } else { define("iMOD", false); }
Keiti į function UGMODS_groupcheck($mods) {
$results = 0;
for($i = 0; $i < count($mods); $i ++) {
if (substr($mods[$i], 1) > "" && checkgroup(substr($mods[$i], 1))) { $results ++; break; }
}
if ($results != 0) { return true; } else { return false; }
}
if (in_array($userdata['user_id'], $forum_mods) || UGMODS_groupcheck($forum_mods)) { define("iMOD", true); } else { define("iMOD", false); }
Išsaugai ir uždarai
Atsidarai forum/post.php
Surandi if (iMEMBER && in_array($userdata['user_id'], $forum_mods)) { define("iMOD", true); } else { define("iMOD", false); }
Keiti į function UGMODS_groupcheck($groups, $mods) {
$results = 0;
for($i = 0; $i < count($mods); $i ++) {
if (substr($mods[$i], 1) > "" && in_array(substr($mods[$i], 1), explode(".", $groups))) { $results ++; break; }
}
if ($results != 0) { return true; } else { return false; }
}
if (iMEMBER && (in_array($userdata['user_id'], $forum_mods) || UGMODS_groupcheck($userdata['user_groups'], $forum_mods))) { define("iMOD", true); } else { define("iMOD", false); }
Išsaugai ir uždarai
Atsidarai forum/postedit.php
Surandi $is_mod = in_array($udata['user_id'], $forum_mods) && $udata['user_level'] < "102" ? true : false;
Keiti į $is_mod = (in_array($udata['user_id'], $forum_mods) || UGMODS_groupcheck($udata['user_groups'], $forum_mods)) && $udata['user_level'] < "102" ? true : false;
Išsaugai ir uždarai
Atsidarai forum/postnewthread.php
Surandi $is_mod = iMOD && iUSER < "102" ? true : false;
Keiti į $is_mod = (iMOD || UGMODS_groupcheck($data['user_groups'], $forum_mods)) && iUSER < "102" ? true : false;
Išsaugai ir uždarai
Atsidarai forum/postreply.php
Surandi $is_mod = iMOD && iUSER < "102" ? true : false;
Po juo dedi $is_mod = (iMOD || UGMODS_groupcheck($data['user_groups'], $forum_mods)) && iUSER < "102" ? true : false;
Išsaugai ir uždarai
Atsidarai forum/viewthread.php
Surandi if (iMEMBER && in_array($userdata['user_id'], $forum_mods)) { define("iMOD", true); } else { define("iMOD", false); }
Keiti į function UGMODS_groupcheck($groups, $mods) {
$results = 0;
for($i = 0; $i < count($mods); $i ++) {
if (substr($mods[$i], 1) > "" && in_array(substr($mods[$i], 1), explode(".", $groups))) { $results ++; break; }
}
if ($results != 0) { return true; } else { return false; }
}
if (iMEMBER && (in_array($userdata['user_id'], $forum_mods) || UGMODS_groupcheck($userdata['user_groups'], $forum_mods))) { define("iMOD", true); } else { define("iMOD", false); }
Surandi $is_mod = in_array($data['user_id'], $forum_mods) && $data['user_level'] < "102" ? true : false;
Keiti į $is_mod = (in_array($data['user_id'], $forum_mods) || UGMODS_groupcheck($data['user_groups'], $forum_mods)) && $data['user_level'] < "102" ? true : false;
Išsaugai ir uždarai
Atsidarai locale/Lithuanian/admin/forums.php
Surandi ?>
Prieš jį dedi // Usergroups As Mods
$locale['UGM_400'] = "Grupės";
$locale['UGM_401'] = "Nariai";
Išsaugai ir uždarai
[i]Tada viską sukelk į FTP ir viskas.