kJams Wiki:about

From kJams Wiki
Jump to: navigation, search
  • Version info
  • PHP Info Page
  • Auth_phpbb.php v 1.5 (released 2005-09-12)
    • Overides includes/AuthPlugin.php functions to provide authentication against phpBB user table for wiki edit access.
  • Added the following lines to includes/templates/Userlogin.php at line 19 to provide account creation info for new users.
<?php
// Begin Edit
// Added link to forum with text for signup.
// Author: Brad on 20050920 ?>
<h2>Create an Account:</h2>
<p>To create an account please <a href="https://www.kjams.com/forum/profile.php?mode=register">register</a> in our forum.
      Once you have registered send an email to the Wiki Group Moderator requesting a Wiki membership.</p>
<?php
// End Edit ?>
  • Addes the following lines to LocalSettings.php at line 2 to force SSL for logins.
// Begin Edit
// We are only operating on port 443 (SSL) for logins
// Author: Brad on 20050920
if($_SERVER['SERVER_PORT'] != '443' && $_REQUEST['title'] == 'Special:Userlogin')
{
  header('Location: https://www.kjams.com'.$_SERVER['REQUEST_URI']);
}
elseif($_SERVER['SERVER_PORT'] == '443' && $_REQUEST['title'] != 'Special:Userlogin')
{
  header('Location: http://www.kjams.com'.$_SERVER['REQUEST_URI']);
}
// End Edit
{{DISPLAYTITLE:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:|}}{{lcfirst:{{PAGENAME}}}}}}
  • enabled email notifications (in DefaultSettings.php, search for "enotif", set them to TRUE)
  • force SSL for registration and login for forums
  • Added Google Analytics using the Analytics Extension using Wiki-Wide Analytics plus Analytics Links.
  • added EmbedVideo for youtube / google video etc
  • added google site map
  • send notify emails for all watchlist edits regardless of recipient page view by not adding a timestamp to the watchlist table
--- ./includes/UserMailer.orig.php	2011-08-23 08:50:41.000000000 -0700
+++ ./includes/UserMailer.php	2011-08-23 09:02:44.000000000 -0700
@@ -326,7 +326,11 @@
 			foreach ( $res as $row ) {
 				$watchers[] = intval( $row->wl_user );
 			}
+/*
+    Brad: Dave wants to be notified of all edits so we will not add a timestamp to the watchlist.wl_notificationtimestamp field.
 			if ( $watchers ) {
+*/
+			if ( $watchers && false ) {
 				// Update wl_notificationtimestamp for all watching users except
 				// the editor
 				$dbw->begin();
  • Added kJams Documentation link to the forum overall_header.html template.
  • added Skype extension
  <li class="icon-faq" style="background-image: url('https://karaoke.kjams.com/forum/styles/prosilver/imageset/kjams_logo16x14.png');">
    <a href="https://karaoke.kjams.com/wiki/Documentation" title="kJams Documentation">kJams Documentation</a></li>
  • Add Google Translate extension

extensions/GoogleTranslator/GoogleTranslator.class.php

<?php
if (!defined('MEDIAWIKI')) die();
/**
 * Class file for the GoogleTranslator extension
 *
 * @addtogroup Extensions
 * @author Joachim De Schrijver
 * @license LGPL
 */
class GoogleTranslator {
        static function GoogleTranslatorInSidebar( $skin, &$bar ) {
                global $wgGoogleTranslatorOriginal,$wgGoogleTranslatorLanguages;
 
                wfLoadExtensionMessages( 'GoogleTranslator' );
                $bar['googletranslator'] = "<div id=\"google_translate_element\"></div><script>
                                        function googleTranslateElementInit() {
                                          new google.translate.TranslateElement({
                                            pageLanguage: '".$wgGoogleTranslatorOriginal."',
                                            includedLanguages: '".$wgGoogleTranslatorLanguages."'
                                          }, 'google_translate_element');
                                        }
                                        </script><script src=\"http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit\"></script>";
                return $bar;
                return true;
        }
}

extensions/GoogleTranslator/GoogleTranslator.css

/**
* Stylesheet for GoogleTranslator extension.
*
* This should be added to [[MediaWiki:Common.css]] page when installing this
* extension and should not be modified. You may modify the CSS code on the
* MediaWiki:Common.css page to adjust padding, alignment, etc.
*
* @addtogroup Extensions
*/
 
/* Pad Google AdSense box in portlet in sidebar */
#p-googleatranslator .pBody {
    padding-top: 5px;
    text-align:  center;
}

extensions/GoogleTranslator/GoogleTranslator.i18n.php

<?php
/**
 * Internationalisation file for extension GoogleTranslator
 *
 * @addtogroup Extensions
 * @license LGPL
 */
 
$messages = array();
 
/** English
 * @author Joachim De Schrijver
 */
$messages['en'] = array(
        'googletranslator'      => 'Translate', # do not translate or duplicate this message to other languages
 'googletranslator-desc' => 'Adds [http://www.google.com/translate Google Translator] to the sidebar',
);
 
/** Message documentation (Message documentation)
 * @author Joachim De Schrijver
 */
$messages['qqq'] = array(
        'googletranslator-desc' => 'Short description of this extension, shown on [[Special:Version]]. Do not translate or change links.',
);
 
/** Russian
 * @author Michael P Dubner
 */
$messages['ru'] = array(
        'googletranslator-desc' => 'Добавляет [http://www.google.com/translate Google Переводчик] в блок навигации.',
);
 
/** French
 * @author Pierre Mavro
 */
$messages['fr'] = array(
        'googletranslator'      => 'Translate',
        'googletranslator-desc' => 'Ajoute [http://www.google.com/translate Google Traduction] dans la bare latérale',
);

extensions/GoogleTranslator/GoogleTranslator.php

<?php
/**
 * MediaWiki extension to add Google Translator in a portlet in the sidebar.
 * Installation instructions can be found on
 * http://www.mediawiki.org/wiki/Extension:Google_Translator
 *
 * This extension will not add the Google Translator portlet to *any* skin
 * that is used with MediaWiki. Because of inconsistencies in the skin
 * implementation, it will not be add to the following skins:
 * cologneblue, standard, nostalgia
 *
 * @addtogroup Extensions
 * @author Joachim De Schrijver
 * @license LGPL
 *
 * Loosely based on the Google AdSense extension by Siebrand Mazeland
 */
 
/**
 * Exit if called outside of MediaWiki
 */
if( !defined( 'MEDIAWIKI' ) ) {
        echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
        die( 1 );
}
 
/**
 * SETTINGS
 * --------
 * The description of the portlet can be changed in [[MediaWiki:Googletranslator]].
 *
 * The following variables may need to be reset in your LocalSettings.php.
  */
$wgGoogleTranslatorOriginal  = $wgLanguageCode; // Original languages of the page that needs translation
$wgGoogleTranslatorLanguages  = 'fr,de';        // Languages included in the translating box
 
$wgExtensionCredits['other'][] = array(
        'name'           => 'Google Translator',
        'version'        => '0.1',
        'author'         => 'Joachim De Schrijver',
        'description'    => 'Adds [http://translate.google.com Google Translator] to the sidebar',
        'descriptionmsg' => 'googletranslator-desc',
        'url'            => 'http://www.mediawiki.org/wiki/Extension:Google_Translator',
);
 
// Register class and localisations
$dir = dirname(__FILE__) . '/';
$wgAutoloadClasses['GoogleTranslator'] = $dir . 'GoogleTranslator.class.php';
$wgExtensionMessagesFiles['GoogleTranslator'] = $dir . 'GoogleTranslator.i18n.php';
 
// Hook to modify the sidebar
$wgHooks['SkinBuildSidebar'][] = 'GoogleTranslator::GoogleTranslatorInSidebar';

LocalSetting.php

