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

A Tutorial To Fix A Few Problems You May Get With MyBB

$
0
0
Welcome To My Tutorial
I'll be showing you how to fix some errors / problems you may get well using MyBB.
I'll also have a few how to's in here.


1. Remove Date User Joined In Post

Go to

Admin CP -> Templates & Styles -> "Your Theme" -> Post Bit Templates -> Postbit_author_user

Remove {$lang->postbit_joined} and save.


2. Disable A A[b]ttachment Type[/b]

Go to

Admin CP -> Configurations -> Attachment Types

Now you can remove / add new attachment types.


3. Disable All Plugins At Once

Go to

Admin CP -> Configurations -> General Configurations

and now go down until you see "Disable All Plugins" and click "Yes" and save.


4. [b]Configure Search Friendly URLs[/b]

Go to

Admin CP -> Configurations -> Server and Optimization Options

Then change "Enable search engine friendly URLs?" to "Enable" Once this setting is enabled you need to make sure you have the MyBB .htaccess in your MyBB root directory (or the equivalent for your web server). Automatic detection may not work on all servers. Please see the MyBB Docs for assistance.


5. Database Error
"MyBB has experienced an internal SQL error and cannot continue.
SQL Error:1045 - Access denied for user [email=foo_mybb'@'localhost]'foo_mybb'@'localhost'[/email] (using password: YES)Query:[READ] Unable to connect to MySQL server
Please contact the MyBB Group for technical support."

To fix

~/inc/config.php file consists of database configuration settings. 
your forum's database password needs to be changed in it.
PHP Code:
~/inc/config.php file consists of database configuration settings
 
your forum's database password needs to be changed in it. 
more details : config.php


6. [b]Make Portal As Home Page[/b]

simple method is to use directory index rule in .htaccess file (assuming that server is Apache)
PHP Code:
DirectoryIndex portal.php index.php index.html index.htm 


7. Change The Text on MyBB landing/Login Page

The content is from header_welcomeblock_guest template of the theme.

[templates guidance]


8. Changing The Database Name

You can change database name & its related configuration in ~/inc/config.php file 

see more details => config.php file


9. Can't Login

Open ~/inc/settings.php file & remove / at the end of cookie domain value
then you should be able to login to forum admin panel 
again remove trailing slash used for cookie domain at Site Details page of Configuration section.


10. Error 44

Error Type: MyBB Error (44)


Error Message: MyBB was unable to load the SQL extension.  

Information: This can occur when the database type is incorrect in inc/config.php file. 

To fix this, open inc/config.php file and check the entry for $config['database']['type'].
A common issue is having mysql instead of mysqlior having mysqli instead of mysql

If you do not know what needs to be here, contact your host provider.


11. Logout A Banned User

In general, forum content is not visible to the banned users & they get banned message for all pages


If banned user is logged out then gets guest status & access to forum content unless you have set forced login


12. Change Default Forum avatar

Go to 
Code:
root/images/default_avatar.png

path and add the image you want.

13. Change Max Avatar Size
Go to Admin CP > Configuration > Settings > Show Thread Options > Maximum Avatar Dimensions in Posts.


Go to Admin CP > Configuration > Settings > User Registration and Profile Options > Maximum Avatar Dimensions.

Go to Admin CP > Configuration > Settings > Member List > Maximum Display Avatar Dimensions.

Change all of them to 26x26, unless you want it configured differently.


14. Attachment In Post Larger

forum admin panel >> Configuration (Settings) >> Attachments 
>> Show Attached Thumbnails in Posts >> select full size image & save the settings


15. Remove Date & Time From Post


You can remove {$lastpost_date} from templates => forumbit_depth1_forum_lastpost &  forumbit_depth2_forum_lastpost 


Also you can remove {$lastpostdate} from templates => forumdisplay_thread , search_results_threads_thread , portal_latestthreads_thread ...


16. Edit Post Templates

admin panel >> Templates & Style >> Templates >> [your theme templates] >> 

Edit Post Templates >> editpost_delete


see also : templates related guidance | expanding all templates


17. Edit Menu Bar

Go to Admin CP -> Templates & Styles -> Templates -> 'Your Theme' -> Header Templates -> header and edit that file


18. Get Rid of Thread Passwords

It is set in the forum settings in forum management section of admin panel

you have to edit that forum & remove the password


I hoped I help! I know I didn't cover everything but it's better then nothing.

Useful Codes for MyBB Beginners

$
0
0
I don't know if this is already posted .
Just Letting the MyBB Beginners to know some useful codes for MyBB .

Code:
{$welcomeblock} - Include welcomeblock (user/guest view of the member bit)
{$mybbversion} - Displays softwares version
{$modcplink} - Displays link to Mod CP
{$admincplink} - Displays link to Admin CP (exclude for clients safety - reinstate it if requested)

