Что пишем:
Код: Выделить всё
трудно понимать что такое 299 рублей ([$=299]) или 499 рублей ([$=499])
Код: Выделить всё
трудно понимать что такое 299 рублей ($10,69) или 499 рублей ($17,82)
Заранее благодарен тому, кто сможет это создать.
Код: Выделить всё
трудно понимать что такое 299 рублей ([$=299]) или 499 рублей ([$=499])
Код: Выделить всё
трудно понимать что такое 299 рублей ($10,69) или 499 рублей ($17,82)
Код: Выделить всё
##############################################################
## MOD Title: [usd] bbCode
## MOD Author: BrainStorm < admin@phpbbguru.net > (Xpert, Egor Naklonyaeff) N/A
## MOD Description: [usd] bbCode to covert currency on the fly
## MOD Version: 0.0.1
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: 1
## includes/bbcode.php
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbbguru.net/mods/
##############################################################
## Author Notes: I'm too lazy to write something
##############################################################
## MOD History:
## 2005-03-30 - Version 0.0.1
## - initial release
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]-------------------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]----------------------------------------
#
// Patterns and replacements for URL and email tags.
#
#-----[ BEFORE, ADD ]----------------------------------
#
// [usd] bbCode
$text = preg_replace("#\[usd:$uid\](.*?)\[/usd:$uid\]#sie", "usd_bbCode('\\1')", $text);
#
#-----[ FIND ]----------------------------------------
#
// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)
#
#-----[ BEFORE, ADD ]----------------------------------
#
// [usd] bbCode
$text = preg_replace("#\[usd\](.*?)\[/usd\]#si", "[usd:$uid]\\1[/usd:$uid]", $text);
#
#-----[ FIND ]----------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]----------------------------------
#
function usd_bbCode($text)
{
//
// Returns usdBBcode
//
global $board_config;
$rur2usd=(isset($board_config['rur2usd']))?floatval($board_config['rur2usd']):((float)29);
$curval=floatval($text);
if($curval==0) return $text;
$usd='($'.number_format(($curval/$rur2usd), 2, '.', '').')';
return "$text руб. $usd";
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Ой, мужики! У меня есть на webmoney последние (тьфу тьфу тьфу) $2, куда перечислить как благодарность?Егор Наклоняев писал(а):Админку грозится Xpert написать. Миром по нитке - голый без рубашки.
Код: Выделить всё
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------
#
"L_RESET" => $lang['Reset'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [begin] mod
"L_RUR2USD" => $lang['rur2usd'],
"L_RUR2USD_EXPLAIN" => $lang['rur2usd_explain'],
// [end] mod
#
#-----[ FIND ]------------------------------------------
#
$template->pparse("body");
include('./page_footer_admin.'.$phpEx);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [begin] mod
$template->assign_vars(array(
"RUR2USD" => $new['rur2usd']
));
// [end] mod
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_DISABLE_BOARD}<br /><span class="gensmall">{L_DISABLE_BOARD_EXPLAIN}</span></td>
<td class="row2"><input type="radio" name="board_disable" value="1" {S_DISABLE_BOARD_YES} /> {L_YES} <input type="radio" name="board_disable" value="0" {S_DISABLE_BOARD_NO} /> {L_NO}</td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- [begin] mod -->
<tr>
<td class="row1">{L_RUR2USD}<br /><span class="gensmall">{L_RUR2USD_EXPLAIN}</span></td>
<td class="row2"><input class="post" type="text" size="8" maxlength="8" name="rur2usd" value="{RUR2USD}" /></td>
</tr>
<!-- [end] mod -->
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [begin]mod
$lang['rur2usd'] = 'Change ratio';
$lang['rur2usd_explain'] = 'RUR to USD change ratio for [usd] BBcode';
// [end] mod
Код: Выделить всё
INSERT INTO `phpbb_config` ( `config_name` , `config_value` ) VALUES ('rur2usd', 29);