• Welcome to Simple Machines Community Forum. Please login or sign up.
October 28, 2021, 05:11:55 AM

News:

Want to get involved in developing SMF, then why not lend a hand on our github!


Where is this mode?

Started by Spike2, December 10, 2006, 01:56:00 PM

Previous topic - Next topic

niko


echo '
<tr>
<td class="windowbg2" valign="middle" align="center" width="5%">
<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>


you have to close this echo with ';

and after if start new:

So it becomes like this:


echo '
<tr>
<td class="windowbg2" valign="middle" align="center" width="5%">
<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>';

if ($context['show_thumbnails'])
{
echo '
<td class="windowbg2" valign="middle" align="center">';

if (isset($topic['image'][0]['id']))
{
$image = &$topic['image'][0];

echo '
<a href="', $image['link'], '"><img src="', $image['url'], '" width="', $image['width'], '" height="', $image['height'], '" alt="" /></a>';
}

echo '
</td>';
}

echo '
<td class="windowbg' , !empty($settings['seperate_sticky_lock']) && $topic['is_sticky'] ? '3' : '' , '" valign="middle" ', (!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'] . '\');"' : ''), '>';
Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

Tanks

January 03, 2007, 06:16:47 AM #21 Last Edit: January 03, 2007, 06:29:45 AM by Knat
Thanks that made it work.. but it just made a new ugly bug show up LoL.. the board i am using this on has 92 topics.. but when i open it only 10 topics shows up on the messageindex... this has something to do with the code in the sources/messageindex.php becuase when i restore my backup all the topics shows up again.

Any idea why it does this ?  :o

And on a different board that hass 200+ topics it shows me red crosses and all topic titles etc are gone  :(


Here is my two files: http://www.gapeindex.dk/thumbview.zip if you can have a look at it pleeease  :D

niko

I think it is because of multiple attachements.

try adding GROUP BY ID_TOPIC to have only one per topic loaded. (to query in MessageIndex)

(new line before ORDER BY line).
Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

Tanks

Sorry my php skills are to weak to do what you ask

Can you show me exactly what to do please  :) And thanks for helping me  :)

niko

Oh sorry.

Find this from MessageIndex.php

AND ml.ID_MSG = t.ID_LAST_MSG
AND mf.ID_MSG = t.ID_FIRST_MSG
ORDER BY " . ($pre_query ? "FIND_IN_SET(t.ID_TOPIC, '" . implode(',', $topic_ids) . "')" : (!empty($modSettings['enableStickyTopics']) ? 'isSticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC')) . "
LIMIT " . ($pre_query ? '' : "$start, ") . "$maxindex", __FILE__, __LINE__);


Replace with

AND ml.ID_MSG = t.ID_LAST_MSG
AND mf.ID_MSG = t.ID_FIRST_MSG
ORDER BY " . ($pre_query ? "FIND_IN_SET(t.ID_TOPIC, '" . implode(',', $topic_ids) . "')" : (!empty($modSettings['enableStickyTopics']) ? 'isSticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC')) . "
GROUP BY t.ID_TOPIC
LIMIT " . ($pre_query ? '' : "$start, ") . "$maxindex", __FILE__, __LINE__);


(changed to t.ID_TOPIC to make sure it won't conflict with anything)
Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

Tanks

Buuhuuu i now get this

QuoteYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY t.ID_TOPIC
LIMIT 0, 20' at line 27
Fil: /hsphere/local/home/kjartan/gapeindex.dk/Sources/MessageIndex.php
Linie: 501

Looks like its not my lucky day today  :P

niko

My bad I made mistake. Group by belongs before order by. Sorry (again).


AND ml.ID_MSG = t.ID_LAST_MSG
AND mf.ID_MSG = t.ID_FIRST_MSG
GROUP BY t.ID_TOPIC
ORDER BY " . ($pre_query ? "FIND_IN_SET(t.ID_TOPIC, '" . implode(',', $topic_ids) . "')" : (!empty($modSettings['enableStickyTopics']) ? 'isSticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC')) . "
LIMIT " . ($pre_query ? '' : "$start, ") . "$maxindex", __FILE__, __LINE__);

Websites: Madjoki || (2 links retracted by team, links out of date and taken over.)
Mods: SMF Arcade, Related topics, SMF Project Tools, Post History

WIP Mods: Bittorrent Tracker || SMF Wiki

Tanks

January 03, 2007, 07:53:28 AM #27 Last Edit: January 05, 2007, 02:35:09 PM by Knat
You are my new best friend LoL

This works perfect now.. amazing.. Thanks 100000000 times for helping me get this to work.. and thanks for being patient with me  :D  :D  :D

Great stuff  ;)

