vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Condition to show ONLY TO THREAD OWNER? (https://vborg.vbsupport.ru/showthread.php?t=292883)

addamroy 12-11-2012 01:34 PM

Condition to show ONLY TO THREAD OWNER?
 
Is there a vbif condition to check if a user is the creator of the thread?

I want to put an ad on threads that show only to the user who started the thread.

Something like,
Code:

<vbif condition=(user_started_thread)>This is your thread!</vbif>
would be perfect :)

Is there something for this?

mokujin 12-11-2012 01:53 PM

<vb:if condition="$thread['postuserid'] == $bbuserinfo['userid']">This is your thread</vb:if>
Not tested yet, but try it.

addamroy 12-11-2012 04:16 PM

Didn't work :(

kh99 12-11-2012 04:20 PM

Try $threadinfo instead of $thread.

addamroy 12-11-2012 05:05 PM

That didn't work either :(

mokujin 12-11-2012 05:27 PM

Where did you put the code into?

addamroy 12-11-2012 06:26 PM

I'm just using it in the "under navbar" advertisement slot right now.

Once I get the conditions to work there, I'm going to try integrating it elsewhere.

mokujin 12-11-2012 06:55 PM

So, try it in SHOWTHREAD template, add this code
<vb:if condition="$thread['postuserid'] == $bbuserinfo['userid']">This is your thread</vb:if>
or
<vb:if condition="$threadinfo['postuserid'] == $bbuserinfo['userid']">This is your thread</vb:if>
under {vb:raw navbar}

addamroy 12-11-2012 07:54 PM

would that conditional work in one template and not another? Shouldn't it work anywhere if it was going to?

Basically I'm just going to put a link under the first post of threads (probably in the postbit_legacy template) in a certain forum, and only show it to whoever created the thread.

I'm just using this code inside the advertising spot to get it working in the first place, I can use other conditionals here just this one you provided isn't working. Nothing shows up at all.

Lynne 12-11-2012 08:16 PM

Only variables that are registered for use in a template may be used in that template. So yes, it very much depends on what template you are going to be using the condition in. Try using $post in the postbit template instead of $thread or $threadinfo.


All times are GMT. The time now is 11:47 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.00948 seconds
  • Memory Usage 1,724KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete