Autor Tematu ala IPS

PHP/MYSQL  Założony przez  MateuszCODE.

Witam , Aktualnie koduje szablon pod moje forum. Szablon będzie przypominać ips 4, Poszukuje modifikacji na autora tematu. Coś w tym stylu jak na zdjęciu
[Obrazek: 811035c089b2409c9f9c1ef4b5846a6e2.png]
Jeśli zły dział to przepraszam oraz proszę o przeniesienie do odpowiedniego działu.
function info_author_thread()
{
    global 
$thread;
    
    
$user get_user($thread['uid']);
    
    
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
    
$thread['username_started'] = build_profile_link($user['username'], $user['uid']);

    
$avatar format_avatar($user['avatar']);
    
$thread['avatar_started'] = '<a href="member.php?action=profile&uid='.$user['uid'].'"><img src="'.$avatar['image'].'" alt="" /></a>';
    
$thread['datethread'] = my_date('relative'$thread['dateline']);

Prośby na PW dotyczące wsparcia z problemami będą ignorowane. Pomoc poza forum - odpłatna; kontakt: snakemybboard@gmail.com.
Dziękuje temat do zamknięcia :)

Mam problem działa {$thread['username']} ale już {$thread['datethread']} nie chce działać oraz inne klasy tylko nazwa użytkownika działa
pokaz swoj plik pluginu
<?php

/********************************************************************************************************************************
*
*  GTA Theme Addons (/inc/plugins/gtaaddons.php)
*  Author: X3nO
*  Copyright: © 2014 - 2016 @ X3nO @ All rights reserved
*  Website: X3nO.pl
*
********************************************************************************************************************************/

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", "gtaaddons_index");

function gtaaddons_info()
{
    return array(
        'name'            => 'GTA Theme Addons',
        'description'    => 'Dodatki do szablonu GTA Theme',
        'website'        => 'http://gta-center.pl',
        'author'        => 'X3nO & MateuszCODE',
        'authorsite'    => 'http://x3no.pl',
        'version'        => '1.0',
        'compatibility'    => '18*'
    );
}

function gtaaddons_activate()
{
    global $db;
}

function gtaaddons_index()
{
usunelem kod pluginu dla bezpieczonośći
}

function info_author_thread()
{
   global $thread;

   $user = get_user($thread['uid']);

    $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
    $thread['username_started'] = build_profile_link($user['username'], $user['uid']);

   $avatar = format_avatar($user['avatar']);
   $thread['avatar_started'] = '<a href="member.php?action=profile&uid='.$user['uid'].'"><img src="'.$avatar['image'].'" style="width: 50px; height:50px;" alt="" /></a>';
    $thread['datethread'] = my_date('relative', $thread['dateline']);
}

function gtaaddons_deactivate()
{
    global $db;
}

?>
Szogi1910 napisał 25.08.2016, 15:39:
Jak chcesz uzyskać pomoc skoro ukrywasz cześć kodu pluginu.

Cytat:
function gtaaddons_index()
{
usunelem kod pluginu dla bezpieczonośći
}
Masz funkcje. Musisz ja odpalic hookiem
Zrobiłem takie coś
<?php

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("global_start", "gtaaddonstopic_global");

function gtaaddonstopic_info()
{
    return array(
        'name'            => 'GTA Theme',
        'description'    => 'Dodatki do szablonu GTA Theme',
        'website'        => 'http://gta-center.pl',
        'author'        => 'MateuszCODE',
        'authorsite'    => 'http://mateuszcode@t.pl',
        'version'        => '1.0',
        'compatibility'    => '18*'
    );
}

function gtaaddonstopic_global()
{
    global $thread;

    $user = get_user($thread['uid']);

    $user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
    $thread['username_started'] = build_profile_link($user['username'], $user['uid']);

    $avatar = format_avatar($user['avatar']);
    $thread['avatar_started'] = '<a href="member.php?action=profile&uid='.$user['uid'].'"><img src="'.$avatar['image'].'" style="width: 50px; height:50px;" alt="" /></a>';
    $thread['datethread'] = my_date('relative', $thread['dateline']);
}
?>
zly hook
Mogę prosić o jaśniejsze rozwiązanie ponieważ nie za bardzo rozumiem
wpisz w google
"MyBB hooks"
wejdz w pierwszy link
przepatrz strone, pomyśl
Dodałem funkcje do showthread.php i nadal jak dodam {$thread['avatar']} nie wyświetla
masz dodac odpowiedni hook do pluginu
Zrobiłem
$plugins->add_hook("showthread_start", "info_author_thread");
i nadal nic
1. Niepotrzebnie globalizujesz $db, w _activate(), _deactivate(), przecież i tak nic w bazie nie wykonujesz.
2. Avatar - {$thread['avatar_started']} powinno zadziałać.
Prośby na PW dotyczące wsparcia z problemami będą ignorowane. Pomoc poza forum - odpłatna; kontakt: snakemybboard@gmail.com.
nie bedzie, zly hook

showthread_end



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

1 gości