Advertisement:

Author Topic: Where is this mode?  (Read 29978 times)

Offline niko

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,003
  • Gender: Male
    • Madjoki
Re: Where is this mode?
« Reply #20 on: January 03, 2007, 06:03:20 AM »
Code: [Select]
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:

Code: [Select]
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'] . '\');"' : ''), '>';

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: Where is this mode?
« Reply #21 on: January 03, 2007, 06:16:47 AM »
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
« Last Edit: January 03, 2007, 06:29:45 AM by Knat »

Offline niko

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,003
  • Gender: Male
    • Madjoki
Re: Where is this mode?
« Reply #22 on: January 03, 2007, 07:03:04 AM »
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).

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: Where is this mode?
« Reply #23 on: January 03, 2007, 07:13:44 AM »
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  :)

Offline niko

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,003
  • Gender: Male
    • Madjoki
Re: Where is this mode?
« Reply #24 on: January 03, 2007, 07:31:46 AM »
Oh sorry.

Find this from MessageIndex.php
Code: [Select]
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
Code: [Select]
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)

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: Where is this mode?
« Reply #25 on: January 03, 2007, 07:39:47 AM »
Buuhuuu i now get this

Quote
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 '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

Offline niko

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,003
  • Gender: Male
    • Madjoki
Re: Where is this mode?
« Reply #26 on: January 03, 2007, 07:48:29 AM »
My bad I made mistake. Group by belongs before order by. Sorry (again).

Code: [Select]
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__);

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: Where is this mode?
« Reply #27 on: January 03, 2007, 07:53:28 AM »
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  ;)
« Last Edit: January 05, 2007, 02:35:09 PM by Knat »

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: Where is this mode?
« Reply #28 on: January 05, 2007, 02:37:34 PM »
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  ;)

Offline Spike2

  • Semi-Newbie
  • *
  • Posts: 50
Re: Where is this mode?
« Reply #29 on: April 27, 2007, 10:50:13 AM »
Hey any one has any new about a mod like this one?  :(

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: Where is this mode?
« Reply #30 on: April 27, 2007, 12:02:35 PM »
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 ;)

Offline kimba

  • Jr. Member
  • **
  • Posts: 214
    • Beyond The Realm
Re: Where is this mode?
« Reply #31 on: May 06, 2007, 07:40:21 PM »
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.

Code: [Select]
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:
Code: [Select]
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?
Kimba
==============================
Beyond the Realm - http://realm.craftylion.com

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: Where is this mode?
« Reply #32 on: May 27, 2007, 01:08:38 PM »
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  ;)

Offline Tanks

  • Full Member
  • ***
  • Posts: 583
  • Gender: Male
  • Danish Dude
Re: Where is this mode?
« Reply #33 on: May 28, 2007, 06:05:58 AM »
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

Offline mywings

  • Newbie
  • *
  • Posts: 1
Re: Where is this mode?
« Reply #34 on: September 20, 2007, 10:32:11 AM »
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

:-)


Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Where is this mode?
« Reply #35 on: May 03, 2008, 06:02:35 AM »
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!

Offline vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,553
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Where is this mode?
« Reply #36 on: May 03, 2008, 09:14:34 AM »
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

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Where is this mode?
« Reply #37 on: May 03, 2008, 08:25:44 PM »
Hello vbgamer!

Thanks for your reply.

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

Code: [Select]
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!

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Where is this mode?
« Reply #38 on: May 04, 2008, 06:58:40 PM »
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!

Offline Adalla

  • Semi-Newbie
  • *
  • Posts: 51
Re: Where is this mode?
« Reply #39 on: July 17, 2008, 05:36:47 AM »
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...