Advertisement:

Author Topic: Thumbnail on Topic Listing  (Read 176360 times)

Offline drHaus

  • Semi-Newbie
  • *
  • Posts: 96
Re: Thumbnail on Topic Listing
« Reply #20 on: April 06, 2008, 09:03:19 PM »
vbgamer45,
can is  posible, if i post image like link , example /img/http://www.example.com/1.gif/img,
and this image to be thumbnail like atachment?
« Last Edit: April 06, 2008, 09:04:59 PM by drHaus »

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #21 on: April 06, 2008, 09:05:10 PM »
A  jpeg attachement and a zip file.


on another issue/note, I noticed that some of the  thumbnails do not appear IF there is both a jpg and a zip file attached in the sampe post.



Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,128
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #22 on: April 06, 2008, 09:12:52 PM »
vbgamer45,
can is  posible, if i post image like link , example /img/http://www.example.com/1.gif/img,
and this image to be thumbnail like atachment?
Not without out a lot of work.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Natz

  • Semi-Newbie
  • *
  • Posts: 29
Re: Thumbnail on Topic Listing
« Reply #23 on: April 06, 2008, 09:39:59 PM »
Hi I am also having problems with this mod.  I got a test failed with the messageindex.template.php file so i attempted to fix it manually and it seems to be clashing with my sticky mod (we think)  I took the sticky code out which fixed the tables but only some images were showing up but in full size not thumb size (i changed the size to 150 x 150).

I also had a problem when i went to view some threads they were missing.  But after searching for them i could find them but couldnt see them within the board.  I uninstalled the mod and all the threads were visable again.

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #24 on: April 06, 2008, 10:46:28 PM »


I also had a problem when i went to view some threads they were missing.  But after searching for them i could find them but couldnt see them within the board.  I uninstalled the mod and all the threads were visable again.

Yep! that's exactly what i experienced.  I did notice one thing that's unrelated to this issue.  If you attach a non jpg file first  followed by a jpg , the thumbnail will not show up.

It seems that you have to attach a jpg first.

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,128
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #25 on: April 06, 2008, 10:50:04 PM »


I also had a problem when i went to view some threads they were missing.  But after searching for them i could find them but couldnt see them within the board.  I uninstalled the mod and all the threads were visable again.

Yep! that's exactly what i experienced.  I did notice one thing that's unrelated to this issue.  If you attach a non jpg file first  followed by a jpg , the thumbnail will not show up.

It seems that you have to attach a jpg first.
Hmm will take a look at that.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #26 on: April 06, 2008, 10:53:05 PM »
thanks Vb.  We appreciate it.

You mod is a big hit on my board  :D

Offline dgandy

  • Semi-Newbie
  • *
  • Posts: 99
  • Gender: Female
  • They call me Debra the Deleter...Don't ask why.
    • Sims Fashion Barn
Re: Thumbnail on Topic Listing
« Reply #27 on: April 07, 2008, 12:12:54 PM »

I also had a problem when i went to view some threads they were missing.  But after searching for them i could find them but couldnt see them within the board.  I uninstalled the mod and all the threads were visable again.

This is the exact problem I was having. I hope you can get it sorted out because i really LOVE this mod. Thank you for your hard work on it.

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,128
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #28 on: April 07, 2008, 08:54:53 PM »

Version 1.1
!Fixed showing an image if there was another attachment of a different type before it.
!Also fixed issue with posts disappearing.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline dgandy

  • Semi-Newbie
  • *
  • Posts: 99
  • Gender: Female
  • They call me Debra the Deleter...Don't ask why.
    • Sims Fashion Barn
Re: Thumbnail on Topic Listing
« Reply #29 on: April 07, 2008, 09:53:06 PM »
I tried the revised mod and still no go. It's not showing all the posts. Do you think it has something to do with using utf8? Maybe I need to do something more?

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,128
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #30 on: April 07, 2008, 10:13:19 PM »
Not sure really it makes two small additions to the query but do not see how it would affect it

Code: [Select]
<file name="$sourcedir/MessageIndex.php">

