Extension:MediaWiki Bulletin Board Modifications

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
MediaWiki Bulletin Board Modifications

Release status: stable

Implementation Example
Description Modifications for MediaWiki Bulletin Board
Author(s) The TattleTale Strangler
Last Version 1.3
License No license specified
Download See installation

MWBB Mods are modifications for MediaWiki Bulletin Board, a message board or forum extension for MediaWiki software. MWBB itself is released under GNU GPL 2.0 and is editable, distributable by anyone. The modification rights are below.

The TattleTale Strangler is no longer supporting this extension.

Contents

[edit] Requirements

  • Perl 5 or above (for avatars)
  • MWBB 0.2 + PM (0.1 will not work)
  • The KeepYourHandsToYourself extension (for signatures)

[edit] Modification List

From newest to oldest:

  • Remove <p> from quoting
  • Signatures
  • Search
  • Avatars
  • Different font for labels
  • User_profile to User
  • Quote button to edit toolbar
  • Fixed MWBB link

Recommended Wiki Extensions


[edit] Installation - Fixed MWBB Link

Let's fix the MWBB link first. Go to Special:Allmessages and search "powered_by". Click on powered_by and put in the following code:

<div style="vertical-align:bottom; text-align:center; font-size:10px">Forums Powered by <a href="http://sourceforge.net/projects/mwbb/">MWBB</a>
That should fix the broken MWBB link. Let's move on to a quote button so people can quote things.


[edit] Installation - Quote Button

Go to MediaWiki:Common.js and go to the edit page. Copy and paste this in the article (at the bottom if you have already added things to this page).

/* Quote button */

var button = {
        "imageFile": "QUOTE IMAGE URL HERE",  //image to be shown on the button (may be a full URL too), 22x22 pixels
        "speedTip": "Quote",    //text shown in a tooltip when hovering the mouse over the button
        "tagOpen": "<div style='background-color:#F5F5F5'>",        //the text to use to mark the beginning of the block
        "tagClose": "</div>",      //the text to use to mark the end of the block (if any)
        "sampleText": "Insert quote here"   //the sample text to place inside the block
};
mwCustomEditButtons.push(button);

/* End of Quote button */
Insert a quote image url at the designated location. If you do not want to create one, you can use mine. Save the page.


[edit] Installation - Quote <p> Fix

Ever quoted more than one person and had <p> everywhere? Well, here's a quick fix. Go to /extensions/mwbb/post.php and replace everything from $post_data=$post_data[0]; to }

$post_data=$post_data[0];
	$data['text']='<div style="background-color:#F5F5F5">
	<b>'.$post_data['user_name'].'</b> said:<br />'.prepareshow($post_data['post_text']).'</div>';
	}
That should fix it.


[edit] Installation - User, Label, Signatures, and Avatars

Now it's time to be adding four things at once:
1. Changing User_profile: to User:,
2. Changing the label font,
3. Adding signatures,
4. Adding avatars.

Open /extensions/mwbb/topic.php and replace everything from //skin function to return $html; }

//Modifications: User_profile to User + Avatars + Staff Label Mod + Signatures
//Modded by The TattleTale Strangler
//skin function
$html.='<script type=text/javascript src='.$wgScriptPath.'/signature.js></script>';
function showtopic(&$data,&$skin,&$topic_data)
{
global $wgUser,$wgOut, $wgScriptPath;
$html='<hr />';
for($i=0;$i<count($data);$i++)
	{
	$html.='';
	$user=User::newFromName($data[$i]['user_name']);
	$groups=$user->getGroups();
	if(count($groups)>0)
	$groups=implode(',',$groups);
	else
	$groups='';	
	$userlink=$skin->MakeKnownLink('User:'.$data[$i]['user_name'],$data[$i]['user_name']);
 	$html.='<p><span><table width="100%" style="vertical-align: top;"><tr><td width="100px" class="bb-side" style="vertical-align: top;">';//start by section
	$html.='<b>'.$userlink.'</b><br /><img src="'.$wgScriptPath.'/avatars/'.$data[$i]['user_name'].'.jpg" width="100" alt="No Avatar"> '.wfGetUserAvi($data[$i]['user_name']).'<br /><span style="font-size: 10px;"><b>'.$groups.'</b></span><br />';
	$html.=$skin->MakeKnownLink('Special:Pm/compose/'.$data[$i]['user_name'],'<img src="'.$wgScriptPath.'/extensions/mwbb/user_comment.png" />');
	 if($data[$i]['poster_id']==$wgUser->getId() || can_mod($wgUser))
	   $html.=$skin->makeKnownLink('Special:Post/edit',' <img src="'.$wgScriptPath.'/extensions/mwbb/pencil.png" />','pid='.$data[$i]['post_id']);
$html.=$skin->makeKnownLink('Special:Post/reply','<img src="'.$wgScriptPath.'/extensions/mwbb/comment.png" />','tid='.$topic_data['topic_id'].'&quote='.$data[$i]['post_id']);
	$html.= '</td><td style="vertical-align: top;"><span style="font-size: 75%;"> '.date(LONG_DATE,$data[$i]['post_date']);
	 if(!is_null($data[$i]['last_editor']))
	 	{
		$html.='<br />'.wfMsg("lastedited", $data[$i]['last_editor'],date(LONG_DATE,$data[$i]['last_edit_time']));
		}
	$html.="</span>";
	$html.='</span></p>';
	//Real content
	$html.='<p>';
	$html.=$wgOut->parse(prepareshow($data[$i]['post_text']));
	$html.='</p>';

//Signatures
	$html.='<hr /> <script type="text/javascript">
ajaxinclude(rootdomain+"/wiki/User:'.$data[$i]['user_name'].'/Signature&action=render")
</script>';
	

//Time for post links		
	$html.='<p><b>';
	//$html.=' | '.$skin->MakeKnownLink('User:'.$data[$i]['user_name'],'Personal Page');
	  
	$html.='</b></p>';
	$html.='</td></tr></table><hr />';
	}

return $html;
}
//End modifications.

