vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   I need help with an IF statement in the Threadbit Template (https://vborg.vbsupport.ru/showthread.php?t=67171)

Ocean 07-14-2004 07:51 PM

I need help with an IF statement in the Threadbit Template
 
1 Attachment(s)
I need help with a line in the Threadbit Template for vB 3.0.3.

I'm using the Thread Creation Date hack (https://vborg.vbsupport.ru/showthread.php?t=64378).


Now, the key line that this hack adds to the end of the Threadbit Template is this one:


Code:


 
<if condition="$show['threadmoved']">
<td class="alt2" align="center">-</td>
<else />
<td class="alt2" title="<phrase 1="$thread[replycount]" 2="$thread[views]">$vbphrase[replies_x_views_y]</phrase>">
<div class="smallfont" style="text-align:$stylevar[right]; white-space:nowrap">
$thread[lastpostdate] <if condition="!$show['detailedtime']"><span class="time">$thread[lastposttime]</span></if><br />
<phrase 1="member.php?find=lastposter&amp;t=$thread[threadid]" 2="$thread[lastposter]">$vbphrase[by_x]</phrase> <a href="showthread.php?$session[sessionurl]goto=lastpost&amp;t=$thread[threadid]"><img class="inlineimg" src="$stylevar[imgdir_button]/lastpost.gif" alt="$vbphrase[go_to_last_post]" border="0" /></a>
</div>
</td>
</if>
 
<!-- This is the key line that the hack adds -->
<td class="alt1" align="center"><div class="smallfont" style="text-align:$stylevar[center]; white-space:nowrap">$thread_dateline</div></font></td>
 
 
<if condition="$show['notificationtype']">
<td class="alt1"><div class="smallfont">
<label for="sub$subscribethread[$threadid]">$thread[notification]</label>
<input type="hidden" name="oldemailupdate[$subscribethread[$threadid]]" id="oe_$subscribethread[$threadid]" value="$emailupdate[$threadid]" />
</div></td>
<td class="alt2"><input type="checkbox" name="deletebox[$subscribethread[$threadid]]" id="sub$subscribethread[$threadid]" value="yes" /></td>
<else />
<td class="alt1" align="center"><if condition="$show['threadmoved']">-<else /><a href="#" onclick="who($thread[threadid]); return false;">$thread[replycount]</a></if></td>
<td class="alt2" align="center">$thread[views]</td>
 
<if condition="$show['forumlink']">
<td class="alt1"><a href="forumdisplay.php?$session[sessionurl]f=$thread[forumid]">$thread[forumtitle]</a></td>
</if>
</if>
</tr>


The problem is that there is no IF statement checking to see if the Threadbit is being used on the Thread Subscriptions page of the UserCP.

As a result, an empty column (where the Thread Creation Date would normally be) is being added to the table. This is throwing the synchronization of Column Header to Column Data completely off. (See attached image)


I'm guessing that the easiest solution would be to encapsulate this line with an IF statement so that if the Thread Subscriptions page is what's being displayed, this statement will not be executed.

But I need help in accomplishing this. The author is no longer responding to the thread, not on vB.org - and not on his own website, which is why I'm asking here.


Can anyone lend some insight? :)

Andreas 07-14-2004 08:03 PM

Code:

<if condition="THIS_SCRIPT != 'subscription' and THIS_SCRIPT != 'usercp'">
put your code here
</if>

should avoid the problem.

But a better solution IMHO would be to modify subscriptions.php and usercp.php to also include the thread creation date.

Brad 07-14-2004 08:06 PM

HTML Code:

<if condition="THIS_SCRIPT == forumdisplay">
<!-- This is the key line that the hack adds -->
<td class="alt1" align="center"><div class="smallfont" style="text-align:$stylevar[center]; white-space:nowrap">$thread_dateline</div></font></td>
</if>


Ocean 07-14-2004 08:33 PM

Quote:

Originally Posted by KirbyDE

should avoid the problem.

But a better solution IMHO would be to modify subscriptions.php and usercp.php to also include the thread creation date.

I agree. I'll have to see if I can muddle my way through making it happen. :)

But thank you for your help - it did the trick for the moment. :)

Ocean 07-14-2004 08:36 PM

Quote:

Originally Posted by Brad.loo

HTML Code:

<if condition="THIS_SCRIPT == forumdisplay">
<!-- This is the key line that the hack adds -->
<td class="alt1" align="center"><div class="smallfont" style="text-align:$stylevar[center]; white-space:nowrap">$thread_dateline</div></font></td>
</if>


Thanks, Brad.loo - I opted to go with KirbyDE's code because this hack is supposed to also show the Thread Creation Date column for searches.

If I used the conditional you listed, the column wouldn't show up for searches. But I appreciate your quick response, nonetheless! :)

Ocean 07-14-2004 09:53 PM

Just so you guys know, I updated the hack so that it fully supports Thread Subscriptions. I uploaded a revised version in the original thread.


Thanks for your help!


All times are GMT. The time now is 01:22 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02400 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_html_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete