1. IMPORTANT : Nouvelles mesures de sécurité - 2. Règles pour obtenir de l'aide dans les forums de support - 3. Restrictions des droits pour le groupe "Support suspendu"

Il est obligatoire de respecter les Règles de MyBB.fr : Version abrégée ou Version complète pour obtenir du support sur nos forums.

Les membres ayant un site/forum contrevenant aux règles de MyBB.support seront placés dans le groupe "Support suspendu" et ne bénéficieront plus du support du staff. Nous recommandons aux autres membres d'agir de même. Il ne s'agit pas d'un bannissement, le membre retrouvera son statut "normal" dès que sa situation sera conforme aux règles.

Nouveau : un Wiki en français : plus de détails.
Avant de soumettre votre problème, consultez-le, ainsi que la FAQ, sans oublier le moteur de recherche interne.


Note de ce sujet :
  • Moyenne : 0 (0 vote(s))
  • 1
  • 2
  • 3
  • 4
  • 5
[Réglé] Erreur suite vérification avec le site : validator.w3.org SideBoxPlus
Mots-clés » erreur, suite, vérification, site, validatorw3org, sideboxplus
25-03-2013, 13:45, (Modification du message : 26-03-2013, 15:03 par Pichorka.)
#13
RE: Erreur suite vérification avec le site : validator.w3.org
(24-03-2013, 23:41)spyto a écrit :  J'ai peut-être trouvé mieux (et plus simple)...

Dans le template 'sbplus_welcome', il suffirait de supprimer le <td>...</td> inutile et de conserver le template 'sbplus_welcome_guesttext' tel qu'il était.

A savoir, au lieu de :
Code PHP :
$template_1 = array(
        
"title" => "sbplus_welcome",
        
"template" => "<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"thead\" colspan=\"2\"><strong>{\$lang->welcome}</strong></td>
</tr>
<tr>
<td class=\"trow1\">
{\$sb_welcometext}
</td></tr>
</table><br>"
,
        
"sid" => -1
    
); 
mettre :
Code PHP :
$template_1 = array(
        
"title" => "sbplus_welcome",
        
"template" => "<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"thead\" colspan=\"2\"><strong>{\$lang->welcome}</strong></td>
</tr>
<tr>
{\$sb_welcometext}
</tr>
</table><br>"
,
        
"sid" => -1
    
); 

Mais tu dois pouvoir atteindre ces templates depuis l'admin sans avoir à bricoler le fichier ou la BD.

Modifier le fichier est utile pour avoir un plugin "propre", à condition de le désinstaller puis de le réinstaller pour que les modifs soient prises en compte !

Effectivement cela fonctionne parfaitement, cette modification est ce qu'il fallait faire, testé et validé.

GRAND MERCI Smile


(24-03-2013, 23:43)spyto a écrit :  
(24-03-2013, 23:36)Pichorka a écrit :  Merci, oui il vaudra mieux modifier le plugins et réinstaller, pour tester j'ai donc changer le code directement dans la BDD, Template > Template , par le code que tu m'a proposer et voila le résultat en image :

Attention, le code que je t'avais donné était pour le fichier, et non pour la BD...
Là les apostrophes ont été "échappées" deux fois semble-t-il.

Effectivement, vu la fatigue je n'avait même pas fait attention ... c'est du lourd ... Wink
Désolé Smile


(24-03-2013, 23:46)spyto a écrit :  Les identifiants donnés dans ton post initial ne fonctionnent pas !
Merci de vérifier et si tu les as modifiés envoie-les par MP, j'éditerai ton post.

C'est fait, je t'ai transmit les identifiants par MP tu me dira si c'est bon, ça devrai marcher j'ai tester le compte ce matin et merci pour la mise à jour Smile


EXPLIQUATION :

Une fois le bout de code changer, et lors de la première activation tout va bien, je désactive le mod et le réative, mais comme le plugin n'a pas de désinstallateur, cela efface juste les entrées de la BDD "mybb_templates" > "templates" les codes (15 au total).

Il reste donc a désinstaller depuis le PCA manuellement le bout de code inscrit par le plugin :
PCA > Votre Template > Page d'index Templates
le code installé par SideBoxPlus dans l'index qui et résiduel est :

Code :
<a class="sbp_buton" style="float: right;" title="{$lang->sbplus_sidebarkapat}"></a>
<a class="sbp_tbuton" style="float: right;" title="{$lang->sbplus_sidebarac}"></a>
<div class="sbp_sbar" style="float: right;width: 25%;">
    {$sb_welcome}{$sb_search}{$sb_whosonline}{$sb_stats}{$sb_latestthreads}{$sb​_additional}
</div>
<div class="sbp_forum" style="float: left;width: 74%;">
{$forums}
</div>

Remplacez par :
Code :
{$forums}

Le plugin, installe une </div> juste après {$forums}, il faut bien sur supprimer aussi cette inscription (une seule </div> a supprimer pas les autres), sinon il restera une </div> sans ouverture et inutile.

Comme l'indique le code source d'installation du plugin ci-dessous :