What I have done is changed the label font, added the image placement for avatars, added signatures, and changed links to User:.


[edit] Installation - Avatars part 2

Now it's time for the fun part: the script for avatars.

---

  • Download these files and put them in your root directory:
    • File 1
    • File 2
    • File 3 (Requires ASCII Mode when uploading!)
      • If this page only comes up with a 500 error, CHMOD the file to 755.

---

The code you had recently put in made it so every post would have an image labeled as "Username.jpeg", with "username" changing to the user's username, respectively.


  • In the root directory, create a /avatars/ subdirectory to store the avatars (you'll need this later).
  • On File 3 (Upload.cgi), edit $folder and $redirect. $folder should have your exact link to the avatars (/avatars/), and $redirect will need the direct link to upload1.html, which you have just uploaded. You may want to edit $domain for security.
    • Also, .jpg is disabled by default. If you want to enable .jpg, go to @types and type "jpg" below "jpeg."


You should now be able to go to upload.html and upload images. You may also notice that there are things you have to follow with avatars.

How this avatar system works is that you upload a .jpeg or .jpg file with the filename as your username (e.g. if you are Iamcool662, then the image you upload should be "Iamcool662.jpeg" or "Iamcool622.jpg") Then, it gets displayed under your username using an image html code. You can display upload.html by IFrame using HTMLets on an article or on a topic or by creating your own special page.

[edit] Installation - Signatures part 2

This one is not quite as long as the avatars part 2 and is quite simple. Just copy and paste this code below and save it as signature.js in your MediaWiki directory. (e.g. /wiki/)

var rootdomain="http://"+window.location.hostname

function ajaxinclude(url) {
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.open('GET', url, false) //get page synchronously 
page_request.send(null)
writecontent(page_request)
}

function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.write(page_request.responseText)
}
You're done! Test it out. :) If you do not like the error message being there, edit MediaWiki:Noarticletext‎ with the message that you want.


[edit] Installation - Search

This one is actually pretty easy. First, go to this page. Fill out the page, except for "sites to search," put in http://www.domain.com/wiki/index.php?title=Special:Topic/* or http://www.domain.com/wiki/Special:Topic/* if you have the short url, with your domain name, respectively. Go with the Standard Edition without checking the box underneath it. Agree to it and click next. When prompt, allow confirmation, as it will give you a very important url. Once you have sent the confirmation, go to your email and copy and paste the url below "To incorporate your search engine into your site or blog, you can find the necessary code at..." Once there, select overlay and put in the direct link to the forum's main page. Generate and copy the code. On your wiki, go to the MediaWiki:Powered_by page and paste the code at the top. There you go, your very own search for your forum! Feel free to tweak around with the code.


[edit] Installation - Ending

Hope everything turns out alright. I made it as simple as I could and I hope you enjoy my modifications. :)

[edit] Updates

If you want to subscribe to updates, then watch this page.

[edit] Rights

These modifications are available to the public, however, you cannot redistribute them without my permission. If you want someone to use these modifications, show them this article. You can, however, add modifications to this article, just as long as you don't credit other modifications as your own, I am fine.

[edit] Bugs/help

If you need help or have bugs, talk on the Discussion page.

[edit] No Longer Supported

The TattleTale Strangler is no longer supporting this extension, for he is far too busy and he thinks this is pretty good the way it is. He is currently working on AWC's Forum as it has lots more features than that of MWBB.

Warning: Default sort key "MediaWiki Bulletin Board Modifications" overrides earlier default sort key "MEDIAWIKI BULLETIN BOARD MODIFICATIONS".

Personal tools