{$mybb->settings['bbname']} - Displays boards name
{$mybb->settings['bburl']} - Displays URL to the board (use always when you have to link to something)
{$mybb->settings['homename']} - Displays homepage name (the one in the footer's menu)
{$mybb->settings['homeurl']} - Displays URL to the homepage site (the one in the footer's menu)

{$mybb->user['username']} - Displays users username
{$mybb->user['usertitle']} - Displays users usertitle
{$mybb->user['uid']} - Displays users UID (User ID)
{$mybb->user['avatar']} - Displays URL of the users avatar
{$mybb->user['lastvisit']} - Displays users last visit (date and time)
{$mybb->user['totalpms']} - Displays the total number of users messages (unread + read)
{$mybb->user['unreadpms']} - Displays number of users unread messages
{$mybb->user['postnum']} - Displays the users post count
{$mybb->user['logoutkey']} - Displays users logout key (used to logout successfully)

{$theme['imgdir']} - Displays themes image dirrectory
{$theme['imglangdir']} - Displays language specific theme image dirrectory
{$theme['tid']} - Displays the themes ID number
{$theme['logo']} - Displays themes logo
{$theme['borderwidth']} - Displays themes borderwidth number
{$theme['tablespace']} - Displays themes tablespace number

{$forum['name']} - Displays forums title
{$forum['description']} - Displays forums description
{$forum['url']} - Displays forums URL
{$forum['fid']} - Displays forums ID number

Enable Systemd Timers to Handle MyBB Task System

$
0
0
Create the following two files in your /etc/systemd/system/ directory:

/etc/systemd/system/mybb.service
Code:
[Unit]
Description=MyBB Tasks

[Service]
User=www-data
ExecStart=/usr/bin/php /var/www/mybb/task.php

/etc/systemd/system/mybb.timer
Code:
[Unit]
Description=Runs MyBB tasks every minute

[Timer]
OnBootSec=5min
OnUnitActiveSec=1min
Unit=mybb.service

[Install]
WantedBy=multi-user.target

Now, run the following commands in your terminal:
Code:
systemctl daemon-reload
systemctl enable mybb.timer
systemctl start mybb.timer

[1.8] [1.6] Forums and Categories In Columns

$
0
0
Hello,

Today I will be telling you how you can make your forum layout like TheTechGame.com by having your forums and categories in columns.

Note: This tutorial was only tested on 1 theme which was Star Gaming. https://community.mybb.com/mods.php?acti...ns&pid=966

P.S: This code hasn't been tested in all browsers and may not work on all themes. MAKE A THEME / TEMPLATE BACKUP!

Let's begin. Go to
Admin CP -> Templates & Styles -> Templates -> 'Your Theme' -> Forum Bit Templates -> forumbit_depth1_cat and replace all with:

Code:
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="width:50%;float:left;">
<thead>
<tr>
<td class="thead" colspan="5">
<div class="expcolimage"><img src="{$theme['imgdir']}/{$expcolimage}" id="cat_{$forum['fid']}_img" class="expander" alt="{$expaltext}" title="{$expaltext}" /></div>
<div><strong>{$forum['name']}</strong><br /><div class="smalltext">{$forum['description']}</div></div>
</td>
</tr>
</thead>
<tbody style="{$expdisplay}" id="cat_{$forum['fid']}_e">
{$sub_forums}
</tbody>
</table>


Then
Admin CP -> Templates & Styles -> Templates -> 'Your Theme' -> Forum Bit Templates -> Forumbit_depth1_cat_subforum and replace all with:
Code:
<tr>
<td class="tcat" colspan="6"><strong>&raquo;&nbsp;&nbsp;<a href="{$forum_url}">{$forum['name']}</a></strong><br /><span class="smalltext">{$forum['description']}</span></td></tr>{$sub_forums}


Then
Admin CP -> Templates & Styles -> Templates -> 'Your Theme' -> Forum Bit Templates -> forumbit_depth2_cat and replace all with:

Code:
<tr>
<td class="{$bgcolor}" align ="center" valign="top" width="1"><img src="{$theme['imgdir']}/{$lightbulb['folder']}.gif" alt="{$lightbulb['altonoff']}" title="{$lightbulb['altonoff']}" class="ajax_mark_read" id="mark_read_{$forum['fid']}" /></td>

<td class="{$bgcolor}" valign="top">
<strong><a href="{$forum_url}">{$forum['name']}</a></strong>{$forum_viewers_text}<div class="smalltext">{$forum['description']}{$subforums}</div>
</td>


Then
Admin CP -> Templates & Styles -> Templates -> 'Your Theme' -> Forum Bit Templates -> forumbit_depth2_forum and replace all with:
Code:
<tr>
<td class="{$bgcolor}" align="center" valign="top" width="1"></td>
<td class="{$bgcolor}" valign="top">
<div class="smalltext">{$forum['description']}{$modlist}{$subforums}</div>
</td>


Then
Admin CP -> Templates & Styles -> Templates -> 'Your Theme' -> Forum Bit Templates -> forumbit_depth3 and replace all with:

Code:
<li>{$statusicon}<a href="forumdisplay.php?fid={$forum['fid']}">{$forum['name']}</a></li>


Then
Admin CP -> Templates & Styles -> Templates -> 'Your Theme' -> Forum Bit Templates -> forumbit_subforums and replace all with:
Code:
<ul class="columns"><font size="3px">{$sub_forums}</font></ul>



The CSS

Go To
Admin CP -> Templates & Styles -> Themes -> 'Your Theme' -> global.css and add

Code:
.columns {
list-style: none;
margin: 0;
padding: 0;
padding-right: 55px;
width: 100%;
}

.columns li {
width: 47%;
float: left;
}
It should look like:
[Image: 07_CB7741_2_E8_D_438_C_BF8_F_CA37_B928558_C.jpg]

For a live preview click Here
READ: Since you will have to use sub forums make sure to go to your Admin CP and make a new forum name it “.” And put it in the category you want and add the forums in that category to the forum you named “.”

If I messed up the code or you want to add anything just post below. Also if this help you should +REP me thanks.

how do i display google adsense

$
0
0
forum http://www.relationshipvilla.com/forum

please i have tried my advertisment and ads manager but none is working and whenever i use this [<div align="center">
**ads**
</div>] on template e,g header i get this error Please make sure you have all the input required to edit this template (tid and sid) , please how do i add my adsense code on header, middle of post and above reply box .  

How to make Myreaction plugin responsive

$
0
0
All you have to do is just go here (I wouldn't do this if you had a non-responsive theme as it's not worth, but if you had a responsive theme like myself, then go ahead and do this as it makes the reaction adding panel responsive. )

Home » Template Sets » Global Templates » Edit Template: myreactions_react

And Replace the first line with following.


Code:
<div class="modal" style="height: 80%;width: 70%;overflow: scroll;margin-left: -468.5px;">

[Image: XhiejWW.png]

Rank CSS

$
0
0
is there a way I can add rank images from CSS to my user groups I know Xenforo has it does Mybb?

How to make Myreaction plugin responsive

$
0
0
All you have to do is just go here (I wouldn't do this if you had a non-responsive theme as it's not worth, but if you had a responsive theme like myself, then go ahead and do this as it makes the reaction adding panel responsive. )

Home » Template Sets » Global Templates » Edit Template: myreactions_react

And Replace the first line with following.


Code:
<div class="modal" style="height: 80%;width: 70%;overflow: scroll;margin-left: -468.5px;">

[Image: XhiejWW.png]

Daily Post Goal Progress Bar/Color

$
0
0
https://community.mybb.com/mods.php?action=view&pid=783

After hours of digging I couldn't find a guide or tutorial how to do this until I decided to play around with the template and the codes to get it working. I will be providing the templates and .css, please remember that the progress bar when it goes to 100% or any other it will show a different color since I'm giving you my .css your more than welcome to play around with the colors yourself. If the template messes up play around with it because some forums may have custom themes!

Paste this code into postgoal template
Code:
<table class="tborder" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td class="thead" align="left">Daily Post Goal</td> </tr>
<tr>
<td class="trow1">
<span style="color:#9DAAAA">Posts:</span><span style="float:right;color: #9DAAAA;"> {$fetch}/{$postgoal}</span>
</td>
</tr>
<tr>
<td class="trow1">
<span style="color:#9DAAAA">Status:</span><if $fetch >= $postgoal then><span style="color: #00BF00;float:right;">Reached</span><else> <span style="color: #e03131;float:right;">Not Reached</span></if>
</td>
</tr>
<tr>
<td class="trow1">
<div class="prog-bar-border">
<div id="progress_bar" class="prog-bar-haxzz">
   <span id="prog-count" style="width: 0%"></span>
   <p id="prog-percent">0%</p>
</div></div>
</td> </tr> </td> </tr> </tbody> </table>

<script>
function setProgress(i){
var y = Math.round( i );
$('#prog-percent').html(y+'%');
var red = 0, green = 0;
if (i >= 80) {
       red = 137 - Math.round(((i - 137) / 34) * 34);
       green = 34;
   } else if (i >= 60) {
       red = 137;
       green = Math.round(((i - 137) /34) * 34);
   } else {
       red = 137;
       green = 34;
   }
$('#prog-count').css('background', "rgb(" + red + "," + green + ",34)");
if (i > 70){
$('#prog-percent').css('color', 'white');
} else {
$('#prog-percent').css('color', '#fff');
}
$('#prog-count').width(i+'%');
}
(function() {
var i = 0;
var n = "{$fetch}";
var o = parseInt(n.replace(',', ''));
var p = {$postgoal};
i = (o/p)*100;
if (i > 100) i = 100;
if (i < 0) i = 0;
setProgress(i);
})();
</script>

Paste this inside global.css
Code:
.prog-bar-border {
   background: #202020;
   position: relative;
   display: block;
   vertical-align: middle;
   height: 100%;
   border-radius: 1px;
   line-height: 30px;
   overflow: hidden;
}

.prog-bar-haxzz {
   background: #202020;
   width: 100%;
   color: white;
   position: relative;
   display: block;
   text-align: center;
   vertical-align: middle;
   height: 100%;
   border-radius: 6px;
   line-height: 27px;
   overflow: hidden;
}

.prog-bar-haxzz>span {
   position: absolute;
   display: block;
   top: 0;
   left: 0;
   bottom: 0;
   border-radius: 1px;
   background: rgba(82,82,82,0.8);
}

.prog-bar-haxzz>p {
   font-weight: 500;
   display: inline;
   position: relative;
   z-index: 1;
}

Preview:
[Image: mXoItim.png]

If you need help with the progress bar color let me know. Smile

Font-Awesome Forum Icons

$
0
0
https://community.mybb.com/thread-156711.html
^^ Don't know what happened to that post <snip> so here's the tutorial for all those newbies. Big Grin

Font-Awesome Forum Icons on MyBB 1.8 Software

Today, I will be giving you a tutorial on how to replace forum icons with Font-Awesome icons. The software of board being used in this tutorial is MyBB 1.8, however, any versions from 1.4 to 1.8 would be fine. Most of you have seen these type of additions on bulletin board's across the globe, and very much sure some of you would like to have one of these pages of your own. All others are also welcome to help other individuals on this thread who may be having issues, problems, and, errors after or before reading this tutorial. Many threads will be created regarding MyBB for owners and theme developers.

1. Loading Font Awesome
In your Templates section of the MyBB ACP, find the Ungrouped Templates -> headerinclude template. Add the following after {$stylesheets}:
Code:
<link href='//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>

2. Adding Your Icon
Still in Templates, find Forum Bit Templates -> forumbit_depth2_forum (Do the same for forumbit_depth2_cat) and replace:
Code:
<span class="forum_status forum_{$lightbulb['folder']} ajax_mark_read" title="{$lightbulb['altonoff']}" id="mark_read_{$forum['fid']}"></span>

With:
Code:
<div class="forum_status forum_{$lightbulb['folder']} ajax_mark_read" title="{$lightbulb['altonoff']}" id="mark_read_{$forum['fid']}"><i class="fa fa-comments"></i></div>

Now find the following in your global.css:
Code:
.forum_status {
height: 30px;
width: 30px;
background: url(images/forum_icon_sprite.png) no-repeat 0 0;
}

.forum_on {
background-position: 0 0;
}

.forum_off {
background-position: 0 -30px;
}

.forum_offlock {
background-position: 0 -60px;
}

.forum_offlink {
background-position: 0 -90px;
}

Replace it with:
Code:
.forum_status {
height: 50px;
width: 50px;
font-size: 30px;
text-align: center;
}

.forum_status i {
display: inline-block;
line-height: 50px;
}

.forum_on {
color: #0094d1;
}

.forum_off, .forum_offlock, .forum_offlink {
color: #333;
}

.forum_off i {
opacity: .4;
}

.forum_offlock i:before {
content: "\f023";
}

.forum_offlink i:before {
content: "\f0c1";
}

3. Fix Your Legend
If you wish to keep your forum icon legend, find your Index Page Templates -> index template and replace the contents with this:
Code:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
lang.no_new_posts = "{$lang->no_new_posts}";
lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
{$forums}
{$boardstats}

<dl class="forum_legend smalltext">
<dt><div class="forum_status forum_on"><i class="fa fa-comments"></i></div></dt>
<dd>{$lang->new_posts}</dd>

<dt><div class="forum_status forum_off"><i class="fa fa-comments"></i></div></dt>
<dd>{$lang->no_new_posts}</dd>

<dt><div class="forum_status forum_offlock"><i class="fa fa-comments"></i></div></dt>
<dd>{$lang->forum_locked}</dd>

<dt><div class="forum_status forum_offlink"><i class="fa fa-comments"></i></div></dt>
<dd>{$lang->forum_redirect}</dd>
</dl>
<br class="clear" />
{$footer}
</body>
</html>

4. Adding Font-Awesome Subforum Icons
Find this in Forum Bit Templates -> forumbit_depth3_statusicon:
Code:
<div title="{$lightbulb['altonoff']}" class="subforumicon subforum_{$lightbulb['folder']} ajax_mark_read" id="mark_read_{$forum['fid']}"></div>

Replace it with:
Code:
<div title="{$lightbulb['altonoff']}" class="subforumicon subforum_{$lightbulb['folder']} ajax_mark_read" id="mark_read_{$forum['fid']}"><i class="fa fa-comment"></i></div>

Then in global.css find this:
Code:
.subforumicon {
height: 10px;
width: 10px;
display: inline-block;
margin: 0 5px;
background: url(images/mini_status_sprite.png) no-repeat 0 0;
}

.subforum_minion {
background-position: 0 0;
}

.subforum_minioff {
background-position: 0 -10px;
}

.subforum_miniofflock {
background-position: 0 -20px;
}

.subforum_miniofflink {
background-position: 0 -30px;
}

Replace it with:
Code:
.subforumicon {
height: 10px;
width: 10px;
display: inline-block;
margin: 0 5px;
}

.subforum_minion {
color: #333;
}

.subforum_minioff, .subforum_miniofflock, .subforum_miniofflink {
color: #333;
}

.subforum_minioff {
opacity: .4;
}

.subforum_miniofflock i:before {
content: "\f023";
}

.subforum_miniofflink i:before {
content: "\f0c1";
}

5. Adding Font-Awesome Forum Icons
Still in Templates, find Forum Bit Templates -> forumbit_depth2_forum (Do the same for forumbit_depth2_cat) and replace:
Code:
<div class="forum_status forum_{$lightbulb['folder']} ajax_mark_read" title="{$lightbulb['altonoff']}" id="mark_read_{$forum['fid']}"><i class="fa fa-comments"></i></div>

With:
Code:
<div class="forum_status forum_{$lightbulb['folder']} ajax_mark_read ficons_{$forum['fid']}" title="{$lightbulb['altonoff']}" id="mark_read_{$forum['fid']}"><i class="fa fa-comments"></i></div>

Find the following in global.css:
Code:
.forum_status {
height: 50px;
width: 50px;
font-size: 30px;
text-align: center;
}

.forum_status i {
display: inline-block;
line-height: 50px;
}

.forum_on {
color: #0094d1;
}

.forum_off, .forum_offlock, .forum_offlink {
color: #333;
}

.forum_off i {
opacity: .4;
}

.forum_offlock i:before {
content: "\f023";
}

.forum_offlink i:before {
content: "\f0c1";
}

After it, add this:
Code:
.ficons_2 i:before {
content: "\f000";
}

.ficons_3 i:before {
content: "\f1ba";
}

.ficons_4 i:before {
content: "\f0f5";
}

.ficons_6 i:before {
content: "\f0e4";
}

.ficons_7 i:before {
content: "\f03e";
}

Quote:ficons_1,2,3 etc are your forums ID, if you don't know your forum ID just hover to one of the forums and underneath left hand corner of your screen you'll see something like forumdisplay.php?fid=9 or go inside your forum and on the search bar you will see fid ID.


All credits go to
Eric J.

Previews:
http://i.imgur.com/qhS0HWt.png
http://i.imgur.com/5gpXDz4.png
http://i.imgur.com/QoHmvQ0.png
http://i.imgur.com/INysr98.png

[TUTORIAL] How to add a discord widget for ASB

$
0
0
[Image: 68747470733a2f2f6769746875622e636f6d2f57...302e706e67]

I don't know if many people has found out this guide on how to add a discord widget for the Advanced Sidebox plugin by Wildcard. I just thought that it'd maybe help people who may want this feature. I'd like to thank Wildcard personally for fixing the code.

So first of all, you basically need the ASB plugin activated and installed successfully. You can find the plugin by clicking here. After that you need to go to "ACP-Plugins-Advanced Sidebox-Custom Boxes-Add a new custom box type". 

After that type in the name textbox with discord or whatever you wish to call it, and untick the checkbox next to it (It will be called; [b] unchecking this box means that you want to build your own tables and expander[/b]). 

After all that, it should look like the following; 

[Image: r38IdcD.png]



After that you go into you're discord server and go to Server Settings, then go to widgets. It then should show something like this;

[Image: G_aTW29QSDaXsk8K2cT0qQ.png]
(Note: You have to have administrative power to access this, if you do not then you won't have access to this section of the discord.)

Just click the "Enable Server Widget and copy the code from the premade widget section at the bottom of the page, finally you just copy the code into the content section below on the custom box section on ASB section and it should be showing something like this;

[Image: zzhx2xnhR6mf9bb_61JZ8w.png]
And then click save button at the bottom of the page, then just head to "manage sideboxes" and you should see the sidebar you created in the custom section in between the Add-on modules and the left section, just place it inwhich section you wish and you're done. You should see something like this;

[Image: F3Hg4AoGRK6xMbNeo3hoKw.png]
And you're done.


I hope you liked my tutorial as it's the first one I have done. Big Thanks to Wildcard for encouraging me to create the tutorial. If you require any assistance, reply on the topic or dm me on discord and I'll try to help the best I can.

[Image: greo2c]

How to put text just below to thread list in index page

$
0
0
I am trying to put an html code which would be actually an offer or ad which will appear in homepage just below to forum list.

Because I also have sidebar there appears a blank space on the left side below of thread list.

.png   gpgp.PNG (Size: 105.6 KB / Downloads: 2)

Tell me how to put the HTML code or suggest plugin if there is one for the same.

Ban User List Page

$
0
0
Hello MyBB!

Today I will showing you how to create a ban user list page the page will display the ban users username, user who banned them, the reason, ban date, unban date, the ban user’s IP address they registered with, the last IP they login from, and their email address.

Step 1) Create a new file in your forum root called “bans.php”
Step 2) Paste the code below in it and save.

PHP Code:
<?php

// Author: Paul H. ( https://community.mybb.com/user-37431.html )
// Code Changes By: Brian. ( https://community.mybb.com/user-115119.html )
// bans.php created on 10-15-17
// Support: http://YourWebProjects.hostwish.net/ or https://community.mybb.com/thread-213593.html

define('IN_MYBB',1);
require_once(
'global.php');
define("PAGINATION",20);
$lang->load("modcp");
add_breadcrumb("Banned Users");
if(isset(
$mybb->input['asc'])) {
    
$options['order_dir'] = 'asc';
    
$ascdesc '&asc';
    
$ascdesci '&desc'; } else {
    
$options['order_dir'] = 'desc';
    
$ascdesc '&desc';
    
$ascdesci '&asc'; }
switch(
$mybb->input['sortby']) {
    case 
'issued':
    
$options['order_by'] = 'dateline';
    break;
    case 
'lifted':
    
$options['order_by'] = 'lifted';
    break;
    default: 
    
$options['order_by'] = 'dateline'; }
if(isset(
$mybb->input['page'])) {
$page = (int)$mybb->input['page']; } else {
$page 1; }
$extra "&orderby={$options['order_by']}{$ascdesc}";
$query $db->simple_select("banned""COUNT(uid) AS count");
$bannum $db->fetch_field($query"count");
$multipage multipage($bannum,PAGINATION,$page,'bans.php?page={page}'.$extra);
$options['limit'] = PAGINATION;
$options['limit_start'] = ($page 1) * PAGINATION;
$query $db->simple_select('banned','*',null,$options);
$bans '<tr>
<td class="tcat" align="center"><span class="smalltext"><strong>'
.$lang->username.'</strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong>'
.$lang->reason.'</strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong>'
.$lang->ban_bannedby.'</strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong><a href="bans.php?sortby=issued'
.$ascdesci.'">Ban Date</a></strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong><a href="bans.php?sortby=lifted'
.$ascdesci.'">Unban Date</a></strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong>User Email</strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong>Registration IP</strong></span></td>
<td class="tcat" align="center"><span class="smalltext"><strong>Latest IP</strong></span></td>
</tr>'
;
$banlist '';
$bantimes fetch_ban_times();
while(
$banned $db->fetch_array($query)) {
    
$user get_user($banned['uid']);
    
$bannedby get_user($banned['admin']);
    if(
$banned['lifted'] == 'perm' || $banned['lifted'] == '' || $banned['bantime'] == 'perm' || $banned['bantime'] == '---') {
    
$banlength $lang->permanent;
    
$timeremaining $lang->na; } else {
    
$banlength $bantimes[$banned['bantime']];
    
$remaining $banned['lifted']-TIME_NOW;
    
$timeremaining nice_time($remaining, array('short' => 1'seconds' => false))."";
    if(
$remaining 3600) {
    
$timeremaining "<span style=\"color: red;\">({$timeremaining} {$lang->ban_remaining})</span>"; }
    else if(
$remaining 86400) {
    
$timeremaining "<span style=\"color: maroon;\">({$timeremaining} {$lang->ban_remaining})</span>"; }
    else if(
$remaining 604800) {
    
$timeremaining "<span style=\"color: green;\">({$timeremaining} {$lang->ban_remaining})</span>"; } else {
    
$timeremaining "({$timeremaining} {$lang->ban_remaining})"; }
    
$timeremaining my_date($mybb->settings['dateformat'],$banned['lifted'])." <br/ ><span class=\"smalltext\">{$timeremaining}</span>"; }
$banlist .= "<tr>
<td class=\"trow1\" align=\"center\">"
.build_profile_link($user['username'], $user['uid'])."</td>
<td class=\"trow1\" align=\"center\">
{$banned['reason']}</td>
<td class=\"trow1\" align=\"center\">"
.build_profile_link($bannedby['username'], $bannedby['uid'])."</td>
<td class=\"trow1\" align=\"center\">"
.my_date($mybb->settings['dateformat'],$banned['dateline'])."</td>
<td class=\"trow1\" align=\"center\">
{$timeremaining}</td>
<td class=\"trow1\" align=\"center\">"
.build_profile_link($user['email'], $user['uid'])."</td>
<td class=\"trow1\" align=\"center\">"
.build_profile_link($user['regip'], $user['uid'])."</td>
<td class=\"trow1\" align=\"center\">"
.build_profile_link($user['lastip'], $user['uid'])."</td>
</tr>"
;}
if(
$banlist == '') {
$banlist '<tr><td colspan="8">'.$lang->no_banned.'</td></tr>';}
$bans .= $banlist;
$page "<html>
<head>
<title>Banned Users</title>
{$headerinclude}
</head>
<body>
{$header}
<br />

<table border=\"0\" cellspacing=\"
{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\">
<tr>
<td class=\"thead\" colspan=\"8\"><span class=\"smalltext\"><strong>Banned Users List</strong></span></td>
</tr>
{$bans}
</table>

{$multipage}
{$footer}
</body>
</html>"
;

output_page($page);
?>


This has been tested on MyBB 1.6 and MyBB 1.8 and works just fine so enjoy!
Screenshot:
[Image: 07_A95_E08_EA3_F_4205_AD81_AF99_EED34_ACF.jpg]

I hope you guys enjoy this!

Avatar Forum Display

$
0
0
Hello,
Today I am going to share with you all a little tweak I did to the "Last Poster Avatar On Forum Display and Index" plugin By Whiteneo.

Before we start I want to give thanks to Whiteneo for creating the plugin without it we probably wouldn't have what I am posting today. 

Now with that said you want to open the following Themes & Templates. We are going to be doing a few edits in these.

Themes & Templates > Themes > YOUR THEME > avatarep.css

Find the Following:


Code:
.avatarep_img {
padding: 3px;
border: 1px solid #D8DFEA;
width: 30px;
height: 30px;
border-radius: 50%;
opacity: 0.9;
margin: 0px 5px 0px 2px;
}

.avatarep_fd {
float:left;
margin: auto;
padding: 0px 20px 0px 0px;
width:30px;
height:40px;
}

Now Change to the Following:

Code:
.avatarep_img {
    float: right;
    clear: left;
    width: 70px;
    height: 70px;
    border-radius: 65%;
    opacity: 0.5;
    right: 70px;
}

.avatarep_fd {
    float: right;
    clear: left;
    width: 70px;
    height: 70px;
    border-radius: 65%;
    opacity: 0.5;
    right: 70px;
}

Once that is done, Save the Theme.

Next we want to go to the following

Themes & Templates > Templates > YOUR THEME > forumdisplay_thread

Find the Following:


Code:
<td class="{$bgcolor}{$thread_type_class}">
<avatarep_uid_[{$thread['lastposteruid']}]>{$attachment_count}

Remove the Following:


Code:
<avatarep_uid_[{$thread['lastposteruid']}]>

Do the same for the following Sections.

Themes & Templates > Templates > YOUR THEME > showthread

Find the Following and Remove the Following:


Code:
<avatarep_uid_[{$thread['lastposteruid']}]>

Once this is done. You should have what the Image below shows. If you do not, please ask for support on the thread and I will try to help you. Please take into consideration I am no expert at .CSS and am only somewhat beginner and I did this with countless amounts of trial and error. But I will help as best as I can.

[Image: nz-CwkJzSfij-q2C34gooA.png]
Please Enjoy and Share if you make anymore customization to it Smile

P.S
Here is a cleaned up version of "avatarep.css" Please remember this is after you've done the tutorial above.
avatarep.css (edited)

Shorten MyBB big numbers to Facebook-like letters

$
0
0

@"andrewjs18" asked me: "is it possible to shorten threads and posts counters to something more readable by displaying a letter for big numbers, much like Facebook and other companies do?". Yes. Thanks to MyBB's customizability, it is possible. Unfortunately there are not hooks available to easily tweak in this little but handy functionality, so we will use Patches to sneak in our code. Before diving into the tutorial, make sure you have downloaded and installed Patches.

MyBB 1.6 and 1.8 are supported, although the search patterns for every patch has been taken from MyBB 1.8.12. You may need to use different search patterns for older versions of MyBB.

This tutorial will apply to every number displayed within the MyBB environment, it is not limited to post and thread counters.

The final result:

[Image: 1iP4Vth.png]

1. Add the converter function
Within your ACP, go to Plugins > Patches, add, save and apply a new patch with the following configuration:

File: inc/functions.php
Title: my_number_shorten
Search pattern
PHP Code:
function my_number_format($number

Insert before
PHP Code:
// Shortens a number and attaches K, M, B, etc. accordingly @https://stackoverflow.com/questions/4371059/shorten-long-numbers-to-k-m-b
function my_number_shorten($number$precision 1$divisors null) {

 
   // Setup default $divisors if not provided
 
   if (!isset($divisors)) {
 
       $divisors = array(
 
           pow(10001) => 'k'// Thousand
 
           pow(10002) => 'm'// Million
 
           pow(10003) => 'b'// Billion
 
           pow(10004) => 't'// Trillion
 
       );    
    
}

 
   // Loop through each $divisor and find the
 
   // lowest amount that matches
 
   foreach ($divisors as $divisor => $shorthand) {
 
       if (abs($number) < ($divisor 1000)) {
 
           // We found a match!
 
           break;
 
       }
 
   }

 
   // We found our match, or there were no matches.
 
   // Either way, use the last defined value for $divisor.
 
   return 0 number_format($number $divisor$precision) . $shorthand;


2. Modify my_number_format
Time to alter the actual MyBB's custom number formatting function. Add, save and apply 2 new patches with the following configurations:

File: inc/functions.php
Title: my_number_format's edit 1
Search pattern
PHP Code:
return number_format((double)$number$decimals$mybb->settings['decpoint'], $mybb->settings['thousandssep']); 

Insert before
PHP Code:
if ($number 999) {
 
   return my_number_shorten($number);


File: inc/functions.php
Title: my_number_format's edit 2
Search pattern
PHP Code:
return number_format($number0$mybb->settings['decpoint'], $mybb->settings['thousandssep']); 

Insert before
PHP Code:
if ($number 999) {
 
   return my_number_shorten($number);


3. Enjoy!
All big numbers will be now converted to the corresponding shorthand version. You can edit the letter attached to thousands, millions, billions or trillions in the my_number_shorten() function. The crucial part is:

PHP Code:
$divisors = array(
 
   pow(10001) => 'k'// Thousand
 
   pow(10002) => 'm'// Million
 
   pow(10003) => 'b'// Billion
 
   pow(10004) => 't'// Trillion
); 

By default, lowercase letters are used but you can use whatever you want.

Add a Thread Header !

$
0
0
Hello there, Today I am going to share my little code for a thread header. 

It is basically a way to have thread information above the thread thus way leaving more space for a more clean and sleek looking thread view. 

Please understand that this was tested on "Tesla Gaming (Dark)" so I am unsure if it will work on other themes. If you test it and it works please confirm for others. 

Recommened Plugins & Programs

Template Editor 
FASTyle 
Notepad ++

First we are going to start by Opening the following.
Themes & Templates > Templates > Your Theme > ShowThread > ShowThread

Find the Following :

Code:
{$header}

This is usually in the first 30 to 40 Lines of Code.

Add the Following Under it :
Code:
<div class="showthread_container">
      <div class="table-wrap">
        <div class="table-cell-mid avatarep">
        <a href="{$user['profilelink']}" title="{$mybb->user['username']}">{$avatarep_thread}</a>
            </div>
        <div class="table-cell-mid showthread-info">
          {$thread['subject']}
          </div>
           <div class="showthread-desc">by {$thread['username']} - {$thread['threaddate']}, {$thread['threadtime']} 
               
           </div>
           </div>
        </div><br />

Secondly Open the Following :

Themes & Templates > Themes > Your Theme > Stylesheets > global.css

Add the Following to the Bottom :
Code:
/* Show Thread Header */
.showthread_container {
    /* background: linear-gradient(-90deg, rgba(250,250,250,0.2), rgba(39, 127, 165,0.4)); */
 background: #2978AD;
-webkit-box-shadow: 0px, 5px, 6px, rgba(0,0,0,0.8);
    -moz-box-shadow: 0px, 5px, 6px, rgba(0,0,0,0.8);
    
    border-radius: 2px;
}

.table-wrap {
 display: table;
 width: 1662px;
 table-layout: fixed;
}

.table-cell-mid.showthread-info {
position: relative;
    left: -480px;
    top: -8px;
    color: #fff;
    font-weight: bold;
    font-size: 16px;

}

.showthread-desc {    
    left: -1034px;
    bottom: -35px;
    position: relative;    
}

.table-cell-mid {
 display: table-cell;
 vertical-align: middle;
}

After you've done this, depending on the current theme you are using you will have to do some edits to the position and maybe the width, also in order to use some of the variables above you will need to have XThreads and PHP and Template Conditionals and Forum Display Avatars Plugins. Unless you can edit the code to show the avatars and date/time without. 

You should see the following 

[Image: ytntuQucSXygh10DsCIdXQ.png]

I thank you for viewing this tutorial and hopefully it worked you all. If you need support please PM me or add my discord "Khaleesi Hale#1153"

Updates will come to this thread once I make some for "Post Reply Button" and "Rate Thread"

Sincerely,
Khaleesi.

Get the current avatar for a specific user

$
0
0
I discovered this playing around, just now.
so lets say that you want to get the current avatar for a specific user, to um, feature on a page perhaps, and you want their featured avatar to change when the user changes their avatar,
so how is this accomplished?

Easy: just right click their current avatar and inspect, then clip their I.D avatar address,
something like <img src="https://yourwebsite.com/uploads/avatars/avatar_1.jpg">

as you can see, this user's I.D is 1,

copy and paste this <img src="https://yourwebsite.com/uploads/avatars/avatar_1.jpg">
into the section that you want the avatar to appear and wholla, magic,
if that user's avatar changes, their featured avatar will change as well, just do a hard refresh to see the changes.


lab tested and twitter verified.

[REQ] Tutorial to setup mybb forum [1.8.X]

$
0
0
I need it cuz i watch all the videos on how to install mybb forum or setup it
and it fails all the time cuz some of the video is older and i cant understand it.

Categories and Forums Management

$
0
0
About Categories and Forums

Categories and forums are root of your forum. It is suggested that they should be in some order so users and visitors can get good view of all categories and forums of your forum. There will be explained basic princip of how categories and forums work and what they are for.

Here it is how it looks when you have a fresh installation of MyBB:


.png   cif1.png (Size: 41.02 KB / Downloads: 15)

Categories

In Category you can't write anything, you can't open threads or post. They are made just for organisation. Inside them there are forums and sub-forums wich are here for threads and posting.


So what are Categories for then?

Well, you can't just make some forum / subforum without it's parent. They cannot be alone. They needs parent Category in wich they are put. Categories are mostly general names of forums under it.
For example, we have category named Community and under it forums like General Discussion, Showcase etc.

What Category can contain?

This is how it looks in ACP:

.png   cif2.png (Size: 37.69 KB / Downloads: 11)

Well, when creating new category they need to contain:
  • Forum Type - Forum type should be category.
  • Title - name of your category. Multiple categories can have same name. It is not it's id.
  • Description - You can have Category description. That can be few words wich will be displayed right below Category name at forum's home page. This field is not necessary and is mostly blank.
  • Parent Forum - Mostly this is left None as categories are here to actually be parents. But if you wish, you can put it under another category. Then it will look like forum but you will be unaviable to write in it so there is not much point in doing that.
  • Display order - This is position of your category between other categories. So if you have more than one category, there you can manage wich will be displayed at wich position. Please note that you can put any number in that places, and they will be sorted from lowest number - top category to biggest number - last category.

There are some Additional Forum Options. Inside them you can change some category settings. Please note:
  • Forum link will work and redirect to written url (in that case, note that you must write whole url as long as http:// or https://). And you will be able to still visit it's all forums and everything under it.
  • Forum password will affect all subforums under that category.
  • Forum is Active? will affect all subforums 
  • Forum is Open? will not affect subforums
  • Style Options will affect all subforums of that category if there is no different rule for specific subforum.
  • Forum Rules will not affect any subforum.
  • Default view options will affect all subforums of that category if there is no different rule for specific subforum.


Forums

Forums and subforums are primary part of your software. Threads are placed inside them.

Now, as stated above, they must be put under some Category. It's creation / editing page looks exactly the same like categories but with few differences.

At forum you must have Parent Forum for every forum. That could be both category or forum.
It is suggested to put some Description of each forum so users can easily navigate and know where to post thread.

Everything else in that part is same as at categories.

Next different thing than in categories is that all Additional Forum Options will affect that forum you are using / editing.

Also, there is one cool thing that you can change forum permissions for each forum. But be careful with them and always check twice, it is your forum wich should be safe.

Theme Variables (MyBB)

$
0
0
Hi,
MyBB Theme Variables;


POST , for Postbit
Template: postbit

Code:
{$post['pid']} //Comment ID
{$post['tid']} //Thread ID (Comment)
{$post['replyto']} //Quoted Comment ID
{$post['fid']} //Forum ID (Comment)
{$post['subject']} //Comment Subject
{$post['icon']} //Comment Icon ID
{$post['uid']} //User ID (Comment)
{$post['username']} //Posted by Username (Comment)
{$post['message']} //Comment Content
{$post['edituid']} //Editor ID
{$post['editreason']} //Edit Reason

THREAD , for Thread
Template: showthread

Code:
{$thread['tid']} //Thread ID
{$thread['fid']} //Forum ID (Thread)
{$thread['subject']} //Thread Subject
{$thread['prefix']} //Prefix ID
{$thread['icon']} //Thread Icon ID
{$thread['uid']} //User ID (Thread)
{$thread['username']} // Username (Thread)
{$thread['firstpost']} //First Comment ID
{$thread['lastposter']} //Lastposter Username
{$thread['lastposteruid']} //Lastposter ID
{$thread['views']} //Total Views
{$thread['replies']} //Total Comments
{$thread['numratings']} //Rate Points
{$thread['totalratings']} //Total Rates
{$thread['attachmentcount']} //Total Attachments

FORUM , for Forums
Template: forumbit_depth1_cat

Code:
{$forum['fid']} //Forum ID
{$forum['name']} //Forum Name
{$forum['description']} //Forum Description
{$forum['linkto']} //Redirect Address
{$forum['threads']} //Total Threads
{$forum['posts']} //Total Comments
{$forum['lastposter']} //Lastposter Username
{$forum['lastposteruid']} //Lastposter ID
{$forum['lastposttid']} //Thread ID of Lastpost

SETTINGS , Global
Template: All Templates


Code:
{$mybb->settings['boardclosed_reason']} //Maintenance Reason
{$mybb->settings['bbname']} //Website Name
{$mybb->settings['bburl']} //Website Link
{$mybb->settings['homename']} //Homepage Name
{$mybb->settings['homeurl']} //Homepage Link
{$mybb->settings['adminemail']} //Admin E-Mail
{$mybb->settings['returnemail']} //Return E-Mail
{$mybb->settings['contactemail']} //Contact E-Mail
{$mybb->settings['contactlink']} //Contact Link
{$mybb->settings['faxno']} //Fax No
{$mybb->settings['bblanguage']} //Forum Language
{$mybb->settings['useravatar']} //Default User Avatar
{$mybb->settings['avatarsize']} //Avatar Size

Goodbye.
Viewing all 685 articles
Browse latest View live