News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

i Want to show icon in under the post

Started by forumnepali, August 02, 2010, 06:26:18 AM

Previous topic - Next topic

forumnepali

i wan to show Icon Like This It's Possible?? if possible please let me know how to do that modify



kat

You want to change this?

Just change the file xx.gif, inside the default theme's images>post directory, to whatever you want.

forumnepali

#2
yes i have changed that icon... please see belo ScreenSHot



i Wan to dis0play my last post's icon at board index like this



Forum Version R3

Joker™

just a idea to move forward , can we just show message icon before topic name , and you can add these images in message icons .

I think this will be a easy way through.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

forumnepali

yes i have upload all image and its working fine post page but to show in board index like this pics



Joker™

if i get time i'll try to look at it, right now my own forum has become a mess ;D
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

forumnepali

ok when you free please reply or mail me

Thanks

Joker™

This will take time as we have to declare the icons in BoardIdex.php in source files then only they will work.I'll try this tonight .
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

forumnepali

if any bady here then please help me guys

forumnepali

Sorry For Dumping But I Need A Salution PLease help me...

SN

Is that image you want there.. the avatar of the member who has just posted?

if it is this mod will do it but its only for 1.1.x

http://custom.simplemachines.org/mods/index.php?mod=1103

forumnepali

Thank you for replying but i don't wan to show avatar i wan to show Icon in board like that mod Setting....


Sorry For My Dab English..

Thanks in advance 


Joker™

i was trying on this , but was not successful.Posting the code here let's see if someone can help us out in this

Open Sources\Subs-BoardIndex.php
Find:
'timestamp' => forum_time(true, $row_board['poster_time']),


Add after:
'icon' => $row_board['id_topic']['last_icon'],
'icon_url' => $settings[$context['icon_sources'][$row_board['id_topic']['last_icon']]] . '/post/' . $row_board['id_topic']['last_icon'] . '.gif',



In themes\default\BoardIndex.template.php
Find:
', $txt['in'], ' ', $board['last_post']['link'], '<br />


Replace it with
', $txt['in'], ' ', '<img src="', $board['last_post']['icon_url'], '" alt="" />', $board['last_post']['link'], '<br />


I think i'm making some mistake in source file  ::)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Hj Ahmad Rasyid Hj Ismail

#14
You can just refer to messageindex.template.php. It has icons there. Otherwise, you may want to refer to this where avatar mod on board has been updated for RC2 and have been reported working with RC3. See how the code add the avatar. The same apply to icons.

Joker™

Quote from: ahrasis on August 09, 2010, 08:07:27 AM
You can just refer to messageindex.template.php. It has icons there. Otherwise, you may want to refer to this where avatar mod on board has been updated for RC2 and have been reported working with RC3. See how the code add the avatar. The same apply to icons.
it tried but couldn't make it to work , can you show us the working code for message icons.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

forumnepali

i have checked but isn't work i have attached my sub and indextemplat please see


Hj Ahmad Rasyid Hj Ismail

#17
I am not sure joker. But I think this the relevant line in MessageIndex.template.php:
// Some columns require a different shade of the color class.
$alternate_class = $color_class . '2';

echo '
<tr>
<td class="icon1 ', $color_class, '">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="icon2 ', $color_class, '">
<img src="', $topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="subject ', $alternate_class, '">
<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>
', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '' ;

// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<a href="', $topic['new_href'], '" id="newicon' . $topic['first_post']['id'] . '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>';

echo '
<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '
<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>
</p>
</div>
</td>
<td class="stats ', $color_class, '">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>
<td class="lastpost ', $alternate_class, '">
<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" /></a>
', $topic['last_post']['time'], '<br />
', $txt['by'], ' ', $topic['last_post']['member']['link'], '
</td>';

// Show the quick moderation options?


And this avatar on board line in Subs-BoardIndex.php: (I am not sure that this is necessary)

if ($modSettings['board_avatar_width'] == 0)
$board_avatar = $row_board['avatar'] == '' ? ($row_board['id_attach'] > 0 ? '<img src="' . (empty($row_board['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row_board['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="middle" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="middle" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="middle" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['avatar_max_width_external'].'" height="'. $modSettings['avatar_max_height_external'].'" align="middle" border="0" />');
elseif ($modSettings['board_avatar_height'] == 0)
$board_avatar = $row_board['avatar'] == '' ? ($row_board['id_attach'] > 0 ? '<img src="' . (empty($row_board['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row_board['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" align="middle" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width'].'" align="middle" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['board_avatar_width'].'" align="middle" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" align="middle" border="0" />');
else
$board_avatar = $row_board['avatar'] == '' ? ($row_board['id_attach'] > 0 ? '<img src="' . (empty($row_board['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row_board['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row_board['filename']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="middle" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="middle" border="0" />') : (stristr($row_board['avatar'], 'http://') ? '<img src="' . $row_board['avatar'] . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="middle" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row_board['avatar']) . '" alt="" width="'. $modSettings['board_avatar_width'].'" height="'. $modSettings['board_avatar_height'].'" align="middle" border="0" />');

// Prepare the subject, and make sure it's not too long.


And for BoardIndex.template.php:
<td', !empty($board['children']) && !$modSettings['display_childboards'] ? ' rowspan="2"' : '', ' class="windowbg2 smalltext lastpost">';

if (!$modSettings['disable_avatar'])
echo '<div style="float: left; margin-right: 4px;">', !empty($board['last_post']['member']['avatar']) ? $board['last_post']['member']['avatar'] : '<img src="'. $modSettings['avatar_url']. '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width']. '" align="middle" border="0" />', '</div>';

Joker™

yeah i know it is not working. i just proposed a way to move forward , as  i like to make some progress rather than sitting idle.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

ahrasis i really don't know why are you not getting my point , but i'll try to make my point again.

The message icon image in MessageIndex.template.php , is emerging due to

<img src="', $topic['first_post']['icon_url'], '" alt="" />

now the variable in it

$topic['first_post']['icon_url'] << this is declared in Sources/MessageIndex.php .We don't have any declaration of " icon_url " in source files used for BoardIndex.template.php.

So we have to declare it first in source file then only we can use it in template .
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Advertisement: