Webboard

Pełna wersja: Tabela ogłoszeń za wysoko, za nisko
Aktualnie przeglądasz uproszczoną wersję forum. Kliknij tutaj, by zobaczyć wersję z pełnym formatowaniem.
Cześć, mam problem z pluginem ogłoszeń, otóż chciałbym aby był nad górną belką, a jak go tam wrzuce to wyrzuca się na samą góre aż za logo, jak dam poniżej header to wrzuca się pod tą belke, mój kod
Kod PHP:
<html>
<
head>
<
link rel="shortcut icon" type="image/x-icon" href="images/flatty/favicon.ico">
<
title>{$mybb->settings['bbname']}</title>
{
$headerinclude}

<
script type="text/javascript">
<!--
 
   lang.no_new_posts "{$lang->no_new_posts}";
 
   lang.click_mark_read "{$lang->click_mark_read}";
// -->


</script>
</
head>
<
body>

{
$header}
    {
$fic_news}
<
script>
 
   var sticked = $('#getsticky').val().split(",");
 
   $.each(sticked,function(i){
 
       $('td#'+sticked[i]).addClass('fic_sticky');
 
   });
</
script>

<
div id="facebook_slider_widget">
<
script src="http://webfrik.pl/widget/facebook_slider.html?fb_url=https://web.facebook.com/motoodcina/?fref=ts&fb_width=290&fb_height=390&fb_faces=true&fb_stream=true&fb_header=true&fb_border=true&fb_theme=undefined&chx=787&speed=FAST&fb_pic=logo&position=RIGHT"></script>
</
div>

<
div class="forums" style="float: left; width: 76%;">{$dvz_shoutbox}<br />{$forums}</div>

    
<
div class="sidebar" style="float: right; width: 22%;">
<
table border="0" cellspacing="{$theme['borderwidth']}cellpadding="{$theme['tablespace']}class="tborder">
    <
tr>
        <
td class="thead_2">
            <
strong>PARTNERZY</strong>
            <
div class="float_right" style="padding-top: 3px;"><class="fa fa-newspaper-o"></i></div>
        </
td>
    </
tr>
    <
tr>
        <
td class="trow1">
            <
span class="smalltext">
                <
center><a href="http://moto-odcina.pl/"><img src="images/flatty/zareklamujsietutaj1.png"></a><br />
                        <
a href="https://web.facebook.com/groups/289518898055052/?fref=ts"><img src="images/flatty/zareklamujsietutaj2.png"></a><br />
        <
a href=""><img src="images/flatty/zareklamujsietutaj3.png"></a><br /></center>

            </
span>
        </
td>
    </
tr>
</
table>

    <
br />
    
<
table border="0" cellspacing="{$theme['borderwidth']}cellpadding="{$theme['tablespace']}class="tborder">
    <
tr>
        <
td class="thead_2">
            <
strong>Kto jest online</strong>
            <
div class="float_right" style="padding-top: 3px;"><class="fa fa-child"></i></div>
        </
td>
    </
tr>
    <
tr>
        <
td class="trow1">
            {
$whosonline}
        </
td>
    </
tr>
</
table>
    
    <
br />
    
<
table border="0" cellspacing="{$theme['borderwidth']}cellpadding="{$theme['tablespace']}class="tborder">
    <
tr>
        <
td class="thead_2">
            <
strong>Statystyki</strong>
            <
div class="float_right" style="padding-top: 3px;"><class="fa fa-line-chart"></i></div>
        </
td>
    </
tr>
    <
tr>
        <
td class="trow1">
            {
$forumstats}
        </
td>
    </
tr>
</
table>
    
</
div>
<
br class="clear" />


{
$footer}
</
body>
</
html

ten kod mam wrzucić, aktualnie jest pod header i jak wejdziecie na www.mammoto.pl możecie zauważyć, że jest pod belką MAM MOTO co wygląda troche dziwnie, da się coś z tym zrobić? 
tutaj kod który mam wrzucić

Kod PHP:
{$fic_news}
<
script>
 
   var sticked = $('#getsticky').val().split(",");
 
   $.each(sticked,function(i){
 
       $('td#'+sticked[i]).addClass('fic_sticky');
 
   });
</
script
Przenieś ogłoszenie do innego szablonu, np. nagłówek - header gdzie będziesz miał możliwość wstawienia w inne miejsce.
(26.09.2016, 18:46)Szogi1910 napisał(a): [ -> ]Przenieś ogłoszenie do innego szablonu, np. nagłówek - header gdzie będziesz miał możliwość wstawienia w inne miejsce.

