MyBB Community Forums

Full Version: 3 great mods | image shrink | sub & sup | Advanced reputation system
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My friend hooked me up with some very good code modifications to the latest MyBB. I've used the mods on my own forum located at http://ep2.nl and they work perfect.


Mod 1: Image shrinker and viewer
This modification reduces too large images posted in topics, and makes them clickable wich onclick opens a pop-up with the full-sized image. If the pop-up is opened, a click on the full-size image closes it again.
A great mod, wich keeps the topic nice and clean.

Preview: Link
Download: Link

-------------------------------------

Mod 2: Sub and Sup tekst
This modification creates the tags [sub] and [sup] in your BB code so that you can use subtekst and suptekst.

Remember to close them with [/sub] and [/sup]!

Preview: Link
Download: Link

-------------------------------------


Mod 3: Advanced Reputation System
This modification is an addition to the reputation system in MyBB. It has multiple functionalities:

1. Members can give -3 to +3 rep.points at once
[Image: asdasdasd.PNG]

2. The reputation image (green or red) gets wider when the reputation
increases, to a max of 10 images.
[Image: ewrwerwer.PNG]
Download:

3. Reputationpoints can be seen in the controlpanel, next to the comments (opmerkingen).
[Image: uyiyuiuiy.PNG]


A preview is not possible unless you actually register at my forums, so here's the code for the Advanced Reputation System:



1) Go to Templates in Admin panel and edit the reputation_add template. this is how my template looks:

<strong>$lang->add_reputation</strong>
<form action="reputation.php" method="post">
<input type="hidden" name="action" value="do_add">
<input type="hidden" name="pid" value="$pid">
<blockquote><input type="radio" name="add" value="-3"> -3&nbsp;
<input type="radio" name="add" value="-2">-2&nbsp;
<input type="radio" name="add" value="-1" $negcheck>-1&nbsp;
<input type="radio" name="add" value="1" $poscheck>+1&nbsp;
<input type="radio" name="add" value="2">+2&nbsp;
<input type="radio" name="add" value="3">+3
</blockquote>
<br />
<br />
<span class="smalltext">$lang->post_comments</span>
<br />
<input type="text" name="comments" size="40" maxlength="250">
<br />
<br />
<center><input type="submit" class="submit" value="$lang->add_to_reputation"></center>
</form>

When clicked on '-' in a post, -1 point will be automaticlly selected, the same happens when clicked on '+'

2) In Templates -> User Controlpanel Templates -> usercp_latestreputations_bit

Overwrite any code with this

<tr>
<td class="$bgclass" align="center"><img src="$theme[imgdir]/$posnegimg"></td>
<td class="$bgclass">$postlink</td>
<td class="$bgclass">$repdate $reptime</td>
<td class="$bgclass">$reputation[comments] ($reputation[reputation])</td>
</tr>


3) Go to your FTP and download reputation.php. Open it and find the next lines (around line 80):

		
			$rep = $mybb->usergroup['reputationpower'];

			if($mybb->input['add'] == "neg")
			{
				$rep = "-".$rep;
			}

CHANGE TO

			$rep = $mybb->input['add'];
			if(abs($rep) > 3){
				$rep = 0;
			}			
			/*
			$rep = $mybb->usergroup['reputationpower'];
			
			if($mybb->input['add'] == "neg")
			{
				$rep = "-".$rep;
			}
			*/


Save it ofcourse!!! Smile

This modification to MyBB 1.1.1 has been coded by Aries-Belgium


I hope you like the modifications!
cool, however it think that mods like these have all ready been realsed, but there are still cool and i might use the 2nd one!
the first one looks useful, im gonna se if i install it
Hi, I'm the one that "coded" these mods. I putted coded between quotes because it wasn't really hard Big Grin
I didn't really found any mods/plugins of that kind, that's why I decided to try it myself. It was actually a good thing, because that way I got to know the template system a bit better.
If you have any question, feel free to ask ...
i have a question with the shrinker and viewer plug

-functions_post.php
-- REPLACE (+- r110)
$message = preg_replace("#\[img\](https?://([^<>\"']+?))\[/img\]#i", "<img src=\"$1\" border=\"0\" alt=\"\" />", $message);
-- WITH -- FOR "CLICK IMAGE TO CLOSE"
$message = preg_replace("#\[img\](https?://([^<>\"']+?))\[/img\]#i", "<img src=\"$1\" border=\"0\" alt=\"\" onclick=\"if(this.style.cursor=='move'){var h = this.height; var w = this.width; var popup = window.open('','imagefix','width=' + screen.width + ',height=' + screen.height + ',toolbar=no,status=no,fullscreen');popup.document.write('<center>CLICK HERE TO CLOSE SCREEN<br><img src=\'$1\' onclick=\'window.close();\' alt=\'Click to close screen\'></center>');}\" onload=\"if(this.width > 550){var h = this.height; var w = this.width; var p = w/400; this.width=400;this.height=h/p;this.style.cursor='move';}\" />", $message);
-- WITH -- FOR "IMAGE AS URL"
$message = preg_replace("#\[img\](https?://([^<>\"']+?))\[/img\]#i", "<img src=\"$1\" border=\"0\" alt=\"\" onclick=\"if(this.style.cursor=='move'){var h = this.height; var w = this.width; var popup = window.open('$1','imagefix','width=' + screen.width + ',height=' + screen.height + ',toolbar=no,status=no,fullscreen');}\" onload=\"if(this.width > 550){var h = this.height; var w = this.width; var p = w/400; this.width=400;this.height=h/p;this.style.cursor='move';}\" />", $message);
the 3rd phrase is under the 2nd one?
the reputation system is ok, but i dont think it will beat ARS, moreover, it wont last for long time Smile as soon as 1.2 is released this will not be compatible anymore, because it has a total different system.

about the Image shrinker and viewer, can the user specify the max size from the board's settings?

regards
no, the size can be selected in the codeline.

@MaRio: you can eith select the second or third line. the second is for a smaller image and a pop-up, the third is for a textlink to the image.
Well it would be better to have it as a setting!

regards
zaher1988 Wrote:Well it would be better to have it as a setting!
These were my first mods for myBB, I'm only getting to know the system for now. All those things can also be done with plugins (I think) but I'm still learning that. However, I'm learning that at the moment. Cool
amygdela Wrote:no, the size can be selected in the codeline.

@MaRio: you can eith select the second or third line. the second is for a smaller image and a pop-up, the third is for a textlink to the image.

thanx... im gonna try it