<operation>
<search position="before"><![CDATA[LEFT(ml.body, 384) AS lastBody, LEFT(mf.body, 384) AS firstBody, ml.smileysEnabled AS lastSmileys,
mf.smileysEnabled AS firstSmileys]]></search>
<add><![CDATA[, IFNULL(big.ID_ATTACH, 0) AS bigId, big.filename AS bigFilename, big.width AS bigWidth, big.height AS bigHeight,
IFNULL(thn.ID_ATTACH, 0) AS thnId, thn.filename AS thnFilename, thn.width AS thnWidth, thn.height AS thnHeight]]></add>
</operation>
<operation>
<search position="before"><![CDATA[FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS ml, {$db_prefix}messages AS mf)]]></search>
<add><![CDATA[
LEFT JOIN {$db_prefix}attachments AS big ON (big.ID_MSG = mf.ID_MSG AND big.attachmentType = 0)
LEFT JOIN {$db_prefix}attachments AS thn ON (thn.ID_ATTACH = big.ID_THUMB)]]></add>
</operation>
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline dgandy

  • Semi-Newbie
  • *
  • Posts: 99
  • Gender: Female
  • They call me Debra the Deleter...Don't ask why.
    • Sims Fashion Barn
Re: Thumbnail on Topic Listing
« Reply #31 on: April 08, 2008, 01:29:49 PM »
I don't know enough about scripts to even say I know anything so, I'm afraid I'm not much help.
When I installed it the first time, there were some random topics missing on the list. For instance, on page 1 of the listing, it showed 6 topics even though it was set to show 15 per page. If I looked at page 2 there were 15 listed that started after the last one that didn't show on page 1. If I clicked the next link, it would show but, just not on the listing.

When I installed the modified version, it only showed one page and one topic listed.
Don't know if that will help any.

Offline Nyx

  • Jr. Member
  • **
  • Posts: 315
  • Gender: Female