z header próbowałem i nie chce mi tam działać
Tak jak sądziłem, możesz jedynie próbować zmienić położenie loga w szablonie header
Pokaż jeszcze kod tego pluginu
(26.09.2016, 18:53)Szogi1910 napisał(a): [ -> ]Tak jak sądziłem, możesz jedynie próbować zmienić położenie loga w szablonie header
Pokaż jeszcze kod tego pluginu

Kod PHP:
<?php 
if(!defined('IN_MYBB'))
{
 
   die('Direct initialization of this file is not allowed.');
}
$plugins->add_hook('index_start''fic_news');
$plugins->add_hook('index_end''fic_news'); 

function 
fic_news_info()
{
 
   return [
 
       'name'          => 'ficus annoucements',
 
       'description'   => 'Displays latest threads from selected forum as an annoucements table.',
 
       'website'       => 'http://maciejfikus.pl/',
 
       'author'        => 'ficus',
 
       'authorsite'    => 'http://maciejfikus.pl/',
 
       'version'       => '1.0',
 
       'guid'          => '',
 
       'codename'      => '',
 
       'compatibility' => '18*'
 
   ];
}

function 
fic_news_activate()
{
    global 
$db;
 
   $max_disporder $db->fetch_field($db->simple_select("settinggroups""MAX(disporder) AS max_disporder"), "max_disporder");
 
   
    $settinggroups 
= array(
 
       "gid"                => "NULL",
 
       "name"                => "ficus_announcements"
 
       "title"                => $db->escape_string("ficus's Annoucements"),
 
       "description"        => $db->escape_string("Settings for ficus's Annoucements plugin"),
 
       "disporder"            => $max_disporder 1,
 
       "isdefault"            => "0",
 
   );
 
   $gid $db->insert_query("settinggroups"$settinggroups);
    
$settings = array();
    
$settings[] = array(
 
       "sid"                => "NULL",
 
       "name"                => "ficus_announcements_onoff",
 
       "title"                => $db->escape_string("Turn on/off"),
 
       "description"        => $db->escape_string("Decide whether plugin should be activated or not"),
 
       "optionscode"        => "onoff",
 
       "value"                => "0",
 
       "disporder"            => "4",
 
       "gid"                => $gid,
 
       "isdefault"            => "0",
 
   );
 
   $settings[] = array(
 
       "sid"                => "NULL",
 
       "name"                => "ficus_announcements_fid",
 
       "title"                => $db->escape_string("Annoucements forum"),
 
       "description"        => $db->escape_string("Choose forum which will be used as an annoucements area"),
 
       "optionscode"        => "forumselectsingle",
 
       "value"                => "0",
 
       "disporder"            => "1",
 
       "gid"                => $gid,
 
       "isdefault"            => "0",
 
   );
    
$settings[] = array(
 
       "sid"                => "NULL",
 
       "name"                => "ficus_announcements_tid",
 
       "title"                => $db->escape_string("Sticked annoucements"),
 
       "description"        => $db->escape_string("Write down TID of threads which are supposed to be sticked"),
 
       "optionscode"        => "text",
 
       "value"                => "0",
 
       "disporder"            => "2",
 
       "gid"                => $gid,
 
       "isdefault"            => "0",
 
   );
    
$settings[] = array(
 
       "sid"                => "NULL",
 
       "name"                => "ficus_announcements_limit",
 
       "title"                => $db->escape_string("How many?"),
 
       "description"        => $db->escape_string("Decide how many annoucements should be displayed"),
 
       "optionscode"        => "numeric",
 
       "value"                => "0",
 
       "disporder"            => "3",
 
       "gid"                => $gid,
 
       "isdefault"            => "0",
 
   );
 
   $db->insert_query_multiple("settings"$settings);
 
   rebuild_settings(); 
 
  
    $templates 
= array();
    
$templates[] = array(
        
"tid"                     => "NULL",
        
"title"                 => "fic_news",
        
"template"                 => $db->escape_string('
        <input id="getsticky" type="hidden" name="action" value="{$sticky}" />
        <table class="tborder">
            <tr>
                <td class="thead" colspan="2">Ogłoszenia sprzedaży</td>
            </tr>
            {$fic_news_row}
        </table>
        <br />
        '
),
        
"sid"                     => "-1",
        
"version"                 => "2.5",
        
"status"                 => "",
        
"dateline"                 => time(),
    );
    
$templates[] = array(
        
"tid"                     => "NULL",
        
"title"                 => "fic_news_row",
        
"template"                 => $db->escape_string('
        <tr>
            <td id="{$subject_tid}" class="trow1">
                <a href="{$subject_link}" class="fic_subject_link">{$subject_name}</a>
                <span class="smalltext fic_date">{$subject_date}</span>
            </td>
        </tr>
        '
),
        
"sid"                     => "-1",
        
"version"                 => "2.5",
        
"status"                 => "",
        
"dateline"                 => time(),
    );
    
$db->insert_query_multiple("templates"$templates);    
}

