Edycja Pluginu Recent topics index page

Założony przez  mrkarpiuk.

wersja skryptu MyBB: 1.8.6
adres forum: mrkarpiuk.xaa.pl
na czym polega problem (screen, opis, komunikaty, nazwa i wersja wtyczki):

Chciałbym żeby po najechaniu na nazwe tematu pokazywała się całą treść tytułu.


Tutaj plugin:

<?php
/*
Recent Topics
by: vbgamer45
http://www.mybbhacks.com
Copyright 2011  MyBBHacks.com

############################################
License Information:

Links to http://www.mybbhacks.com must remain unless
branding free option is purchased.
#############################################
*/
if(!defined('IN_MYBB'))
    die('This file cannot be accessed directly.');

$plugins->add_hook("index_end", "recenttopicsindex_show");

function recenttopicsindex_info()
{

    return array(
        "name"        => "Recent Topics Index Page PLUS",
        "description"        => "Adds Recent Topics to the index page | Plugin dodaje listę najnowszych wątków na forum.",
        "website"        => "http://www.mybbhacks.com",
        "author"        => "vbgamer45 (Edited by Matslom from mybboard.pl)",
        "authorsite"        => "http://www.mybbhacks.com",
        "version"        => "1.8.6",
        "guid"             => "*",
        "compatibility"    => "18*"
        );
}


function recenttopicsindex_install()
{
    global $mybb, $db;
    $styl = 'max-height: 30px;
        max-width: 30px;
        float: left;
        margin-top: -2px;
       margin-left: 3px;
       margin-right: 5px;
        padding: 2px;';
    $db->write_query("INSERT INTO `".TABLE_PREFIX."settinggroups` VALUES (NULL, 'recenttopics', 'Recent topics index page', 'Ustawienia pluginu Recent Topics Index Page.', 1, 0)");
  $query = $db->simple_select("settinggroups", "gid", "name = 'recenttopics'", array("limit" => 1));
    $gid = $db->fetch_field($query, "gid");

    $recenttopics_setting = array(
        'name'            => 'recenttopicslimit',
        'title'            => 'Ilość wyświetlanych wątków',
        'description'    => 'Liczba ostatnich tematów, które mają zostać wyświetlone na stronie głównej',
        'optionscode'    => 'text',
        'value'            => '10',
        'disporder'        => '1',
        'gid'            => intval($gid)
    );

    $recenttopics_forums = array(
        'name'            => 'recenttopics_forums',
        'title'            => 'Działy do wyświetlania',
        'description'    => 'Wpisz fid działu(ów) z których mają być pobierane wątki. Liczby oddzialaj przecinkami. Przykład: 5,8,10 - plugin pobierze ostatnie wątki z działów o fid 5, 8 oraz 10, pozostałe zostaną ominięte. <br/> Pozostaw puste pole, aby wybrać wszystkie działy.',
        'optionscode'    => 'text',
        'value'            => null,
        'disporder'        => '2',
        'gid'            => intval($gid)
    );
    
    $recenttopics_awatar = array(
        'name'            => 'recenttopics_awatar',
        'title'            => 'Wyświetlanie awatarów na liście',
        'description'    => 'Włączenie lub wyłączenie pokazywania awatarów w pluginie',
        'optionscode'    => 'yesno',
        'value'            => '1',
        'disporder'        => '3',
        'gid'            => intval($gid)
    );

    $recenttopics_style = array(
        'name'            => 'recenttopics_style',
        'title'            => 'Styl wyświetlania awatarów',
        'description'    => 'Za pomocą języka CSS, określ jaki mają mieć wygląd awatary w pluginie',
        'optionscode'    => 'textarea',
        'value'            => $styl,
        'disporder'        => '4',
        'gid'            => intval($gid)
    );

    $recenttopics_dafault_a = array(
        'name'            => 'recenttopics_default_a',
        'title'            => 'Ścieżka do domyślnego awatara',
        'description'    => 'Podaj ścieżkę do domyślnego awatara w przypadku gdy użytkownik go nie posiada',
        'optionscode'    => 'text',
        'value'            => './images/default_avatar.gif',
        'disporder'        => '5',
        'gid'            => intval($gid)
    );
    // Create Tables/Settings
    $db->insert_query('settings', $recenttopics_setting);
      $db->insert_query('settings', $recenttopics_awatar);
    $db->insert_query('settings', $recenttopics_style);
    $db->insert_query('settings', $recenttopics_forums);
    $db->insert_query('settings', $recenttopics_dafault_a);
    rebuild_settings();


}

function recenttopicsindex_is_installed()
{
    global $db;
    $query = $db->write_query("SELECT * FROM " . TABLE_PREFIX . "settings WHERE `name` = 'recenttopicslimit'");

    if($db->num_rows($query) > 0)
        return true;
    else
        return false;
}

