TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 15, 2024, 05:45:18 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,188
  • Total Topics: 21,220
  • Online today: 149
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 126
  • Total: 126

[SOLVED] Any idea how this was done ? (thumbnails on messageindex)

Started by knat, October 25, 2006, 07:14:37 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

knat

I really really want this on my site, but as you all know there is not much help to get at SMF forum.

Here is how it looks: http://phofan.com/forum/index.php?PHPSESSID=db181232c8e63ec49046680c79b4c26e&board=2.0

The mod was never released.. so now im asking you nice people here at TP if any know how to create this..

It shows a thumb of the first attached image..

Please help me if you have any idea how to make this

Cheers

Knat

G6Cad

There are some descriptions that will give you similar looks like from the link.
You have to search for it though  :)

knat

I searched high and low but all i can find are people who want this.. not any posts about how to do it  :P

Maybe you can provide a link  ::)

stormlrd

I dont know about a link but its a modified message.template.php file what you can do is take from the default theme folder that file and the display.template.php file than look through the display.template file for the part that shows attachments than use those variables and redo the html in the php of the message.template to show the attachment in a new column you have to insert for these posts.

knat

I wish i had the skills to do such a thing  :) but i dont  :'(

Thats why im asking if anybody is able to provide me with the changes that i need to make for the message.template to show thumbs of attached image.. just like in the example i provided in the first post..  :coolsmiley:

And i think many people would like to use this if somebody can provide the code for it  ;)

This is the code that shows the image attachment inside the post..

// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<hr width="100%" size="1" class="hrcolor" />
<div style="overflow: auto; width: 100%;">';
foreach ($message['attachment'] as $attachment)
{
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
else
echo '
<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
}


How do i insert this code into a row on the message.template.php and how do i make it a fixed width/hight + only show the first attachment ??


stormlrd

I wish I had the time to do it but I dont right now, maybe after Xmas i can do it but Im just to swamped with projects at the moment

knat

Quote from: StormLrd on October 25, 2006, 12:17:22 PM
I wish I had the time to do it but I dont right now, maybe after Xmas i can do it but Im just to swamped with projects at the moment

Fair enough :-) i wish i could do it myself but i pretty much suck at coding !

knat

With this script i can use SSI to pull pictures from attachments.. how can i use SSI to pull the first image attachment from the topic and put it messageindex

$array_boardNews = ssi_boardNews(30, 5, null, 250 , 'array');
foreach ($array_boardNews as $news)
{
$newsImage = '' ;
if( isset( $news[ 'attachments' ][ 0 ] ) )
{
$newsImage = '<img class="news" src="' . $news[ 'attachments' ][ 0 ][ 'href' ] . ';image" alt="' . $news[ 'attachments' ][ 0 ][ 'name' ] . '" title="' . $news[ 'attachments' ][ 0 ][ 'name' ] . '" width="150" height="250" align="middle" />' ;
}
echo ' <div class="teaser" align="middle">
<div class="teasercontent" align="middle">
<h6 class="news"></h6>' . $newsImage .  '</div>
</div>
';
}


This script pulls 5 attached pictures from the 5 first posts from board ID 30.0

Any help out there ?

Bushido

Look at this, this is what the owners of the site respond me:

"The mod that accomplishes this is coded specifically for PhoFan and is a feature of this forum that we would like to keep unique.

Sorry.."  :tickedoff: :tickedoff: :tickedoff: :tickedoff:

http://phofan.com/forum/index.php/topic,613.msg1421.html#msg1421
:tickedoff: :tickedoff: :tickedoff: :tickedoff: :tickedoff: :tickedoff:
>:( >:( >:( >:( >:( >:(

IchBin

yes, I figured they would say that being as that they didnt put it on SMF as a mod. I'm sure if you put a request in the mod board at SMF someone may take a look at doing it for you.