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

Installing Nginx with PHP support

$
0
0
To new users, installing a new web server is overwhelming. I've created this tutorial due to the fact that there are very good simply tutorials on Nginx. This is a very basic tutorial. Please tell me if there are any errors in the tutorial, as it is pretty long.

http://cyberforums.net/Thread-Setup-Ngin...HP-support

Video Course: Watch Me Build a Gaming Forum with MyBB 1.6.11

$
0
0
Hello MyBBers!

I've been using MyBB for years now but have never posted in the forums I guess...

I'm building a gaming forum with MyBB and recording the whole thing so people can watch and see all the steps involved.

All the videos are in a playlist on YouTube. I tried to embed the playlist but it won't let me so I'm not sure if I should add all the videos here or just the first one... Advice?

Anyways, I use MyBB 1.6.11, the Google SEO plugin, the My Advertisements plugin, and even customize the default theme in this video course.

I hope you enjoy it and if you have any feedback or questions or anything, don't hesitate to ask. I'm finishing up the build today so the final few videos should be on there later...

Thanks,
Cal

Here's the first video... If I should put them all in this post, let me know, not sure what to do here...

Link to the playlist...

What I cover...
  • Get a Domain
  • Install MyBB Locally
  • Customize Default Theme
  • Install Plugins
  • Change Default Buttons
  • Upload to Host

And just for the record, I love MyBB. If you want more videos on how to do a specific thing or think I should build a different type of site next time, please let me know.



Rainbow usernames, the proper way.

$
0
0
I'm sick of seeing the dodgy, nonworking tutorials floating around this forum, so I decided to write one myself. Please note, this will only work in the latest browsers, so if your clients all use IE6, this isn't the tutorial for you.

First up, insert the following CSS into your global.css file:
Code:
.rainbow{
-webkit-animation:rainbow 3s linear infinite;
animation:rainbow 3s linear infinite;

}

@keyframes rainbow {
  from {
color: red;
text-shadow: 0 0 10px red;
  }
  15% {
color: orange;
text-shadow: 0 0 10px orange;
  }
  30% {
  color: yellow;
text-shadow: 0 0 10px yellow;
  }
  45% {
color: green;
text-shadow: 0 0 10px green;
  }
  60% {
color: blue;
text-shadow: 0 0 10px blue;
  }
  75% {
color: indigo;
text-shadow: 0 0 10px indigo;
  }
  90% {
color: violet;
text-shadow: 0 0 10px violet;
  }
  to {
color: red;
text-shadow: 0 0 10px red;
  }
}
@-webkit-keyframes rainbow {
  from {
color: red;
text-shadow: 0 0 10px red;
  }
  15% {
color: orange;
text-shadow: 0 0 10px orange;
  }
  30% {
  color: yellow;
text-shadow: 0 0 10px yellow;
  }
  45% {
color: green;
text-shadow: 0 0 10px green;
  }
  60% {
color: blue;
text-shadow: 0 0 10px blue;
  }
  75% {
color: indigo;
text-shadow: 0 0 10px indigo;
  }
  90% {
color: violet;
text-shadow: 0 0 10px violet;
  }
  to {
color: red;
text-shadow: 0 0 10px red;
  }
}

Now, under the group settings of the group you want to have "rainbow text" on, insert the following username style:
PHP Code:
<span class="rainbow">{username}</span

For a working demo, check out this user on my forum: http://villainforums.com/member.php?acti...ile&uid=13

I'm happy to answer any questions.

Advanced portal Search ( google search )

$
0
0
HI


Author: OmidKarimzadeh ( ! Omid StaR ! )
mian link: http://mods.mybb.com/view-resource/advan...tal-search
Support: http://mybbskin.ir
web: http://iran-talk.ir

Please go to

ACP >>> Templates & Style >>> Themes >>> Your Theme >>>portal>>>portal_search

Please replace the previous



PHP Code:
<table border="0" cellspacing="{$theme['borderwidth']}cellpadding="{$theme['tablespace']}">
  <
tr>
  <
td><strong>{$lang->search_forums}</strong></td>
  </
tr>
  <
tr>
  <
td align="center">
  <
form method="post" action="{$mybb->settings['bburl']}/search.php">
  <
input type="hidden" name="action" value="do_search" />
  <
input type="hidden" name="postthread" value="1" />
  <
input type="hidden" name="forums" value="all" />
  <
input type="hidden" name="showresults" value="threads" />
  <
input type="text" name="keywords" value="" />
  {
$gobutton}
  </
form><br />
  <
span>
  (<
a href="{$mybb->settings['bburl']}/search.php">{$lang->advanced_search}</a>)
  </
span>
  </
td>
  </
tr>
  </
table>
  <
br />
  <
table border="0" cellspacing="{$theme['borderwidth']}cellpadding="{$theme['tablespace']}">
  <
tr>
  <
td><strong>{$lang->search_forums}</strong></td>
  </
tr>
  <
tr>
  <
td align="center">
  <
form method="get" action="http://www.google.com/search" target="_blank" >
  
  <