/* Add Multilang extension */
# Include Google Translator extension.
include_once( "$IP/extensions/GoogleTranslator/GoogleTranslator.php" );
# Set original language to convert from.
$wgGoogleTranslatorOriginal  = 'en';
# List languages we want to convert to.
$wgGoogleTranslatorLanguages  = 'es,nl,fr,de,it,ja,zh-CN,zh-TW,iw,ko,ru';
# Non-authoratative list of languages support by Google Translate. 20120110
/*
"af"-Afrikaans
"sq"-Albanian
"ar"-Arabic
"hy"-Armenian ALPHA
"az"-Azerbaijani ALPHA
"eu"-Basque ALPHA
"be"-Belarusian
"bg"-Bulgarian
"ca"-Catalan
"zh-CN"-Chinese
"hr"-Croatian
"cs"-Czech
"da"-Danish
"nl"-Dutch
"en"-English
"et"-Estonian
"tl"-Filipino
"fi"-Finnish
"fr"-French
"gl"-Galician
"ka"-Georgian ALPHA
"de"-German
"el"-Greek
"ht"-Haitian Creole ALPHA
"iw"-Hebrew
"hi"-Hindi
"hu"-Hungarian
"is"-Icelandic
"id"-Indonesian
"ga"-Irish
"it"-Italian
"ja"-Japanese
"ko"-Korean
"lv"-Latvian
"lt"-Lithuanian
"mk"-Macedonian
"ms"-Malay
"mt"-Maltese
"no"-Norwegian
"fa"-Persian
"pl"-Polish
"pt"-Portuguese
"ro"-Romanian
"ru"-Russian
"sr"-Serbian
"sk"-Slovak
"sl"-Slovenian
"es"-Spanish
"sw"-Swahili
"sv"-Swedish
"th"-Thai
"tr"-Turkish
"uk"-Ukrainian
"ur"-Urdu ALPHA
"vi"-Vietnamese
"cy"-Welsh
"yi"-Yiddish
/**/

LocalSetting.php

/* Add ConfirmEdit extension */
require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" );

/* Asirra captcha *
require_once( "$IP/extensions/ConfirmEdit/Asirra.php" );
$wgCaptchaClass = 'Asirra';
/**/

/* QuestyCaptcha captcha */
require_once( "$IP/extensions/ConfirmEdit/QuestyCaptcha.php" );
$wgCaptchaClass = 'QuestyCaptcha';
$wgCaptchaQuestions[] = array( 'question' => "Question 1?", 'answer' => array ( "answer 1" , "Answer One" ) );
$wgCaptchaQuestions[] = array( 'question' => "Question 2?", 'answer' => array ( "AnSwEr TwO" ) );
/**/

$wgGroupPermissions['*'            ]['skipcaptcha'] = false;
$wgGroupPermissions['user'         ]['skipcaptcha'] = false;
$wgGroupPermissions['autoconfirmed']['skipcaptcha'] = false;
$wgGroupPermissions['bot'          ]['skipcaptcha'] = false;
$wgGroupPermissions['sysop'        ]['skipcaptcha'] = false;

$wgCaptchaTriggers['edit']          = true;
$wgCaptchaTriggers['create']        = true;
$wgCaptchaTriggers['addurl']        = true;
$wgCaptchaTriggers['createaccount'] = true;
$wgCaptchaTriggers['badlogin']      = true;
$wgCaptchaTriggers['contactpage']   = true; // this is the feedback form
/**/                                                                                                         

LocalSetting.php

/* Add ContactPage extension */
require_once( "$IP/extensions/ContactPage/ContactPage.php" );
$wgContactUser = 'WikiUserWhoWillReceiveEmail';
$wgContactSender = $wgPasswordSender;
$wgContactSenderName = 'Contact Form on ' . $wgSitename;
/**/
  • Add WikiEditor extension

LocalSetting.php

/* Add WikiEditor extension */
require_once( "$IP/extensions/WikiEditor/WikiEditor.php" );
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
/**/
  • Use SMTP

LocalSetting.php

/* Use SMTP */
$wgSMTP = array(
    'host'     => 'smtp.domain.com',
    'IDHost'   => 'karaoke.kjams.com',
    'port'     => [port number],
    'auth'     => true,
    'username' => [email account],
    'password' => [password],
);
/**/

add this to LocalSettings:

// external links open in new page
$wgExternalLinkTarget = '_blank';


changed last line of NavImage.php to be this (for external links to go to new tab):

$myreturn = '<a href="'.$out_url[1].'" target="_blank">'.$imageoutput.'</a>';
  • Fix GoogleTranslate extension

extensions/GoogleTranslator/GoogleTranslator.class.php

/**
 * The wfLoadExtensionMessages function has been removed from mediawiki and we don't need
 * it here so we comment it out.
 */
#                wfLoadExtensionMessages( 'GoogleTranslator' );
  • phpBB requires ImageMagick for attachment thumbnail generation.
    • We used MacPorts to install ImageMagick to /opt/local prefix.
      • Note: we installed ImageMagick via MacPorts without having an Xcode installation and testing indicates this worked ok in this case.