function 
fic_news_deactivate()
{
    global 
$db$cache;
    
$db->delete_query("settinggroups""name = \"ficus_announcements\"");
    
$db->delete_query("settings""name LIKE \"ficus_announcements%\"");
    
rebuild_settings();
    
$db->delete_query("templates""title LIKE \"fic_%\"");
}

function 
fic_news() 
{    
    global 
$db$mybb$fic_news$index$templates;
    if(
$mybb->settings['ficus_announcements_onoff']) {
        
$sticky $mybb->settings['ficus_announcements_tid'];
        
$fic_news_row '';
        
$sql "SELECT subject, dateline, fid, tid
                FROM "
.TABLE_PREFIX."threads
                WHERE 1=1 AND fid='
{$mybb->settings['ficus_announcements_fid']}
                ORDER BY FIELD(tid,
$sticky) DESC, tid DESC LIMIT {$mybb->settings['ficus_announcements_limit']};
        "
;
        
$result $db->query($sql);
        while (
$row $db->fetch_array($result))
            {    
                
$subject_name = (my_strlen($row['subject']) > 30) ? my_substr($row['subject'], 030) . "..." $row['subject'];
                
$subject_date my_date('relative'$row['dateline']);
                
$subject_link get_thread_link($row['tid']);
                
$subject_tid $row['tid'];
                
                eval(
"\$fic_news_row .= \"" $templates->get("fic_news_row") . "\";");
            }
        eval(
"\$fic_news = \"" $templates->get("fic_news") . "\";");
    } else {
        
$fic_news '';
    }


(26.09.2016, 18:53)Szogi1910 napisał(a): [ -> ]Tak jak sądziłem, możesz jedynie próbować zmienić położenie loga w szablonie header
Pokaż jeszcze kod tego pluginu

Kod PHP:
<?php 
if(!defined('IN_MYBB'))
{
 
   die('Direct initialization of this file is not allowed.');
}
$plugins->add_hook('index_start''fic_news');
$plugins->add_hook('index_end''fic_news'); 

function 
fic_news_info()
{
 
   return [
 
       'name'          => 'ficus annoucements',
 
       'description'   => 'Displays latest threads from selected forum as an annoucements table.',
 
       'website'       => 'http://maciejfikus.pl/',
 
       'author'        => 'ficus',
 
       'authorsite'    => 'http://maciejfikus.pl/',
 
       'version'       => '1.0',
 
       'guid'          => '',
 
       'codename'      => '',
 
       'compatibility' => '18*'
 
   ];
}

function 
fic_news_activate()
{
    global 
$db;
 
   $max_disporder $db->fetch_field($db->simple_select("settinggroups""MAX(disporder) AS max_disporder"), "max_disporder");
 
   
    $settinggroups 
= array(
 
       "gid"                => "NULL",
 
       "name"                => "ficus_announcements"
 
       "title"                => $db->escape_string("ficus's Annoucements"),
 
       "description"        => $db->escape_string("Settings for ficus's Annoucements plugin"),
 
       "disporder"            => $max_disporder 1,
 
       "isdefault"            => "0",
 
   );
 
   $gid $db->insert_query("settinggroups"$settinggroups);
    
$settings = array();
    
$settings[] = array(
 
       "sid"                => "NULL",
 
       "name"                => "ficus_announcements_onoff",
 
       "title"                => $db->escape_string("Turn on/off"),
 
       "description"        => $db->escape_string("Decide whether plugin should be activated or not"),
 
       "optionscode"        => "onoff",
 
       "value"                => "0",
 
       "disporder"            => "4",
 
       "gid"                => $gid,
 
       "isdefault"            => "0",
 
   );
 
   $settings[] = array(
 
       "sid"                => "NULL",
 
       "name"                => "ficus_announcements_fid",
 
       "title"                => $db->escape_string("Annoucements forum"),
 
       "description"        => $db->escape_string("Choose forum which will be used as an annoucements area"),
 
       "optionscode"        => "forumselectsingle",
 
       "value"                => "0",
 
       "disporder"            => "1",
 
       "gid"                => $gid,
 
       "isdefault"            => "0",
 
   );
    
$settings[] = array(
 
       "sid"                => "NULL",
 
       "name"                => "ficus_announcements_tid",
 
       "title"                => $db->escape_string("Sticked annoucements"),
 
       "description"        => $db->escape_string("Write down TID of threads which are supposed to be sticked"),
 
       "optionscode"        => "text",
 
       "value"                => "0",
 
       "disporder"            => "2",
 
       "gid"                => $gid,
 
       "isdefault"            => "0",
 
   );
    
$settings[] = array(
 
       "sid"                => "NULL",
 
       "name"                => "ficus_announcements_limit",
 
       "title"                => $db->escape_string("How many?"),
 
       "description"        => $db->escape_string("Decide how many annoucements should be displayed"),
 
       "optionscode"        => "numeric",
 
       "value"                => "0",
 
       "disporder"            => "3",
 
       "gid"                => $gid,
 
       "isdefault"            => "0",
 
   );
 
   $db->insert_query_multiple("settings"$settings);
 
   rebuild_settings(); 
 
  
    $templates 
= array();
    
$templates[] = array(
        
"tid"                     => "NULL",
        
"title"                 => "fic_news",
        
"template"                 => $db->escape_string('
        <input id="getsticky" type="hidden" name="action" value="{$sticky}" />
        <table class="tborder">
            <tr>
                <td class="thead" colspan="2">Ogłoszenia sprzedaży</td>
            </tr>
            {$fic_news_row}
        </table>
        <br />
        '
),
        
"sid"                     => "-1",
        
"version"                 => "2.5",
        
"status"                 => "",
        
"dateline"                 => time(),
    );
    
$templates[] = array(
        
"tid"                     => "NULL",
        
"title"                 => "fic_news_row",
        
"template"                 => $db->escape_string('
        <tr>
            <td id="{$subject_tid}" class="trow1">
                <a href="{$subject_link}" class="fic_subject_link">{$subject_name}</a>
                <span class="smalltext fic_date">{$subject_date}</span>
            </td>
        </tr>
        '
),
        
"sid"                     => "-1",
        
"version"                 => "2.5",
        
"status"                 => "",
        
"dateline"                 => time(),
    );
    
$db->insert_query_multiple("templates"$templates);    
}

function 
fic_news_deactivate()
{
    global 
$db$cache;
    
$db->delete_query("settinggroups""name = \"ficus_announcements\"");
    
$db->delete_query("settings""name LIKE \"ficus_announcements%\"");
    
rebuild_settings();
    
$db->delete_query("templates""title LIKE \"fic_%\"");
}

function 
fic_news() 
{    
    global 
$db$mybb$fic_news$index$templates;
    if(
$mybb->settings['ficus_announcements_onoff']) {
        
$sticky $mybb->settings['ficus_announcements_tid'];
        
$fic_news_row '';
        
$sql "SELECT subject, dateline, fid, tid
                FROM "
.TABLE_PREFIX."threads
                WHERE 1=1 AND fid='
{$mybb->settings['ficus_announcements_fid']}
                ORDER BY FIELD(tid,
$sticky) DESC, tid DESC LIMIT {$mybb->settings['ficus_announcements_limit']};
        "
;
        
$result $db->query($sql);
        while (
$row $db->fetch_array($result))
            {    
                
$subject_name = (my_strlen($row['subject']) > 30) ? my_substr($row['subject'], 030) . "..." $row['subject'];
                
$subject_date my_date('relative'$row['dateline']);
                
$subject_link get_thread_link($row['tid']);
                
$subject_tid $row['tid'];
                
                eval(
"\$fic_news_row .= \"" $templates->get("fic_news_row") . "\";");
            }
        eval(
"\$fic_news = \"" $templates->get("fic_news") . "\";");
    } else {
        
$fic_news '';
    }

Strzelam w ciemno ale zobacz co się stanie jak podmienisz hook na global_start oraz global_end
(26.09.2016, 19:02)Szogi1910 napisał(a): [ -> ]Strzelam w ciemno ale zobacz co się stanie jak podmienisz hook na global_start oraz global_end

wyjebao strone ;)
A dodając pod obecnymi hookami
Kod PHP:
$plugins->add_hook('global_start''fic_news');
$plugins->add_hook('global_end''fic_news'); 
(26.09.2016, 19:16)Szogi1910 napisał(a): [ -> ]A dodając pod obecnymi hookami
Kod PHP:
$plugins->add_hook('global_start''fic_news');
$plugins->add_hook('global_end''fic_news'); 

brak zmian ;/