p align="center">
  
  <
input type="text"   name="q" size="31"
   
maxlength="255" value="" />
  <
input type="submit" value="جستجو"/>
  <
input type="radio"  name="sitesearch"
   
value="iran-talk.ir" checked /> google search <br />
  </
p>
  </
form>
  </
div>
  
  <
br />
  <
span>
  (<
a href="{$mybb->settings['bburl']}/search.php">{$lang->advanced_search}</a>)
  </
span>
  </
td>
  </
tr>
  </
table>
  <
br /> 


find:

PHP Code:
value="iran-talk.ir" 

adding your site Instead iran-talk.ir


Good luck
Omid Karimzadeh (!ArTiN!)
http://mybulletinboard.ir


Sample:

.gif  test.gif (Size: 20.43 KB / Downloads: 24)

Pro Attachments

$
0
0
HI

Author: OmidKarimzadeh ( ! Omid StaR ! )
mian link: http://mods.mybb.com/view-resource/advanced-attachments
Support: http://mybbskin.ir
web: http://iran-talk.ir


Please go to:

ACP >>> Templates & Style >>> Themes >>> Your Theme >>>postbit>>>postbit_attachments_attachment


Please replace the previous:


PHP Code:
<head>  
    <
style type="text/css">  
<!--  
td.attachrow        {fontnormal 11px Tahoma;}  
td.attachheader    {fontnormal 11px Tahomabackground-color#ededed; }  
table.attachtable    {fontnormal 12px Tahoma;border-collapse collapse; }  
-->  
</
style>  
    <
style type="text/css">  
<!--  
td.attachrow        {fontnormal 11px Tahoma;}  
td.attachheader    {fontnormal 11px Tahomabackground-color#ededed; }  
table.attachtable    {fontnormal 12px Tahoma;border-collapse collapse; }  
-->  
</
style>  
    <
style>  
<!--  
table.attachtable    {fontnormal 12px Tahoma;border-collapse collapse; }  
td.attachheader    {fontnormal 11px Tahomabackground-color#ededed; }  
td.attachrow        {fontnormal 11px Tahoma;}  
-->  
</
style>  
    </
head>  
<
table border="0" cellpadding="0" cellspacing="3">  
<!-----
Postbit_Attachment---->  
    </
table>  
    <
table id="table2" width="95%" align="center" border="1" cellpadding="2" cellspacing="0">  
        <
tr>  
            <
td colspan="3" width="100%" align="center"><b>  
            {
$attachment['filename']}</b></td>  
        </
tr>  
        <
tr>  
            <
td width="15%"><span>File Type</span></td>  
            <
td width="75%">  
            {
$attachment['icon']}</td>  
            <
td rowspan="3" width="10%" align="center">  
            <
a href="attachment.php?aid={$attachment['aid']}">  
            <
img src="http://up.iran-talk.ir/uploads/13326006071.png" alt="download" border="0"></a><br>  
</
td>        </tr>  
        <
tr>  
            <
td width="15%"><span>Hits</span></td>  
            <
td width="75%"><span>{$attachment['downloads']}</span></td>  
        </
tr>  
        <
tr>  
            <
td width="15%"><span>Size</span></td>  
            <
td width="75%">{$attachment['filesize']}</td>  
        </
tr>  
    </
table>  
    <
br


Good luck Heart
Omid Karimzadeh (!ArTiN!)
http://mybulletinboard.ir


Sample:

.gif  att.gif (Size: 7.46 KB / Downloads: 41)

Advanced Moving Post + Scroll

$
0
0
HI

Author: OmidKarimzadeh ( ! Omid StaR ! )
mian link: http://url.MyBBSkin.ir/move
Support: http://mybbskin.ir
web: http://iran-talk.ir


Please go to:

ACP >>> Templates & Style >>> Themes >>> Your Theme >>>postbit>>>postbit Or postbit_classic

Find :

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



And replace whit it :


PHP Code:
<div id="pid_{$post['pid']}class="post_body">
        <
div>
        <
div id="1" style="float:left; z-index: 1; position: Absolute;">
        <
br><img src="http://up.iran-talk.ir/uploads/13765797251.gif">
        </
div>
        <
div id="2" style="z-index: 0; padding: 5px;">
        <
fieldset style="background: #DCDCDC url(http://up.iran-talk.ir/uploads/13765796481.png);
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 22px;
    margin-top:10px;
    margin-bottom:0px;
    box-shadow:#E6E6FA 0 0 7px;
    -moz-box-shadow:#E6E6FA 0 0 7px;
    -webkit-box-shadow:#9400D3 0 0 20px;
    text-shadow: #fff 1px 1px;
            position: relative;"
>
                <
div style="min-height: auto auto;max-height:350px;overflow:auto;">{$post['message']}</div>
                </
fieldset>
        </
div>
        </
div>
        </
div



Good luck Heart
Omid Karimzadeh (!ArTiN!)
http://mybulletinboard.ir


Sample:

.png  scr.png (Size: 235.03 KB / Downloads: 35)

Advanced Signature

$
0
0
HI

Author: OmidKarimzadeh ( ! Omid StaR ! )
mian link: http://mods.mybb.com/view-resource/advanced-signature
Support: http://mybbskin.ir
web: http://iran-talk.ir



Please go to:

ACP >>> Templates & Style >>> Themes >>> Your Theme >>>postbit>>>postbit_signature


Please replace the previous:


PHP Code:
<fieldset class="fieldset"><legend><b><strong><fieldset class="fieldset"><font color="#C71585">Signature
<strong><span class="largetext"><a href="#" id="profilelink_{$post['pid']}">{$post['username_formatted']}</span></strong></a>
<
div id="profilelink_{$post['pid']}_popup" class="popup_menu" style="display: none;">
<
div class="popup_item_container">
<
a href="{$mybb->settings['bburl']}/member.php?action=profile&uid={$post['uid']}class="popup_item">View User Profile</a>
</
div>
<
div class="popup_item_container">
<
a href="{$mybb->settings['bburl']}/search.php?action=finduser&uid={$post['uid']}class="popup_item">View  user Posts</a>
</
div>
<
div class="popup_item_container">
<
a href="{$mybb->settings['bburl']}/search.php?action=finduserthreads&uid={$post['uid']}class="popup_item">View  user Threads</a>
</
div>
<
div class="popup_item_container">
<
a href="{$post['website']}target="_blank" " class="popup_item">View  user Website</a>
</div>
<div class="
popup_item_container">
<a href="
{$mybb->settings['bburl']}/private.php?action=send&uid={$post['uid']}" class="popup_item">Send a private message to user</a>
</div>
<div class="
popup_item_container">
<a href="
{$mybb->settings['bburl']}/member.php?action=emailuser&uid={$post['uid']}" class="popup_item">Send mail to user</a>
</div>
</div><br />
<script language="
javascript" type="text/javascript">
new PopupMenu("
profilelink_{$post['pid']}");
</script></font></strong></b><br /><a href="
misc.php?action=imcenter&imtype=yahoo&uid=$post[uid]" onclick="popupWin('misc.php?action=imcenter&imtype=yahoo&uid=$post[uid]''imcenter'450300);">
<img src="
http://up.iran-talk.ir/uploads/13317439651.png" alt="Send a message to the user through Yahoo" width="17" height="17" border="0" title="اSend a message to the user through Yahoo"></a><a href="misc.php?action=imcenter&imtype=msn&uid=$post[uid]" onclick="popupWin('misc.php?action=imcenter&imtype=msn&uid=$post[uid]', 'imcenter', 450, 300);">
<img title="Send a message to the user through MSN" src="http://up.iran-talk.ir/uploads/13317446821.png" alt="اSend a message to the user through MSN" border="0"></a><a href="misc.php?action=imcenter&imtype=aim&uid=$post[uid]onclick="popupWin('misc.php?action=imcenter&imtype=aim&uid=$post[uid]', 'imcenter', 450, 300);">
<
img src="http://up.iran-talk.ir/uploads/13317446822.png" alt="اSend a message to the user through AIM" width="17" height="17" border="0" title="Send a message to the user through AIM"><a href="misc.php?action=imcenter&imtype=icq&uid=$post[uid]onclick="popupWin('misc.php?action=imcenter&imtype=icq&uid=$post[uid]', 'imcenter', 450, 300);">
<
img src="http://up.iran-talk.ir/uploads/13317462711.gif" alt="Send a message to the user through ICQ" width="17" height="17" border="0" title="Send a message to the user through ICQ"></a></fieldset>{$post['signature']}</fieldset></legend




Good luck Heart
Omid Karimzadeh (!ArTiN!)
http://mybulletinboard.ir


Sample:

.gif  sin.gif (Size: 24.56 KB / Downloads: 25)

Pro Css Signature

$
0
0
HI

Author: OmidKarimzadeh ( ! Omid StaR ! )
mian link: http://url.MyBBSkin.ir/Signature
Support: http://mybbskin.ir
web: http://iran-talk.ir


Please go to:

ACP >>> Templates & Style >>> Themes >>> Your Theme >>>postbit>>>postbit_signature



Please replace the previous:


PHP Code:
<style>
.
omidkarimzadeh_MyBBSkin {
    
backgroundrgb(238,238,238); /* Old browsers */
background: -moz-radial-gradient(centerellipse cover,  rgba(238,238,238,11%, rgba(238,238,238,157%, rgba(211,211,211,1100%); /* FF3.6+ */
background: -webkit-gradient(radialcenter center0pxcenter center100%, color-stop(1%,rgba(238,238,238,1)), color-stop(57%,rgba(238,238,238,1)), color-stop(100%,rgba(211,211,211,1))); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(centerellipse cover,  rgba(238,238,238,11%,rgba(238,238,238,157%,rgba(211,211,211,1100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(centerellipse cover,  rgba(238,238,238,11%,rgba(238,238,238,157%,rgba(211,211,211,1100%); /* Opera 12+ */
background: -ms-radial-gradient(centerellipse cover,  rgba(238,238,238,11%,rgba(238,238,238,157%,rgba(211,211,211,1100%); /* IE10+ */
backgroundradial-gradient(ellipse at center,  rgba(238,238,238,11%,rgba(238,238,238,157%,rgba(211,211,211,1100%); /* W3C */
filterprogid:DXImageTransform.Microsoft.gradientstartColorstr='#eeeeee'endColorstr='#d3d3d3',GradientType=); /* IE6-9 fallback on horizontal gradient */
    
border2px solid #D3D3D3;
        
margin-top2em;
        
border-radius10px;
        -
moz-border-radius10px;
-
webkit-border-radius10px;
-
o-border-radius10px;
-
ms-border-radius10px;
        
box-shadow0px 0px 5px #6b6b6b;
        
-moz-box-shadow0px 0px 5px #6b6b6b;
-webkit-box-shadow0px 0px 5px #6b6b6b;
-o-box-shadow0px 0px 5px #6b6b6b;
-ms-box-shadow0px 0px 5px #6b6b6b;
        
margin-left13px;
        
margin-right12px;
        
font-familyByekan;
}
</
style>


    <
div class="omidkarimzadeh_MyBBSkin">
<
fieldset class="fieldset"><legend><b><strong>Signature
{$post['username_formatted']}</font></strong></b></legend>
 {
$post['signature']}
</
fieldset></div





Good luck Heart
Omid Karimzadeh (!ArTiN!)
http://mybulletinboard.ir


Sample:

.png  sin.png (Size: 67.79 KB / Downloads: 27)

[Special] Pro Style Username ( Bright & Bold )

$
0
0
HI

Author: OmidKarimzadeh ( ! Omid StaR ! )
mian link: url.mybbskin.ir/username
Support: http://mybbskin.ir
web: http://iran-talk.ir

All color coded

Please go to:

ACP >>> Users & Groups >>>Groups >>> your aim group >>> Username Style >>> And insert :


Registered

PHP Code:
<span style="color: #808000; text-shadow: 0px 0px 1px;"><strong>{username}</strong></span


Super Moderators

PHP Code:
<span style="color: #C71585; text-shadow: 0px 0px 1px;"><strong>{username}</strong></span


Administrators

PHP Code:
<span style="color:red; text-shadow: 0px 0px 1px;"><strong>{username}</strong></span


Awaiting Activation

PHP Code:
<span style="color:#A9A9A9;"><strong>{username}</strong></span


Moderators

PHP Code:
<span style="color: #4169E1; text-shadow: 0px 0px 1px;"><strong>{username}</strong></span



Banned

PHP Code:
<s><span style="color:  black; text-shadow: 0px 0px 1px;"><strong>{username}</strong></span></s



You want change its color?

All color coded Web 4 yoU



Good luck Heart
Omid Karimzadeh (!ArTiN!)
http://mybulletinboard.ir


Live Demo
Sample:

.png  style.png (Size: 16.28 KB / Downloads: 46)

Fix security error in any theme/template

$
0
0
Basic changes

They usually work for most of outdated themes. You need to open the theme_name.xml file in text editor, such as Notepad++, and search for the following 4 codes:

1.
Code:
{$monthnames[$prev_month['month']]}
if found, replace with:
Code:
{$prev_month['month']}

2.
Code:
{$monthnames[$next_month['month']]}
if found, replace with:
Code:
{$next_month['month']}

3.
Code:
{$monthnames[$week_from[1]]}
if found, replace with:
Code:
{$monthnames[$week_from_one]}

4.
Code:
{$type_checked[$type['tid']]}
if found, replace with:
Code:
{$checked}

Then try to import .xml file again.

If none of those codes were found or you corrected them and the error is still present, you need to apply advanced changes below.

Advanced changes

Several themes have other problems in templates which are not as easy to find. That's why I wrote this topic: http://community.mybb.com/thread-139498.html Noone was interested but I see on this/Polish forum some themes still can't be imported so I decided to give it a try myself although I'm not the best PHP coder.

It requires changes in several core files, I suggest to do them using Patches plugin: http://mods.mybb.com/view/patches

In admin/inc/functions.php change:
PHP Code:
function check_template($template)
{
    
// Check to see if our database password is in the template
    
if(preg_match("#database'?\\s*\]\\s*\[\\s*'?password#"$template))
    {
        return 
true;
    }

    
// System calls via backtick
    
if(preg_match('#\$\s*\{#'$template))
    {
        return 
true;
    }

    
// Any other malicious acts?
    // Courtesy of ZiNgA BuRgA
    
if(preg_match("~\\{\\$.+?\\}~s"preg_replace('~\\{\\$+[a-zA-Z_][a-zA-Z_0-9]*((?:-\\>|\\:\\:)\\$*[a-zA-Z_][a-zA-Z_0-9]*|\\[\s*\\$*([\'"]?)[a-zA-Z_ 0-9 ]+\\2\\]\s*)*\\}~'''$template)))
    {
        return 
true;
    }

    return 
false;

to:
PHP Code:
function check_template($template)
{
    
    
$results = array();
    
    
// Check to see if our database password is in the template
    
if(preg_match_all("#database'?\\s*\]\\s*\[\\s*'?password#"$template$matches))
    {
        
$results array_merge($results$matches[0]);
    }

    
// System calls via backtick
    
if(preg_match_all('#\$\s*\{#'$template$matches))
    {
        
$results array_merge($results$matches[0]);
    }

    
// Any other malicious acts?
    // Courtesy of ZiNgA BuRgA
    
$template preg_replace('~\\{\\$+[a-zA-Z_][a-zA-Z_0-9]*((?:-\\>|\\:\\:)\\$*[a-zA-Z_][a-zA-Z_0-9]*|\\[\s*\\$*([\'"]?)[a-zA-Z_ 0-9 ]+\\2\\]\s*)*\\}~'''$template);
    if(
preg_match_all("~\\{\\$.+?\\}~s"$template$matches))
    {
        
$results array_merge($results$matches[0]);
    }
    
    
$output '';
    
    foreach(
$results as $result) {
        
$result htmlspecialchars_uni($result);
        
$output .= "\n<li>$result</li>\n";
    }

    return 
$output;


In admin/inc/functions_themes.php change:
PHP Code:
        $security_check false;
        
$templatecache = array();

        foreach(
$templates as $template)
        {
            if(
check_template($template['value']))

            {
                
$security_check true;
                break;
            }

            
$templatecache[] = array(
                
"title" => $db->escape_string($template['attributes']['name']),
                
"template" => $db->escape_string($template['value']),
                
"sid" => $db->escape_string($sid),
                
"version" => $db->escape_string($template['attributes']['version']),
                
"dateline" => TIME_NOW
            
);
        }

        if(
$security_check == true)
        {
            return -
4;
        } 
to:
PHP Code:
        $templatecache = array();
        
$invalidcode '';
        foreach(
$templates as $template)
        {
            
$check check_template($template['value']);
            if (
$check)
            {
                
$temp_name "\n<li>".htmlspecialchars_uni($template['attributes']['name']).":</li>\n";
                
$invalidcode .= $temp_name."<ul>".$check."</ul>";
            }

            
$templatecache[] = array(
                
"title" => $db->escape_string($template['attributes']['name']),
                
"template" => $db->escape_string($template['value']),
                
"sid" => $db->escape_string($sid),
                
"version" => $db->escape_string($template['attributes']['version']),
                
"dateline" => TIME_NOW
            
);
        }

        if(
$invalidcode)
        {
            return 
$invalidcode;
        } 

In admin/modules/style/themes.php change:
PHP Code:
                if($theme_id > -1)
                {
                    
$plugins->run_hooks("admin_style_themes_import_commit");
                    
                    
// Log admin action
                    
log_admin_action($theme_id);
            
                    
flash_message($lang->success_imported_theme'success');
                    
admin_redirect("index.php?module=style-themes&action=edit&tid=".$theme_id);
                }
                else
                {
                    switch(
$theme_id)
                    {
                        case -
1:
                            
$errors[] = $lang->error_uploadfailed_nocontents;
                            break;
                        case -
2:
                            
$errors[] = $lang->error_invalid_version;
                            break;
                        case -
3:
                            
$errors[] = $lang->error_theme_already_exists;
                            break;
                        case -
4:
                            
$errors[] = $lang->error_theme_security_problem;
                    }
                } 
to:
PHP Code:
                if(strpos($theme_id"<li>") !== false)
                {
                    
$errors[] = $lang->sprintf($lang->error_theme_security_problem$theme_id);
                }
                else if(
$theme_id > -1)
                {
                    
$plugins->run_hooks("admin_style_themes_import_commit");
                    
                    
// Log admin action
                    
log_admin_action($theme_id);
            
                    
flash_message($lang->success_imported_theme'success');
                    
admin_redirect("index.php?module=style-themes&action=edit&tid=".$theme_id);
                }
                else
                {
                    switch(
$theme_id)
                    {
                        case -
1:
                            
$errors[] = $lang->error_uploadfailed_nocontents;
                            break;
                        case -
2:
                            
$errors[] = $lang->error_invalid_version;
                            break;
                        case -
3:
                            
$errors[] = $lang->error_theme_already_exists;
                    }
                } 

In admin/modules/style/templates.php change both instances of:
PHP Code:
        if(check_template($mybb->input['template']))
        {
            
$errors[] = $lang->error_security_problem;
        } 
to:
PHP Code:
        $invalidcode check_template($mybb->input['template']);
        if(
$invalidcode)
        {
            
$errors[] = $lang->sprintf($lang->error_security_problem$invalidcode);
        } 

In inc/languages/[language]/admin/style_themes.lang.php change:
PHP Code:
$l['error_theme_security_problem'] = "A potential security issue was found in the theme. It was not imported. Please contact the Author or MyBB Group for support."
to:
PHP Code:
$l['error_theme_security_problem'] = "A potential security issue was found in the theme. It was not imported. Please contact the Author or MyBB Group for support. The following codes in listed templates are invalid and need to be corrected in .xml file:\n<ul>{1}</ul>"
You can modify it for your language, but you have to keep <ul>{1}</ul> at the end.

In inc/languages/[language]/admin/style_templates.lang.php change:
PHP Code:
$l['error_security_problem'] = "A potential security issue was found in the template. Please review your changes or contact the MyBB Group for support."
to:
PHP Code:
$l['error_security_problem'] = "A potential security issue was found in the template. Please review your changes or contact the MyBB Group for support. The following codes are invalid and need to be corrected:\n<ul>{1}</ul>"
You can modify it for your language, but you have to keep <ul>{1}</ul> at the end.


Then, after doing these changes in files, import the theme/modify template again. It should list all required changes (and while importing theme all templates where they need to be done) like this: https://docs.google.com/file/d/0B6pgReiH...p=drivesdk
You can either remove the listed codes, or fix them if you know how, and the theme/template will be imported/editted without any problem after next attempt.

Animated Rainbow Username Tutorial [Javascript][Something Found on Github]

$
0
0
Note, the rainbow does not need to be animated. It's completely up to you how you use the javascript provided by this tutorial.

After seeing countless rainbow "username tutorials". I thought I would step it up a notch.

If you get offended by me bashing rainbow text, please, do yourself a favor, skip to the "Actual Tutorial" part...

After my whole 2 second search on google, I found this (http://xoxco.com/projects/code/rainbow/) and in-turn found this (https://github.com/xoxco/rainbow-text).

No matter how annoying that animated rainbow may be to me, and how much harm I am probably going to be doing to my eyes when I have to look at someone's website using this, I figured someone might find it helpful (whether for a joke, or for real (scary))

If you want to be cruel to your pet forum. Do this. If you want to be cruel to your forum about rainbows, no need. You have already been cruel enough.

Jokes aside, This might actually be useful for someone, so I thought I'd show people how.

JSFIDDLE provided by developers

Actual Tutorial...

add anywhere required. headerinclude or the footer would be best. Javascript has been minified, because I don't know if people want to include a js file. js file is here non-minified(https://github.com/xoxco/Rainbow-Text/bl...ainbow.js) and here (http://xoxco.com/projects/code/rainbow/rainbow.js)

If you don't have jQuery installed, install it by including this above the code below...
Code:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
Code:
<script>
(function(e){e.fn.rainbow=function(t){this.each(function(){t.originalText=e(this​).html();t.iterations=0;if(!t.pauseLength){t.pauseLength=t.animateInterval}e(thi​s).data("options",t);if(t.pad){for(x=0;x<t.originalText.length;x++){t.colors.unshift(t.colors[t.colors.length-1])}}e.fn.rainbow.render(this)})};e.fn.pauseRainbow=function(){this.each(function(​){var t=e(this).data("options");if(t){t.animate=false;e(this).data("options",t)}})};e.fn.resumeRainbow=function(){this.each(function(){var t=e(this).data("options");if(t){t.animate=true;e(this).data("options",t);e.fn.rainbow.render(this)}})};e.fn.rainbow.render=function(t){var n=e(t).data("options");var r=n.originalText.split("");n.iterations++;var i="";var s=0;for(var o in r){if(r[o]!=" "){i=i+'<span style="color: '+n.colors[s]+';">'+r[o]+"</span>";s++}else{i=i+" "}if(s>=n.colors.length){s=0}}e(t).html(i);var u=n.iterations%n.colors.length==0;if(n.animate){(function(t,n){var r=e(t).data("options");var i=setTimeout(function(){e.fn.rainbow.shift(t)},n);r.interval=i;e(t).data("options",r)})(t,u?n.pauseLength:n.animateInterval)}};e.fn.rainbow.shift=function(t){var n=e(t).data("options");var r=n.colors.pop();n.colors.unshift(r);e.fn.rainbow.render(t)}})(jQuery)
</script>
<script>
// Change options here!
$('.rainbow').rainbow({
    colors: [
        '#FF0000',
        '#f26522',
        '#fff200',
        '#00a651',
        '#28abe2',
        '#2e3192',
        '#6868ff'
    ],
    animate: true,
    animateInterval: 100,
    pad: false,
    pauseLength: 100
});
// End change options
</script>

Then set the username style in the usergroups section for the group you want to have the rainbow style username to:

Code:
<span class="rainbow">{username}</span>

Upload to Imgur: Sceditor version

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

2 - Open root/jscripts/sceditor/jquery.sceditor.mybb.helper.js
2.1 - Copy code below after all:

Code:
function upload(file) {

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

        /* It is! */
        document.body.className = "uploading";
var d = document.querySelector(".sceditor-button-imgur div");
d.className = d.className + " imgurup";

        /* 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
        var xhr = new XMLHttpRequest(); // Create the XHR (Cross-Domain XHR FTW!!!) Thank you sooooo much imgur.com
        xhr.open("POST", "https://api.imgur.com/3/image.json"); // Boooom!
        xhr.onload = function() {
            var code = '[img]' + JSON.parse(xhr.responseText).data.link + '[/img]';
            clickableEditor.performInsert(code);
var d = document.querySelector(".sceditor-button-imgur div.imgurup");
d.className = d.className - " imgurup";
document.querySelector('input.imgur').remove();
        }
        // Ok, I don't handle the errors. An exercice for the reader.
        xhr.setRequestHeader('Authorization', 'Client-ID <yourkey>');
        /* And now, we send the formdata */
        xhr.send(fd);
    };

2.2 - Change <yourkey> with Client ID key obtained in 1
2.3 - Find

Code:
    /*******************
     * Init the editor *
     *******************/

2.3.1 - Copy code below above

Code:
    /********************************************
     * Imgur Tag *
     ********************************************/
$.sceditor.command.set("imgur", {
    exec: function ()
    {
        document.querySelector('textarea').insertAdjacentHTML( 'afterEnd', '<input class="imgur" style="visibility: collapse; width: 0px; display:none;" type="file" onchange="upload(this.files[0])">' );
        document.querySelector('input.imgur').click();
    },
    txtExec: function()
    {
        document.querySelector('textarea').insertAdjacentHTML( 'afterEnd', '<input class="imgur" style="visibility: collapse; width: 0px; display:none;" type="file" onchange="upload(this.files[0])">' );
        document.querySelector('input.imgur').click();
    },
    tooltip: 'Upload para Imgur'
});
$.sceditor.plugins.bbcode.bbcode.set("imgur", {
    tags: {
        pre: null
    },
    format: function ()
    {
        document.querySelector('textarea').insertAdjacentHTML( 'afterEnd', '<input class="imgur" style="visibility: collapse; width: 0px; display:none;" type="file" onchange="upload(this.files[0])">' );
        document.querySelector('input.imgur').click();
    },
    html: function ()
    {
        document.querySelector('textarea').insertAdjacentHTML( 'afterEnd', '<input class="imgur" style="visibility: collapse; width: 0px; display:none;" type="file" onchange="upload(this.files[0])">' );
        document.querySelector('input.imgur').click();
    }
});

2.4 - Find

Code:
'image,

2.4.1 - Replace

Code:
'image,imgur,

2.5 - Find

Code:
$('#message, #signature').data('sceditor').insert(code);

2.5.1 - Replace

Code:
$('#message, #signature, textarea[id*="quickedit_"]').data('sceditor').insert(code);

3 - Open root/jscripts/sceditor/themes/default.min.css
3.1 - Copy code below after all:
Code:
.sceditor-button-imgur div { background-image:url(imgur.png); }.sceditor-button-imgur div.imgurup { background-image:url(spinner.gif) !important; }
3.2 - Repeat step 3 and 3.1 with modern.min.css, office.min.css, office-toolbar.min.css and square.min.css.

4 - Copy imgur.png and spinner.gif in root/jscripts/sceditor/themes/

All done.

Demo video:





Credit: https://hacks.mozilla.org/category/drag-.../complete/
http://stackoverflow.com/questions/16951...javascript

.gif  spinner.gif (Size: 1.51 KB / Downloads: 33)

.png  imgur.png (Size: 1.12 KB / Downloads: 33)

help please !!

where to read emails coming to webmaster@mydomain.com

$
0
0
can someone help me .. i dont know how to find the emails sent to webmaster@mydomain.com

Multiple Colored Category Headings/ Thead MyBB

$
0
0
Original Topic here : http://myskins.org/Thread-Multiple-Color...Thead-MyBB
Hello friends,
As requested by our friend Zwiv, i am making this tut for Multiple color category background / Thead for MyBB.
It requires knowledge in template editing and is very simple,

First as always the HTML.
Navigate to Templates > forumbit templates > forumbit_depth1_cat template.

Look for this code on 4th line.
Code:
<td class="thead" colspan="5">

Replace with:
Code:
<td class="thead" colspan="6" id="forum_cat_{$forum['fid']}">

So copy paste business lets you learn nothing. So here i explain what you are exactly doing.
You are assigning an ID for the category heading. As ID's are unique, they tend to have a property of assigning themselves to a particular element.

Now its Css time :
So you have to look for number of categories you have.
Look for their ID's in the admin panel > forums.

So every category needs to be having a particular ID and insert in following code:
Code:
#forum_cat_x {background:#D12C2C;}

x="ID Number of the Category.

For example:

The first forum cat ID is 1 then you have to insert the ID within the following code:
Code:
#forum_cat_1 {background:#111;}

So the next category has an ID 8 then the code becomes :
Code:
#forum_cat_8 {background:#222;}

So you have to assign color to every category you have and thus you can achieve multiple clored Thead/ Category Heading Backgrounds.
You can add images instead of colors too., instead of colors #xxxxxx
you need to add the image path ex: url(images/xx.png);

So if you enjoy this feel free to share it with your friends, with credits to me.
Thank you
regards

Restrict Signature Image Size : Maintain Forum Decency

$
0
0
We often see users apply huge images in signatures that appear in postbit making the postbit look more like an advert zone. That not only destroys the decency of the board but much annoying too.

This tweak will handle this issue restricting the size of the signature image in postbit as desired / defined by admin.

Go to template:
ACP > Templates & Styles > Templates > {theme_name} Templates > Postbit Templates > postbit_signature

Find this:
Code:
{$post['signature']}

Change it to:
Code:
<div class="postbit_sig">{$post['signature']}</div>

Save the template.
Now open your theme's showthread.css in advanced edit mode:
ACP > Templates & Styles > Themes > {theme_name} > showthread.css > Edit Stylesheet : Advanced Mode

and add the following at the end:

Code:
.postbit_sig div img, .postbit_sig div a img {
max-height: 70px;
}

Change the height pixel value as required and save.

Now the signatures of the users in postbit will be maintained not exceeding the size limit you have specified.

Note: Declaring height or width only will change the subsequent width or height maintaining aspect ratio. You can declare both the values; ( eg. max-width: 100px; ) in that case whichever value will exceed the tweak will take effect.

Limit Signature Image Size in kilobyte

$
0
0
Create limitsign.php in Notepad ++

and copy (or you can use attached file)

PHP Code:
<?php 
// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
    die(
"Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

// Plugin info
function limitsign_info ()
{
    return array(
        
"name"            => "limitsign",
        
"description"    => "limitsign",
        
"website"        => "limitsign",
        
"author"        => "limitsign",
        
"authorsite"    => "limitsign",
        
"version"        => "limitsign",
        
"guid"             => "limitsign",
        
"compatibility" => "16*"
    
);
}

$plugins->add_hook('usercp_start''signsize');
function 
signsize()
{
    global 
$mybb$error;

    
preg_match_all("/\[img(.*?)\](.*?)\[\/img\]/i"$mybb->input['signature'], $matchesPREG_SET_ORDER);

    
$kbsizetot 0;
    
    foreach (
$matches as $img)
    {
    
$kbsize strlen(@file_get_contents($img[2]));
    
$kbsizetot += $kbsize;
    }
    
    if ((
$kbsizetot 350000) && ($mybb->input['action'] == "do_editsig")) {

    
$error inline_error("The sum of the size of the images exceeds the allowed limit of 350kb.");

    }    
}
?>

Change "350000" with value you want...
350000 is same 350 kb
100000 is same 100 kb.....

Change "The sum of the size of the images exceeds the allowed limit of 350kb." with error message you want.

upload limitsign.php to plugin folder and activate.
it´s all.

.php  limitsign.php (Size: 1.04 KB / Downloads: 4)

[Core Mod] How to get title tag on posts (vB Style)

$
0
0
1. Open your MYBB_ROOT/inc/class_parser.php
2. Find function mycode_parse_url_callback1 (around line 973)
3. Replace all with:

PHP Code:
    function mycode_parse_url_callback1($matches)
    {
        if(!isset(
$matches[3]))
        {
            
$matches[3] = '';
        }
        
        
$urlContents file_get_contents($matches[1].$matches[2]);
        
preg_match("/<title>(.*)<\/title>/i"$urlContents$hehu);
        
        
$title $hehu[1];
        return 
$this->mycode_parse_url($matches[1].$matches[2], $title);
    } 

Demo:
[Image: 61Cqt.png]
[Image: 61CrJ.png]

Looking for Tut

Avatar in Header with Fallback

$
0
0
Dependency:
jQuery library with proper noConflict(); included.

Background:
As requested by a member of the community in this thread:
http://community.mybb.com/thread-149474.html
I've made this simple jQuery function.

Purpose:
As we all know that this variable: {$mybb->user['avatar']} returns the avatar url path of the logged in user, so using this variable we can display logged in user's avatar in welcomeblock. But there is a problem. If the user doesn't have set any avatar; this variable returns a blank value; thus the avatar area remains with an empty spaceholder.

The idea is to display the avatar of the current user, if set, else a predefined default avatar.

Process:
In header_welcomeblock_member template add an image tag where you wanna show the avatar.
Code:
<img id="avatar"/>

Upload the default avatar image, say it is:
Code:
{$theme['imgdir']}/defaultavatar.png

Now add this script at the end of header_welcomeblock_member template:
Code:
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
var user_avatar = "{$mybb->user['avatar']}";
var default_avatar = "{$theme['imgdir']}/defaultavatar.png";
jQuery( "#avatar" ).error(function() {
  jQuery(this).attr( "src", default_avatar );
}).attr( "src", user_avatar );
});
</script>

Things to make sure
1. Ensure that the path of the default avatar image you are linking via variable 'default_avatar' is correct.
2. Remember to include jQuery library in headerinclude template if it is not already ...

Happy coding.
Viewing all 685 articles
Browse latest View live