Quantcast
Channel: MyBB Community Forums - Tutorials
Viewing all 690 articles
Browse latest View live

Custom 404 Page Creation For Mybb Without Any Plugin

$
0
0
1. Add this code to the last line on your .htaccess

Code:
ErrorDocument 404 /filenotfound.php

2.Create a file called filenotfound.php, and add this to it:

Code:
<?php
    define('IN_MYBB', 1);
    require_once("global.php");

    add_breadcrumb("404 Error", $_SERVER['PHP_SELF']);

    eval("\$page = \"".$templates->get("404")."\";");

    output_page($page);
?>

3. Upload the filenotfound.php file to your main website's directory.

4. Create a new template on your main theme with the name 404 and add this to it:


Code:
<html>
<head>
<title>Your title</title>
{$headerinclude}
</head>
<body>
{$header}
Your 404 Page Content
{$footer}
</body>
</html>

Edit where it says Your 404 Page Content to whatever suits your needs.


Credits:Ocean

Latest thread deteails as CSS popup/hover

$
0
0
Original and maintained thread here: http://www.communityplugins.com/forum/sh...hp?tid=308

I had a request for a simple feature to make the latest threads in the portal have all its details such as author, date, views, replies removed from view until hovered. WIth just CSS and template edits you can get a result in behavior like

[Image: attachment.php?aid=148]

portal_latestthreads_thread
Code:
<tr>
<td class="{$altbg}">
<a class="tooltip" href="{$mybb->settings['bburl']}/{$thread['threadlink']}">
    {$thread['subject']}
    <span class="custom portal_popup">
        <img src="{$mybb->settings['bburl']}/images/on.gif" alt="Thread" height="24" width="24" />
        <em>{$thread['subject']}</em>
           {$lang->latest_threads_lastpost} {$thread['lastposter']} &raquo;  {$lastpostdate} {$lastposttime} <strong>&raquo; </strong>{$lang->latest_threads_replies} {$thread['replies']}     <strong>&raquo; </strong>{$lang->latest_threads_views} {$thread['views']}
    </span>
</a>
</td>
</tr>

notice the class="tooltip" and <span class="custom portal_popup">...</span> changes. Please note the changes in the content being output as well. You can change the icon being displayed here as well, for now I just used "on.gif"

then in global.css add the following (edit to your own style if you like)

Code:
.tooltip {
    border-bottom: 1px dotted #000000; color: #000000; outline: none;
    cursor: se-resize; text-decoration: none;
    position: relative;
}
.tooltip span {
    margin-left: -999em;
    position: absolute;
}
.tooltip:hover span {
    border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);
    font-family: Calibri, Tahoma, Geneva, sans-serif;
    position: absolute; left: 1em; top: 2em; z-index: 99;
    margin-left: 0; width: 500px;
}
.tooltip:hover img {
    border: 0; margin: -10px 0 0 -55px;
    float: left; position: absolute;
}
.tooltip:hover em {
    font-family: Candara, Tahoma, Geneva, sans-serif; font-size: 1.2em; font-weight: bold;
    display: block; padding: 0.2em 0 0.6em 0;
}
.custom { padding: 0.5em 0.8em 0.8em 2em; }
* html a:hover { background: transparent; }
.portal_popup { background: #FFCCAA; border: 1px solid #FF3334;}

[TUTORIAL] Give Your MyBB Forum a CSS3 Look

$
0
0
Every Forum Admin wants to make their forum Look Advanced and Modern.I've been modifying my forum to CSS3 Standards and thought it would be really nice to share here :

So What we start ? Well , I want to talk about how to give your forum rows an excellent CSS3 look with box-shadows :



So , we see that a cool shadow behind the forum row and also a block like rows. To get this ,


CSS3 FORUM ROWS :



[Image: 28770Untitled.jpg]
Go to

ADMINCP>TEMPLATES/STYLE>THEMES>YOUR THEMES > GLOBAL.CSS

Now ctrl+f and find "trow1" and "trow2"

Code:
background: #ffffff;
    background: rgb(252,252,252); /* Old browsers */  background: -moz-linear-gradient(top,  rgba(252,252,252,1) 0%, rgba(247,247,247,1) 100%); /* FF3.6+ */  
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(252,252,252,1)), color-stop(100%,rgba(247,247,247,1))); /* Chrome,Safari4+ */  
    background: -webkit-linear-gradient(top,  rgba(252,252,252,1) 0%,rgba(247,247,247,1) 100%); /* Chrome10+,Safari5.1+ */  background: -o-linear-gradient(top,  rgba(252,252,252,1) 0%,rgba(247,247,247,1) 100%); /* Opera 11.10+ */  background: -ms-linear-gradient(top,  rgba(252,252,252,1) 0%,rgba(247,247,247,1) 100%); /* IE10+ */  background: linear-gradient(top,  rgba(252,252,252,1) 0%,rgba(247,247,247,1) 100%); /* W3C */  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfcfc', endColorstr='#f7f7f7',GradientType=0 ); /* IE6-9 */;    
    border-top: 1px solid #fff;
    border-bottom: 1px solid #ddd;
    padding: 15px;
color: #000;
    vertical-align: middLe;

[b]So That is current CSS3 Standard look . Paste the above code replacing in trow1 and trow2 to get a look like in the picture.

Done?

Ok Now we gonna see how to change this :

CSS3 DEFAULT BUTTONS:
[Image: 98603Untitled.jpg]
So we will change all the default buttons to css buttons.