function recenttopicsindex_uninstall()
{
    global $mybb, $db;

    $db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN ('recenttopicslimit')");
    $db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN ('recenttopics_awatar')");
    $db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN ('recenttopics_style')");
    $db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN ('recenttopics_forums')");
    $db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN ('recenttopics_default_a')");
    $db->write_query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name = 'recenttopics'");

    rebuild_settings();
}


function recenttopicsindex_activate()
{

}

function recenttopicsindex_deactivate()
{

}

function recenttopicsindex_show()
{
    global $db, $mybb, $page, $recenttopics, $theme, $permissioncache;


    require_once MYBB_ROOT."inc/functions_search.php";

    $recenttopics .= '<table border="0" cellspacing="' . $theme['borderwidth'] . '" cellpadding="' . $theme['tablespace'] . '" class="tborder2">
<thead>
<tr>
<td class="thead2" colspan="2">
<div><strong>Najnowsze wątki</strong></div>
</td>
</tr>
</thead>';

    // Run the Query
    
   // !!! FIX private forum exposure!!!
  if ( !is_array($permissioncache) ||(is_array($permissioncache) && ((count($permissioncache)==1) && (isset($permissioncache['-1']) && ($permissioncache['-1'] = "1")))))
      $permissioncache = forum_permissions();

    $unsearchforums = get_unsearchable_forums();
    if($unsearchforums)
        $where_sql .= " AND t.fid NOT IN ($unsearchforums)";

    $inactiveforums = get_inactive_forums();
    if ($inactiveforums)
        $where_sql .= " AND t.fid NOT IN ($inactiveforums)";

//Wyświetlanie z wybranych działów
if($mybb->settings['recenttopics_forums'] == null)
{
    $query = $db->query("
    SELECT
        t.tid, t.fid, t.subject, t.lastposteruid, t.lastposter, t.lastpost, f.name, u.username, u.usergroup, u.displaygroup, u.avatar, u.uid
    FROM ".TABLE_PREFIX."threads as t,  ".TABLE_PREFIX."forums as f,  ".TABLE_PREFIX."users as u
    WHERE u.username=t.lastposter AND f.fid = t.fid AND t.visible = 1 $where_sql
    ORDER BY t.lastpost DESC LIMIT " . $mybb->settings['recenttopicslimit']);
}
else
{
    $query = $db->query("
    SELECT
        t.tid, t.fid, t.subject, t.lastposteruid, t.lastposter, t.lastpost, f.name, u.username, u.usergroup, u.displaygroup, u.avatar, u.uid
    FROM ".TABLE_PREFIX."threads as t,  ".TABLE_PREFIX."forums as f,  ".TABLE_PREFIX."users as u
    WHERE t.fid IN(".$mybb->settings['recenttopics_forums'].") AND u.username=t.lastposter AND f.fid = t.fid AND t.visible = 1 $where_sql
    ORDER BY t.lastpost DESC LIMIT " . $mybb->settings['recenttopicslimit']);
}


    while($threadRow = $db->fetch_array($query))
    {
    
    if($threadRow['avatar'] == null)
    { $threadRow['avatar'] = $mybb->settings['recenttopics_default_a']; }
        
        $awatar = "<a href=\"".$mybb->settings['bburl']."/".get_profile_link($threadRow['uid'])."\"><img src=\"".$threadRow['avatar']."\" style=\"".$mybb->settings['recenttopics_style']."\" alt=\"avatar\" class=\"favimg\" /></a>";
        $usernameFormatted = format_name($threadRow['username'], $threadRow['displaygroup']);
        $username = '<a href="member.php?action=profile&uid='.intval($threadRow['lastposteruid']).'"> '.$usernameFormatted.'  </a>';
        $subject = my_substr($threadRow['subject'], 0, 20);
        $subject = htmlspecialchars_uni($subject);
        $postdate = my_date($mybb->settings['dateformat'], $threadRow['lastpost']);
        $posttime = my_date($mybb->settings['timeformat'], $threadRow['lastpost']);
        $recenttopics .= '<tr> <td class="trow3 smalltext" valign="top">';
        if($mybb->settings['recenttopics_awatar'] == '1' ) { $recenttopics .= $awatar; }
        
        $recenttopics .= '<strong><a href="showthread.php?tid=' . $threadRow['tid'] . '&action=lastpost" >' . $subject .' ...</a></strong> </br> '
        . $username .'  - <br />' . $postdate  .' '. $posttime . '
        </td>
        </tr>';
    }
    $recenttopics .= "</table><br />";
}
?>




Oraz aby przed nickie było przez (nick) bo niestety nie bardzo wiem jak edytować aby nie sypało błędami co mogło to edytowałem już dla siebie.



Dzięki!
Ale dokładniej. Jako popup czy title?
[Obrazek: cY8Xc8H.png]

Chyba jako title nie wiem czy dobrze powiedziałem ale ma tak wyglądać ;)



Użytkownicy przeglądający ten wątek:

1 gości