Tanks

Hey Nico

The pictures on my messageindex shows perfectly.. i am so thankful.. my forum has never looked this cool before.. its perfect for my movies & Gallery sections.

Can this somehow be applyed to the show unread and unreadreplies ?

Would look really good if it could be done  :D

Anyway thanks again for making this cool feature  ;)

Spike2

Hey any one has any new about a mod like this one?  :(

Tanks

Quote from: spike2 on April 27, 2007, 10:50:13 AM
Hey any one has any new about a mod like this one?  :(

Just read up and make the changes yourself.. i use this on my forum and it is working like a charm.. no need for mod.. changes are easy to make ;)

CraftyLion

I've just been implementing the mod and I seem to be getting this error and I can't fix it. Mind you, my php isn't all that flash so any help would be greatly appreciated.


You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM (smf_topics AS t, smf_messages AS ml, smf_messages AS mf)

LEFT J' at line 14
File: /home/ofstagea/www/www/Sources/MessageIndex.php
Line: 470


The string I have is this:

FROM ({$db_prefix}topics AS t, {$db_prefix}messages AS ml, {$db_prefix}messages AS mf)
" . (in_array($board, $modSettings['photo_boards']) ? "
LEFT JOIN {$db_prefix}attachments AS big ON (big.ID_MSG = mf.ID_MSG AND big.attachmentType = 0)


Anyone help?

Tanks

Still using this on all boards on my site.. its really good and my members love it, but

Can this somehow be applyed to the show unread and unreadreplies ?  ???

It would make my board near perfect if it could be done  ;)

Tanks

I tried making the same changes to the recent.template.php as this code makes to the messageindex.template.php but nothing changed.. nothing at all.. so i must be doin it worng.. if anybody can help me achieve this i will be forever thankful  :)

What i need are these thumbnails, that i already have showing on messageindex, to show up on the unread and unreadreplies pages.. they are already there in the $context i think.. they just need to be inserted somehow.. please help

mywings

Hi all !

First : special thanks to niko for this code !

But i have some troubles with my theme...maybe it's my MessageIndex.template.php ...

I use a SMF 1.1.2 ,

Someone can read my files please ?

hxxp:espaceguitariste.free.fr/download/thumview.rar [nonactive]

Thanks

:-)


samurai-lupin

Hello, can one also define for which boards this mod should be used? I mean I do not want to use thumbs on all of my boards but just on some. What code would I need to change for this? Thanks!

vbgamer45

You might be able to do that insert a setting into the settings table called "'photo_boards"

And then for the value insert the boardid seperate each boardid with a comma
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

samurai-lupin

Hello vbgamer!

Thanks for your reply.

I assume I would have to add the board id numbers somewhere here?

if (isset($modSettings['photo_boards']))
$modSettings['photo_boards'] = explode(',', $modSettings['photo_boards']);
else
$modSettings['photo_boards'] = array($board);


Could you please kindly let me know where exactly?

Thank you!

samurai-lupin

I tried figuring it out myself but it unfortunately kept on producing errors in my former.

If anybody knows how I can exclude or include boards on which this mod should be applied, please kindly let me know.

Thank you!

Adalla

I just tried installing the Thumbnail Toic Mod By: vbgamer45/Niko, and I got the following error:

Error in Package Installation

At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

Installing this package will perform the following actions:  Type Action Description
1. Execute Modification ./Sources/MessageIndex.php Test successful
2. Execute Modification ./Themes/default/MessageIndex.template.php Test failed

The mod referred to this topic, so I posted here.

I'm using SMF 1.1.5 and it's supposed to be compatible...

Advertisement: