TinyPortal

Development => Support => Topic started by: Kimmen on February 04, 2011, 11:27:42 AM

Title: Recent Block - Member Color
Post by: Kimmen on February 04, 2011, 11:27:42 AM
Link to my site: http://www.efclan.eu
SMF version: SMF2 RC4
TP version: TinyPortal 1.0 RC1
Default Forum Language: English
Theme name and version: Catamosphere by Shine-Art & Smf Personal
Browser Name and Version: Firefox
Mods installed: Aeva Media 1.4c - MCLegendII RC3 3.0 - Member Color Link 3.0.8 - Curve_centered_menu 1.2 - Menu_Icons 1.0 - Custom Buttons / tabs and menus
Related Error messages: Error message here

How can i easy make the recent topics block display the set membergroup color on the users? Right now, it display only a default color, i want that it display the current membergroup color instead.
Title: Re: Recent Block - Member Color
Post by: IchBin on February 04, 2011, 06:27:50 PM
TP uses the ssi_recentTopics() function from SMF to get the latest topics. That function does not call the user member group color. You'll have to modify the SSI.php file to get this to work properly.

In SSI.php recentTopics function:
Find this line:
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, b.id_board, b.name AS board_name, t.num_replies, t.num_views,

Replace with:
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, grp.online_color, b.id_board, b.name AS board_name, t.num_replies, t.num_views,

Find:
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '

Add After:
LEFT JOIN {db_prefix}membergroups AS grp ON (mem.id_group = grp.id_group)


Find:
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'

Replace with:
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '"><span style="color: '. $row['online_color'] .'">' . $row['poster_name'] . '<span></a>'
Title: Re: Recent Block - Member Color
Post by: Kimmen on February 04, 2011, 08:18:31 PM
Almost, the color is showing, have a look at my site: www.efclan.eu it displayes like this:

# Upcoming staff meeting Su... by
MylilPwny">MylilPwny
[Today at 20:03:27]

I guess its not supposed to show my name twice or?  ;D
Title: Re: Recent Block - Member Color
Post by: IchBin on February 04, 2011, 11:53:06 PM
I don't see a mistake in my code that I posted. Could you post the contents in that function that you modified so I can see if you made a mistake?
Title: Re: Recent Block - Member Color
Post by: Kimmen on February 05, 2011, 12:08:48 AM
1:
// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = $smcFunc['db_query']('substring', '
SELECT
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, grp.online_color, b.id_board, b.name AS board_name, t.num_replies, t.num_views,


2:
// Find all the posts in distinct topics.  Newer ones will have higher IDs.
$request = $smcFunc['db_query']('substring', '
SELECT
m.poster_time, ms.subject, m.id_topic, m.id_member, m.id_msg, grp.online_color, b.id_board, b.name AS board_name, t.num_replies, t.num_views,
IFNULL(mem.real_name, m.poster_name) AS poster_name, ' . ($user_info['is_guest'] ? '1 AS is_read, 0 AS new_from' : '
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, 0)) >= m.id_msg_modified AS is_read,
IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1 AS new_from') . ', SUBSTRING(m.body, 1, 384) AS body, m.smileys_enabled, m.icon
FROM {db_prefix}topics AS t
INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_last_msg)
INNER JOIN {db_prefix}boards AS b ON (b.id_board = t.id_board)
INNER JOIN {db_prefix}messages AS ms ON (ms.id_msg = t.id_first_msg)
LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)' . (!$user_info['is_guest'] ? '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = b.id_board AND lmr.id_member = {int:current_member})' : '') . '
                        LEFT JOIN {db_prefix}membergroups AS grp ON (mem.id_group = grp.id_group)


3:
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '"><span style="color: '. $row['online_color'] .'">' . $row['poster_name'] . '<span></a>' . '">' . $row['poster_name'] . '</a>'


There is what i have, here you also can see my SSI.php


Title: Re: Recent Block - Member Color
Post by: IchBin on February 05, 2011, 02:41:01 AM
You see the mistake you made in the very last code section? :)

This: 'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '"><span style="color: '. $row['online_color'] .'">' . $row['poster_name'] . '<span></a>' . '">' . $row['poster_name'] . '</a>'


Should be this:
'topic' => $row['id_topic'],
'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => empty($row['id_member']) ? '' : $scripturl . '?action=profile;u=' . $row['id_member'],
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '"><span style="color: '. $row['online_color'] .'">' . $row['poster_name'] . '<span></a>'
Title: Re: Recent Block - Member Color
Post by: Kimmen on February 05, 2011, 10:08:47 AM
I have again changed the code, i dont see any changes in Firefox, but IE shows like this now:

ââ,¬Â¢Paris, New York and Tehra... by
MylilPwny">MylilPwny
[February 04, 2011, 14:30:12]

Could you be so sweet and edit my SSI.php please? This is crazy  :-[
Title: Re: Recent Block - Member Color
Post by: IchBin on February 06, 2011, 03:31:49 AM
Attached.
Title: Re: Recent Block - Member Color
Post by: Kimmen on February 06, 2011, 12:51:20 PM
Yeah, that fix the problem of name appearing twice, but i notice something else. The structure of the listing, i would imagen it was supposed to list this way:

Topic name
By User
Date - Year - Time


Example:
What We Know So Far (Rele...
by MylilPwny
[Today at 13:42:54]

But it seems to depend on the length of topic name, so short topicnames, it would display like this:

Server Ping by MylilPwny
[February 05, 2011, 12:52:08]

How can we make it display on three lines like described above?
Title: Re: Recent Block - Member Color
Post by: IchBin on February 07, 2011, 02:28:00 AM
So you won't care if someone has a long topic and then it makes your shoutbox have a scroll bar for left to right? It limits the topic title length for that very reason.
Title: Re: Recent Block - Member Color
Post by: alqo on January 23, 2012, 07:51:04 PM
098 1.1.16 member color sorunu
Title: Re: Recent Block - Member Color
Post by: alqo on January 26, 2012, 06:02:45 PM
?
Title: Re: Recent Block - Member Color
Post by: ZarPrime on January 26, 2012, 06:39:00 PM
alqo,

Sorry for the delay in responding.  As Ichbin explained earlier in this topic, the Member Group colors aren't used in the TinyPortal Recent block.  In order to change it, an edit would have to be done in the ssi.php which is an SMF file.  Because you are using SMF 1.1.16, and an older version of TinyPortal that is no longer supported (TP 0.9.8), there is a good chance that we wouldn't be able to tell you how to make these changes to that file.

However, if Ichbin gets a chance to look at the ssi.php file for that version of SMF sometime, he might be able to tell you how to do it.  It is just that I am not familiar enough with the ssi.php to figure out how to do the edits.

ZarPrime
Title: Re: Recent Block - Member Color
Post by: alqo on February 01, 2012, 04:29:45 PM
ssi.php is okay, but I have a problem that blocks the issues forum user names are not colored.
Title: Re: Recent Block - Member Color
Post by: ZarPrime on February 01, 2012, 07:37:28 PM
alqo,

I'm really not sure what you are trying to do?  Where are the user names not colored?  Are you talking about the recent block?

I'll tell you what.  Let's start over with your question.  Could you give us the information requested in our Posting Guidelines (http://www.tinyportal.net/index.php?topic=581), specifically the following information ...

Link to my site: http://www.yourdomain.com
SMF version: SMF ver. here
TP version: TP ver. here
Default Forum Language: Your Default Forum Language here
Theme name and version: Theme name here
Browser Name and Version: Browser name/version here
Mods installed: Mods listed here
Related Error messages: Error message here

... and perhaps show us a screenshot of where you think that the user name colors are not showing up but you think they should be as I am confused as to what it is you are trying to do.

ZarPrime