Jump to content

(DP32) Topic Starter Info


DawPi
 Share

Recommended Posts

  • Manager

Nazwa pliku: (DP32) Topic Starter Info

Autor: DawPi

Data wysłania: 15 gru 2011

Data aktualizacji: 05 sty 2012

Kategoria: Modyfikacje

Wspierana wersja IP.Board: 3.2.x+

Prosta modyfikacja wyświetlająca informację o autorze wątku w widoku tematu. Przydatne na forach, gdzie toczą się długotrwałe dyskusje lub po prostu, by rozeznać się w sytuacji czy osoba, z którą prowadzimy dyskusję jest autorem wątku.

Pobierz plik

  • Like 1

intermedia - profesjonalne rozwiązania Invision Power Board

---

Chcesz uzyskać szybko i sprawnie pomoc? Uzupełnij wersję i adres w profilu.

Link to comment
Share on other sites

  • 3 weeks later...

zainstalowalem, hook wlaczony, a dalej w temacie nic nie ma :-/

o to plik userInfoPane mojego stylu (wzialem go przez ACP)

[long]<div class='user_details'>

<ul class='basic_info'>

<if test="membertitle:|:$author['member_title']">

<p class='desc member_title'>{$author['member_title']}</p>

</if>

<if test="avatar:|:$author['member_id']">

<li class='avatar'>

<a href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}" class='ipsUserPhotoLink'>

<if test="hasVariable:|:$this->settings['member_topic_avatar_max']">

<img src='{$author['pp_main_photo']}' class='ipsUserPhoto ipsUserPhoto_variable' />

<else />

<img src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />

</if>

</a>

</li>

<else />

<li class='avatar'>

<img src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />

</li>

</if>

<li class='group_title'>

{$author['_group_formatted']}

</li>

<if test="rankimage:|:$author['member_rank_img']">

<li class='group_icon'>

<if test="rankimageimage:|:$author['member_rank_img_i'] == 'img'">

<img src='{$author['member_rank_img']}' alt='' />

<else />

{$author['member_rank_img']}

</if>

</li>

</if>

<if test="postCount:|:$author['member_id']">

<li class='post_count desc lighter'>

{parse expression="$this->registry->getClass('class_localization')->formatNumber( intval( $author['posts'] ) )"} {$this->lang->words['m_posts']}

</li>

</if>

</ul>

<if test="authorcfields:|:$author['custom_fields'] != """>

<ul class='custom_fields'>

<foreach loop="customFieldsOuter:$author['custom_fields'] as $group => $data">

<foreach loop="customFields:$author['custom_fields'][ $group ] as $field">

<if test="$field != ''">

<li>

{$field}

</li>

</if>

</foreach>

</foreach>

</ul>

</if>

<if test="authorwarn:|:$author['warn_percent'] !== NULL">

<ul>

<li>

<br />

<div class='warn_panel clear rounded ipsType_small'>

<strong><a href='{parse url="app=core&module=modcp&section=editmember&do=view&mid={$author['member_id']}&_tab=warn" base="public"}' id='warn_link_{$contentid}_{$author['member_id']}' title='{$this->lang->words['warn_view_history']}' class='warn_link'>{$this->lang->words['warn_status']}</a></strong>

<if test="highwarn:|:$author['warn_percent'] >= 80">

<p class='progress_bar user_warn limit' title='{$this->lang->words['warn_level']} {$author['warn_percent']}%'>

<else />

<p class='progress_bar user_warn' title='{$this->lang->words['warn_level']} {$author['warn_percent']}%'>

</if>

<span style='width: {$author['warn_percent']}%'><span>{$this->lang->words['warn_level']} {$author['warn_percent']}%</span></span>

</p>

</div>

</li>

</ul>

</if>

</div>[/long]

chyba nie ma kodu w srodku co ? Dlatego nie pokazuje autora tematu..?

Nie wiem dlatego pisze :)

Link to comment
Share on other sites

Dalej nic :/ Nie wiem jak innym, ale mi nie działa :( Instakuje hooka według instrukcji, nic łatwiejszego chyba nie ma. Pisze nowy temat i nie widzę nic pod avatarem ani nad, zadnej informacji że jestem autorem postu. Chcesz zawartość jakiegoś pliku? :/

Link to comment
Share on other sites

Również to przetestowałem na najnowszej wersji i nie wyświetla się informacja o autorze tematu ;-)

W profilu masz wersję 3.1.4 a ta wersja jest do 3.2.X

Owszem mam 2 fora, jeden jest w wersji 3.1.4 drugi w 3.2.3 ;-)

Link to comment
Share on other sites

Plik userInfoPane

[long]<div class='user_details'>

<ul class='basic_info'>

<if test="membertitle:|:$author['member_title']">