Re: Thumbnail on Topic Listing
« Reply #32 on: April 08, 2008, 08:10:44 PM »
amazing! I was looking for a mod like this, but my forum is 2.0 beta 3  :'( :'( :'( :'(

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #33 on: April 11, 2008, 05:02:15 PM »
vb im sure you are aware, but yes, some posts are still missing.  Im gonna reinstall the mod again this weeked.

thanks again

Offline madman71

  • Full Member
  • ***
  • Posts: 652
Re: Thumbnail on Topic Listing
« Reply #34 on: April 13, 2008, 02:33:07 AM »
Vb, I did more tests with uninstalling and reinstalling the updated mod and im still getting the same results. I even tried it on the default theme that comes with SMF.

On one board I had 60 posts with the mod turned off.  When i turned back on there was only about 28 showing with the rest showing empty boxes where links should go.  I know this doesn't tell you much but it does show over half are missing. :(


------------------------
on a different topic:

I had a user inform me of the hoverlink popup mod that has not been written yet for SMF.  it's the one that dispalys thumbnails of external links when you hover on links.  I've mentioned it here: http://www.simplemachines.org/community/index.php?topic=227723.0


He got his friend to give us the code. (not sure if it's complete) This code is for the






Code: [Select]
function make_preview_images($getpostimages,$maximages)
{
preg_match_all('^\[URL=(.+?)\](.+?)\[/URL\]^im', $getpostimages, $url_matches);
preg_match_all('/\[IMG\](.*?)\[\/IMG\]/si', $getpostimages, $img_matches);
if(!$url_matches[1] OR !$img_matches[1]){
preg_match_all('^\[url=(.+?)\](.+?)\[/url\]^im', $getpostimages, $url_matches);
preg_match_all('/\[img\](.*?)\[\/img\]/si', $getpostimages, $img_matches);
}

$getpostimages = "";
for ($i=0; $i< $maximages; $i++) {
if(isset($url_matches[1][$i])){
   $getpostimages .= "[URL=". $url_matches[1][$i]."][IMG]". $img_matches[1][$i]."[/IMG][/URL]";
   }
 }
    return $getpostimages;
}

USEAGE: echo make_preview_images($POST_DATA_FROM_DATABASE,10);
for the rest he should find some 'tooltip' javascript...
-----------------------------------
the above code and instructions is what his friend sent us. I do not know much about programming but I thought maybe this might help you if you decide to make that thumbnail mod that displays EXTERNAL links and not attached files.
I know you said that it's a lot of work but maybe the code above will make it easier. I dont know.


cheers!

madman

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Thumbnail on Topic Listing
« Reply #35 on: April 14, 2008, 08:17:55 PM »
Hello,

this is a really great mod! I wanted to integrate it, but it doesn't integrate into my MessageIndex.template.php

I have tried to add the code manually but it will keep on producing errors.

Could someone maybe please kindly make the neccessary changes to my MessageIndex.template.php for me?

Any help would be much appreciated. Thank you!

Code: [Select]
<?php
// Version: 1.1; MessageIndex

function template_main()
{
global $context$settings$options$scripturl$modSettings$txt;
//Display Ads on the Message index
if (function_exists("show_threadindexAds"))
{
$ads show_threadindexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}


echo '
<div style="margin-bottom: 2px;"><a name="top"></a>'
theme_linktree(), '</div>';

if (isset($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
{
echo '
<div class="tborder" style="margin-bottom: 3ex; '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
<tr>
<td colspan="5" class="catbg">'
$txt['parent_boards'], '</td>
</tr>'
;

foreach ($context['boards'] as $board)
{
echo '
<tr>
<td ' 
, !empty($board['children']) && !$modSettings['display_childboards'] && !$modSettings['disable_avatar'] ? 'rowspan="2"' '1' ' class="windowbg" width="6%" align="center" valign="top"><a href="'$scripturl'?action=unread;board='$board['id'], '.0">';

if ($board['new']) {
if (file_exists($settings['theme_dir'] . '/icons/' $board['id'] . '/on.gif'))
$board_new_img=$settings['theme_url']. '/icons/' $board['id'] . '/on.gif';
else
$board_new_img=$settings['images_url']. '/on.gif';

echo '<img src="'$board_new_img,'" alt="'$txt[333], '" title="'$txt[333], '" border="0" />';
} elseif ($board['children_new']) {
if (file_exists($settings['theme_dir'] . '/icons/' $board['id'] . '/on2.gif'))
$childboard_new_img=$settings['theme_url']. '/icons/' $board['id'] . '/on2.gif';
else
$childboard_new_img=$settings['images_url']. '/on2.gif';

echo '<img src="'$childboard_new_img,'" alt="'$txt[333], '" title="'$txt[333], '" border="0" />';
} else {
if (file_exists($settings['theme_dir'] . '/icons/' $board['id'] . '/off.gif'))
$board_nonew_img=$settings['theme_url']. '/icons/' $board['id'] . '/off.gif';
else
$board_nonew_img=$settings['images_url']. '/off.gif';

echo '<img src="'$board_nonew_img,'" alt="'$txt[334], '" title="'$txt[334], '" border="0" />';
}


echo '</a>
</td>
<td class="windowbg2" valign=top>
'
,$board['viewer_text'],'<span class="largetext"><a href="'$board['href'], '" name="b'$board['id'], '">'$board['name'], '</a></span><br />
'
$board['description'];

// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']))
echo '
<div style="padding-top: 1px;"><small><i>'
count($board['moderators']) == $txt[298] : $txt[299], ': 'implode(', '$board['link_moderators']), '</i></small></div>';


// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="windowbg" valign="top" align="center" style="width: 12ex;"><small>
'
$board['posts'], '<br>'$txt[21], '<br />
'
$board['topics'],'<br>'$txt[330], '</small>
</td>'
;
if (!$modSettings['disable_avatar'])
echo '
<td width="'
$modSettings['board_avatar_width'] ? $modSettings['board_avatar_width'] : '1','" class="windowbg2" align="center">
'
$board['last_post']['member']['avatar'], '
</td>'
;
echo '
<td class="windowbg2" valign="middle" width="22%"><small>'
;

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<b>'
$txt[22], '</b> '$txt[525], ' '$board['last_post']['member']['link'] , '<br />
'
$txt['smf88'], ' '$board['last_post']['link'], '<br />
'
$txt[30], ' '$board['last_post']['time'];

echo '</small>
</td>
</tr>'
;

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']) && !$modSettings['display_childboards'])
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
$child['link'] = '<a href="' $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' $txt[330] . ': ' $child['topics'] . ', ' $txt[21] . ': ' $child['posts'] . $child['viewer_text'] . ')">' $child['name'] . '</a>';
$children[] = $child['new'] ? '<b>' $child['link'] . '</b>' $child['link'];
}

echo '
<tr>
<td colspan="'
, !$modSettings['display_childboards'] ? '4' '1''" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' '''">
<small><b>'
$txt['parent_boards'], '</b>: 'implode(', '$children), '</small>
</td>
</tr>'
;
}
}

echo '
</table>
</div>'
;

//Display Ads on the Message index
if (function_exists("show_underchildren"))
{
$ads show_underchildren();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

}


if (!empty($options['show_board_desc']) && $context['description'] != '')
{
echo '
<table width="100%" cellpadding="6" cellspacing="1" border="0" class="tborder" style="padding: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg2" width="100%" height="24" style="border-top: 0;">
<small>'
$context['description'], '</small>
</td>
</tr>
</table>'
;
}

// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new''text' => 'smf258''image' => 'new_topic.gif''lang' => true'url' => $scripturl '?action=post;board=' $context['current_board'] . '.0'),
'post_poll' => array('test' => 'can_post_poll''text' => 'smf20''image' => 'new_poll.gif''lang' => true'url' => $scripturl '?action=post;board=' $context['current_board'] . '.0;poll'),
'markread' => array('text' => 'mark_read_short''image' => 'markread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=board;board=' $context['current_board'] . '.0;sesc=' $context['session_id']),
'notify' => array('test' => 'can_mark_notify''text' => 125'image' => 'notify.gif''lang' => true'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"''url' => $scripturl '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';board=' $context['current_board'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'post_smfbuy' => array('test' => 'can_post_smfbuy''text' => 'new_smfbuy''image' => 'auction.gif''lang' => true'url' => $scripturl '?action=post;board=' $context['current_board'] . '.0;smfbuy'),
);

// They can only mark read if they are logged in and it's enabled!
if (!$context['user']['is_logged'] || !$settings['show_mark_read'])
unset($normal_buttons['markread']);

if (!$context['no_topic_listing'])
{
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext">'
$txt[139], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><b>' $txt['topbottom5'] . '</b></a>' '''</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">
<tr>
'
template_button_strip($normal_buttons'bottom'), '
</tr>
</table>
</td>
</tr>
</table>'
;

// If Quick Moderation is enabled start the form.
if (!empty($options['display_quick_mod']) && !empty($context['topics']))
echo '
<form action="'
$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], '" method="post" accept-charset="'$context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;">';

echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' '''>
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr>'
;

// Are there actually any topics to show?
if (!empty($context['topics']))
{
echo '
<td width="9%" colspan="2" class="catbg3"></td>

<td class="catbg3"><b><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=subject'$context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[70], $context['sort_by'] == 'subject' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></b></td>

<td class="catbg3" width="11%"><b><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=starter'$context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[109], $context['sort_by'] == 'starter' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></b></td>

<td class="catbg3" width="4%" align="center"><b><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=replies'$context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[110], $context['sort_by'] == 'replies' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></b></td>

<td class="catbg3" width="4%" align="center"><b><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=views'$context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[301], $context['sort_by'] == 'views' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></b></td>

<td class="catbg3" width="22%"><b><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=last_post'$context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[111], $context['sort_by'] == 'last_post' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></b></td>';

// Show a "select all" box for quick moderation?
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<td class="catbg3" width="24" valign="middle" align="center">
<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="check" />
</td>'
;
// If it's on in "image" mode, don't show anything but the column.
elseif (!empty($options['display_quick_mod']))
echo '
<td class="catbg3" width="4%" valign="middle" align="center"></td>'
;
}
// No topics.... just say, "sorry bub".
else
echo '
<td class="catbg3" width="100%" colspan="7"><b>'
$txt[151], '</b></td>';

echo '
</tr>'
;

if (!empty($settings['display_who_viewing']))
{
echo '
<tr class="windowbg2">
<td colspan="' 
, !empty($options['display_quick_mod']) ? '8' '7' '"><small>';
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' 'count($context['view_members']) == $txt['who_member'] : $txt[19];
else
echo empty($context['view_members_list']) ? '0 ' $txt[19] : implode(', '$context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' ' (+ ' $context['view_num_hidden'] . ' ' $txt['hidden'] . ')');
echo $txt['who_and'], $context['view_num_guests'], ' '$context['view_num_guests'] == $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
</small></td>
</tr>'
;
}

foreach ($context['topics'] as $topic)
{
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0strrpos($topic['class'], '_sticky'));
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0strrpos($topic['class'], '_locked'));

echo '
<tr>

'
;
if(isset($topic['is_buddy']) && empty($options['show_buddy_highlight']))
echo '<td bgcolor="',$modSettings['color_buddylist'],'" valign="middle" align="center" width="5%">';
else
echo '<td class="windowbg2" valign="middle" align="center" width="5%">';
echo 
'
<img src="'
$settings['images_url'], '/topic/'$topic['class'], '.gif" alt="" />
</td>
<td class="windowbg2" valign="middle" align="center" width="4%">
<img src="'
$topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="windowbg' 
, !empty($settings['seperate_sticky_lock']) && $topic['is_sticky'] ? '3' '' '" valign="top" ', (!empty($topic['quick_mod']['remove']) ? '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'] . '\', \'' $context['session_id'] . '\');"' ''), '>';

if (!empty($settings['seperate_sticky_lock']))
echo '
$topic['is_locked'] ? '<img src="' $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" id="lockicon' $topic['first_post']['id'] . '" style="margin: 0;" />' '' '
$topic['is_sticky'] ? '<img src="' $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" id="stickyicon' $topic['first_post']['id'] . '" style="margin: 0;" />' '';

echo '
'
$topic['is_sticky'] ? '<b>' '' '<span title="'$topic['first_post']['preview'], '"><span id="msg_' $topic['first_post']['id'] . '">'$topic['first_post']['link'], '</span></span>'$topic['is_sticky'] ? '</b>' '';



// 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['images_url'], '/'$context['user']['language'], '/new.gif" alt="'$txt[302], '" /></a>';
$preLength $modSettings['previewLength'];
$oldPreview $topic['first_post']['preview'];
$newPreview wordwrap($oldPreview$preLength"\n"1);
echo'<span class="smalltext"><br />'$newPreview '</span><br />';



echo '
<small id="pages' 
$topic['first_post']['id'] . '">'$topic['pages'], '</small>
</td>
<td class="windowbg2" style="padding: 0px;" align="center"  valign="middle" width="17%">'
;
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($modSettings['enable_mini_avatars']))
echo '<table width="100%" cellpadding="0" cellspacing="2px" border="0"><tr><td class="windowbg2" width="30%" align="center">
'
$topic['first_post']['member']['avatar'],'</td><td class="windowbg2" width="70%">';
echo'
'
$topic['first_post']['member']['link'], '</td>';

if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($modSettings['enable_mini_avatars']))
echo '</tr></table></td>';
echo'

<td class="windowbg' 
$topic['is_sticky'] ? '3' '' '" valign="middle" width="4%" align="center">
'
$topic['replies'], '
</td>
<td class="windowbg' 
$topic['is_sticky'] ? '3' '' '" valign="middle" width="4%" align="center">
'
$topic['views'], '
</td>
<td class="windowbg2" valign="middle" width="22%">
<a href="'
$topic['last_post']['href'], '"><img src="'$settings['images_url'], '/icons/last_post.gif" alt="'$txt[111], '" title="'$txt[111], '" style="float: right;" /></a>
<span class="smalltext">
'
$topic['last_post']['time'], '<br />
'
$txt[525], ' '$topic['last_post']['member']['link'], '
</span>
</td>'
;

// Show the quick moderation options?
if (!empty($options['display_quick_mod']))
{
echo '
<td class="windowbg' 
$topic['is_sticky'] ? '3' '' '" valign="middle" align="center" width="4%">';
if ($options['display_quick_mod'] == 1)
echo '
<input type="checkbox" name="topics[]" value="'
$topic['id'], '" class="check" />';
else
{
// Check permissions on each and show only the ones they are allowed to use.
if ($topic['quick_mod']['remove'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=remove;sesc='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_remove.gif" width="16" alt="'$txt[63], '" title="'$txt[63], '" /></a>';

if ($topic['quick_mod']['lock'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=lock;sesc='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_lock.gif" width="16" alt="'$txt['smf279'], '" title="'$txt['smf279'], '" /></a>';

if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
echo '<br />';

if ($topic['quick_mod']['sticky'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=sticky;sesc='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="'$txt['smf277'], '" title="'$txt['smf277'], '" /></a>';

if ($topic['quick_mod']['move'])
echo '<a href="'$scripturl'?action=movetopic;board='$context['current_board'], '.'$context['start'], ';topic='$topic['id'], '.0"><img src="'$settings['images_url'], '/icons/quick_move.gif" width="16" alt="'$txt[132], '" title="'$txt[132], '" /></a>';
}
echo '</td>';
}
echo '
</tr>'
;
}

if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == && !empty($context['topics']))
{
echo '
<tr class="catbg">
<td colspan="8" align="right">
<select name="qaction"'
$context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' '''>
<option value="">--------</option>
'
$context['can_remove'] ? '<option value="remove">' $txt['quick_mod_remove'] . '</option>' '''
'
$context['can_lock'] ? '<option value="lock">' $txt['quick_mod_lock'] . '</option>' '''
'
$context['can_sticky'] ? '<option value="sticky">' $txt['quick_mod_sticky'] . '</option>' '''
'
$context['can_move'] ? '<option value="move">' $txt['quick_mod_move'] . ': </option>' '''
'
$context['can_merge'] ? '<option value="merge">' $txt['quick_mod_merge'] . '</option>' '''
<option value="markread">'
$txt['quick_mod_markread'], '</option>
</select>'
;

if ($context['can_move'])
{
echo '
<select id="moveItTo" name="move_to" disabled="disabled">'
;

foreach ($context['jump_to'] as $category)
foreach ($category['boards'] as $board)
{
if (!$board['is_current'])
echo '
<option value="'
$board['id'], '"', !empty($board['selected']) ? ' selected="selected"' '''>'str_repeat('-'$board['child_level'] + 1), ' '$board['name'], '</option>';
}
echo '
</select>'
;
}
echo '
<input type="submit" value="'
$txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\''$txt['quickmod_confirm'], '\');" />
</td>
</tr>'
;
}

echo '
</table>
</div>
<a name="bot"></a>'
;

// Finish off the form - again.
if (!empty($options['display_quick_mod']) && !empty($context['topics']))
echo '
<input type="hidden" name="sc" value="' 
$context['session_id'] . '" />
</form>'
;

echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext">'
$txt[139], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><b>' $txt['topbottom4'] . '</b></a>' '''</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">  <tr>
'
template_button_strip($normal_buttons'top'), '
</tr>
</table>
</td>
</tr>
</table>'
;
}


// Show breadcrumbs at the bottom too?
echo '
<div>'
theme_linktree(), '<br /></div>';

echo '
<div class="tborder">
<table cellpadding="8" cellspacing="0" width="100%" class="titlebg2">
<tr>'
;

if (!$context['no_topic_listing'])
echo '
<td style="padding-top: 2ex;" class="smalltext">'
, !empty($modSettings['enableParticipation']) ? '
<img src="' 
$settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' $txt['participation_caption'] . '<br />' '''
<img src="' 
$settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' $txt[457] . '<br />
<img src="' 
$settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' $txt[454] . '<br />
<img src="' 
$settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' $txt[455] . '
</td>
<td valign="top" style="padding-top: 2ex;" class="smalltext">
<img src="' 
$settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' '
<img src="' 
$settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' $txt['smf96'] . '<br />' '') . ($modSettings['pollMode'] == '1' '
<img src="' 
$settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' $txt['smf43'] : '') . '
</td>
</tr>'
;

echo '
<tr>
<td colspan=2 align="'
, !$context['right_to_left'] ? 'right' 'left''" valign="middle">
<form action="'
$scripturl'" method="get" accept-charset="'$context['character_set'], '" name="jumptoForm">
<span class="smalltext"><label for="jumpto">' 
$txt[160] . '</label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' 
$txt[251] . ':</option>';

// Show each category - they all have an id, name, and the boards in them.
foreach ($context['jump_to'] as $category)
{
// Show the category name with a link to the category. (index.php#id)
echo '
<option value="" disabled="disabled">-----------------------------</option>
<option value="#'
$category['id'], '">'$category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>'
;

/* Now go through each board - they all have:
id, name, child_level (how many parents they have, basically...), and is_current. (is this the current board?) */
foreach ($category['boards'] as $board)
{
// Show some more =='s if this is a child, so as to make it look nice.
echo '
<option value="?board='
$board['id'], '.0"'$board['is_current'] ? ' selected="selected"' '''> 'str_repeat('=='$board['child_level']), '=> '$board['name'], '</option>';
}
}

echo '
</select>&nbsp;
<input type="button" value="'
$txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \''$scripturl'\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
</form>
</td>
</tr>
</table>
</div>'
;

// Javascript for inline editing.
echo '
<script language="JavaScript" type="text/javascript" src="' 
$settings['default_theme_url'] . '/xml_board.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

// Hide certain bits during topic edit.
hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon");

// Use it to detect when we\'ve stopped editing.
document.onclick = modify_topic_click;

var mouse_on_div;
function modify_topic_click()
{
if (in_edit_mode == 1 && mouse_on_div == 0)
modify_topic_save("'
$context['session_id'], '");
}

function modify_topic_keypress(oEvent)
{
if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
{
modify_topic_save("'
$context['session_id'], '");
if (typeof(oEvent.preventDefault) == "undefined")
oEvent.returnValue = false;
else
oEvent.preventDefault();
}
}

// For templating, shown when an inline edit is made.
function modify_topic_show_edit(subject)
{
// Just template the subject.
setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 99%;"  maxlength="80" onkeypress="modify_topic_keypress(event)" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
}

// And the reverse for hiding it.
function modify_topic_hide_edit(subject)
{
// Re-template the subject!
setInnerHTML(cur_subject_div, \'<a href="'
$scripturl'?topic=\' + cur_topic_id + \'.0">\' + subject + \'</a>\');
}

// ]]></script>'
;
}

function 
theme_show_buttons()
{
global $context$settings$options$txt$scripturl;

$buttonArray = array();

// If they are logged in, and the mark read buttons are enabled..
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$buttonArray[] = '<a href="' $scripturl '?action=markasread;sa=board;board=' $context['current_board'] . '.0;sesc=' $context['session_id'] . '">' $txt['mark_read_short'] . '</a>';

// If the user has permission to show the notification button... ask them if they're sure, though.
if ($context['can_mark_notify'])
$buttonArray[] = '<a href="' $scripturl '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';board=' $context['current_board'] . '.' $context['start'] . ';sesc=' $context['session_id'] . '" onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');">' $txt[125] . '</a>';

// Are they allowed to post new topics?
if ($context['can_post_new'])
$buttonArray[] = '<a href="' $scripturl '?action=post;board=' $context['current_board'] . '.0">' $txt['smf258'] . '</a>';

// How about new polls, can the user post those?
if ($context['can_post_poll'])
$buttonArray[] = '<a href="' $scripturl '?action=post;board=' $context['current_board'] . '.0;poll">' $txt['smf20'] . '</a>';

return implode(' &nbsp;|&nbsp; '$buttonArray);
}

?>

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Thumbnail on Topic Listing
« Reply #36 on: April 15, 2008, 07:57:43 PM »
Will there soon be a release where one can specify the boards on which to use this mod? Thanks!

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,128
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Thumbnail on Topic Listing
« Reply #37 on: April 15, 2008, 08:07:25 PM »
Will there soon be a release where one can specify the boards on which to use this mod? Thanks!
That's a planned upgrade.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Thumbnail on Topic Listing
« Reply #38 on: April 15, 2008, 10:05:53 PM »
Thanks! Can't wait for it!

Offline samozin

  • Jr. Member
  • **
  • Posts: 390
    • www.caffeh.com
Re: Thumbnail on Topic Listing
« Reply #39 on: April 25, 2008, 12:46:25 PM »
  great mod   thanx vbgamer45
  do me afav vbgamer45  plz  iam using ur mod could u give acode  for for viewing  the leastes 

attached  pictures   to put on tp block
 
 u  know u gave that code for the leastes(random)  pictures  from the gallery
 can u  make that code shows the athumbnails   attached

  the i dea is to make something like mp3 portal on  tp   shows  leastes albums   from  the

aspesific board when   user  clicks on  apicture   goes to the  the topic where that pic attached
plzzzzzzzz  i  know can  do it