PDA


View Full Version : Something extra for the Current Threads


Bellinis
12-01-2005, 12:36 PM
I don't know if the following would be possible, but I'll just give it a shot:

I my 'current threads' box I want to add an IF statment that would do the following:

IF the thread comes from FORUMID=x, THEN add an IMG after the titel.

The purpose for this is that my forum uses different languages, so when a thread is located in the french section, I would like to add a little french flag after the title. I know I can set the current threads to show the forum, but that's not exactly what I had in mind... ;)

I hope someone can help me on this one :)

Thanks

Brian
12-01-2005, 05:06 PM
<if condition="$thread['forumid'] == X"> Your Image Here </if>

Bellinis
12-01-2005, 07:54 PM
Thanks for your reply Brian :)

the IF condition sounds very logical, but where do I put it so each thread title in the 'Current Threds' will have a country flag right next to it? ;)

Brian
12-02-2005, 04:56 PM
Edit your adv_portal_latesttopicbits template and add the code somewhere near the $thread[title] variable.

Bellinis
12-04-2005, 11:05 AM
I can't seem to get this to work.... :(

Added the following near the $thread[title], but nothing happens:

<if condition="$thread['forumid'] == 37"><img src="/images/flags/Tsjechische.gif" width="16" height="10" /></if>

Any idea what I might be doing wrong?

Brian
12-04-2005, 03:19 PM
You may be adding it in the wrong place. The adv_portal_latesttopicbits template has two separate pieces of code that will be displayed depending on whether the module is in the center column or one of the side columns. If your module is in the center column then the code to modify would be near the top of the template. If it's in one of the side columns then the code would be closer to the center.

Bellinis
12-04-2005, 03:37 PM
Yes, I inserted it at the right place, but still nothing shows up.

Here's what I have somewhere on top of adv_portal_latesttopicbits:

<b><font size="-3">• </font><a href="$vboptions[bburl]/showthread.php?t=$thread[threadid]" title="$thread[preview]">$thread[title]</a></b><if condition="$thread['forumid'] == 37">xxxx</if>

Without the IF function the 'xxxx' ofcourse shows up, but somehow this condition isn't working. Something I'm missing ? :confused:

Brian
12-04-2005, 03:42 PM
Are you sure that 37 is the correct forumid? The code looks fine, so an incorrect forumid is about the only thing I can think of...

Bellinis
12-04-2005, 03:53 PM
Are you sure that 37 is the correct forumid? The code looks fine, so an incorrect forumid is about the only thing I can think of...

Absolutely sure it's the correct forum ID.
When you look at my forum: http://www.tsjechie.net, then on the bottom of the page you see the latest threads. The fourth from the top is forumID 37 (you can see that also in your status bar).

Bellinis
12-04-2005, 03:57 PM
Ahaa, I figured out that with "Show Forum" turned of, the above if function doesn't work ;)

So how can I make it work without turning it on ? :D

Brian
12-04-2005, 04:04 PM
You know, I had already checked the files to be sure it wasn't something like that. Of course I checked the dev files where that query has been changed instead of the public version though. If you'll look in your modules/latesttopics.php file for this code though:
thread.threadid,

And replace it with this:
thread.threadid, thread.forumid,

Then you should be able to use the condition without turning that option on. :)

Bellinis
12-04-2005, 04:18 PM
Ok, that worked!! Thanks a lot Brian and sorry for sounding so st..id :)

Bellinis
12-04-2005, 04:36 PM
Last question: how do I add a second forumid ?

Brian
12-04-2005, 05:08 PM
<if condition="$thread['forumid'] == X OR $thread['forumid'] == Y">