<p class='desc member_title'>{$author['member_title']}</p>

</if>

<if test="avatar:|:$author['member_id']">

<li class='avatar'>

<a href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}" class='ipsUserPhotoLink'>

<if test="hasVariable:|:$this->settings['member_topic_avatar_max']">

<img src='{$author['pp_main_photo']}' class='ipsUserPhoto ipsUserPhoto_variable' />

<else />

<img src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />

</if>

</a>

</li>

<else />

<li class='avatar'>

<img src='{$author['pp_thumb_photo']}' class='ipsUserPhoto ipsUserPhoto_large' />

</li>

</if>

<li class='group_title'>

{$author['_group_formatted']}

</li>

<if test="rankimage:|:$author['member_rank_img']">

<li class='group_icon'>

<if test="rankimageimage:|:$author['member_rank_img_i'] == 'img'">

<img src='{$author['member_rank_img']}' alt='' />

<else />

{$author['member_rank_img']}

</if>

</li>

</if>

<if test="postCount:|:$author['member_id']">

<li class='post_count desc lighter'>

{parse expression="$this->registry->getClass('class_localization')->formatNumber( intval( $author['posts'] ) )"} {$this->lang->words['m_posts']}

</li>

</if>

</ul>

<if test="authorcfields:|:$author['custom_fields'] != """>

<ul class='custom_fields'>

<foreach loop="customFieldsOuter:$author['custom_fields'] as $group => $data">

<foreach loop="customFields:$author['custom_fields'][ $group ] as $field">

<if test="$field != ''">

<li>

{$field}

</li>

</if>

</foreach>

</foreach>

</ul>

</if>

<if test="authorwarn:|:$author['warn_percent'] !== NULL">

<ul>

<li>

<br />

<div class='warn_panel clear rounded ipsType_small'>

<strong><a href='{parse url="app=core&module=modcp&section=editmember&do=view&mid={$author['member_id']}&_tab=warn" base="public"}' id='warn_link_{$contentid}_{$author['member_id']}' title='{$this->lang->words['warn_view_history']}' class='warn_link'>{$this->lang->words['warn_status']}</a></strong>

<if test="highwarn:|:$author['warn_percent'] >= 80">

<p class='progress_bar user_warn limit' title='{$this->lang->words['warn_level']} {$author['warn_percent']}%'>

<else />

<p class='progress_bar user_warn' title='{$this->lang->words['warn_level']} {$author['warn_percent']}%'>

</if>

<span style='width: {$author['warn_percent']}%'><span>{$this->lang->words['warn_level']} {$author['warn_percent']}%</span></span>

</p>

</div>

</li>

</ul>

</if>

</div>[/long]

Edited by matthewk
Link to comment
Share on other sites

No to jest zaintalowany z tego tematu więc ?

[long]

<?php

//-----------------------------------------------

// (DP31) Topic Starter Info

//-----------------------------------------------

//-----------------------------------------------

// Template Hook

//-----------------------------------------------

// Author: DawPi

// Site: http://www.ipslink.pl

// Written on: 22 / 09 / 2010

//-----------------------------------------------

// Copyright © 2010 DawPi

// All Rights Reserved

//-----------------------------------------------

class dp3tsiSkinHook

{

/**

* CONSTRUCTOR

**/

function __construct()

{

/* Make registry objects */

$this->registry = ipsRegistry::instance();

$this->DB = $this->registry->DB();

$this->lang = $this->registry->getClass('class_localization');

}

public function getOutput()

{

# O.o

}

public function replaceOutput( $output, $key )

{

$postData = $this->registry->output->getTemplate('topic')->functionData['topicViewTemplate'][0]['post_data'];

$starterId = $this->registry->output->getTemplate('topic')->functionData['topicViewTemplate'][0]['topic']['starter_id'];

if( is_array( $postData ) AND count( $postData ) )

{

$tag = '<!--hook.' . $key . '-->';

$last = 0;

foreach( $postData as $pid => $post )

{

$pos = strpos( $output, $tag, $last );

if( $pos )

{

$string = ( ( $post['author']['member_id'] == $starterId ) && ! $post['post']['new_topic'] ) ? $this->lang->words['dp3_tsi_txt'] : '';

$output = substr_replace( $output, $string . $tag, $pos, strlen( $tag ) );

$last = $pos + strlen( $tag . $string );

}

}

}

return $output;

}

} // End of class

[/long]

Link to comment
Share on other sites

A tak btw. obstawiam, że $this->registry->output->getTemplate('topic')->functionData['topicViewTemplate'] jest problemem. Coraz częściej spotykam się z przypadkiem gdzie pewnie jakiś inny mod zeruje tą tablicę.

Więc spróbuj może wyłączyć wszystkie inne hooki poza tym i wtedy sprawdzić.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.