Jump to the post that solved this thread.
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 11 Years, 4 Months, 2 Weeks ago Conditional show only to guests viewing threads
#1
Solved: 11 Years, 4 Months, 2 Weeks ago
Hi, how can I show a message only to guests viewing threads?
#2
Solved: 11 Years, 4 Months, 2 Weeks ago
What kind of message do you mean?
#3
Solved: 11 Years, 4 Months, 2 Weeks ago
Lets just pretend I want to show this one "HELLO WORLD"
#4
Solved: 11 Years, 4 Months, 2 Weeks ago
You can add the message or things you want on header templates:
header_wellcomeblock_guest

Something like that i don't remember fine xD, but something like that, you can add whatever you want and shows only to guests.

Many users i helped, add some message like vB xD.
The only infinite thing is the universe and human stupidity, but the universe is not for sure

Plugins 1.6.x

Plugins 1.8.x

#5
Solved: 11 Years, 4 Months, 2 Weeks ago
as you are using template conditionals plugin, you can use code like below in showthread template
<if $mybb->user['uid'] == 0 then>
content to be shown to guests (not logged in viewers)
</if>
#6
Solved: 11 Years, 4 Months, 2 Weeks ago
Thanks very much! I know where it should be added but I need conditional control so that only guests browsing threads can see it!

(2013-09-03, 02:08 PM).m. Wrote: as you are using template conditionals plugin, you can use code like below in showthread template
<if $mybb->user['uid'] == 0 then>
content to be shown to guests (not logged in viewers)
</if>

Thanks, how to make your code to show my message only when someone is viewing a thread. For instance http://letsforum.com/Thread
I want to add this code to header template!

Hi .M. what if I can add it to "Navigation Templates"
#7
Solved: 11 Years, 4 Months, 2 Weeks ago
if you want to show it on the thread pages only then showthread template is the correct place.

if you want to show the message on all pages except the index then code like below can be used in header / footer template
<if $mybb->user['uid'] == 0 && THIS_SCRIPT != "index.php" then>
content to be shown to guests (not logged in viewers)
</if>

I'd not suggest to add such code to navigation templates - but the code can be added to header template below <navigation>
#8
Solved: 11 Years, 4 Months, 2 Weeks ago
(2013-09-03, 03:03 PM).m. Wrote: if you want to show it on the thread pages only then showthread template is the correct place.

if you want to show the message on all pages except the index then code like below can be used in header / footer template
<if $mybb->user['uid'] == 0 && THIS_SCRIPT != "index.php" then>
content to be shown to guests (not logged in viewers)
</if>

I'd not suggest to add such code to navigation templates - but the code can be added to header template below <navigation>

As always perfect answer! Thanks very much.
Me love you long time
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)