Установил этот мод но не знаю как поменять англиский на русский(что надо поменять на русские слова) подскажите?
#Karma Mod- by countach44
#root@countach44.mine.nu
#
#Sorry for this being poorly written, but hey, at least it's written
#Sql queries: 2
#
#
ALTER TABLE `phpbb_users` ADD `karma` MEDIUMINT DEFAULT '0' NOT NULL ;
ALTER TABLE `phpbb_users` ADD `karma_time` BIGINT DEFAULT '0' NOT NULL ;
#where 'phpbb_' is your $table_prefix
#New files:1
# $PHPBBROOT/karma.php
#
#Files to edit:4
# includes/usercp_viewprofile.php
# $PHPBBROOT/viewtopic.php
# templates/"template"/profile_view_body.tpl
# templates/"template"/viewtopic_body.tpl
# open includes/usercp_viewprofile.php
#before:
#
//
// Calculate the number of days this user has been a member ($memberdays)
// Then calculate their posts per day
#
#add:
//Fetch karma
$sql = "select karma from " . USERS_TABLE . " where username='$profiledata[username]'";
$result = $db->sql_query($sql);
$array = mysql_fetch_array($result);
$karma = $array[0];
#after:
#
#'JOINED' => create_date($lang['DATE_FORMAT'], $profiledata['user_regdate'], $board_config['board_timezone']),
#
#add:
'KARMA' => $karma,
#Save: usercp_viewprofile.php
#Open: $PHPBBROOT/viewtopic.php
#before:
#//
#// Again this will be handled by the templating
#// code at some point
#//
#
#Add:
//Fetch karma
$sql = "select karma from " . USERS_TABLE . " where username='$poster'";
$result = $db->sql_query($sql);
$array = mysql_fetch_array($result);
$karma = $array[0];
#
#After:
'POSTER_JOINED' => $poster_joined,
#Add:
'POSTER_KARMA' => $karma,
#Save: viewtopic.php
#Open: templates/x/profile_view_body.tpl
#where x == each template
#before (Or anywhere around here...)
#
# <tr>
# <td valign="middle" align="right" nowrap="nowrap"><span class="gen">{L_EMAIL_ADDRESS}:</span></td>
# <td class="row1" valign="middle" width="100%"><b><span class="gen">{EMAIL_IMG}</span></b></td>
# </tr>
#
#
#Add:
<tr>
<td valign="middle" align="right" nowrap="nowrap"><span class="gen">Karma:</span></td>
<td class="row1" valign="middle" width="100%"><span class="gen">{KARMA}</span></td>
</tr>
#Save: templates/x/profile_view_body.tpl
#Open: templates/x/viewtopic_body.tpl
#
#In same line after {postrow.POSTER_POSTS}<br />
#
#Add:
<font size=1>Karma: {postrow.POSTER_KARMA}<br /><a href="karma.php?x=applaud&u={postrow.POSTER_ID}&t={TOPIC_ID}">applaud</a> / <a href="karma.php?x=smite&u={postrow.POSTER_ID}&t={TOPIC_ID}">smite</a></font><br />
#Save: templates/x/viewtopic_body.tpl
#If voting doesn't work do this:
#Open $PHPBBROOT/viewtopic.php
#After
'POSTER_NAME' => $poster,
#Add
'POSTER_ID' => $poster_id,
#Save $PHPBBROOT/viewtopic.php
Что надо перевести?
-
- phpBB 1.4.1
- Сообщения: 40
- Стаж: 20 лет 1 месяц
-
- Поддержка
- Сообщения: 5426
- Стаж: 20 лет 3 месяца
- Откуда: Питер
- Благодарил (а): 177 раз
- Поблагодарили: 749 раз
Kovalev
в приведённом коде нет локализации.. Может в моде есть языковые файлы? lang_....php?
в приведённом коде нет локализации.. Может в моде есть языковые файлы? lang_....php?
Еще одно нарушение правил и будете забанены. © Mr. Anderson
Ты очистил кеш? © Sheer
https://siava.ru (phpbb2.0.x 3.5.x)
Ты очистил кеш? © Sheer
https://siava.ru (phpbb
-
- phpBB 1.0.0
- Сообщения: 4
- Стаж: 20 лет
- Откуда: Nizhny Novgorod
-
- phpBB 1.4.1
- Сообщения: 40
- Стаж: 20 лет 1 месяц
Есть еще один фаил каторый надо заливать!
вот он
<?php
#
#Karma mod-
#
unset($x);
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//Taken from login.php
//
// Set page ID for session management
//
$userdata = session_pagestart($user_ip, PAGE_LOGIN);
init_userprefs($userdata);
//
// End session management
//
//echo $username;
$user = $_GET['u']; //UserID of victim
$x = $_GET['x']; // applaud or smite
if($x == "applaud")
{
$x = 1;
}
else
{
$x = -1;
}
if(!$userdata['session_logged_in'])
{
header('Location: login.php');
}
else
{
global $db;
$sql = "select karma_time from " . USERS_TABLE . " where user_id='$userdata[user_id]'"; //get last time user tried a karma vote
$result = $db->sql_query($sql);
$array = mysql_fetch_array($result);
$time_old = $array[0];
$sql = "select user_id from " . USERS_TABLE . " where user_id='$userdata[user_id]'";//make sure no one votes for themselves
$result = $db->sql_query($sql);
$array = mysql_fetch_array($result);
$voter_id = $array[0];
if($voter_id == $user)
{
@exit("<a href=viewtopic.php?t=".$_GET['t'].">Can't vote for self</a>");
}
else
{
$time = time();
$diff = $time - $time_old;
if($diff >= 3600 || $userdata['user_level'] > 0) //make sure they haven't voted in the last hour or if they're a mod or admin, they can continue
{
$sql = "select karma from " . USERS_TABLE . " where user_id='$user'"; //find the victim
$result = $db->sql_query($sql);
$array = mysql_fetch_array($result);
$karma = $array[0];
$karma += $x; //change the karma based on appluad or smite.
//update the database with current time() for voter
$karma_update = "update " . USERS_TABLE . " set karma ='$karma' where user_id='$user'";
$time_update = "update " . USERS_TABLE . " set karma_time ='$time' where user_id ='$userdata[user_id]'";
$result = $db->sql_query($karma_update);
$time_result = $db->sql_query($time_update);
if($result&&$time_result) //Both gotta happen...
{
if(!isset($_GET['t']))
{
header('Location: index.php');
break;
}
else
{
header('Location: viewtopic.php?t='.$_GET['t']);
}
}
else
{
echo "<p>Foo</p>";
echo "<a href=index.php>Return to index</a>";
return;
}
}
else
{
echo "<HTML>";
echo "Too soon from last karma vote, <a href=index.php>Return to forums</a>";
echo "</HTML>";
}
}
}
?>
вот он
<?php
#
#Karma mod-
#
unset($x);
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//Taken from login.php
//
// Set page ID for session management
//
$userdata = session_pagestart($user_ip, PAGE_LOGIN);
init_userprefs($userdata);
//
// End session management
//
//echo $username;
$user = $_GET['u']; //UserID of victim
$x = $_GET['x']; // applaud or smite
if($x == "applaud")
{
$x = 1;
}
else
{
$x = -1;
}
if(!$userdata['session_logged_in'])
{
header('Location: login.php');
}
else
{
global $db;
$sql = "select karma_time from " . USERS_TABLE . " where user_id='$userdata[user_id]'"; //get last time user tried a karma vote
$result = $db->sql_query($sql);
$array = mysql_fetch_array($result);
$time_old = $array[0];
$sql = "select user_id from " . USERS_TABLE . " where user_id='$userdata[user_id]'";//make sure no one votes for themselves
$result = $db->sql_query($sql);
$array = mysql_fetch_array($result);
$voter_id = $array[0];
if($voter_id == $user)
{
@exit("<a href=viewtopic.php?t=".$_GET['t'].">Can't vote for self</a>");
}
else
{
$time = time();
$diff = $time - $time_old;
if($diff >= 3600 || $userdata['user_level'] > 0) //make sure they haven't voted in the last hour or if they're a mod or admin, they can continue
{
$sql = "select karma from " . USERS_TABLE . " where user_id='$user'"; //find the victim
$result = $db->sql_query($sql);
$array = mysql_fetch_array($result);
$karma = $array[0];
$karma += $x; //change the karma based on appluad or smite.
//update the database with current time() for voter
$karma_update = "update " . USERS_TABLE . " set karma ='$karma' where user_id='$user'";
$time_update = "update " . USERS_TABLE . " set karma_time ='$time' where user_id ='$userdata[user_id]'";
$result = $db->sql_query($karma_update);
$time_result = $db->sql_query($time_update);
if($result&&$time_result) //Both gotta happen...
{
if(!isset($_GET['t']))
{
header('Location: index.php');
break;
}
else
{
header('Location: viewtopic.php?t='.$_GET['t']);
}
}
else
{
echo "<p>Foo</p>";
echo "<a href=index.php>Return to index</a>";
return;
}
}
else
{
echo "<HTML>";
echo "Too soon from last karma vote, <a href=index.php>Return to forums</a>";
echo "</HTML>";
}
}
}
?>
Моргающую откровенную рекламу мы не любим...