Extension:Colorize/bn
Jump to navigation
Jump to search
![]() | This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Note: No localisation updates are provided for this extension by translatewiki.net . |
![]() | This extension is currently not actively maintained! Although it may still work, any bug reports or feature requests will more than likely be ignored. |
Colorize মুক্তির অবস্থা: অরক্ষণাবেক্ষণ |
|
---|---|
বাস্তবায়ন | ট্যাগ |
বিবরণ | Makes text to appear more fun |
লেখক(গণ) | Javier Valcarce García (javier.{NOSPAM}valcarce @gmail.com) |
সর্বশেষ সংস্করণ | 0.2 (2013-04-05) |
MediaWiki | 1.15+ |
লাইসেন্স | লাইসেন্স নির্ধারিত হয় নি |
ডাউনলোড | নীচে কোড দেখুন |
The Colorize extension allows to colorize text between <colorize> and </colorize> tags to make it to appear more fun.
ইনস্টলেশন
- Copy the code below into a file called "Colorize.php" করুন এবং আপনার
extensions/
ফোল্ডারেColorize
নামক ডিরেক্টরির মধ্যে ফাইল(গুলি) নিন। - আপনার LocalSettings.php-এর নীচের অংশে নিম্নলিখিত কোড যোগ করুন:
require_once "$IP/extensions/Colorize/Colorize.php";
করা হয়েছে – এক্সটেনশনটি সফলভাবে ইনস্টল করা হয়েছে কিনা তা যাচাই করতে আপনার উইকির Special:Version-এ যান।
কোড
- Colorize.php
<?php
$wgExtensionFunctions[] = "wfColorizeSetup";
$wgExtensionCredits['parserhook'][] = array(
'name' => 'Colorize',
'url' => 'https://www.mediawiki.org/wiki/Extension:Colorize',
'author' => 'Javier Valcarce Garcia',
'version' => '0.2',
'description' => 'Makes text to appear more fun',
);
function wfColorizeSetup() {
global $wgParser;
$wgParser->setHook( "colorize", "wfColorizeRender" );
}
function wfColorizeRender( $input, $argv, $parser ) {
// Character styles
$input = utf8_decode($input);
$output = ""; // To stop the "Undefined Variable" errors in the webserver logfile
for ($i = 0; $i < strlen($input); $i++)
{
$s = rand(0, 9) * 8 + 150;
$w = rand(5, 9) * 100;
$r = rand(20, 220);
$g = rand(20, 220);
$b = rand(20, 220);
$output .=
'<span style="font-size: ' . strval($s) . '%; font-weight:'
. strval($w) . ';color: #' . dechex($r) . dechex($g) . dechex($b)
. ';">';
$output .= $input[$i];
$output .= '</span>';
}
return utf8_encode($output);
}