Parašė si-acc-nx-metu· 2007 Lie. 21 22:07:40
#3
1.Issimk is winra[
[kuri prisegiau] aplankus ir idek i savo
ftp.
2.Atidaryk :
maincore.php
3.Rask sia eilute :
$link = dbconnect($db_host, $db_user, $db_pass, $db_name);
4.Ir pakeisk i sias eilutes :
include BASEDIR."includes/functions_db.php";
$db = new sql_db($db_host, $db_user, $db_pass, $db_name);
if(!$db->db_connect_id)
{
die("<div style='font-family:Verdana;font-size:11px;text-align:center;'><b>Unable to establish connection to MySQL</b><br>".mysql_errno()." : ".mysql_error()."</div>");
}
5.Surask sia eilute :
define("THEMES", BASEDIR."themes/");
6.Ir po ja idek sia ilute :
define("IMAGES_MD", INFUSIONS."medal_panel/images/");
7.Issaugojam.
8.Atidarom :
profile.php
9.Randam sia eilute :
include LOCALE.LOCALESET."user_fields.php";
10.Ir po ja idek si koda :
if(file_exists(INFUSIONS."medal_panel/locale/".$settings['locale'].".php"))
{
include(INFUSIONS."medal_panel/locale/".$settings['locale'].".php");
}
else
{
include(INFUSIONS."medal_panel/locale/Lithuanian.php");
}
include(INFUSIONS."medal_panel/medal_funcs.php");
11.Randam :
if ($data['user_groups']) {
tablebreak();
echo "<table align='center' cellpadding='0' cellspacing='1' width='400' class='tbl-border'>\n";
echo "<tr>\n<td class='tbl2'><b>".$locale['423']."</b></td>\n\n</tr>\n<tr>\n<td class='tbl1'>\n";
$user_groups = (strpos($data['user_groups'], ".") == 0 ? explode(".", substr($data['user_groups'], 1)) : explode(".", $data['user_groups']));
for ($i = 0;$i < count($user_groups);$i++) {
echo "<a href='".FUSION_SELF."?group_id=".$user_groups[$i]."'>".getgroupname($user_groups[$i])."</a>";
if ($i != (count($user_groups)-1)) { echo ",\n"; } else { echo "\n"; }
}
echo "</td>\n</tr>\n</table>\n";
}
12.Ir po ja ideksia si koda :
$medal_settings = get_medal_settings();
if( $medal_settings['m_status'] == '1' && $medal_settings['display_profile'] == '1' )
{
$result = $db->sql_query("SELECT cat_id, cat_title FROM ".$db_prefix."medal_cat ORDER BY cat_order");
$category_rows = array();
while ( $row = $db->sql_fetchrow($result) )
{
$category_rows[] = $row;
}
$result = $db->sql_query("SELECT m.medal_id, mu.user_id FROM ".$db_prefix."medal m, ".$db_prefix."medal_user mu WHERE mu.user_id = '" . $lookup . "' AND m.medal_id = mu.medal_id ORDER BY m.medal_name");
$medal_list = $db->sql_fetchrowset($result);
$medal_count = count($medal_list);
$i_a = 1;
if ( $medal_count )
{
tablebreak();
echo "<table class='tbl-border' width='400' cellspacing='1' cellpadding='3' align='center'>
<tr>
<td class='tbl2' align='center' height='28' colspan='2'><b><span class='gen'>".$locale['Medal_Information']."</span></b></td>
</tr>
<tr>
<td class='tbl2' align='left' valign='middle' width='10%'><span class='gen'>".$locale['Medals'].": <b>".$medal_count."</b></span><br><br><a name='medal'></a><div style='position:relative;'><table>";
for ($i = 0; $i <= count($category_rows); $i++)
{
$cat_id = $category_rows[$i]['cat_id'];
$cat_title = $category_rows[$i]['cat_title'];
$issue = "SELECT m.*, mu.issue_reason, mu.issue_time, c.cat_id, c.cat_title FROM ".$db_prefix."medal m, ".$db_prefix."medal_user mu, ".$db_prefix."medal_cat c WHERE mu.user_id = '" . $lookup . "' AND m.cat_id = c.cat_id AND m.medal_id = mu.medal_id ORDER BY c.cat_order, m.medal_name, mu.issue_time";
$result = $db->sql_query($issue);
if (dbrows($result))
{
$row = array();
$rowset = array();
$medal_time = $locale['Medal_time'] . ': ';
$medal_reason = $locale['Medal_reason'] . ': ';
while ($row = $db->sql_fetchrow($result))
{
if (empty($rowset[$row['medal_name']]))
{
$rowset[$row['medal_name']]['cat_id'] = $row['cat_id'];
$rowset[$row['medal_name']]['cat_title'] = $row['cat_title'];
$rowset[$row['medal_name']]['medal_description'] .= $row['medal_description'];
$rowset[$row['medal_name']]['medal_image'] = $row['medal_image'];
$row['issue_reason'] = ( $row['issue_reason'] ) ? $row['issue_reason'] : $locale['Medal_no_reason'];
$rowset[$row['medal_name']]['medal_issue'] = "<tr><td><span class='genmed'>" . $medal_time . showdate('longdate', $row['issue_time']) . "</span></td></tr><tr><td><span class='genmed'>" . $medal_reason . $row['issue_reason'] . "</span><hr></td></tr>";
$rowset[$row['medal_name']]['medal_count'] = '1';
}
else
{
$row['issue_reason'] = ( $row['issue_reason'] ) ? $row['issue_reason'] : $locale['Medal_no_reason'];
$rowset[$row['medal_name']]['medal_issue'] .= "<tr><td><span class='genmed'>" . $medal_time . showdate('longdate', $row['issue_time']) . "</span></td></tr><tr><td><span class='genmed'>" . $medal_reason . $row['issue_reason'] . "</span><hr /></td></tr>";
$rowset[$row['medal_name']]['medal_count'] += '1';
}
}
$medal_name = array();
$data = array();
$display_medal = 0;
$last_cat_id = 0;
while (list($medal_name, $data) = @each($rowset))
{
if ( $cat_id == $data['cat_id'] ) { $display_medal = 1; }
if($cat_id != $last_cat_id) { echo "<td>";}
if ( !empty($display_medal) )
{
echo "<a href=\"javascript:ShowHide('medalDIV".$i_a."')\"><img src='". IMAGES_MD . $data['medal_image'] . "' border='0' alt='" . $medal_name . "' title='" . $medal_name . "'></a>";
echo "<div id='medalDIV".$i_a."' style='visibility:hidden;position:absolute;z-index:".$i.";left:0px; top:-100px;width:570;'><table class='tbl-border' width='100%' cellspacing='1' cellpadding='3' border='0' align='center'>
<tr>
<th class='thCornerL' align='center' nowrap='nowrap' width='20%'> ".$locale['Medal_name']." </th>
<th class='thCornerR' align='center' nowrap='nowrap'> ".$locale['Medal_details']."</th>
</tr>
<tr>
<td class='tbl2' nowrap='nowrap'>
<table width='100%' cellspacing='1' cellpadding='3' border='0'>
<tr><td align='center'><span class='gen'>".$data['cat_title']."</span></td></tr>
<tr><td align='center'><span class='genmed'>".$medal_name."</span></td></tr>
<tr><td align='center'><img src='". IMAGES_MD . $data['medal_image'] . "' border='0' alt='" . $medal_name . "' title='" . $medal_name . "'> </td></tr>
<tr><td align='center'><span class='gensmall'>".$locale['Medal_amount'].$data['medal_count']."</span></td></tr></table></td>
<td class='tbl2' valign='top'>
<table width='100%' cellspacing='1' cellpadding='3' border='0'>
<tr><td><span class='gen'>".$locale['Medal_description'].": <b>".$data['medal_description']."</b></span></td></tr>
<tr><td class='tbl2'>
<table width='100%' cellspacing='1' cellpadding='3' border='0'>
<tr><td><span class='genmed'>".$data['medal_issue']."</span></td></tr>
<tr><td align='right'><a href=\"javascript:ShowHide('medalDIV".$i_a."')\">Close</a></td></tr>
</table>
</td></tr>
</table></td>
</tr></table></div>";
$display_medal = 0;
$i_a++;
}
$last_cat_id = $cat_id;
}
echo "</td>";
}
}
echo "</table></div></td></tr></table>";
}
}
13.Randam sia eilute :
require_once "side_right.php";
require_once "footer.php";
?>
14.Ir pres ja idedam si koda :
echo "<script type='text/javascript'>
function ShowHide(id)
{
obj = document.getElementsByTagName(\"div\");
if (obj[id].style.visibility == 'visible')
{
obj[id].style.visibility = 'hidden';
}
else
{
obj[id].style.visibility = 'visible';
}
}
</script>\n";
15.Issaugojam.
16.Atidarom :
forum/viewthread.php
17.Randam sia eilute :
include LOCALE.LOCALESET."forum/main.php";
18.Ir idedam po ja si koda :
if(file_exists(INFUSIONS."medal_panel/locale/".$settings['locale'].".php"))
{
include(INFUSIONS."medal_panel/locale/".$settings['locale'].".php");
}
else
{
include(INFUSIONS."medal_panel/locale/Lithuanian.php");
}
include(INFUSIONS."medal_panel/medal_funcs.php");
19.Randam sia eilute :
echo "<span class='alt'>".$locale['504']."</span> ".showdate("%d.%m.%y", $data['user_joined'])."</td>
19.Keiciam i si koda :
echo "<span class='alt'>".$locale['504']."</span> ".showdate("%d.%m.%y", $data['user_joined'])."<br><br>";
20.Ir po ja idedam si koda :
echo "<span class='alt'>".$locale['504']."</span> ".showdate("%d.%m.%y", $data['user_joined'])."<br><br>";
21.Randam sia eilute :
<td>
<table cellspacing='0' cellpadding='0' width='100%'>
22.Keciaim i sia eilute :
echo "</td><td>
<table cellspacing='0' cellpadding='0' width='100%'>
23.Issaugojam.
24.Idedam visu failus kurios redagavom.
25.Idegiam ir naudojames.
P.S.Tikiosiu padejau
sorry kat ne lietuviskom raidem rasau.