Code :
    find_replace_templatesets("index", '#'.preg_quote('<a class="sbp_buton" style="float: right;" title="{$lang->sbplus_sidebarkapat}"></a>
<a class="sbp_tbuton" style="float: right;" title="{$lang->sbplus_sidebarac}"></a>
<div class="sbp_sbar" style="float: right;width: 25%;">
    {$sb_welcome}{$sb_search}{$sb_whosonline}{$sb_stats}{$sb_latestthreads}{$sb​_additional}
</div>
<div class="sbp_forum" style="float: left;width: 74%;">
{$forums}
</div>').'#', '{$forums}',0);

Milles merci à spyto qui ma aider à résoudre le problème de <br> :
Citation :Dans le template 'sbplus_welcome', il suffirait de supprimer le <td>...</td> inutile et de conserver le template 'sbplus_welcome_guesttext' tel qu'il était.

et bien sur les <td> .. </td>

[quote]
SPYTO dit : Le <br> est à la ligne 269 dans le template 'sbplus_welcome'

EDIT : il y en a un aussi a corriger ligne 366 et pas mal d'autre codés en </br> étrange ... et a changer peu-être aussi ?

Message un peu long Wink mais je pense utile ^^

Le code du plugin modifié (SAUF LES BALISES EN "</br>", les 2 autres "<br>" ont été remplacés par "<br />" :

Code :
<?php
/**
* Side Boxes!
* Copyright TECHEX - The Site
* http://www.thetechex.net
*/

// 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.");
}

$plugins->add_hook("index_start", "sideboxes_start");
$plugins->add_hook("showthread_start", "sideboxes_konu_func");
$plugins->add_hook("global_end", "sideboxes_loadlang");

function sideboxes_info()
{
    global $lang;
    $lang->load("sideboxes", false, true);
    
    return array(
        "name"            => $lang->side_boxes,
        "description"    => $lang->side_boxes_desc,
        "website"        => "http://www.thetechex.net",
        "author"        => "Zaher1988",
        "authorsite"    => "http://www.thetechex.net",
        'guid'            => 'effbc96a4db5de1154b7d3ac6869d9f8',
        "version"        => "2.1.5",
    );
}

function sideboxes_activate()
{
    global $db, $lang;
    $lang->load("sideboxes", false, true);
    
    $sideboxes_group = array(
        "gid"            => "NULL",
        "title"            => $lang->side_boxes_index,
        "name"            => "sideboxes",
        "description"    => $lang->sideboxes_set_group,
        "disporder"        => "600",
        "isdefault"        => "no",
    );
    
    $db->insert_query("settinggroups", $sideboxes_group);
    $gid = $db->insert_id();
    
    
    $sideboxes_setting_1 = array(
        "sid"            => "NULL",
        "name"            => "sb_welcome",
        "title"            => $lang->sideboxes_set_1,
        "description"    => $lang->sideboxes_set_desc_1,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '1',
        "gid"            => intval($gid),
    );
    $sideboxes_setting_2 = array(
        "sid"            => "NULL",
        "name"            => "sb_stats",
        "title"            => $lang->sideboxes_set_2,
        "description"    => $lang->sideboxes_set_desc_2,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '2',
        "gid"            => intval($gid),
    );
    $sideboxes_setting_3 = array(
        "sid"            => "NULL",
        "name"            => "sb_search",
        "title"            => $lang->sideboxes_set_3,
        "description"    => $lang->sideboxes_set_desc_3,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '3',
        "gid"            => intval($gid),
    );
    $sideboxes_setting_4 = array(
        "sid"            => "NULL",
        "name"            => "sb_latest",
        "title"            => $lang->sideboxes_set_4,
        "description"    => $lang->sideboxes_set_desc_4,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '4',
        "gid"            => intval($gid),
    );
    $sideboxes_setting_5 = array(
        "sid"            => "NULL",
        "name"            => "sb_latest_num",
        "title"            => $lang->sideboxes_set_5,
        "description"    => $lang->sideboxes_set_desc_5,
        "optionscode"    => "text",
        "value"            => '10',
        "disporder"        => '5',
        "gid"            => intval($gid),
    );
    $sideboxes_setting_6 = array(
        "sid"            => "NULL",
        "name"            => "sb_whos_online",
        "title"            => $lang->sideboxes_set_6,
        "description"    => $lang->sideboxes_set_desc_6,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '6',
        "gid"            => intval($gid),
    );

    $sideboxes_setting_7 = array(
        "sid"            => "NULL",
        "name"            => "sb_additional",
        "title"            => $lang->sideboxes_set_7,
        "description"    => $lang->sideboxes_set_desc_7,
        "optionscode"    => "textarea",
        "value"            => $db->escape_string('<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><strong>Benim ek kutum</strong></td>
</tr>
<tr>
<td class="trow1">Benim sidebox kutu içeriğim</td>
</tr>
</table>
<br />'),
    "disporder"        => '7',
    "gid"            => intval($gid),
    );

    $db->insert_query("settings", $sideboxes_setting_1);
    $db->insert_query("settings", $sideboxes_setting_2);
    $db->insert_query("settings", $sideboxes_setting_3);
    $db->insert_query("settings", $sideboxes_setting_4);
    $db->insert_query("settings", $sideboxes_setting_5);
    $db->insert_query("settings", $sideboxes_setting_6);
    $db->insert_query("settings", $sideboxes_setting_7);
    
    $sideboxes_group_2 = array(
        "gid"            => "NULL",
        "title"            => $lang->side_boxes_konu,
        "name"            => "sideboxes_2",
        "description"    => $lang->sideboxes_set_group_konu,
        "disporder"        => "601",
        "isdefault"        => "no",
    );
    
    $db->insert_query("settinggroups", $sideboxes_group_2);
    $gid = $db->insert_id();
    
        $sideboxes_setting_8 = array(
        "sid"            => "NULL",
        "name"            => "konu_ackapa",
        "title"            => $lang->konu_ackapa,
        "description"    => $lang->konu_ackapa_desc,
        "optionscode"    => "onoff",
        "value"            => '1',
        "disporder"        => '1',
        "gid"            => intval($gid),
    );
    
        $sideboxes_setting_9 = array(
        "sid"            => "NULL",
        "name"            => "konu_bilgi",
        "title"            => $lang->konu_bilgi,
        "description"    => $lang->konu_bilgi_desc,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '2',
        "gid"            => intval($gid),
    );
    
        $sideboxes_setting_10 = array(
        "sid"            => "NULL",
        "name"            => "konu_okuyan",
        "title"            => $lang->konu_okuyan,
        "description"    => $lang->konu_okuyan_desc,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '3',
        "gid"            => intval($gid),
    );
    
        $sideboxes_setting_11 = array(
        "sid"            => "NULL",
        "name"            => "konu_arama",
        "title"            => $lang->konu_arama,
        "description"    => $lang->konu_arama_desc,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '4',
        "gid"            => intval($gid),
    );
    
        $sideboxes_setting_12 = array(
        "sid"            => "NULL",
        "name"            => "konu_hizlimenu",
        "title"            => $lang->konu_hizlimenu,
        "description"    => $lang->konu_hizlimenu_desc,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '5',
        "gid"            => intval($gid),
    );
    
        $sideboxes_setting_13 = array(
        "sid"            => "NULL",
        "name"            => "konu_benzer",
        "title"            => $lang->konu_benzer,
        "description"    => $lang->konu_benzer_desc,
        "optionscode"    => "yesno",
        "value"            => '1',
        "disporder"        => '6',
        "gid"            => intval($gid),
    );
    
        $sideboxes_setting_14 = array(
        "sid"            => "NULL",
        "name"            => "konu_benzer_tip",
        "title"            => $lang->konu_benzer_tip,
        "description"    => $lang->konu_benzer_tip_desc,
        "optionscode"    => 'radio \n10=Gelişmiş\n20=Basit',
        "value"            => '10',
        "disporder"        => '7',
        "gid"            => intval($gid),
    );

    $sideboxes_setting_15 = array(
    "sid"            => "NULL",
    "name"            => "konu_ek",
        "title"            => $lang->konu_ek,
        "description"    => $lang->konu_ek_desc,
    "optionscode"    => "textarea",
    "value"            => $db->escape_string('<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<tr>
<td class="thead"><strong>Benim ek kutum</strong></td>
</tr>
<tr>
<td class="trow1">Benim sidebox kutu içeriğim</td>
</tr>
</table>
<br />'),
    "disporder"        => '8',
    "gid"            => intval($gid),
    );

    $db->insert_query("settings", $sideboxes_setting_8);
    $db->insert_query("settings", $sideboxes_setting_9);
    $db->insert_query("settings", $sideboxes_setting_10);
    $db->insert_query("settings", $sideboxes_setting_11);
    $db->insert_query("settings", $sideboxes_setting_12);
    $db->insert_query("settings", $sideboxes_setting_13);
    $db->insert_query("settings", $sideboxes_setting_14);    
    $db->insert_query("settings", $sideboxes_setting_15);
    rebuild_settings();

    //şablon ekle
$template_1 = array(
        "title" => "sbplus_welcome",
        "template" => "<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"thead\" colspan=\"2\"><strong>{\$lang->welcome}</strong></td>
</tr>
<tr>
<td class=\"trow1\"/>
{\$sb_welcometext}
</tr>
</table><br />",
        "sid" => -1
    );

    $db->insert_query("templates", $template_1);
    
    $template_2 = array(
        "title" => "sbplus_welcome_membertext",
        "template" => "<div id=\"login_blok_menu\">
<center>
<a href=\"{\$mybb->settings[\'bburl\']}/usercp.php?action=avatar\" title=\"{\$lang->sbplus_avatar}\">
<img class=\"side-avatar\" src=\"{\$mybb->user[\'avatar\']}\" alt=\"{\$mybb->user[\'username\']}\" height=\"70\" width=\"70\"/></a>
</center>
<ul>
<li>{\$admincplink}</li>
<li>{\$modcplink}</li>
<li><a href=\"usercp.php\" rel=\"nofollow\" title=\"{\$lang->sbplus_usercp_t}\"><img src=\"images/sbplus/ikon/profil.png\" height=\"20\" width=\"20\"/> {\$lang->welcome_usercp}</a></li>
<li><a href=\"search.php?action=getnew\" rel=\"nofollow\" title=\"{\$lang->sbplus_sonkonu_t}\"><img src=\"images/sbplus/ikon/son-yorumlar.png\" height=\"20\" width=\"20\" /> {\$lang->latest_threads}</a></li>
<li><a href=\"search.php?action=getdaily\" rel=\"nofollow\" title=\"{\$lang->sbplus_bugunku_t}\"><img src=\"images/sbplus/ikon/bugun-yorumlar.png\" height=\"20\" width=\"20\" /> {\$lang->welcome_todaysposts}</a></li>
<li><a href=\"private.php\" rel=\"nofollow\" title=\"{\$lang->sbplus_ozelmesaj_t}\"><img src=\"images/sbplus/ikon/ozel-mesaj.png\" height=\"20\" width=\"20\"/> {\$lang->forumjump_pms}</a></li>
<li><a href=\"javascript:;\" onclick=\"MyBB.popupWindow(\'{\$mybb->settings[\'bburl\']}/misc.php?action=buddypopup\', \'buddyList\', 350, 350);\" rel=\"nofollow\" title=\"{\$lang->sbplus_arkadaslarim_t}\"><img src=\"images/sbplus/ikon/arkadas.png\" height=\"20\" width=\"20\"/> {\$lang->welcome_open_buddy_list}</a></li>
<li><a href=\"member.php?action=logout&amp;logoutkey={\$mybb->user[\'logoutkey\']}\" title=\"{\$lang->sbplus_cikis_t}\" rel=\"nofollow\"><img src=\"images/sbplus/ikon/cikis-yap.png\" height=\"20\" width=\"20\"/> {\$lang->welcome_logout}</a></li>
</ul>
</div>",
        "sid" => -1
    );
    $db->insert_query("templates", $template_2);

    $template_3 = array(
        "title" => "sbplus_welcome_guesttext",
        "template" => "<td class=\"trow1\"><span class=\"smalltext\">{\$lang->guest_welcome_registration}</span><br />
<br />
<form method=\"post\" action=\"{\$portal_url}\"><input type=\"hidden\" name=\"action\" value=\"do_login\" />
{\$lang->username}<br />&nbsp;&nbsp;<input type=\"text\" class=\"textbox\" name=\"username\" value=\"\" /><br /><br />
{\$lang->password}<br />&nbsp;&nbsp;<input type=\"password\" class=\"textbox\" name=\"password\" value=\"\" /><br /><br />
<label title=\"{\$lang->remember_me_desc}\"><input type=\"checkbox\" class=\"checkbox\" name=\"remember\" value=\"yes\" /> {\$lang->remember_me}</label><br />
<br /><input type=\"submit\" class=\"button\" name=\"loginsubmit\" value=\"{\$lang->login}\" /> - <a href=\"{\$mybb->settings[\'bburl\']}/member.php?action=register\"><b>{\$lang->welcome_register}</b></a></form></td>",
        "sid" => -1
    );
    $db->insert_query("templates", $template_3);

    $template_4 = array(
        "title" => "sbplus_search",
        "template" => "<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"thead\"><strong>{\$lang->search_forums}</strong></td>
</tr>
<tr>
<td class=\"trow1\" 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\" class=\"textbox\" size=\"16\" name=\"keywords\" value=\"\" />
{\$gobutton}
</form>
<span class=\"smalltext\">
(<a rel=\"nofollow\" href=\"{\$mybb->settings[\'bburl\']}/search.php\">{\$lang->advanced_search}</a>)
</span>
</td>
</tr>
</table>
<br />",
        "sid" => -1
    );
    $db->insert_query("templates", $template_4);

    $template_5 = array(
        "title" => "sbplus_stats",
        "template" => "<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"thead\"><strong>{\$lang->forum_stats}</strong></td>
</tr>
<tr>
<td class=\"trow1\">
<span class=\"smalltext\">
<img src=\"{\$theme[\'imgdir\']}/portal_istatistik.png\" style=\"vertical-align: middle;\" height=\"14\" width=\"14\" alt=\"istatistik\" border=\"0\" /> {\$lang->num_members} {\$stats[\'numusers\']}<br />
<img src=\"{\$theme[\'imgdir\']}/portal_istatistik.png\" style=\"vertical-align: middle;\" height=\"14\" width=\"14\" alt=\"istatistik\" border=\"0\" /> {\$lang->num_threads} {\$stats[\'numthreads\']}<br />
<img src=\"{\$theme[\'imgdir\']}/portal_istatistik.png\" style=\"vertical-align: middle;\" height=\"14\" width=\"14\" alt=\"istatistik\" border=\"0\" /> {\$lang->num_posts} {\$stats[\'numposts\']}<br />
<img src=\"{\$theme[\'imgdir\']}/portal_istatistik.png\" style=\"vertical-align: middle;\" height=\"14\" width=\"14\" alt=\"istatistik\" border=\"0\" /> {\$lang->latest_member} {\$newestmember}
<br /><img src=\"{\$theme[\'imgdir\']}/pbullet.gif\" style=\"vertical-align: middle;\" height=\"7\" width=\"14\" alt=\"istatistik\" border=\"0\" /> <a rel=\"nofollow\" href=\"{\$mybb->settings[\'bburl\']}/stats.php\" title=\"{\$lang->full_stats}i Göster\">{\$lang->full_stats}</a>
</span>
</td>
</tr>
</table>
<br />",
        "sid" => -1
    );
    $db->insert_query("templates", $template_5);

    $template_6 = array(
        "title" => "sbplus_latestthreads",
        "template" => "<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr>
<td class=\"thead\"><strong>{\$lang->latest_threads}</strong></td>
</tr>
{\$sbp_threadlist}
</table><br />",
        "sid" => -1
    );
    $db->insert_query("templates", $template_6);

    $template_7 = array(
        "title" => "sbplus_latestthreads_thread",
        "template" => "<tr>
<td class=\"{\$altbg}\">
<strong><a href=\"{\$mybb->settings[\'bburl\']}/{\$thread[\'threadlink\']}\">{\$thread[\'subject\']}</a></strong><br />
<span class=\"smalltext\"><a href=\"{\$thread[\'lastpostlink\']}\">{\$lang->latest_threads_lastpost}</a> {\$lastposterlink}<br />
{\$lastpostdate} {\$lastposttime}<br />
<strong>&raquo; </strong>{\$lang->latest_threads_replies} {\$thread[\'replies\']}<br />
<strong>&raquo; </strong>{\$lang->latest_threads_views} {\$thread[\'views\']}
</span>
</td>
</tr>",
        "sid" => -1
    );
    $db->insert_query("templates", $template_7);

    $template_8 = array(
        "title" => "sbplus_konubilgileri",
        "template" => "<table cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" border=\"0\" style=\"margin-bottom: 0px;\" class=\"tborder\">
<tr><td class=\"thead\"><strong>{\$lang->sbplus_konubilgi}</strong></td></tr>
<tr><td class=\"trow2\"><ul class=\"thread_tools\"><li class=\"yazar\"><b>{\$lang->author}:</b> \$thread[username]</li></ul></td></tr>
<tr><td class=\"trow1\"><ul class=\"thread_tools\"><li class=\"okunma\"><b>{\$lang->sbplus_okunma}</b> \$thread[views]</li></ul></td></tr>
<tr><td class=\"trow2\"><ul class=\"thread_tools\"><li class=\"yorum\"><b>{\$lang->forumbit_posts}:</b> \$thread[replies]</li></ul></td></tr>
<tr><td class=\"trow1\"><table cellspacing=\'0\' cellpadding=\'0\' width=\'120\' border=\'0\'>
<b>{\$lang->sbplus_kalite}</b><span style=\'font-weight:bold; font-size:9px; color:crimson\'> % \$kalite</span>
<td width=\'3\' height=\'13\'><img width=\'3\' height=\'13\' src=\'images/kalite/img_left.gif\' alt=\'\' /></td>
<td width=\'114\' height=\'13\' style=\'line-height: 13px;background: url(images/kalite/img_backing.gif) repeat-x top left;text-align: left;\'><img src=\'images/kalite/green.gif\' width=\\\"\$kalite\\\" height=\'9\' alt=\'\' /><img src=\'images/kalite/mp.gif\' height=\'9\' alt=\'\' /></td>
<td width=\'3\' height=\'13\'><img width=\'3\' height=\'13\' src=\'images/kalite/img_right.gif\' alt=\'\' /></td></table></td></tr>
<tr><td class=\"trow1\">
        <!-- Sosyal Buton -->
        <div class=\"addthis_toolbox addthis_default_style\">
            <div class=\"float_left\"><span class=\"paylas\"><b>{\$lang->sbplus_paylas}</b></span> </div>
            <div class=\"float_right\">
                <a rel=\"nofollow\" title=\"{\$thread[\'subject\']} {\$lang->sbplus_facebook_paylas}\" class=\"addthis_button_facebook\" style=\"cursor:pointer\"></a>
                <a rel=\"nofollow\" title=\"{\$thread[\'subject\']} {\$lang->sbplus_twitter_paylas}\" class=\"addthis_button_twitter\" style=\"cursor:pointer\"></a>
                <a rel=\"nofollow\"title=\"{\$thread[\'subject\']} {\$lang->sbplus_friendfeed_paylas}\" class=\"addthis_button_friendfeed\" style=\"cursor:pointer\"></a>
                <a rel=\"nofollow\"title=\"{\$thread[\'subject\']} {\$lang->sbplus_myspace_paylas}\" class=\"addthis_button_myspace\" style=\"cursor:pointer\"></a>
                    <script type=\"text/javascript\">
                    addthis_pub             = \'xpserkan\';
                    addthis_logo            = \'\';
                    addthis_logo_background = \'ffff\';
                    addthis_logo_color      = \'ffff\';
                    addthis_brand           = \'{\$mybb->settings[\'bbname\']}\';
                    addthis_options         = \'facebook, twitter, friendfeed, myspace, google, google buzz, blogger, wordpress, live, digg, reddit, delicious, technorati, more\';
                    </script>
                <a rel=\"nofollow\" href=\"http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4acfa489038aaf54\" class=\"addthis_button_compact\" title=\"{\$thread[\'subject\']} {\$lang->sbplus_konu_paylas}\"></a>
                <script type=\"text/javascript\" src=\"http://s7.addthis.com/js/250/addthis_widget.js#pub=xa-4acfa489038aaf54\"></script>
            </div>
        </div>
        <!-- Sosyal Buton Bitti -->
</td></tr>
<tr><td class=\"trow2\">
        <!-- Begin TranslateThis Button -->
        <div id=\"translate-this\"><a href=\"http://translateth.is/\" class=\"translate-this-button\">Translate</a></div>
        <script type=\"text/javascript\" src=\"http://www.google.com/jsapi\"></script>
        <script type=\"text/javascript\" src=\"http://x.translateth.is/translate-this.js\"></script>
        <script type=\"text/javascript\">
            TranslateThis({
            ddLangs : [
            \'en\',
            \'fr\',
            \'es\',
            \'ar\',
            \'zh-CN\',
            \'ko\',
            \'it\',
            \'iw\',
            \'de\',
            \'pt-PT\',
            \'ru\',
            \'ja\',
            \'vi\',
            \'el\',
            \'hi\',
            \'tr\'
                    ]
                        });
        </script>
        <!-- End TranslateThis Button -->
</td></tr>
<tr><td class=\"trow1\"><ul class=\"thread_tools\"><li class=\"subscription_{\$add_remove_subscription}\"><b><a href=\"usercp2.php?action={\$add_remove_subscription}subscription&amp;tid={\$tid}&amp;my_post_key={\$mybb->post_code}\">{\$add_remove_subscription_text}</a></b></li></ul></td></tr>
<tr><td class=\"trow2\"><ul class=\"thread_tools\"><li class=\"sendthread\"><b><a href=\"sendthread.php?tid={\$tid}\">{\$lang->send_thread}</a></b></li></ul></td></tr>
<tr><td class=\"trow1\"><ul class=\"thread_tools\"><li class=\"printable\"><b><a href=\"printthread.php?tid={\$tid}\">{\$lang->view_printable}</a></b></li></ul></td></tr>
</table>
<br />",
        "sid" => -1
    );
    $db->insert_query("templates", $template_8);

    $template_9 = array(
        "title" => "sbplus_konuyuokuyan",
        "template" => "<table cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" border=\"0\" style=\"margin-bottom: 0px;\" class=\"tborder\">
    <tr><td class=\"thead\"><strong>{\$lang->sbplus_konu_okuyan}</strong></td></tr>
    <tr><td class=\"trow1\">{\$usersbrowsing}</td></tr>
</table>
<br />",
        "sid" => -1
    );
    $db->insert_query("templates", $template_9);

    $template_10 = array(
        "title" => "sbplus_konuarama",
        "template" => "<table cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" border=\"0\" style=\"margin-bottom: 0px;\" class=\"tborder\">
    <tr><td class=\"thead\"><strong>{\$lang->enter_keywords}</strong></td></tr>
    <tr><td class=\"trow2\">{\$search_thread}</td></tr>
</table>
<br />",
        "sid" => -1
    );
    $db->insert_query("templates", $template_10);

    $template_11 = array(
        "title" => "sbplus_hizlimenu",
        "template" => "<table cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" border=\"0\" style=\"margin-bottom: 0px;\" class=\"tborder\">
    <tr><td class=\"thead\"><strong>{\$lang->sbplus_forumjump}</strong></td></tr>
    <tr><td class=\"trow2\"><div class=\"forum_jump\">{\$forumjump}</div></td></tr>
</table>
<br />",
        "sid" => -1
    );
    $db->insert_query("templates", $template_11);

    $template_12 = array(
        "title" => "sbplus_benzerkonu",
        "template" => "<table border=\"0\" cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" class=\"tborder\">
<tr><td class=\"thead\"><strong>{\$lang->sbplus_benzerkonu}</strong></td></tr>
    {\$konu_benzer_bit}
</table></br>",
        "sid" => -1
    );
    $db->insert_query("templates", $template_12);

    $template_13 = array(
        "title" => "sbplus_benzerkonu_bit",
        "template" => "<tr>
<td class=\"{\$trow}\"><strong>{\$similar_thread[\'threadprefix\']}<a href=\"{\$similar_thread[\'threadlink\']}\" title=\"{\$similar_thread[\'subject\']}, {\$lang->sbplus_konugit}\">{\$similar_thread[\'subject\']}</a></strong>
<br /><span class=\"smalltext\">{\$lang->author}: {\$similar_thread[\'profilelink\']}
<br />{\$lang->forumbit_posts}: <a href=\"javascript:MyBB.whoPosted({\$similar_thread[\'tid\']});\">{\$similar_thread[\'replies\']}</a>
<br />{\$lang->sbplus_okunma} {\$similar_thread[\'views\']}
<br />{\$lastpostdate} {\$lastposttime}
<br /><a href=\"{\$similar_thread[\'lastpostlink\']}\">{\$lang->lastpost}</a>: {\$lastposterlink}</span>
</td>
</tr>",
        "sid" => -1
    );
    $db->insert_query("templates", $template_13);

    $template_14 = array(
        "title" => "sbplus_benzerkonu_2",
        "template" => "<table cellspacing=\"{\$theme[\'borderwidth\']}\" cellpadding=\"{\$theme[\'tablespace\']}\" style=\"margin-bottom: 0px;\" class=\"tborder\">
    <tr><td class=\"thead\"><strong>{\$lang->sbplus_benzerkonu}</strong></td></tr>
    <td class=\"trow2\">
    <table>
        {\$konu_benzer_bit}
    </table>
    </td>
</table>
</br>",
        "sid" => -1
    );
    $db->insert_query("templates", $template_14);

    $template_15 = array(
        "title" => "sbplus_benzerkonu_bit_2",
        "template" => "<tr>
<td align=\"center\" class=\"{\$trow}\" width=\"1%\">{\$icon}</td>
<td class=\"{\$trow}\">{\$similar_thread[\'threadprefix\']}<a href=\"{\$similar_thread[\'threadlink\']}\" title=\"{\$similar_thread[\'subject\']}, {\$lang->sbplus_konugit}\"><span class=\"smalltext\">{\$similar_thread[\'subject\']}</span></a>
</td>
</tr>",
        "sid" => -1
    );
    $db->insert_query("templates", $template_15);

//yeni css ekleme
    $stylesheet = '#login_blok_menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#login_blok_menu ul img {
    margin: 0;
    padding: 0;
    vertical-align: top;
}

#login_blok_menu li a {
    padding: 3px;
    border-bottom: 1px dotted #9F8D6D;
    text-decoration: none;
}

#login_blok_menu li a:link, #login_blok_menu li a:visited {
    color: #00B1E2;
    display: block;
    background: transparent;
}

#login_blok_menu li a:hover {
    color: #fff;
    background: #00B1E2;
}

/* XS Sidebar Avatar CSS*/

.side-avatar {
background-image: url(images/sbplus/cerceve_blue.png);
width: 94px;
height: 94px;
background-position: center center;
background-repeat: no-repeat;
padding: 10px;
}

/* buttons */
.sbp_buton {
    background: url(images/sbplus/arrowright.png) no-repeat;
    width: 32px;
    height: 32px;
    display: block;
    cursor: pointer;
    margin-top: 37px;
    margin-right: -35px;
}

.sbp_tbuton {
    background: url(images/sbplus/arrowleft.png) no-repeat;
    width: 32px;
    height: 32px;
    display: block;
    cursor: pointer;
    margin-top: 37px;
    margin-right: -35px;
}

ul.thread_tools li.okunma {
    background: url(images/sbplus/ikon/okunma_icon.png) no-repeat 0px 0px;
}

ul.thread_tools li.yazar {
    background: url(images/sbplus/ikon/yazar_icon.png) no-repeat 0px 0px;
}

ul.thread_tools li.yorum {
    background: url(images/sbplus/ikon/yorum_icon.png) no-repeat 0px 0px;
}

.paylas {
    background: url(images/sbplus/ikon/paylas_icon.gif) no-repeat 0px 0px;
    width: 12px;
    height: 12px;
    font-size: 11px;
    line-height: 12px;
    padding-left: 18px;
}

';

    $new_stylesheet = array(
        'name'         => 'side_boxes_plus.css',
        'tid'          => 1,
        'attachedto'   => '',
        'stylesheet'   => $stylesheet,
        'lastmodified' => TIME_NOW
    );

    $sid = $db->insert_query('themestylesheets', $new_stylesheet);
    $db->update_query('themestylesheets', array('cachefile' => "css.php?stylesheet={$sid}"), "sid='{$sid}'", 1);

    $query = $db->simple_select('themes', 'tid');
    while($theme = $db->fetch_array($query))
    {
        require_once MYBB_ADMIN_DIR.'inc/functions_themes.php';
        update_theme_stylesheet_list($theme['tid']);
    }

    require MYBB_ROOT.'/inc/adminfunctions_templates.php';
    find_replace_templatesets("headerinclude", '#'.preg_quote('{$stylesheets}').'#', '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="{$mybb->settings[\'bburl\']}/jscripts/jquery.cookie.js"></script>
<script type="text/javascript" src="{$mybb->settings[\'bburl\']}/jscripts/sidebar.js"></script>
{$stylesheets}');
    find_replace_templatesets("index", '#'.preg_quote('{$forums}').'#', '<a class="sbp_buton" style="float: right;" title="{$lang->sbplus_sidebarkapat}"></a>
<a class="sbp_tbuton" style="float: right;" title="{$lang->sbplus_sidebarac}"></a>
<div class="sbp_sbar" style="float: right;width: 25%;">
    {$sb_welcome}{$sb_search}{$sb_whosonline}{$sb_stats}{$sb_latestthreads}{$sb​_additional}
</div>
<div class="sbp_forum" style="float: left;width: 74%;">
{$forums}
</div>');
    find_replace_templatesets("showthread", '#'.preg_quote('{$pollbox}').'#', '{$konu_sidebar_1}{$konu_bilgileri}{$konu_okuyanlar}{$konu_iciarama}{$konu_khizl​imenu}{$konu_benzerkonu}{$konu_ekkutu}{$konu_sidebar_2}{$pollbox}');
    find_replace_templatesets("showthread", '#'.preg_quote('{$quickreply}').'#', '{$konu_sidebar_3}{$quickreply}');

}

function sideboxes_deactivate()
{
    global $db;

    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='sb_welcome'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='sb_stats'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='sb_additional'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='sb_search'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='sb_latest'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='sb_latest_num'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='sb_whos_online'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='sideboxes'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='konu_ackapa'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='konu_bilgi'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='konu_okuyan'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='konu_arama'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='konu_hizlimenu'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='konu_benzer'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='konu_benzer_tip'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='konu_ek'");
    $db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='sideboxes_2'");
    rebuild_settings();
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_welcome'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_welcome_membertext'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_welcome_guesttext'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_search'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_stats'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_latestthreads'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_latestthreads_thread'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_konubilgileri'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_konuyuokuyan'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_konuarama'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_hizlimenu'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_benzerkonu'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_benzerkonu_bit'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_benzerkonu_2'");
    $db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title='sbplus_benzerkonu_bit_2'");

    //css silme
    $db->delete_query('themestylesheets', "name='side_boxes_plus.css'");

    $query = $db->simple_select('themes', 'tid');
    while($theme = $db->fetch_array($query))
    {
        require_once MYBB_ADMIN_DIR.'inc/functions_themes.php';
        update_theme_stylesheet_list($theme['tid']);
    }

    require MYBB_ROOT.'/inc/adminfunctions_templates.php';
    find_replace_templatesets("headerinclude", '#'.preg_quote('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="{$mybb->settings[\'bburl\']}/jscripts/jquery.cookie.js"></script>
<script type="text/javascript" src="{$mybb->settings[\'bburl\']}/jscripts/sidebar.js"></script>
{$stylesheets}').'#', '{$stylesheets}');
    find_replace_templatesets("index", '#'.preg_quote('<a class="sbp_buton" style="float: right;" title="{$lang->sbplus_sidebarkapat}"></a>
<a class="sbp_tbuton" style="float: right;" title="{$lang->sbplus_sidebarac}"></a>
<div class="sbp_sbar" style="float: right;width: 25%;">
    {$sb_welcome}{$sb_search}{$sb_whosonline}{$sb_stats}{$sb_latestthreads}{$sb​_additional}
</div>
<div class="sbp_forum" style="float: left;width: 74%;">
{$forums}
</div>').'#', '{$forums}',0);
    find_replace_templatesets("showthread", '#'.preg_quote('{$konu_sidebar_1}{$konu_bilgileri}{$konu_okuyanlar}{$konu_iciara​ma}{$konu_khizlimenu}{$konu_benzerkonu}{$konu_ekkutu}{$konu_sidebar_2}{$pollbox}​').'#', '{$pollbox}');
    find_replace_templatesets("showthread", '#'.preg_quote('{$konu_sidebar_3}{$quickreply}').'#', '{$quickreply}');

}

function sideboxes_start()
{
    global $db, $mybb, $settings, $templates, $lang, $cache;
    global $sb_search, $sb_welcome, $sb_stats, $sb_latestthreads, $sb_additional, $pms, $sb_welcometext, $sb_whosonline;
    global $gobutton, $theme, $lastvisit;

    $lang->load("portal");

    if($mybb->settings['sb_welcome'] == 1)
    {
        if($mybb->user['uid'] != 0)
        {
            if($mybb->user['receivepms'] != "no" && $mybb->usergroup['canusepms'] != "no" && $mybb->settings['portal_showpms'] != "no" && $mybb->settings['enablepms'] != "no")
            {
                $query = $db->simple_select("privatemessages", "COUNT(*) AS pms_total, SUM(IF(dateline>'".$mybb->user['lastvisit']."' AND folder='1','1','0')) AS pms_new, SUM(IF(status='0' AND folder='1','1','0')) AS pms_unread", "uid='".$mybb->user['uid']."'");
                $messages = $db->fetch_array($query);
                if(!$messages['pms_new'])
                {
                    $messages['pms_new'] = 0;
                }
                // the SUM() thing returns "" instead of 0
                if($messages['pms_unread'] == "")
                {
                    $messages['pms_unread'] = 0;
                }
                $lang->pms_received_new = $lang->sprintf($lang->pms_received_new, $mybb->user['username'], $messages['pms_new']);
                eval("\$pms = \"".$templates->get("portal_pms")."\";");
            }    
    
            //get number of new posts, threads, announcements
            $query = $db->simple_select("posts", "COUNT(pid) AS newposts", "dateline>'".$mybb->user['lastvisit']."' $unviewwhere");
            $newposts = $db->fetch_field($query, "newposts");
            if($newposts)
            { // if there aren't any new posts, there is no point in wasting two more queries
                $query = $db->simple_select("threads", "COUNT(tid) AS newthreads", "dateline>'".$mybb->user['lastvisit']."' $unviewwhere");
                $newthreads = $db->fetch_field($query, "newthreads");
                $query = $db->simple_select("threads", "COUNT(tid) AS newann", "dateline>'".$mybb->user['lastvisit']."' AND fid IN (".$mybb->settings['portal_announcementsfid'].") $unviewwhere");
                $newann = $db->fetch_field($query, "newann");
                if(!$newthreads)
                {
                    $newthreads = 0;
                }
                if(!$newann)
                {
                    $newann = 0;
                }
            }
            else
            {
                $newposts = 0;
                $newthreads = 0;
                $newann = 0;
            }
    
            // Make the text
            if($newann == 1)
            {
                $lang->new_announcements = $lang->new_announcement;
            }
            else
            {
                $lang->new_announcements = $lang->sprintf($lang->new_announcements, $newann);
            }
            if($newthreads == 1)
            {
                $lang->new_threads = $lang->new_thread;
            }
            else
            {
                $lang->new_threads = $lang->sprintf($lang->new_threads, $newthreads);
            }
            if($newposts == 1)
            {
                $lang->new_posts = $lang->new_post;
            }
            else
            {
                $lang->new_posts = $lang->sprintf($lang->new_posts, $newposts);
            }
            
            if(isset($mybb->user['lastvisit'])) {
                $lastvisit = my_date($mybb->settings['dateformat'], $mybb->user['lastvisit']) . ', ' . my_date($mybb->settings['timeformat'], $mybb->user['lastvisit']);
            }
            else
            {
                $lastvisit = "Never";
            }
            eval("\$sb_welcometext = \"".$templates->get("sbplus_welcome_membertext")."\";");
        }
        else
        {
            $lang->guest_welcome_registration = $lang->sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register');
            $mybb->user['username'] = $lang->guest;
            $portal_url = get_current_location();
            eval("\$sb_welcometext = \"".$templates->get("sbplus_welcome_guesttext")."\";");
        }
        $lang->welcome = $lang->sprintf($lang->welcome, $mybb->user['username']);
        
        eval("\$sb_welcome = \"".$templates->get("sbplus_welcome")."\";");
        if($mybb->user['uid'] == 0)
        {
            $mybb->user['username'] = "";
        }
    }

    //Start statistics
    if($mybb->settings['sb_stats'] == 1)
    {
        $stats = $cache->read("stats");
        $threadsnum = $stats['numthreads'];
        $postsnum = $stats['numposts'];
        $membersnum = $stats['numusers'];
        if(!$stats['lastusername'])
        {
            $newestmember = "<b>" . $lang->no_one . "</b>";
        }
        else
        {
            $newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);
        }
        eval("\$sb_stats = \"".$templates->get("sbplus_stats")."\";");
    }

global $total_posts, $total_threads, $total_users, $total_posts_today, $total_posts_lasthour;
    global $newestmember, $total_online, $users_count, $guest_count, $today_online;
    
//Start who is online
$timesearch = time() - $mybb->settings['wolcutoffmins']*60;
$query = $db->query("SELECT uid FROM ".TABLE_PREFIX."sessions WHERE time>'$timesearch' ORDER BY time DESC");
$users_count = 0;
$guest_count = 0;
while($on_line = $db->fetch_array($query))
{
    if($on_line['uid'] == 0)
    {
        $guest_count++;
    }
    else
    {
        $users_count++;
    }    
}
    $total_online = $users_count + $guest_count;
    $oneday_timesearch = time() - (60*60*24);
    $query = $db->query("SELECT sid FROM ".TABLE_PREFIX."sessions WHERE time>'$oneday_timesearch'");
    $today_online = $db->num_rows($query);
    //Forum stats
    $stats = $cache->read("stats");


    if(!$stats['lastusername'])
    {
        $newestmember = "no-one";
    }
    else
    {
        $newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);
    }
    
    
    $total_posts = my_number_format($stats['numposts']);
    $total_threads = my_number_format($stats['numthreads']);
    $total_users =  my_number_format($stats['numusers']);
    
    //Posts today
    $total_posts_today = $db->num_rows($db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE dateline>'$oneday_timesearch'"));
    $onehour_timesearch = time() - (60*60);
    $total_posts_lasthour = $db->num_rows($db->query("SELECT * FROM ".TABLE_PREFIX."posts WHERE dateline>'$onehour_timesearch'"));
    
    
    //Search Box
    if($mybb->settings['sb_search'] == 1)
    {
        eval("\$sb_search = \"".$templates->get("sbplus_search")."\";");
    }

    //Get latest threads
    if($mybb->settings['sb_latest'] == 1)
    {
        $altbg = alt_trow();
        $sbp_threadlist = '';
        $query = $db->query("
            SELECT t.*, u.username
            FROM ".TABLE_PREFIX."threads t
            LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
            WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
            ORDER BY t.lastpost DESC
            LIMIT 0, ".$mybb->settings['sb_latest_num']
        );
        while($thread = $db->fetch_array($query))
        {
            $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
            $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
            // Don't link to guest's profiles (they have no profile).
            if($thread['lastposteruid'] == 0)
            {
                $lastposterlink = $thread['lastposter'];
            }
            else
            {
                $lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
            }
            if(my_strlen($thread['subject']) > 25)
            {
                $thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
            }
            $thread['subject'] = htmlspecialchars_uni($thread['subject']);
            $thread['threadlink'] = get_thread_link($thread['tid']);
            $thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
            eval("\$sbp_threadlist .= \"".$templates->get("sbplus_latestthreads_thread")."\";");
            $altbg = alt_trow();
        }
        if($sbp_threadlist)
        { // show the table only if there are threads
            eval("\$sb_latestthreads = \"".$templates->get("sbplus_latestthreads")."\";");
        }
    }

    // Get the online users
    if($mybb->settings['sb_whos_online'] == 1)
    {    
    $timesearch = TIME_NOW - $mybb->settings['wolcutoff'];
    $comma = '';
    $guestcount = 0;
    $membercount = 0;
    $onlinemembers = '';
    $query = $db->query("
        SELECT s.sid, s.ip, s.uid, s.time, s.location, u.username, u.invisible, u.usergroup, u.displaygroup
        FROM ".TABLE_PREFIX."sessions s
        LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
        WHERE s.time>'$timesearch'
        ORDER BY u.username ASC, s.time DESC
    ");
    while($user = $db->fetch_array($query))
    {
    
        // Create a key to test if this user is a search bot.
        $botkey = my_strtolower(str_replace("bot=", '', $user['sid']));
        
        if($user['uid'] == "0")
        {
            ++$guestcount;
        }
        elseif(my_strpos($user['sid'], "bot=") !== false && $session->bots[$botkey])
        {
            // The user is a search bot.
            $onlinemembers .= $comma.format_name($session->bots[$botkey], $session->botgroup);
            $comma = $lang->comma;
            ++$botcount;
        }
        else
        {
            if($doneusers[$user['uid']] < $user['time'] || !$doneusers[$user['uid']])
            {
                ++$membercount;
                
                $doneusers[$user['uid']] = $user['time'];
                
                // If the user is logged in anonymously, update the count for that.
                if($user['invisible'] == 1)
                {
                    ++$anoncount;
                }
                
                if($user['invisible'] == 1)
                {
                    $invisiblemark = "*";
                }
                else
                {
                    $invisiblemark = '';
                }
                
                if(($user['invisible'] == 1 && ($mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])) || $user['invisible'] != 1)
                {
                    $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
                    $user['profilelink'] = get_profile_link($user['uid']);
                    eval("\$onlinemembers .= \"".$templates->get("portal_whosonline_memberbit", 1, 0)."\";");
                    $comma = $lang->comma;
                }
            }
        }
    }
    
    $onlinecount = $membercount + $guestcount + $botcount;
    
    // If we can see invisible users add them to the count
    if($mybb->usergroup['canviewwolinvis'] == 1)
    {
        $onlinecount += $anoncount;
    }
    
    // If we can't see invisible users but the user is an invisible user incriment the count by one
    if($mybb->usergroup['canviewwolinvis'] != 1 && $mybb->user['invisible'] == 1)
    {
        ++$onlinecount;
    }

    // Most users online
    $mostonline = $cache->read("mostonline");
    if($onlinecount > $mostonline['numusers'])
    {
        $time = TIME_NOW;
        $mostonline['numusers'] = $onlinecount;
        $mostonline['time'] = $time;
        $cache->update("mostonline", $mostonline);
    }
    $recordcount = $mostonline['numusers'];
    $recorddate = my_date($mybb->settings['dateformat'], $mostonline['time']);
    $recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);

    if($onlinecount == 1)
    {
      $lang->online_users = $lang->online_user;
    }
    else
    {
      $lang->online_users = $lang->sprintf($lang->online_users, $onlinecount);
    }
    $lang->online_counts = $lang->sprintf($lang->online_counts, $membercount, $guestcount);
            eval("\$sb_whosonline = \"".$templates->get("portal_whosonline")."\";");
    }

    //Workout additional cutom boxes
    eval("\$sb_additional = \"".$db->escape_string($mybb->settings['sb_additional'])."\";");

    if($mybb->input['action'] == "do_login" && $mybb->request_method == "post")
    {
        require_once MYBB_ROOT."inc/functions_user.php";

        // Checks to make sure the user can login; they haven't had too many tries at logging in.
        // Is a fatal call if user has had too many tries
        $logins = login_attempt_check();
        $login_text = '';
    
        if(!username_exists($mybb->input['username']))
        {
            error($lang->error_invalidpworusername.$login_text);
        }
        $user = validate_password_from_username($mybb->input['username'], $mybb->input['password']);
        if(!$user['uid'])
        {
            my_setcookie('loginattempts', $logins + 1);
            $db->write_query("UPDATE ".TABLE_PREFIX."users SET loginattempts=loginattempts+1 WHERE username = '".$db->escape_string($mybb->input['username'])."'");
            if($mybb->settings['failedlogintext'] == 1)
            {
                $login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
            }
            error($lang->error_invalidpassword.$login_text);
        }
    
        my_setcookie('loginattempts', 1);
        $db->delete_query("sessions", "ip='".$db->escape_string($session->ipaddress)."' AND sid != '".$session->sid."'");
        $newsession = array(
            "uid" => $user['uid'],
        );
        $db->update_query("sessions", $newsession, "sid='".$session->sid."'");
        
        $db->update_query("users", array("loginattempts" => 1), "uid='{$mybb->user['uid']}'");
    
        // Temporarily set the cookie remember option for the login cookies
        $mybb->user['remember'] = $user['remember'];
    
        my_setcookie("mybbuser", $user['uid']."_".$user['loginkey'], null, true);
        my_setcookie("sid", $session->sid, -1, true);
    
        if(function_exists("loggedIn"))
        {
            loggedIn($user['uid']);
        }
    
        redirect("index.php", $lang->redirect_loggedin);
    }
}

//Konu gosterimde side bar
function sideboxes_konu_func()
{
    global $db, $mybb, $settings, $templates, $theme, $lang, $cache;
    global $konu_sidebar_1, $konu_sidebar_2, $konu_sidebar_3, $konu_ekkutu, $konu_bilgileri, $konu_okuyanlar, $konu_iciarama, $konu_khizlimenu, $konu_benzerkonu;
    
    if($mybb->settings['konu_ackapa'] == 1)
    {
        $parser = new postParser;
        $konu_sidebar_1='<a class="sbp_buton" style="float: right;" title="'. $lang->sbplus_sidebarkapat .'"></a>
<a class="sbp_tbuton" style="float: right;" title="'. $lang->sbplus_sidebarac .'"></a>
<div class="sbp_sbar" style="float: right;width: 25%;">';
    
        $konu_sidebar_2='</div>
    <div class="sbp_forum" style="float: left;width: 74%;">';
    
        $konu_sidebar_3='</div>';
    
        $konu_ekkutu=''. $mybb->settings['konu_ek'] .'';

    //Konu gosterim sidebar konu bilgileri
    if($mybb->settings['konu_bilgi'] == 1)
    {
    // Get the thread details from the database.
        $thread = get_thread($mybb->input['tid']);
        $tid = $thread['tid'];
    // Konu Kalitesi Start.
        $kalite=$thread[replies];
        if ($kalite>20)
        {
            $kalite=100;
        }
    // Konu kalitesi End.
    // Subscription status
        $add_remove_subscription = 'add';
        $add_remove_subscription_text = $lang->subscribe_thread;

        if($mybb->user['uid'])
        {
            $query = $db->simple_select("threadsubscriptions", "tid", "tid='".intval($tid)."' AND uid='".intval($mybb->user['uid'])."'", array('limit' => 1));

            if($db->fetch_field($query, 'tid'))
            {
                $add_remove_subscription = 'remove';
                $add_remove_subscription_text = $lang->unsubscribe_thread;
            }
        }
        
        eval("\$konu_bilgileri = \"".$templates->get("sbplus_konubilgileri")."\";");
    }
    
    //Konu gosterim sidebar konuyu okuyanlar
    if($mybb->settings['konu_okuyan'] == 1)
    {
        // Get users viewing this thread
        $timecut = TIME_NOW - $mybb->settings['wolcutoff'];

        $comma = '';
        $guestcount = 0;
        $membercount = 0;
        $inviscount = 0;
        $onlinemembers = '';
        $doneusers = array();

        $query = $db->query("
            SELECT s.ip, s.uid, s.time, u.username, u.invisible, u.usergroup, u.displaygroup
            FROM ".TABLE_PREFIX."sessions s
            LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid=u.uid)
            WHERE s.time > '$timecut' AND location2='$tid' AND nopermission != 1
            ORDER BY u.username ASC, s.time DESC
        ");

        while($user = $db->fetch_array($query))
        {
            if($user['uid'] == 0)
            {
                ++$guestcount;
            }
            else if($doneusers[$user['uid']] < $user['time'] || !$doneusers[$user['uid']])
            {
                ++$membercount;
                $doneusers[$user['uid']] = $user['time'];

                $invisiblemark = '';
                if($user['invisible'] == 1)
                {
                    $invisiblemark = "*";
                    ++$inviscount;
                }

                if($user['invisible'] != 1 || $mybb->usergroup['canviewwolinvis'] == 1 || $user['uid'] == $mybb->user['uid'])
                {
                    $user['profilelink'] = get_profile_link($user['uid']);
                    $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
                    $user['reading'] = my_date($mybb->settings['timeformat'], $user['time']);

                    eval("\$onlinemembers .= \"".$templates->get("showthread_usersbrowsing_user", 1, 0)."\";");
                    $comma = $lang->comma;
                }
            }
        }

        if($guestcount)
        {
            $guestsonline = $lang->sprintf($lang->users_browsing_thread_guests, $guestcount);
        }

        if($guestcount && $onlinemembers)
        {
            $onlinesep = $lang->comma;
        }

        $invisonline = '';
        if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1 && ($inviscount != 1 && $mybb->user['invisible'] != 1))
        {
            $invisonline = $lang->sprintf($lang->users_browsing_thread_invis, $inviscount);
        }

        if($invisonline != '' && $guestcount)
        {
            $onlinesep2 = $lang->comma;
        }

        eval("\$usersbrowsing = \"".$templates->get("showthread_usersbrowsing")."\";");
    
        eval("\$konu_okuyanlar = \"".$templates->get("sbplus_konuyuokuyan")."\";");
    }

    //Konu gosterim sidebar konu ici arama
    if($mybb->settings['konu_arama'] == 1)
    {
        eval("\$search_thread = \"".$templates->get("showthread_search")."\";");
        eval("\$konu_iciarama = \"".$templates->get("sbplus_konuarama")."\";");
    }

    //Konu gosterim sidebar hizli menu
    if($mybb->settings['konu_hizlimenu'] == 1)
    {
        $forumjump = build_forum_jump("", $fid, 1);
        eval("\$konu_khizlimenu = \"".$templates->get("sbplus_hizlimenu")."\";");
    }

    //Konu gosterim sidebar benzer konu
    if($mybb->settings['konu_benzer'] == 1)
    {
        switch($db->type)
        {
            case "pgsql":
                $query = $db->query("
                    SELECT t.*, t.username AS threadusername, u.username
                    FROM ".TABLE_PREFIX."threads t
                    LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid), plainto_tsquery ('".$db->escape_string($thread['subject'])."') AS query
                    WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.subject @@ query AND ts_rank_cd(to_tsvector('english',t.subject), query ) >= '{$mybb->settings['similarityrating']}'
                    ORDER BY t.lastpost DESC
                    OFFSET 0 LIMIT {$mybb->settings['similarlimit']}
                ");
                break;
            default:
                $query = $db->query("
                    SELECT t.*, t.username AS threadusername, u.username, MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') AS relevance
                    FROM ".TABLE_PREFIX."threads t
                    LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
                    WHERE t.fid='{$thread['fid']}' AND t.tid!='{$thread['tid']}' AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND MATCH (t.subject) AGAINST ('".$db->escape_string($thread['subject'])."') >= '{$mybb->settings['similarityrating']}'
                    ORDER BY t.lastpost DESC
                    LIMIT 0, {$mybb->settings['similarlimit']}
                ");
        }

        $count = 0;
        $konu_benzer_bit = '';
        $icon_cache = $cache->read("posticons");
        while($similar_thread = $db->fetch_array($query))
        {
            ++$count;
            $trow = alt_trow();
            if($similar_thread['icon'] > 0 && $icon_cache[$similar_thread['icon']])
            {
                $icon = $icon_cache[$similar_thread['icon']];
                $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
            }
            else
            {
                $icon = "&nbsp;";
            }                
            if(!$similar_thread['username'])
            {
                $similar_thread['username'] = $similar_thread['threadusername'];
                $similar_thread['profilelink'] = $similar_thread['threadusername'];
            }
            else
            {
                $similar_thread['profilelink'] = build_profile_link($similar_thread['username'], $similar_thread['uid']);
            }
            
            // If this thread has a prefix, insert a space between prefix and subject
            if($similar_thread['prefix'] != 0)
            {
                $prefix = build_prefixes($similar_thread['prefix']);
                $similar_thread['threadprefix'] = $prefix['displaystyle'].'&nbsp;';
            }
            
            $similar_thread['subject'] = $parser->parse_badwords($similar_thread['subject']);
            $similar_thread['subject'] = htmlspecialchars_uni($similar_thread['subject']);
            $similar_thread['threadlink'] = get_thread_link($similar_thread['tid']);
            $similar_thread['lastpostlink'] = get_thread_link($similar_thread['tid'], 0, "lastpost");

            $lastpostdate = my_date($mybb->settings['dateformat'], $similar_thread['lastpost']);
            $lastposttime = my_date($mybb->settings['timeformat'], $similar_thread['lastpost']);
            $lastposter = $similar_thread['lastposter'];
            $lastposteruid = $similar_thread['lastposteruid'];

            // Don't link to guest's profiles (they have no profile).
            if($lastposteruid == 0)
            {
                $lastposterlink = $lastposter;
            }
            else
            {
                $lastposterlink = build_profile_link($lastposter, $lastposteruid);
            }
            $similar_thread['replies'] = my_number_format($similar_thread['replies']);
            $similar_thread['views'] = my_number_format($similar_thread['views']);
            if($mybb->settings['konu_benzer_tip'] == 10)
            {
                eval("\$konu_benzer_bit .= \"".$templates->get("sbplus_benzerkonu_bit")."\";");
            }
            if($mybb->settings['konu_benzer_tip'] == 20)
            {
                eval("\$konu_benzer_bit .= \"".$templates->get("sbplus_benzerkonu_bit_2")."\";");
            }
        }
        if($count)
        {
            if($mybb->settings['konu_benzer_tip'] == 10)
            {
                eval("\$konu_benzerkonu = \"".$templates->get("sbplus_benzerkonu")."\";");
            }
            if($mybb->settings['konu_benzer_tip'] == 20)
            {
                eval("\$konu_benzerkonu = \"".$templates->get("sbplus_benzerkonu_2")."\";");
            }
        }
    }

    }

}

//Function to rebuilt all settings
if(!function_exists("rebuild_settings"))
{
    function rebuild_settings()
{
    global $db, $mybb;

    if(!file_exists(MYBB_ROOT."inc/settings.php"))
    {
        $mode = "x";
    }
    else
    {
        $mode = "w";
    }
    $options = array(
        "order_by" => "title",
        "order_dir" => "ASC"
    );
    $query = $db->simple_select("settings", "value, name", "", $options);

    while($setting = $db->fetch_array($query))
    {
        $setting['value'] = str_replace("\"", "\\\"", $setting['value']);
        $settings .= "\$settings['".$setting['name']."'] = \"".$setting['value']."\";\n";
        $mybb->settings[$setting['name']] = $setting['value'];
    }
    $settings = "<"."?php\n/*********************************\ \n  DO NOT EDIT THIS FILE, PLEASE USE\n  THE SETTINGS EDITOR\n\*********************************/\n\n$settings\n?".">";
    $file = @fopen(MYBB_ROOT."inc/settings.php", $mode);
    @fwrite($file, $settings);
    @fclose($file);
    $GLOBALS['settings'] = &$mybb->settings;
    }

}

function sideboxes_loadlang(){
    global $lang, $mybb;
    
    $lang->load("sideboxes");    
    $lang->sbplus_cikis_t = $lang->sprintf($lang->sbplus_cikis_t, $mybb->user['username']);
    $lang->sbplus_avatar = $lang->sprintf($lang->sbplus_avatar, $mybb->user['username']);
}
?>

J'espère que mon retour soit clair (si ça ne l'est pas désolé), et en aidera plus d'un, et qu'il est complet, ceci grâce a spyto que je remercie encore beaucoup pour son aide précieuse, qui m'a aider à comprendre mieux et résoudre les problèmes, car sans lui j'y serai encore Smile

Cordialement,
Pichorka !




Répondre


Messages dans ce sujet
RE: Erreur suite vérification avec le site : validator.w3.org - Pichorka - 25-03-2013, 13:45



Utilisateur(s) parcourant ce sujet :

Contact | MyBB.support | Retourner en haut | Retourner au contenu | Version bas-débit (Archivé) | Syndication RSS
 Utilitaire de traduction fourni par Regentronique