Potrebujete preložiť mód, či hack? Pomôžeme vám
Moderátor: Moderátori
od dexter-svk » Sob Sep 01, 2007 8:20 am
Pls prelozil by mi niekto tento mod ? (staci cast s lang aby bol mod po slovensky ostatne netreba )
- Kód: Vybrať všetko
########################################################
## Mod Title: Medal System
## MOD Author: ycl6 < ycl6@users.sourceforge.net > (Y.C. LIN) http://macphpbbmod.sourceforge.net/
## MOD Description: This mod is a complete Medal system for your phpBB forum.
## It consists:
## A ACP medal management panel
## A Medal Listing page to display all medal information
## A Medal moderator management panel for adding/removing medal from users
## An e-mail is sent to user receiving the medal
## Display amount of medal a user holds on viewtopic and profile page
## Mod Version: 0.4.6
##
## Installation Level: Intermediate
## Installation Time: 10 Minutes
##
## Files To Edit: 12
## viewonline.php
## viewtopic.php
## includes/constants.php
## includes/functions.php
## includes/page_header.php
## includes/usercp_viewprofile.php
## language/lang_english/lang_main.php
## language/lang_english/lang_admin.php
## templates/subSilver/viewtopic_body.tpl
## templates/subSilver/profile_view_body.tpl
## templates/subSilver/overall_header.tpl
## templates/subSilver/subSilver.cfg
##
## Included Files: 17 (+ 24 images)
## root/medals.php
## root/medalcp.php
## root/medalcp_edit.php
## root/admin/admin_medal.php
## root/admin/admin_medal_cfg.php
## root/language/lang_english/email/medal_added.tpl
## root/templates/toggle.js
## root/templates/subSilver/medals_body.tpl
## root/templates/subSilver/medalcp_body.tpl
## root/templates/subSilver/medalcp_edit_body.tpl
## root/templates/subSilver/images/icon_mini_medal.gif
## root/templates/subSilver/admin/medal_config_body.tpl
## root/templates/subSilver/admin/medal_delete_body.tpl
## root/templates/subSilver/admin/medals_edit_body.tpl
## root/templates/subSilver/admin/medals_editcat_body.tpl
## root/templates/subSilver/admin/medals_list_body.tpl
## root/templates/subSilver/admin/medals_moderator_body.tpl
## root/medals/*.gif
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
#################################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## Please READ the "Usage Guide" found in EXTRA folder for FAQ/Tips
##
## Special thanks to Gremlinn and other supporters of this MOD
##
##############################################################
## MOD History:
##
## 2003-10-21 - Version 0.0.1 { a.k.a 1.0.0 in the older release files}
## - Initial Release
##
## 2003-11-02 - Version 0.0.2 { a.k.a 1.0.1 in the older release files}
## - Fix image display path in medals.php
## - 2 small changes to medals_body.tpl
##
## 2003-11-02 - Version 0.0.3 { a.k.a 1.0.2 in the older release files}
## - Fix sql statement in admin_medal.php
## - A change in the lang_admin.php
##
## 2003-11-03 - Version 0.1.0 { a.k.a 1.1.0 in the older release files}
## - Allow admin to choose showing medal images in viewtopic or not
## - All admin to configure number of rows & column in the viewtopic display
## - Change medal display in profile, if no medal, medal table does not appear
##
## 2003-11-07 - Version 0.1.1 { a.k.a 1.1.1 in the older release files}
## - Upgraded to 2.0.6 competible
## - Only 2 minor changes in medalcp.php, and 1 change in the installation guide
## for usercp_viewprofile.php
##
## 2004-03-24 - Version 0.2.0 { a.k.a 2.0.0 in the older release files}
## - Major re-write of this MOD, 1.1.1 is NOT upgradable to 2.0.0
## because of the change in database design
## - What's New:
## * In ACP, Medal Configuration & Medal Management
## * In ACP Medal Management, Add, Delete & Edit Medal, Add & Delete Medal Moderator(s)
## * Medals.php for overall Medal & User Listing
## * Moderator(s) can enter Medal Control Panel to Award & Delete User
## * Moderator can edit Award Reason for each award occasion for each user
## * Viewtopic Medal Display with image number and size control
## from ACP Medal Configuration
## * Viewprofile Medal History for the particular user
##
## 2004-03-26 - Version 0.2.1 { a.k.a 2.0.1 in the older release files}
## - Security updates
## - Fix 2 bugs in medalcp.php
##
## 2004-04-03 - Version 0.2.2 { a.k.a 2.0.2 in the older release files}
## - Bug Fixs in medalcp.php & admin_medal.php
## - Fix Medal Count Display in Viewtopic for Guests
## - Two Chinese language change in lang_admin.php
##
## 2004-04-08 - Version 0.3.0 { a.k.a 2.1.0 in the older release files}
## - Bug Fixs in viewtopic.php & usercp_viewprofile.php
## - Added image randomize feature to Viewtopic, config in ACP
##
## 2004-08-11 - Version 0.4.0 { a.k.a 2.2.0 in the older release files}
## - Fix template Actions synthax (Thanks to silvercloud @ phpBB.com)
## - Fix image path in Viewtopic & Usercp_viewprofile
## - Optimize & fix admin_medal_cfg.php sql query
## - Added Medal Category and Category Order fuction
##
## 2004-08-12 - Version 0.4.1 { a.k.a 2.2.1 in the older release files}
## - Added the forgotten toggle.js modification step in UPGRADE guide
##
## 2004-08-14 - Version 0.4.2 { a.k.a 2.2.2 in the older release files}
## - Fix non-admin medal moderator can't see medalcp link problem
##
## 2005-09-25 - Version 0.4.3 { a.k.a 2.2.3 in the older release files}
## - Fix some bugs and re-wrote some bits of script
## - Added an add-on to remove toggle button effect from viewprofile
##
## 2005-12-06 - Version 0.4.4
## - Fix a problem concerning issuing medal to user that has a username consists of numbers
## (changes in medalcp.php only)
## - Change parts of the SQL syntax to add NOT NULL to a few places and removed "TYPE=MyISAM"
##
## 2005-12-07 - Version 0.4.5
## - Fix an error in a switch (thanks to ¤ßĆF®·¤â from phpbb-tw)
## - Fix type-errors in Chinese lang file (thanks to ¤ßĆF®·¤â from phpbb-tw)
##
## 2006-04-04 - Version 0.4.6
## - Fix a few language errors
## - Fix toogle button to allow make it work in Firefox (thanks to ¤ßĆF®·¤â from phpbb-tw)
## - Fix a bug with empty username in medalcp.php
## - Fix a bug with dropdown list ordering bug in admin_medal.php
## - Fix a bug with the showing of category in medals.php
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ COPY ]------------------------------------------
#
copy root/medals.php to medals.php
copy root/medalcp.php to medalcp.php
copy root/medalcp_edit.php to medalcp_edit.php
copy root/language/lang_english/email/medal_added.tpl to language/lang_english/email/medal_added.tpl
copy root/admin/*.* to admin/
copy root/templates/toggle.js to templates/toggle.js
copy root/templates/subSilver/*.* to templates/subSilver/*.*
copy root/medals/*.gif to medals/*.gif
#
#-----[ SQL ]------------------------------------------
#
# Remember to change the table prefix used on your database
CREATE TABLE `phpbb_medal` (
`medal_id` mediumint(8) UNSIGNED NOT NULL auto_increment,
`cat_id` mediumint(8) UNSIGNED NOT NULL default '1',
`medal_name` varchar(40) NOT NULL,
`medal_description` varchar(255) NOT NULL,
`medal_image` varchar(40) NULL,
PRIMARY KEY (`medal_id`)
);
CREATE TABLE `phpbb_medal_user` (
`issue_id` mediumint(8) UNSIGNED NOT NULL auto_increment,
`medal_id` mediumint(8) UNSIGNED NOT NULL,
`user_id` mediumint(8) UNSIGNED NOT NULL,
`issue_reason` varchar(255) NOT NULL,
`issue_time` int(11) NOT NULL,
PRIMARY KEY (`issue_id`)
);
CREATE TABLE `phpbb_medal_mod` (
`mod_id` mediumint(8) UNSIGNED NOT NULL auto_increment,
`medal_id` mediumint(8) UNSIGNED NOT NULL,
`user_id` mediumint(8) UNSIGNED NOT NULL,
PRIMARY KEY (`mod_id`)
);
CREATE TABLE `phpbb_medal_cat` (
`cat_id` mediumint(8) UNSIGNED NOT NULL auto_increment,
`cat_title` varchar(100) NOT NULL,
`cat_order` mediumint(8) UNSIGNED NOT NULL default '0',
PRIMARY KEY (`cat_id`),
KEY `cat_order` (`cat_order`)
);
INSERT INTO `phpbb_config` VALUES ('allow_medal_display', '0');
INSERT INTO `phpbb_config` VALUES ('medal_display_row', '1');
INSERT INTO `phpbb_config` VALUES ('medal_display_col', '1');
INSERT INTO `phpbb_config` VALUES ('medal_display_width', '');
INSERT INTO `phpbb_config` VALUES ('medal_display_height', '');
INSERT INTO `phpbb_config` VALUES ('medal_display_order', '');
INSERT INTO `phpbb_medal_cat` VALUES ('1', 'Default', '10');
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Medal MOD
$lang['Medal_Control_Panel'] = 'Medal Control Panel';
$lang['Medals'] = 'Medals';
$lang['View_More'] = 'View more...';
$lang['Medal_amount'] = 'Amount: ';
$lang['Medal_Information'] = 'Medal Information';
$lang['Medal_name'] = 'Medal Name';
$lang['Medal_description'] = 'Medal Description';
$lang['Medal_image'] = 'Medal Image';
$lang['Medal_details'] = 'Award Details';
$lang['Medal_reason'] = 'Awarded Reason';
$lang['Medal_reason_explain'] = 'You can give a reason to why this medal this awarded to this user at this time.<br />This is not compulsory';
$lang['Medal_no_reason'] = '<i>No Reason was given</i>';
$lang['Medal_time'] = 'Awarded Time';
$lang['Medal_moderator'] = 'Medal Moderator';
$lang['No_medal_mod'] = 'No Medal Moderator';
$lang['Medal_userlist'] = 'User Lists';
$lang['Medal_Members'] = 'Members having this medal';
$lang['Medal_Members_explain'] = 'Click on the username to edit award reason(s)';
$lang['No_medal_members'] = 'No member has this medal';
$lang['No_medals_exist'] = 'No Medals Exist';
$lang['Medal_not_exist'] = 'That medal does not exist';
$lang['No_username_specified'] = 'No username specified';
$lang['No_medal_id_specified'] = 'No Medals specified';
$lang['Medal_user_username'] = 'Award one or more specific users with this Medal';
$lang['Medal_unmedal_username'] = 'Remove this Medal from one or more specific users';
$lang['Medal_unmedal_username_explain'] = 'You can remove multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser';
$lang['Medal_added'] = 'You have been awarded this medal.';
$lang['Medal_update_sucessful'] = 'User and Medal information has been updated';
$lang['Could_not_anonymous_user'] = 'You cannot give Anonymous a medal.';
$lang['Not_medal_moderator'] = 'You are not a moderator of this medal';
$lang['Link_to_cp'] = 'Medal Control Panel';
$lang['Click_return_medal'] = 'Click %sHere%s to return to medal information';
$lang['No_medal'] = 'No Medal Available';
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Medal MOD
$lang['Medals'] = 'Medal Admin';
$lang['Manage'] = 'Management';
$lang['Medal_Config'] = 'Medal Configuration';
$lang['Medal_Config_explain'] = 'The form below will allow you to customize all the general medal options.';
$lang['Medal_setting'] = 'Medal Setting';
$lang['Allow_medal'] = 'Allow Medal Display in Viewtopic';
$lang['Medal_rand'] = 'Allow Random Medal Image in Viewtopic';
$lang['Medal_rand_explain'] = 'Image will displayed in random order, only work if you allow medal display in viewtopic';
$lang['Medal_display'] = 'Medal table (Rows x Columns)';
$lang['Medal_display_explain'] = 'Define how many rows and columns the medal table in <b>viewtopic</b>.<br />E.g. 1 row and 1 column display 1 image, and 1 row 2 columns display 2 images. <br />Make sure you set this correctly so it does not distort or introduce extra spaces your viewtopic.';
$lang['Medal_size'] = 'Maximum Medal Dimensions in Viewtopic';
$lang['Medal_size_explain'] = '(Height x Width in pixels)<br />If blank, images will display in it\'s original size';
$lang['Click_return_medalcfg'] = 'Click %sHere%s to return to Medal Configuration.';
$lang['Medal_admin'] = 'Medal Administration';
$lang['Medal_admin_explain'] = 'From this panel you can administer all your medals. You can delete, create and edit existing medals. You may choose moderators and set the medal name and description';
$lang['Updated_medal'] = 'Medal was successfully updated';
$lang['Updated_medal_category'] = 'Medal category was successfully updated';
$lang['Added_new_medal'] = 'New medal was successfully created';
$lang['Added_new_category'] = 'New medal category was successfully created';
$lang['Deleted_medal'] = 'Medal was successfully deleted';
$lang['Deleted_medal_category'] = 'Medal category was successfully deleted';
$lang['New_medal'] = 'Create new medal';
$lang['medal_name'] = 'Medal name';
$lang['medal_description'] = 'Medal description';
$lang['medal_image'] = 'Medal Image';
$lang['medal_image_explain'] = 'Use this to define a image associated with the medal<br />(Relative to phpBB2 root path)';
$lang['No_medal_name'] = 'You must specify a name for this medal';
$lang['No_medal_description'] = 'You must specify a description for this medal';
$lang['No_medal_image'] = 'You must specify an image for this medal';
$lang['Must_select_medal'] = 'Must specify a medal';
$lang['Click_return_medaladmin'] = 'Click %sHere%s to return to Medal Administration.';
$lang['Medal_mod'] = 'Medal Moderator';
$lang['Medal_mod_admin'] = 'Medal Moderator Administration';
$lang['Medal_mod_admin_explain'] = 'From this panel you can appoint medal moderators for your medals.';
$lang['Medal_mod_username'] = 'Appoint one or more specific users to be Medal Moderator';
$lang['Medal_unmod_username'] = 'Remove one or more specific users from Medal Moderator';
$lang['Medal_unmod_username_explain'] = 'You can remove multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser';
$lang['No_medal_mod'] = 'No Medal Moderator';
$lang['No_medal_in_cat'] = 'No medal in this category';
$lang['Must_delete_medal'] = 'You need to delete all medals before you can delete this category';
$lang['Category_delete'] = 'Delete Medal Category';
$lang['Category_delete_explain'] = 'The form below will allow you to delete a category and decide where you want to put all medals it contained.';
$lang['Move_medals'] = 'Move medals to';
$lang['Category_name'] = 'Category Name';
$lang['Medal_mod_update_sucessful'] = 'Medal Moderator has been updated successfully';
$lang['Click_return_medal_mod_admin'] = 'Click %sHere%s to return to Medal Moderator Administration.';
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
// Again this will be handled by the templating
// code at some point
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Medal MOD
$medal ='';
$sql = "SELECT m.medal_id, m.medal_name
FROM " . MEDAL_TABLE . " m, " . MEDAL_USER_TABLE . " mu
WHERE mu.user_id = '" . $postrow[$i]['user_id'] . "'
AND m.medal_id = mu.medal_id
ORDER BY m.medal_name";
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Error getting medal information", "", __LINE__, __FILE__, $sql);
}
$medal_list = $db->sql_fetchrowset($result);
$medal_count = count($medal_list);
if ( $postrow[$i]['user_id'] == ANONYMOUS )
{
$medal_count = '';
}
else
{
$medal_count = ($medal_count) ? $lang['Medals'] . ': <a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $postrow[$i]['user_id'] . "#medal") . '" class="gensmall">' . $medal_count . '</a>' . ' (<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $postrow[$i]['user_id'] . "#medal") . '" class="gensmall">' . $lang['View_More'] . '</a>)' : $lang['Medals'] . ': ' . $lang['None'];
}
#
#-----[ FIND ]------------------------------------------
#
'POSTER_AVATAR' => $poster_avatar,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'POSTER_MEDAL_COUNT' => $medal_count, // Medal MOD
#
#-----[ FIND ]------------------------------------------
#
'U_POST_ID' => $postrow[$i]['post_id'])
);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//Medal MOD
if ( $board_config['allow_medal_display'] )
{
$order = ( $board_config['medal_display_order'] ) ? "RAND()" : "m.medal_name";
$template->assign_block_vars('postrow.medal', array());
$sql = "SELECT m.medal_id, m.medal_name, m.medal_image
FROM " . MEDAL_TABLE . " m, " . MEDAL_USER_TABLE . " mu
WHERE mu.user_id = '" . $poster_id . "'
AND m.medal_id = mu.medal_id
ORDER BY " . $order;
if ($result = $db->sql_query($sql))
{
$rowset = array();
while ($row = $db->sql_fetchrow($result))
{
$rowset[$row['medal_image']]['medal_name'] = $row['medal_name'];
if ($rowset[$row['medal_image']]['medal_name'] == $row['medal_name'])
$rowset[$row['medal_image']]['medal_count'] += 1;
}
// Check Medal config in ACP
$medal_rows = $board_config['medal_display_row'];
$medal_cols = $board_config['medal_display_col'];
$medal_width = ( $board_config['medal_display_width'] ) ? 'width="'.$board_config['medal_display_width'].'"' : '';
$medal_height = ( $board_config['medal_display_height'] ) ? 'height="'.$board_config['medal_display_height'].'"' : '';
if ($medal_list)
{
$split_row = $medal_cols - 1;
$s_colspan = 0;
$row = 0;
$col = 0;
while (list($medal_image, $medal) = @each($rowset))
{
if (!$col)
{
$template->assign_block_vars('postrow.medal.medal_row', array());
}
$template->assign_block_vars('postrow.medal.medal_row.medal_col', array(
'MEDAL_IMAGE' => $phpbb_root_path . $medal_image,
'MEDAL_WIDTH' => $medal_width,
'MEDAL_HEIGHT' => $medal_height,
'MEDAL_NAME' => $medal['medal_name'],
'MEDAL_COUNT' => '('. $lang['Medal_amount'] . $medal['medal_count']. ')')
);
$s_colspan = max($s_colspan, $col + 1);
if ($col == $split_row)
{
if ($row == $medal_rows - 1)
{
break;
}
$col = 0;
$row++;
}
else
{
$col++;
}
}
}
}
$db->sql_freeresult($result);
}
#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
define('POST_GROUPS_URL', 'g');
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('POST_MEDAL_URL', 'm'); // Medal MOD
define('MEDAL_CAT_URL', 'mc'); // Medal MOD
#
#-----[ FIND ]------------------------------------------
#
define('PAGE_GROUPCP', -11);
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('PAGE_MEDALS', -2115); // Medal MOD
#
#-----[ FIND ]------------------------------------------
#
define('GROUPS_TABLE', $table_prefix.'groups');
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('MEDAL_TABLE', $table_prefix.'medal'); // Medal MOD
define('MEDAL_MOD_TABLE', $table_prefix.'medal_mod'); // Medal MOD
define('MEDAL_USER_TABLE', $table_prefix.'medal_user'); // Medal MOD
define('MEDAL_CAT_TABLE', $table_prefix.'medal_cat'); // Medal MOD
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
function check_medal_mod($medal_id)
{
global $db, $userdata;
$sql = "SELECT *
FROM " . MEDAL_MOD_TABLE . "
WHERE medal_id =" . $medal_id;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user and medal information', '', __LINE__, __FILE__, $sql);
}
$medal_info = array();
$found = FALSE;
while ( $medal_info = $db->sql_fetchrow($result) )
{
$medal_moderator = $medal_info['user_id'];
if ( $medal_moderator == $userdata['user_id'] )
{
$found = TRUE;
}
}
$db->sql_freeresult($result);
return $found;
}
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
'L_USERGROUPS' => $lang['Usergroups'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_MEDALS' => $lang['Medals'], // Medal MOD
#
#-----[ FIND ]------------------------------------------
#
'U_GROUP_CP' => append_sid('groupcp.'.$phpEx),
#
#-----[ AFTER, ADD ]------------------------------------------
#
'U_MEDALS' => append_sid('medals.'.$phpEx), // Medal MOD
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------
#
$profiledata = get_userdata($HTTP_GET_VARS[POST_USERS_URL]);
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Medal MOD
//
// Category
//
$sql = "SELECT cat_id, cat_title
FROM " . MEDAL_CAT_TABLE . "
ORDER BY cat_order";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query medal categories list', '', __LINE__, __FILE__, $sql);
}
$category_rows = array();
while ( $row = $db->sql_fetchrow($result) )
{
$category_rows[] = $row;
}
$db->sql_freeresult($result);
$sql = "SELECT m.medal_id, mu.user_id
FROM " . MEDAL_TABLE . " m, " . MEDAL_USER_TABLE . " mu
WHERE mu.user_id = '" . $profiledata['user_id'] . "'
AND m.medal_id = mu.medal_id
ORDER BY m.medal_name";
if($result = $db->sql_query($sql))
{
$medal_list = $db->sql_fetchrowset($result);
$medal_count = count($medal_list);
if ( $medal_count )
{
$medal_count = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $profiledata['user_id'] . "#medal") . '" class="genmed">' . $medal_count . '</a>';
$template->assign_block_vars('switch_display_medal', array());
$template->assign_block_vars('switch_display_medal.medal', array(
'MEDAL_BUTTON' => '<button onclick="ToggleBox(\'toggle_medal\')">'.$lang['Medal_details'].'</button>')
);
}
}
for ($i = 0; $i < count($category_rows); $i++)
{
$cat_id = $category_rows[$i]['cat_id'];
$sql = "SELECT m.medal_id, m.medal_name,m.medal_description, m.medal_image, m.cat_id, mu.issue_reason, mu.issue_time, c.cat_id, c.cat_title
FROM " . MEDAL_TABLE . " m, " . MEDAL_USER_TABLE . " mu, " . MEDAL_CAT_TABLE . " c
WHERE mu.user_id = '" . $profiledata['user_id'] . "'
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";
if ($result = $db->sql_query($sql))
{
$row = array();
$rowset = array();
$medal_time = $lang['Medal_time'] . ': ';
$medal_reason = $lang['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'] : $lang['Medal_no_reason'];
$rowset[$row['medal_name']]['medal_issue'] = '<tr><td><span class="genmed">' . $medal_time . create_date($board_config['default_dateformat'], $row['issue_time'], $board_config['board_timezone']) . '</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'] : $lang['Medal_no_reason'];
$rowset[$row['medal_name']]['medal_issue'] .= '<tr><td><span class="genmed">' . $medal_time . create_date($board_config['default_dateformat'], $row['issue_time'], $board_config['board_timezone']) . '</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_width = ( $board_config['medal_display_width'] ) ? 'width="'.$board_config['medal_display_width'].'"' : '';
$medal_height = ( $board_config['medal_display_height'] ) ? 'height="'.$board_config['medal_display_height'].'"' : '';
$medal_name = array();
$data = array();
//
// Should we display this category/medal set?
//
$display_medal = 0;
while (list($medal_name, $data) = @each($rowset))
{
if ( $cat_id == $data['cat_id'] ) { $display_medal = 1; }
if ( !empty($display_medal) )
{
$template->assign_block_vars('switch_display_medal.details', array(
'MEDAL_CAT' => $data['cat_title'],
'MEDAL_NAME' => $medal_name,
'MEDAL_DESCRIPTION' => $data['medal_description'],
'MEDAL_IMAGE' => '<img src="'. $phpbb_root_path . $data['medal_image'] . '" border="0" alt="' . $medal_name . '" title="' . $medal_name . '" />',
'MEDAL_IMAGE_SMALL' => '<img src="'. $phpbb_root_path . $data['medal_image'] . '" border="0" alt="' . $medal_name . '" title="' . $medal_name . '"' . $medal_width . $medal_height . ' />',
'MEDAL_ISSUE' => $data['medal_issue'],
'MEDAL_COUNT' => $lang['Medal_amount'] . $data['medal_count'],
'L_MEDAL_DESCRIPTION' => $lang['Medal_description'])
);
$display_medal = 0;
}
}
}
}
#
#-----[ FIND ]------------------------------------------
#
'USERNAME' => $profiledata['username'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_USER_MEDAL' =>$lang['Medals'], // Medal MOD
'USER_MEDAL_COUNT' => $medal_count, // Medal MOD
'L_MEDAL_INFORMATION' => $lang['Medal_Information'], // Medal MOD
'L_MEDAL_NAME' => $lang['Medal_name'], // Medal MOD
'L_MEDAL_DETAIL' => $lang['Medal_details'], // Medal MOD
#
#-----[ OPEN ]------------------------------------------
#
viewonline.php
#
#-----[ FIND ]------------------------------------------
#
case PAGE_FAQ:
$location = $lang['Viewing_FAQ'];
$location_url = "faq.$phpEx";
break;
#
#-----[ AFTER, ADD ]------------------------------------------
#
case PAGE_MEDALS: // Medal MOD
$location = $lang['Medals'];
$location_url = "medals.$phpEx";
break;
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name">
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.POSTER_FROM}</span><br /></td>
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
{postrow.POSTER_FROM}<br />{postrow.POSTER_MEDAL_COUNT}<br />
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN medal -->
<table border="0" cellspacing="0" cellpadding="5">
<!-- BEGIN medal_row -->
<tr align="left" valign="middle">
<!-- BEGIN medal_col -->
<td><img src="{postrow.medal.medal_row.medal_col.MEDAL_IMAGE}" border="0" alt="{postrow.medal.medal_row.medal_col.MEDAL_NAME} {postrow.medal.medal_row.medal_col.MEDAL_COUNT}" title="{postrow.medal.medal_row.medal_col.MEDAL_NAME} {postrow.medal.medal_row.medal_col.MEDAL_COUNT}" {postrow.medal.medal_row.medal_col.MEDAL_WIDTH} {postrow.medal.medal_row.medal_col.MEDAL_HEIGHT} /></td>
<!-- END medal_col -->
</tr>
<!-- END medal_row -->
</table>
<!-- END medal -->
</span><br /></td>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<script src="templates/toggle.js"></script>
#
#-----[ FIND ]------------------------------------------
#
</tr>
</table>
</td>
</tr>
</table>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN switch_display_medal -->
<br />
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<td class="catLeft" align="center" height="28" colspan="2"><b><span class="gen">{L_MEDAL_INFORMATION}</span></b></td>
</tr>
<tr>
<td class="row1" align="center" valign="middle" width="10%"><span class="gen">{L_USER_MEDAL}: <b>{USER_MEDAL_COUNT}</b></span>
<!-- BEGIN medal -->
<br /><br />{switch_display_medal.medal.MEDAL_BUTTON}
<!-- END medal -->
</td>
<td class="row1" valign="middle" align="left" nowrap="nowrap" width="100%">
<!-- BEGIN details -->
{switch_display_medal.details.MEDAL_IMAGE_SMALL}
<!-- END details -->
</td>
</tr>
</table>
<br />
<div style="width: 100%; overflow: hidden; display: none;" id="toggle_medal">
<a name="medal"></a>
<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<th class="thCornerL" align="center" nowrap="nowrap"> {L_MEDAL_NAME} </th>
<th class="thCornerR" align="center" nowrap="nowrap"> {L_MEDAL_DETAIL} </th>
</tr>
<!-- BEGIN details -->
<tr>
<td class="row2" nowrap="nowrap">
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr><td align="center"><span class="gen">{switch_display_medal.details.MEDAL_CAT}</span></td></tr>
<tr><td align="center"><span class="genmed">{switch_display_medal.details.MEDAL_NAME}</span></td></tr>
<tr><td align="center">{switch_display_medal.details.MEDAL_IMAGE}</td></tr>
<tr><td align="center"><span class="gensmall">{switch_display_medal.details.MEDAL_COUNT}</span></td></tr></table></td>
<td class="row2" valign="top">
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr><td><span class="gen">{switch_display_medal.details.L_MEDAL_DESCRIPTION}: <b>{switch_display_medal.details.MEDAL_DESCRIPTION}</b></span></td></tr>
<tr><td class="quote">
<table width="100%" cellspacing="1" cellpadding="3" border="0">
<tr><td><span class="genmed">{switch_display_medal.details.MEDAL_ISSUE}</span></td></tr>
</table>
</td></tr>
</table></td>
</tr>
<!-- END details -->
</table>
</a>
</div>
<!-- END switch_display_medal -->
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ FIND ]------------------------------------------
#
<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{L_USERGROUPS}</a>
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<a href="{U_MEDALS}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_medal.gif" width="12" height="13" border="0" alt="{U_MEDALS}" hspace="3" />{L_MEDALS}</a>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.cfg
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$images['Medals'] = "$current_template_images/icon_mini_medal.gif"; // Medal MOD
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
-

dexter-svk
- Skúsený

-
- Príspevky: 151
- Registrovaný: Pia Júl 27, 2007 5:07 pm
od drndos » Sob Sep 01, 2007 8:47 am
a takto v preložených modifikáciach si sa pozeral?
-
drndos
- Moderátor

-
- Príspevky: 2555
- Registrovaný: Ned Máj 06, 2007 4:32 pm
-
Späť na Potrebujem preložiť (phpBB 2)
Kto je on-line
Užívatelia prezerajúci fórum: Žiadny registrovaný užívateľ nie je prítomný a 0 hostia