All you need to do is go to http://www.css3buttongenerator.com , Here is the code we are using our website
Code:
.button {
    -moz-box-shadow:inset 0px 1px 0px 0px #7d7d7d;
    -webkit-box-shadow:inset 0px 1px 0px 0px #7d7d7d;
    box-shadow:inset 0px 1px 0px 0px #7d7d7d;
    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #1E90FF), color-stop(1, #1E90FF) );
    background:-moz-linear-gradient( center top,#1E90FF 5%, #1E90FF 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#1E90FF', endColorstr='#1E90FF');
    background-color:#00b3ee;
    -moz-border-radius:6px;
    -webkit-border-radius:6px;
    border-radius:6px;
    border:1px solid #00b3ee;
    display:inline-block;
    color:#f5e9f5;
    font-family:Georgia;
    font-size:15px;
    font-weight:bold;
    padding:6px 24px;
    text-decoration:none;
    text-shadow:1px 1px 0px #ffffff;
}.button:hover {
    background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #00b3ee), color-stop(1, #00b3ee) );
    background:-moz-linear-gradient( center top, #00b3ee 5%, #00b3ee 100% );
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00b3ee', endColorstr='#00b3ee');
    background-color:#00b3ee;

}.button:active {
    position:relative;
    top:1px;

But this code gives BLUE CSS3 buttons , just change the background color to your forum color , Done! Heart

CSS3 POSTBIT BUTTONS :

Now You have changed the default buttons , you can also change ur postbit buttons also to CSS3 Style :

[Image: 40521Untitled.jpg]

What you do is :
Code:
ADMINCP/TEMPLATES/STYLE/TEMPLATES/YOUR TEMPLATES/FORUMDISPLAY/FORUMDISPLAY_NEWTHREAD

Now remove this code <img src=........../>
and replace it with

Code:
<input type="button" class="button" value="+Post a New Thread">

Done ! You do this same to all postbit templates liked edit,find etc.
Checkout the outcome.


Enough of views , start replying now !

290 Forum Icons 48*48 In Size And All Are Premium

$
0
0
To Decorate your forum you'll need custom icons for each forum Smile

This is my collection i collected it from various forums so yeah you can say i leeched them Toungue feel free to do whatever you want i am also including screens of those icons

If you need to know the tutorial for changing Custom Forum Icons ~ A Unique icon for Each Forum

To Download The Resource Check the attachment

[Image: 1gYf8.jpg]
[Image: cFDyA.jpg]
[Image: Xc2z8.jpg]
[Image: jvL8Z.jpg]
[Image: juyXv.jpg]
[Image: s0oJs.jpg]

[Tutorial]How To Add All Social Icons In Your Postbit Without Plugin

$
0
0
I was looking for some plugin for social sharing but couldn't find any plugin so with some other tutorial references i came up with this and i succeed to add social buttons into postbit Angel

Okay you need to follow these steps in order to get results like this

[Image: uGCWV.jpg]

Alright i know this is fantastic okay let's start:

Step:

Click Me And create an account here.

Okay so after signup choose the website marked in red box in image

[Image: O5DFu.jpg]

Now proceed to step 2

and choose the button size of your choice i am choosing only button no text.

[Image: 4qE7R.jpg]

alright after this proceed to step 3
[Image: Cchx6.jpg]

now select the social networks which you want to place in your list i used the most used one coz everybody has account on facebook,google+,twitter and so on so select what you want to give your audience as a sharing options.

okay click the FINISH:Get The Code button and a popup will came up


[Image: sJBYz.jpg]

okay so now you've 2 code i've marked them as code red and code blue

now copy the code red and go to


Code:
Admin Panel>Templates>Your Template>Ungrouped Templates>headerinclude

And search for
Code:
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
and paste the code before this line and save the template

now for the second code which is marked as blue in image copy that code and go to

Code:
Admin Panel>Templates>Your Template>Post Bit Templates>postbit

and paste it before the
Code:
</tbody>


and save it now you've the final output as

[Image: uGCWV.jpg]


If you wish to share this to any forum/blog please include my name there

Thanks Smile

Perfect rounded corners in MyBB

$
0
0
This thread was originally published on Animaus.com.

Here's the complete tutorial on rounding corners on MyBB. This will result in perfect corners across all the aspects of MyBB - including the User CP, Mod CP, index, showthread and User Profiles. I hope you enjoy it. Smile Note: There is only one template edit required for this tutorial - anyone can do it!

Previews:

.png  Mod CP.png (Size: 111.42 KB / Downloads: 91)
.png  Index.png (Size: 124.34 KB / Downloads: 65)
.png  Showthread.png (Size: 150.54 KB / Downloads: 53)
.png  User CP.png (Size: 154.27 KB / Downloads: 41)
.png  Thread bottom.png (Size: 131.6 KB / Downloads: 46)

Process:
First off you're going to need to go in to your Admin CP. Click on the top links to Templates and Style and click on your theme. For this tutorial I'll be using the MyBB default theme. From there, head in to global.css and follow the next few steps.

Add this to your .tborder class:
Code:
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;

Add this to your .thead class:
Code:
    -webkit-border-top-left-radius: 4px;
    -webkit-border-top-right-radius: 4px;
    -moz-border-radius-topleft: 4px;
    -moz-border-radius-topright: 4px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;

Add this to your .tfoot class:
Code:
    -webkit-border-bottom-right-radius: 4px;
    -webkit-border-bottom-left-radius: 4px;
    -moz-border-radius-bottomright: 4px;
    -moz-border-radius-bottomleft: 4px;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 4px;

Great! Now you've completed half of the tutorial. By now you should see some significant changes in your theme. But there's still a few bugs float around - for example if you go to your User CP / Mod CP / Profile - or even looking at a thread it doesn't look too good. That's what these handy CSS hacks are for. 8)

Click on Edit Stylesheet: Advanced Mode on your global.css file and add the follow:
Code:
/* Selects the bottom lefthand corner of your tables. */
tr:last-child > .trow1:first-child, tr:last-child > .trow2:first-child,  tbody:last-child tr:last-child > .tcat:first-child {
    -webkit-border-bottom-left-radius: 4px;
    -moz-border-radius-bottomleft: 4px;
    border-bottom-left-radius: 4px;
}

/* Selects the bottom righthand corner of your tables. */
tr:last-child > .trow1:last-child, tr:last-child > .trow2:last-child{
    -webkit-border-bottom-right-radius: 4px;
    -moz-border-radius-bottomright: 4px;
    border-bottom-right-radius: 4px;
}

/* Selects any table with the ID containing 'post' and gets rid of the rounding - this is for the showthread template. */
table[id*="post_"], td.post_buttons, tborder.posthead, tbody[id*="usercpp"] > tr:last-child > td, tbody[id*="modcpforums"] > tr:last-child > td{
    -webkit-border-radius: !important;
    -moz-border-radius: 0!important;
    border-radius: 0!important;
}

/* The custom template ID we added in to get rid of the ugly rounding on the showthread .thead */
table[id="notop"]{
    -webkit-border-bottom-right-radius: 0!important;
    -webkit-border-bottom-left-radius: 0!important;
    -moz-border-radius-bottomright: 0!important;
    -moz-border-radius-bottomleft: 0!important;
    border-bottom-right-radius: 0!important;
    border-bottom-left-radius: 0!important;
}

/* The custom template ID we added in to get rid of the ugly rounding on the showthread .tfoot */
table[id="nobottom"]{
    -webkit-border-top-left-radius: 0!important;
    -webkit-border-top-right-radius: 0!important;
    -moz-border-radius-topleft: 0!important;
    -moz-border-radius-topright: 0!important;
    border-top-left-radius: 0!important;
    border-top-right-radius: 0!important;
}
Scroll down in that box! I've added comments to explain what each segment does.
Edit: Added code to round the .tcat used in the Calendar. Thanks to Ryuuseiken for pointing it out.


By now everything should be looking pretty awesome. There's just one more step left! Open your Templates and go on to your themes' template set. Scroll down and find the Showthread Templates and click on it. From there, click on the showthread template set.

Find:
Code:
    {$ratethread}
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">

Replace with:
Code:
    {$ratethread}
    <table border="0" id="notop" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">

Find:
Code:
    <div id="posts">
        {$posts}
    </div>
    <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">

Replace with:
Code:
    <div id="posts">
        {$posts}
    </div>
    <table border="0" id="nobottom" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="border-top-width: 0;">

And you're done. Now you have beautiful rounding wherever you go on the forum. Toungue If there's a problem or you need help with something just let me know. If I helped you, don't be afraid to +Rep. Smile

Achieving a more streamlined Board Stats

$
0
0
This thread was originally publish on Animaus.com.

One thing that I personally don't find very attractive about MyBB is the "Board Statistics" section at the bottom of the index page. I find it can be too large and cluttered. This is a simple little template edit to achieve more of a streamlined and cleaner Board Statistics section on your forum. I'll once again be using the default MyBB theme for this demonstration.

Previews:

.png  Screen Shot 2013-01-10 at 11.02.28 PM.png (Size: 136.92 KB / Downloads: 116)
.png  Screen Shot 2013-01-10 at 11.02.06 PM.png (Size: 31.4 KB / Downloads: 105)

Process:
First, as always - log in to your Admin CP and go to the "Templates and Style" section of the control panel. Click on "Templates" and click on the set your current theme is using. Scroll down until you see the "Index Page Templates" set. Click to expand the templates and click on index_boardstats.

Replace the contents of index_boardstats with this:
Code:
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead" colspan="3">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['boardstats']}.gif" id="boardstats_img" class="expander" alt="[-]" title="[-]" /></div>
<div><strong>Forum Info</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['boardstats_e']}" id="boardstats_e">
<tr>
<td class="tcat" width="65%"><span class="smalltext"><strong>Who's Online</strong> [<a href="online.php">Complete List</a>]</td>
<td class="tcat" width="35%"><span class="smalltext"><strong>Board Statistics</strong> [<a href="stats.php">Full Statistics</a>]</td>
</tr>
{$forumstats}
{$birthdays}
</tbody>
</table>
<br />

Hit "Save and return to listing". Next, open the index_stats templates. Replace the contents:
Code:
<tr>
<td class="trow1" valign="top" align="left"><span class="smalltext">{$lang->online_note}<br />{$onlinemembers}</span></td>
<td class="trow1" valign="middle" align="left"><span class="smalltext">
{$lang->stats_posts_threads}<br />
{$lang->stats_numusers}<br />
{$lang->stats_newestuser}<br />
{$lang->stats_mostonline}
</span></td>
</tr>

Hit "Save and return to listing". Next, open the index_birthdays templates. Replace the contents with:
Code:
<tr><td class="tcat" colspan="2"><span class="smalltext"><strong>{$lang->todays_birthdays}</strong></span></td></tr>
<tr>
<td class="trow1" colspan="2"><span class="smalltext">{$bdays}</span></td>
</tr>
Thanks to Omar G. for pointing it out.

And that's it. It's all done. Smile If you want to change the width of either of the boxes, simple change the percentages (e.g 65%) to your desired value. You can also use px (e.g 350px). You know have a more streamlined and efficient Board Stats section on your index. Smile +Rep if you found this useful.

Like this tutorial? Check out perfect rounded corners in MyBB!

Enhanced Social Share buttons Tutorial without plugins

$
0
0
Hello guys,
Its been a long time since i have posted any tut,
Here is one for you.

Original Topic written for http://www.myskins.org

As said in the title, i present you enhanced social share buttons in Show Thread/post/topic without a plugin.

So lets start with :

1. Editing the Global.css :
Go to your theme > global.css > advanced mode
Add the following code at bottom of your global.css

Code:
.socialshare {
padding: 5px;
border-radius: 2px;
margin-top: -11px;
}

.sst {
background: #51CDF6;
border: 1px solid #4DB9D5;
padding: 5px;
text-align: center;
vertical-align: top;
-webkit-border-radius: 2px;
-khtml-border-radius: 2px;
border-radius: 2px;
float: left;
margin-right: 5px;
}

.ssg {
background: #D4503F;
border: 1px solid #CE0E0E;
padding: 5px;
text-align: center;
vertical-align: top;
-webkit-border-radius: 2px;
-khtml-border-radius: 2px;
border-radius: 2px;
float: left;
margin-right: 5px;
}

.ssf {
background: #4A65A1;
border: 1px solid #1D59A5;
padding: 5px;
text-align: center;
vertical-align: top;
-webkit-border-radius: 2px;
-khtml-border-radius: 2px;
border-radius: 2px;
float: left;
margin-right: 5px;
}

2. Editing the Templates :
Go to your theme templates > Showthread templates > showthread template.

Find :
Code:
<body>
{$header}
{$pollbox}


Add this code just after that

Code:
<div style="float: left" class="socialshare">
<span class="sst"><a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-lang="en" >Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></span>
<span class="ssg"><script type="text/javascript" src="https://apis.google.com/js/plusone.js">
  {lang: 'en'}
</script>
<g:plusone size="medium" href="{$mybb->settings['bburl']}/showthread.php?tid={$tid}"></g:plusone></span>
<span class="ssf"><iframe src="//www.facebook.com/plugins/like.php?href={$mybb->settings['bburl']}/showthread.php?tid={$tid}&amp;send=false&amp;layout=button_count&amp;width=130&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:130px; height:20px;" allowTransparency="true"></iframe></span>
<span class="ssf"><a title="Share On Facebook" href="http://www.facebook.com/share.php?u={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}" target="_blank" style="color: #FFF;"><img src="images/fb.png" alt="Facebook" style="padding-right: 5px;padding-bottom: 2px;vertical-align: middle;"/> <b>Share</b></a></span>
</div>
<br />

here is a preview of what you do : link

Live Demo : Click

Hope you guys like it Smile
P.S: Please give credits to me, if you post it on any other site.
Regards,

Changing link color of Thread/Forum with unread post

$
0
0
Hi,

Finally I get a way how to change the color of the thread (and his forum parent) containing a new unread post, and I want to share this with you:

CSS modifications:

Go to ACP Home » Themes » YourTheme » global.css » Advanced editing (top right)

1. find:
Code:
.subject_new {
    ....
}

add before the ending }
Code:
color: #CB296A !important;


2. Find:

Code:
.forumtitle {
    font-weight: bold;
}

add below:
Code:
.on {
      color: #CB296A !important;
}

(you can change the color #CB296A to what ever you want)
*******************************************************************************
Template modification:


Home » Template Sets » YourTheme Templates » Forum Bit » forumbit_depth2_forum:

Find:
Code:
<a class="forumtitle"

Change it to:
Code:
<a class="forumtitle {$lightbulb['folder']}"

Ads in Post ( Problem Solution )

$
0
0

Moderator Notice

Sorry for me ...If this is not relevant forum... But you can move this to there....


.png  screen shot.png (Size: 21.92 KB / Downloads: 38)

Hi ,


I am not expert of PHP,MYSQL,MYBB but I just released a "Best Inline ads" in post "manager" for MYBB .. I have developed this for my personal use .. Now i am submitting this to MYBB world ...

i am calling best as because .... i have added maximum customization to this plugin...(I am expecting more feature request from community)..
Now this plugin support only single ad code .. Next release would give more ad code managing....and lot other features


I am Giving Thanks to "Nayer" , i used some parts from whose "Postad" plugin


Download:

http://kreview.com/t-Best-Inline-ads-in-...ature-rich


Features:


1.You can Paste your ad code in given "Enter Ad code" to show in mybb posts


2.You can place ads in
1.First Post Only
2.On each pages first post
3.On focused post
4.On all post

3.You can Position the ads, placing in post
1.Right
2.Left
3.Top
4.Bottom


4.You can restrict where NOT to display Ads
Enter Forum ID separated with commas

5.You can restrict Usergroup to whom NOT to display Ads
Enter Usergroup ID separated with commas


Installation:

Upload bestads.php into inc/plugins

Activate in MYbb Admin Home=>Plugins

customisation in Board Setting/Configuration => BestAds

Adding "View New Posts" and "View Today's Posts" in Forum Jump List

$
0
0
This is with reference to this thread.
http://community.mybb.com/thread-133403.html

I've checked it from my end and working fine. However if there is any problem with the tutorial, please state so that I can update and finetune the tutorial.

This will add two more options "View New Posts" and "View Today's Posts" in your Forum Jump list.

Open your forumdisplay.php and locate the following code near about line 49 - 51

Code:
case "-5":
$location = "online.php";
break;

Now add just after that:

Code:
case "-6":
$location = "search.php?action=getnew";
break;

case "-7":
$location = "search.php?action=getdaily";
break;

Save your 'forumdisplay.php'.

Now open the template:
Forum Jump Templates > forumjump_advanced

find the line:

Code:
<option value="-1">{$lang->forumjump_home}</option>

Add just after that:

Code:
<option value="-6">{$lang->welcome_newposts}</option>
<option value="-7">{$lang->welcome_todaysposts}</option>

Save the template. You are done. Now you have "View New Posts" and "View Today's Posts" in your Forum Jump Dropdown list.

[Image: 8QppvoZ.png]

Max User Connections Workaround

$
0
0
Hello,
Due to this recent incident:
http://community.mybb.com/thread-133889-...#pid968998

I went to dig up an old solution I used on shared servers:

Code:
$dbusers = array(
array('user' => 'site_connect1', 'password' => 'DBPassword')
, array('user' => 'site_connect2', 'password' => 'DBPassword')
, array('user' => 'site_connect3', 'password' => 'DBPassword')
, array('user' => 'site_connect4', 'password' => 'DBPassword')
, array('user' => 'site_connect5', 'password' => 'DBPassword')
);
$mysql_user = $dbusers[rand(0, count($dbusers) - 1)];

$config['database']['type'] = 'mysql';
$config['database']['hostname'] = 'localhost';
$config['database']['username'] = $mysql_user['user'];
$config['database']['password'] = $mysql_user['password'];
$config['database']['database'] = 'site_database';
$config['database']['table_prefix'] = 'mybb_';

Replace your Database portion in the config.php
You will have to create multiple accounts to the database, there is no limit. I used up to 20 or so at one point.

How this works is when a user accesses your board, they're randomly given a database account to use. So the likely hood of 20, or even 10 people using the same account simultaneously reduces greatly, and the max user connection errors are gone.

Be aware though that not all hosting will allow this, and you may receive cease & desist warnings. If that should happen, be prepared to find a new host. But it's an easy way to get around the max user connections issue.

Custom Style Manager [Tutorial]

$
0
0
First, I'm sure it's been posted somewhere, but I want to give a descriptive tutorial.
This is my first tutorial. Please do not hate. Criticism accepted, and welcomed, but flaming and hate, I do not want.
LET'S GET STARTED!

First thing: What is a user title?
The user title is the little words under a username.
EG:
Eskii[Image: buddy_online.gif]
Junior Member
[Image: star.gif][Image: star.gif]

The bolded part is the user title. You can change this to make it colorful, or glowing/animated just like the username, and just as simply.


Step 1):
Login to your ACP and go to the group you want to edit
ACP > Users & Groups > Groups > Group you want to edit

Now scroll down to where you see "Default User Title"
Now NORMALLY, you'd just put "Admin" or "Mod", but using this simple code you can make it look like: Admin

Next Step:
When you edit the usergroup name to make your username colored/animated (the way I have above) you'd use:
Code:
<span style="color: red;"><strong>{username}</strong></span>

Instead of posting THAT on the "Default User Title" you would use:
Code:
<span style="color: red;"><strong>Title</strong></span>

The ONLY difference is instead of using
{username} you use the name of the title.

Hope this helps!
~Eskii


NEXT TUTORIAL:
How to make specific usergroups have colored background colors!
(will be posted in a couple of minutes.)

Post background color depending on usergroup [TUTORIAL]

$
0
0
My last tutorial was a little long. So this one will be short!

Steps in simple:
ACP > Templates & Style > Themes > Add code > Templates > Add code
Easy in theory? Yes. Good..
OK now here is the long steps....

ACP > Templates & Style > Themes
Now choose the theme you are currently using.
Click "options"
Then "edit theme"
Now click on "showthread.css"
Add this to the VERY bottom of that:
Code:
.usergroup4 {
    color: white;
    background-color: red;
    background-image: none;
}
Let's review this code before we move on, so that way it makes sense.

".usergroup4" That little 4 number is the GID, that be found very easily, but I will not explain that.
Change that number, to the GID of the group you want to color.
Don't mind the "color: white;"

The "background-color: red;" is the color of the post background. This can be used like "red" or HEX codes such as "#FF0000"

The "background-image: none;" is the URL of a background image you want to use.

Now lets move to the next step:
Go to templates > Choose the theme you choose before
Click "Options"
Click "Expand Templates"
Now here is where it gets confusing.
There should be a big list of words.
Find the one that says "Post bit templates" easily by hitting
"CTRL+F" and typing "Post bit templates"
Now click on "Post bit"
Click on the first link called "Postbit"
Replace the current code with this:
Code:
{$ignore_bit}
<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
     <tbody>
         <tr>
             <td class="tcat">
                 <div class="float_left smalltext">
                     {$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
                 </div>
                 {$post['posturl']}
             </td>
         </tr>

         <tr>
             <td class="trow1 {$unapproved_shade}">
                 <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
                     <tr>
                         <td class="post_avatar" width="1" style="{$post['avatar_padding']}">
                             {$post['useravatar']}
                         </td>
                         <td class="post_author">
                             <strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
                             <span class="smalltext">
                                 {$post['usertitle']}<br />
                                 {$post['userstars']}
                                 {$post['groupimage']}
                             </span>
                         </td>
                         <td class="smalltext post_author_info" width="165">
                             {$post['user_details']}
                         </td>
                     </tr>
                 </table>
             </td>
         </tr>

         <tr>
             <td class="trow2 post_content usergroup{$post['usergroup']} {$unapproved_shade}">
                 <span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>

                 <div class="post_body" id="pid_{$post['pid']}">
                     {$post['message']}
                 </div>
                 {$post['attachments']}
                 {$post['signature']}

                 <div class="post_meta" id="post_meta_{$post['pid']}">
                 {$post['iplogged']}
                 </div>
             </td>
         </tr>

         <tr>
             <td class="trow1 post_buttons {$unapproved_shade}">
                 <div class="author_buttons float_left">
                     {$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
                 </div>
                 <div class="post_management_buttons float_right">{$post['button_spam']}{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
                 </div>
             </td>
         </tr>
     </tbody>
</table>
I hope this helps you, and I will help you with any problems you have (hopefully)

NOTE!!!!!! I DID NOT CREATE THIS CODE!!! ALL CREDIT GOES TO LEEFISH, THE ONLY THING I DID WAS ADVERTISE IT!!!!

By the way: forget the short.

[Tutorial] Banning CAPSLOCK / shouting in posts

$
0
0
This modification will stop your users from "shouting" in posts. (Posting with caps-lock on for everything)

Open inc/class_parser.php.

Find:
PHP Code:
        // Get rid of cartridge returns for they are the workings of the devil
        
$message str_replace("\r"""$message); 

Add below:
PHP Code:
        // Caps lock / shouting? Nonono!
        
if(strtoupper($message) == $message) {
        
$message strtolower($message);
        
$message ucfirst($message);
        } 



Example:
"OH MY GOD YOU ARE STUPID"
will become:
"Oh my god you are stupid"


-Brandon

Using CSS Sprites for On/Off/Offlock

$
0
0
I don't think there's a tut for this yet, so I figured I'd make one real quick.

Alright, so first things first we'll have to turn our on/off/offlock icons into a sprite. So what we'll have to do is find the size of our icons, multiply either the height/width by 3, then order them vertically/horrizontally respectively (Say that 5 times fast).

If I lost you somewhere, here's an example. The default MyBB icons are 22px by 22px. So we'll multiply the height by 3, which gives us 66px. In Photoshop we create a 66px by 22px canvas, and stick in the images like so:

[Image: iUfYNRxu5sv71.png]

(Feel free to use this image and skip that step)



Next we'll want to change the way MyBB picks the images. By default it finds the correct image folder, then looks for on.gif, off.gif, and offlock.gif. However this won't work for CSS sprites, since we need to specify the background location with CSS. So let's find the template MyBB decides to do this.

Navigate to:
Template Sets » Default Templates » forumbit_depth2_forum

And find this code:
Code:
<img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />

We'll have to change it so that instead of checking for an image, it checks for a class. So let's try this instead:

Code:
<div class="forumbit_{$lightbulb['folder']}" title="{$lightbulb['altonoff']}"></div>

Alright, so there's only one step left. Positioning the image to work through CSS. So just add this to your global.css file (changing the image path to the correct path to the image):

Code:
.forumbit_on, .forumbit_off, .forumbit_offlock {
background: url(path/to/css/sprite.png) no-repeat center center;
width: 22px;
height: 22px;
}

.forumbit_on { background-position: 0 0; }
.forumbit_off { background-position: 0 -22px; }
.forumbit_offlock { background-position: 0 -44px; }

And there you go, the server is only loading 1 image instead of 3 now. You can combine this with other images throughout your theme to cut down on load time even more. Smile


If you want to retain clicking a node icon to mark all threads as read, continue reading, else you're finished.

First up you'll want to create a transparent image the same size as one of your icons (Important: Not the size of the whole sprite), in our case 22px by 22px. Upload that to the same place your sprite is located.

Now we'll go back into our template and replace this:

Code:
<div class="forumbit_{$lightbulb['folder']}" title="{$lightbulb['altonoff']}"></div>

with this (changing the image path to the correct path to the image):

Code:
<div class="forumbit_{$lightbulb['folder']}">
<img src="path/to/css/transparent.css" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" />
</div>

Remember this now means you're loading 2 resources instead of 1, though if you use the CSS Sprite for more than just these 3 images (on/off/offlock), your server will still love you.

Imgur Upload

$
0
0
1 - Get imgur api key: https://imgur.com/register/api_anon

2 - Create imgur.php in root

PHP Code:
<html>
<
head>
<
title>Upload to Imgur</title>
</
head>
</
html>
<
div><img src="images/imgur.png" border="0" /></div>
<
br /><br />
<
button onclick="document.querySelector('input').click()">Select file...</button>
<
input style="visibility: collapse; width: 0px;" type="file" onchange="upload(this.files[0])">

<
script>
    
window.ondragover = function(e) {e.preventDefault()}
    
window.ondrop = function(e) {e.preventDefault(); upload(e.dataTransfer.files[0]); }
    function 
upload(file) {

        
/* Is the file an image? */
        
if (!file || !file.type.match(/image.*/)) return;

        
/* It is! */
        
document.body.className "uploading";

        
/* Lets build a FormData object*/
        
var fd = new FormData(); // I wrote about it: https://hacks.mozilla.org/2011/01/how-to-develop-a-html5-image-uploader/
        
fd.append("image"file); // Append the file
        
fd.append("key""your key"); // Get your own key http://api.imgur.com/
        
var xhr = new XMLHttpRequest(); // Create the XHR (Cross-Domain XHR FTW!!!) Thank you sooooo much imgur.com
        
xhr.open("POST""http://api.imgur.com/2/upload.json"); // Boooom!
        
xhr.onload = function() {
            var 
code '[img]' JSON.parse(xhr.responseText).upload.links.original '[/img]';
            var 
editor = eval('opener.' 'clickableEditor');
            
editor.performInsert(code);
            
javascript:window.close()
        }
        
// Ok, I don't handle the errors. An exercice for the reader.

        /* And now, we send the formdata */
        
xhr.send(fd);
    }
</script>

<!-- Bla bla bla stuff ... -->

<style>
    body {text-align: center; background-color: #181817; overflow-x:hidden; overflow-y:auto;}
    div { background-color: rgb(43, 43, 43); border-bottom: 4px solid rgb(68, 68, 66); margin: -8px;}
    p {display: none}
    .uploading p {display: inline}
</style>
<br /><br />
<p><img src="images/loader.gif" border="0" /></p> 

2.1 - Change your key in imgur.php with key obtained in 1

3 - Copy loader.gif and imgur.png in images folder of your mybb installation.

4 - Copy imgurbut.png in jscripts/editor_themes/default/images/ and jscripts/editor_themes/office2007/images/

5 - Open jscripts/editor.js

5.1 - Find

Code:
{type: 'button', name: 'img', sprite: 'image', insert: 'image', extra: 1, title: this.options.lang.title_image},

5.2 - Add after

Code:
{type: 'button', name: 'imgur', insert: 'imgur', image: 'imgurbut.png', title: 'Upload to Imgur'},

5.3 - Find

Code:
insertIMG: function()
    {
        image = prompt(this.options.lang.enter_image, "http://");

        if(image)
        {
            this.performInsert("[img]"+image+"[/img]", "", true);
        }
    },

5.4 - Add after

Code:
insertImgur: function()
    {
        MyBB.popupWindow('imgur.php', 'imgur', 240, 200);
    },

5.5 - Find

Code:
case "image":
                this.insertIMG();
                break;

5.6 - Add after

Code:
case "imgur":
                this.insertImgur();
                break;

Credit: https://hacks.mozilla.org/category/drag-.../complete/

.gif  loader.gif (Size: 6.22 KB / Downloads: 279)

.png  imgur.png (Size: 2.26 KB / Downloads: 280)

.png  imgurbut.png (Size: 1.13 KB / Downloads: 278)

Color All Post Backgrounds of a Usergroup

$
0
0
This tutorial is for those who want some specific usergroup's posts be different from the others. Like say all moderators' post background to be some different color. We can do it without using any plugin. Let's discuss about that trick today.

First we have to add a special class to our postbit templates to override the default post colors. For that open the template:

ACP > Templates & Styles > Templates > [Theme Name] Templates > Postbit Templates > postbit

and find:

Code:
<td class="trow2 post_content {$unapproved_shade}">

Now we have to add our special class post{$usergroup['gid']} to it. So, change the code to:

Code:
<td class="trow2 post_content post{$usergroup['gid']} {$unapproved_shade}">

Note that: You have to place the class
a) after class 'trow2' else the 'trow2' background color will govern.
b) before class'{$unapproved_shade}' so that Unapproved post's color can lead over any user's post.

Do the same thing with postbit_classic template. Open:

ACP > Templates & Styles > Templates > [Theme Name] Templates > Postbit Templates > postbit_classic

and find:

Code:
<div id="pid_{$post['pid']}" class="post_body">

Change the code to:

Code:
<div id="pid_{$post['pid']}" class="post_body post{$usergroup['gid']}">

Now the CSS, main trick part. Our dynamic class 'post{$usergroup['gid']}' will change at runtime based on group ID. ie. for all the posts of admins (default group ID is 4) it will be post4, for all the posts of members (default group ID is 2) it will be post2

So, as we said, if we want to target the specific group, for our example, say Moderators (default group ID is 6) we will declare our CSS class as .post6

Now, open your global.css and add at the end (or any suitable location):

Code:
.post6 { background: #FDB5FF; }

and save global.css.

Now the background of all posts made by any Moderator is a decent light pink.
We can change post backgrounds for as many usergroups as we wish using this trick, only we need to know the target group ID and change the number at the end of the class in css as per that group ID.

Add Social Links to Your MyBB Forum

$
0
0
Original Tutorial on : http://www.myskins.org

Hello guys,
I have been asked by many people on how to add social links into the footer or header or where ever possible just like my site.

So i am making a tutorial on how to add the links to your footer, the social icons.

So the first thing you need is to have a Social icon set.
Example down load this set : Link

Create a Folder called Social in your server, which means in public_html > Images > Social.

Upload whatever icons you need to show.

Now into the coding :
First the css task:

All you need to do is copy this code and place it at the bottom of your global.css of your theme.

Code:
.fb a {
    background: url(images/Social/facebook.png) no-repeat;
    width: 32px;
    height: 32px;
    display: block;
    opacity: 0.8;
    float: right;
    padding-right: 5px;    
     -webkit-transition: all 250ms ease-in-out;
       -moz-transition: all 250ms ease-in-out;
       -o-transition: all 250ms ease-in-out;
       transition: all 250ms ease-in-out;
}

.fb a:hover {
   opacity: 1;
}

.tw a {
    background: url(images/Social/twitter.png) no-repeat;
    width: 32px;
    height: 32px;
    display: block;
     opacity: 0.8;
    float: right;
    padding-right: 5px;
     -webkit-transition: all 250ms ease-in-out;
       -moz-transition: all 250ms ease-in-out;
       -o-transition: all 250ms ease-in-out;
       transition: all 250ms ease-in-out;
}

.tw a:hover {
   opacity: 1;
}


The example is above has only facebook icon and twitter icon.
If you need extra icons, just make another class and copy the facebook code into it.

Now the Html time:

Below is the code which i have added into footer template.
You can add it any where to your likes.

Code:
<div>
<span class="tw"><a href="https://twitter.com/" target="_blank" title="Follow us on Twitter"></a></span>
<span class="fb"><a href="https://www.facebook.com/" target="_blank" title="Like Us on Facebook"></a></span>
<span style="float: right;padding: 5px;font-size: 18px;color: #606060;">Social Links :</span>
</div>
All you need is to modify the links in the code, that links your profile in the respective network.

Preview: http://www.myskins.org look at footer .

This finishes the tutorial, and it is as simple as it takes less than 10 minutes.

Hope this helpful, and feel free to ask your questions.
regards,

Makeup for MyBB forum with 3d fold-in menu

$
0
0
An experimental CSS 3D fold-in menu. Works in any browser that supports CSS 3D transforms,
So , first see pictures ( and also demo site ).
This work is adapted from Hakim (meny project).
If you like it and want it , I teach How to setting in forum ( I did it in default template ) step by step .

1 - Upload js & css folders in root
2 - Go to Template ---> default template ( you can edit for your template ) ----> Edit template ---> header template ---> header ---- > replace all with below code

PHP Code:
<div id="container">
        <
a name="top" id="top"></a>
        <
div id="header">
            <
div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}alt="{$mybb->settings['bbname']}title="{$mybb->settings['bbname']}/></a></div>
            <
div class="menu">
                <
ul>
                    <
li><a href="{$mybb->settings['bburl']}/search.php"><img src="{$theme['imgdir']}/toplinks/search.gif" alt="" title="" />{$lang->toplinks_search}</a></li>
                    <
li><a href="{$mybb->settings['bburl']}/memberlist.php"><img src="{$theme['imgdir']}/toplinks/memberlist.gif" alt="" title="" />{$lang->toplinks_memberlist}</a></li>
                    <
li><a href="{$mybb->settings['bburl']}/calendar.php"><img src="{$theme['imgdir']}/toplinks/calendar.gif" alt="" title="" />{$lang->toplinks_calendar}</a></li>
                    <
li><a href="{$mybb->settings['bburl']}/misc.php?action=help"><img src="{$theme['imgdir']}/toplinks/help.gif" alt="" title="" />{$lang->toplinks_help}</a></li>
                </
ul>
            </
div>
            <
hr class="hidden" />
            <
div id="panel">
                {
$welcomeblock}
            </
div>
        </
div>
                <
navigation>
            <
br />
<
link rel="stylesheet" href="{$mybb->settings['bburl']}/css/3d_menu.css">
        <
div class="meny">
            <
h2>Menu</h2>
            <
ul>
                <
li><a href="{$mybb->settings['bburl']}/search.php">Search</a></li>
                <
li><a href="{$mybb->settings['bburl']}/memberlist.php">Memberlist</a></li>
                <
li><a href="{$mybb->settings['bburl']}/calendar.php">Calendar</a></li>
                <
li><a href="{$mybb->settings['bburl']}/misc.php?action=help">Help</a></li>
                <
li><a href="{$mybb->settings['bburl']}/usercp.php">CP</a></li>                
            </
ul>
        </
div>
<
div class="meny-arrow"></div>
        <
div class="contents"><article>            
                        {
$pm_notice}
            {
$bannedwarning}
            {
$bbclosedwarning}
            {
$unreadreports}
            {
$pending_joinrequests}</article>
        <
script src="{$mybb->settings['bburl']}/js/meny.js"></script>
        <script>
            // Create an instance of Meny
            var meny = Meny.create({
                // The element that will be animated in from off screen
                menuElement: document.querySelector( '.meny' ),
                // The contents that gets pushed aside while Meny is active
                contentsElement: document.querySelector( '.contents' ),
                // [optional] The alignment of the menu (top/right/bottom/left)
                position: Meny.getQuery().p || 'right',
                // [optional] The height of the menu (when using top/bottom position)
                height: 200,
                // [optional] The width of the menu (when using left/right position)
                width: 260,
                // [optional] Distance from mouse (in pixels) when menu should open
                threshold: 40
            });
            // API Methods:
            // meny.open();
            // meny.close();
            // meny.isOpen();
            // Events:
            // meny.addEventListener( 'open', function(){ console.log( 'open' ); } );
            // meny.addEventListener( 'close', function(){ console.log( 'close' ); } );
            // Embed an iframe if a URL is passed in
            if( Meny.getQuery().u && Meny.getQuery().u.match( /^http/gi ) ) {
                var contents = document.querySelector( '.contents' );
                contents.style.padding = '0px';
                contents.innerHTML = '<div class="cover"></div><iframe src="'+ Meny.getQuery().u +'" style="width: 100%; height: 100%; border: 0; position: absolute;"></iframe>';
            }
        </script> 

Complete . Big Grin
Now you have a 3d fold-in menu .

For more information about customize setting

https://github.com/hakimel/meny
demo http://lab.hakim.se/meny/

.png  2013-03-03_122305.png (Size: 149.71 KB / Downloads: 44)

.png  2013-03-03_122249.png (Size: 153.14 KB / Downloads: 46)

.png  2013-03-03_122434.png (Size: 138.9 KB / Downloads: 48)

.zip  3d_fold-in_menu.zip (Size: 5.91 KB / Downloads: 5)
Viewing all 690 articles
Browse latest View live