vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Open Anouncement? (https://vborg.vbsupport.ru/showthread.php?t=198115)

Ghost Shadow 12-06-2008 02:44 AM

Open Anouncement?
 
Is it possible to have the Announcement or Sticky fully open when someone visits a thread, so they do not have to open it?

TIA!!
K58
vBulletin® Version 3.7.4

ssslippy 12-06-2008 02:52 AM

Use a notice

Lynne 12-06-2008 02:56 AM

Do you mean have them open when someone visits the forumdisplay? I'm not sure how you can have a thread open when you visit another thread. But, anyway, it sounds like maybe you want to use Notices. Those may do what you want.

Ghost Shadow 12-06-2008 03:00 AM

Quote:

Originally Posted by ssslippy (Post 1679435)
Use a notice

it won't work since I'm using BB Code [table] mod. It is a table.

I want to have a different Announcement or Sticky on each thread. So when someone opens a thread, they will see the Announcement or Sticky open at the top of the thread.

--------------- Added [DATE]1228590163[/DATE] at [TIME]1228590163[/TIME] ---------------

I want to have a different Announcement or Sticky on each thread "open". So when someone opens a thread, they will see the Announcement or Sticky open at the top of the thread.

There has to be a way!!

I tried the "Notices" option, but table code is not as flexible as BB Code [table]!!

Lynne 12-07-2008 06:04 PM

Create a new phrase..... I'll call it 'new_phrase', and put your message in there using valid html

At the top of the SHOWTHREAD template where you want the message to appear, put in:

HTML Code:

<if condition="in_array($forum[forumid], array(x,y,z))">
<!-- message shown if you are in forumid x,y,or z -->
 $vbphrase['new_phrase]
</if>


Ghost Shadow 12-07-2008 06:20 PM

I don't think this will work since I have 12 Threads and I want a different message on top of each Thread.

ssslippy 12-07-2008 06:44 PM

ok what page exactly are u talking about here, can u give us a link to what page u want to show this on?

You keep saying thread, but then that would be the first post in a thread.

Ghost Shadow 12-07-2008 07:01 PM

Quote:

Originally Posted by ssslippy (Post 1680439)
ok what page exactly are u talking about here, can u give us a link to what page u want to show this on?

You keep saying thread, but then that would be the first post in a thread.

OK...
Threads:
http://www.warfaith.com/forumdisplay.php?f=1

Top Thread:
http://www.warfaith.com/forumdisplay.php?f=2

What I want open on top of the Thread (Sticky):
http://www.warfaith.com/showthread.php?t=2

or

What I want open on top of the Thread (Announcement):
http://www.warfaith.com/announcement.php?f=2

On each Thread I want a different message. If you look at each of the Threads, you will notice a Sticky and Announcement, each different; that's what I want to appear open on each Thread.

Thanks.

Lynne 12-07-2008 07:02 PM

Be creative.

HTML Code:

<if condition="in_array($forum[forumid], array(x,y,z))">
<if condition="$threadid=='xxxxx'">
html message here or contents from post maybe - could require plugin
</if>
<if condition="$threadid=='yyyyyy'">
html message here
</if>
<if condition="$threadid=='zzzzzz'">
html message here
</if>
etc.

</if>


Ghost Shadow 12-08-2008 01:29 AM

Do I still create a new phrase...where does the "if" statement go?

Thanks.

Lynne 12-08-2008 03:03 AM

I just suggested a phrase cuz it's easy and looks cleaner to me in the template. You don't have to do it that way. There are a ton of different ways you could do it - you could even use templates. If I were to do it, I'd use a plugin. I'd have the condition, and based on which thread it is, I'd do a query and grab the first post in the Sticky thread that you want at the top of the thread and then spit it out. I don't know how comfortable you are coding, but that is a nice clean, simple way to do it. The easy way if you don't want to code is to do what I suggested and just write that condition at the top of the SHOWTHREAD template where you want the message/announcement to appear. You probably don't need the first condition regarding the forumid, you just need the condition regarding the thread id. So, you check to see if it's thread id xxxx, and if so, you spit out 'whatever'. If this were me putting the message at the top of the page, I'd put it either right above or right below the $poll.

Ghost Shadow 12-08-2008 03:54 AM

1. Getting this error when placing above $poll.
The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected ']' in /home/jlee1958/public_html/includes/adminfunctions_template.php(3772) : eval()'d code on line 26

2. Correct santax would be?
<if condition="$threadid]=='2'">

Thank you.

cono1717 12-08-2008 12:08 PM

I am not too sure about this as I am not a expert with this but wouldn't it be.
<if condition="[$threadid]=='2'"> ? Again I am not too sure though.

Lynne 12-08-2008 02:41 PM

Quote:

Originally Posted by Ghost Shadow (Post 1680706)
1. Getting this error when placing above $poll.
The following error occurred when attempting to evaluate this template:

Parse error: syntax error, unexpected ']' in /home/jlee1958/public_html/includes/adminfunctions_template.php(3772) : eval()'d code on line 26

2. Correct santax would be?
<if condition="$threadid]=='2'">


Thank you.

I mistyped the second line. It should just be:

HTML Code:

<if condition="$threadid=='2'">

Ghost Shadow 12-08-2008 11:41 PM

I put this bellow $poll to just test things and nothing happened when I went into the Thread.

Code:

<if condition="in_array($forum[forumid], array(x,y,z))">
<if condition="$threadid=='2'">
html message here or contents from post maybe - could require plugin
</if>
<if condition="$threadid=='yyyyyy'">
html message here
</if>
<if condition="$threadid=='zzzzzz'">
html message here
</if>
etc.

</if>

Thank you for helping and being patient with me.

Lynne 12-09-2008 12:05 AM

Remove the part about the forumid (especially since you didn't replace x, y, z with any forumids). So:
HTML Code:

<if condition="$threadid=='2'">
html message here or contents from post maybe - could require plugin
</if>
<if condition="$threadid=='yyyyyy'">
html message here
</if>
<if condition="$threadid=='zzzzzz'">
html message here
</if>
etc.

Also, make sure you replace yyyyy and zzzzz with actual thread ids.

Ghost Shadow 12-09-2008 03:30 AM

OK, below is what I placed below $poll in the Styles SHOWTHREAD:


Code:

<if condition="$threadid=='2'">
Testing 2
</if>
<if condition="$threadid=='7'">
Testing 3
</if>
<if condition="$threadid=='8'">
Testing 8
</if>

Still nothing shows in the 2, 7 and 8t Thread.

Lynne 12-09-2008 03:34 AM

You have threads numbered 2, 7, and 8? Perhaps a link to one of these threads would help.

You could try replacing $threadid with $thread['threadid'] and see if that works. And you didn't place this inside the condition that is right below the poll, right? If what you really mean is forum 2 and forum 7, then you need to replace $threadid with $thread[forumid].

Ghost Shadow 12-09-2008 03:52 AM

Quote:

Originally Posted by Lynne (Post 1681404)
You have threads numbered 2, 7, and 8? Perhaps a link to one of these threads would help.

You could try replacing $threadid with $thread['threadid'] and see if that works. And you didn't place this inside the condition that is right below the poll, right? If what you really mean is forum 2 and forum 7, then you need to replace $threadid with $thread[forumid].

Did not work.

http://www.warfaith.com/forumdisplay.php?f=2

Code:

</head>
<body onload="$onload">
$header
$navbar


$poll

<if condition="$threadid=='2'">
Testing 2
</if>
<if condition="$threadid=='7'">
Testing 3
</if>
<if condition="$threadid=='8'">
Testing 8
</if>


<if condition="$show['inlinemod']">
$spacer_close
<form action="inlinemod.php?threadid=$threadinfo[threadid]&amp;p=$postid" method="post" id="inlinemodform">
$spacer_open
</if>

<a name="poststop" id="poststop"></a>


Lynne 12-09-2008 03:54 AM

That is forumid 2, not threadid 2. As I said, if you are using forumids, then you need to use $thread[forumid] instead of $threadid.

HTML Code:

<if condition="$thread[forumid]=='2'">
Testing 2
</if>
<if condition="$thread[forumid]=='7'">
Testing 3
</if>
<if condition="$thread[forumid]=='8'">
Testing 8
</if>


Ghost Shadow 12-09-2008 05:09 AM

Still not working....

Style Manager
Default Style
Edit Templates
Show Thread Templates
SHOWTHREAD


Code:

$header
$navbar

<if condition="$thread[forumid]=='2'">
Testing 2
</if>
<if condition="$thread[forumid]=='7'">
Testing 3
</if>
<if condition="$thread[forumid]=='8'">
Testing 8
</if>


$poll

<if condition="$show['inlinemod']">


Lynne 12-09-2008 03:22 PM

You could try $forum[forumid] instead of $thread[forumid]. I just looked at my SHOWTHREAD template and I use $forum[forumid] in a condition for a couple of my forums, so I know that works.

Ghost Shadow 12-09-2008 04:24 PM

Still not working!!
Do I need to do anything elsewhere to make it work?
Is the location correct where I placed it, inserted it?
Can you please post your "condition" with the top and bottom line where it was inserted?

Thanks!!

Lynne 12-09-2008 04:55 PM

1 Attachment(s)
Are you sure you are changing the template for the correct style you are using? Put an X above it so you can see that it is there:

HTML Code:

$header
$navbar

<if condition="$forum[forumid]=='2'">
Testing 2
</if>
<if condition="$forum[forumid]=='7'">
Testing 3
</if>
<if condition="$forum[forumid]=='8'">
Testing 8
</if>


$poll
<if condition="$show['inlinemod']">

I just put that exact condition in the template on my website, only with forumid 12 instead of 2 (I don't have a forumid 2) and it worked just fine. It also worked fine with $thread[forumid] and with $forumid.

Attachment 90358

Ghost Shadow 12-10-2008 12:44 AM

My BAD...it is working but in the wrong area, that is why I could never see it.

It is showing up when you open a post, but I need it when you open a thread; back one page. Is it possible??

Followup:
Looks like it's not going to do what I need to do anyway. I have a table code that appears to only work in Posts, Announcement, and Sticky. BB Code [table] does not work with the above method.

https://vborg.vbsupport.ru/showthrea...57#post1467357

Lynne 12-10-2008 04:01 AM

I think a problem we are having here is terminology. A thread is made up of lots of posts. A thread is like what we are in right now - it is on the page showthread.php. Perhaps you are talking about the forumdisplay page which is a page that lists the child forums and the thread titles of the threads in that forum - like this page https://vborg.vbsupport.ru/forumdisplay.php?f=111

You could do something like we were discussing here for on the top of the FORUMDISPLAY page if you wanted.

Ghost Shadow 12-10-2008 04:31 AM

Lynne: Correct!! That is the location I want it to appear, the forumdisplay page!!!

Now I face a problem. Posts, Announcement, and Stickys appears to be the only means that BB Code [table] works in. If I wanted to use Notices or if statements, then BB Code [table] code would not work. Since I have it perfectly done in BB Code [table], and am not able to duplicate it using regular html table code.

Example of BB Code [table] code:
Code:

[table="width=100%"]SACRED TEXTS: Tripitaka: 'The Baskets' canon of Buddhist literature; discourses of the Buddha and/or his desciples.|GODHEAD: No omnipotent creator God. Many God-like beings subject to the law of rebirth (Dharma).|COSMOLOGY: Cyclical, endless becoming & dissolving. No point of creation.|ON TIME: Cyclical & not Important as cycle at rebirth continues forever.|ON THE NATURE OF THE SOUL: Life continues after death In another form. The cycle of birth / death can only be broken by achieving Enlightenment.[/table]
If you paste this code into a post, sticky or anouncement and you have BB Code [table] hack; it will look perfect, use it anywhere else, such as Notice or IF statement and it will not work.
Example of one of the tables coded in BB Code [table]:
https://vborg.vbsupport.ru/external/2008/12/1.bmp

Lynne 12-10-2008 02:49 PM

Just copy the html from your page source.

Ghost Shadow 12-10-2008 03:55 PM

Quote:

Originally Posted by Lynne (Post 1682455)
Just copy the html from your page source.


IT WORKED!!!!!!!!!!! FINALLY!!!
THANK YOU..THANK YOU.....THANK YOU Lynne!!!!!!!!

Three final questions:

1. How do I get it to show up on forumdisplay page now, one page up from here?
2. How do I put a quarter inch space between the bottom of the table and the "Closed" icon?
3. Can I reduce the space a bit at the top?

https://vborg.vbsupport.ru/external/2008/12/77.jpg

Lynne 12-10-2008 04:13 PM

This is what I'd do.....

put in a template_hook in FORUMDISPLAY where you want this stuff to appear:
HTML Code:

$template_hook[forumdisplay_notice]
Then, create a plugin using the 'forumdisplay_start' hook location:
PHP Code:

if ($forumid == '2') {
eval(
'$template_hook[forumdisplay_notice] .= "<table><tr><td>Your HTML here - remember if you have link you need to escape it <a href=\"yourlink.php\">Your Link</a></td></tr></table>";');
}
if (
$forumid == '7') {
eval(
'$template_hook[forumdisplay_notice] .= "<table><tr><td>Your HTML here - remember if you have link you need to escape it <a href=\"yourlink.php\">Your Link</a></td></tr></table>";');
}
if (
$forumid == '8') {
eval(
'$template_hook[forumdisplay_notice] .= "<table><tr><td>Your HTML here - remember if you have link you need to escape it <a href=\"yourlink.php\">Your Link</a></td></tr></table>";');



You'll need to pretty that up, but that is how I'd go about it. Actually, if you wanted to do it prettier, your eval a template, but you can go look into that in the articles forum (read up on hooks).

I tested that exact code, only with forumids I use, and it works (but I'd change it to look nicer).

Ghost Shadow 12-10-2008 05:52 PM

Ohh no buddy, just when I thought It was safe to go back into the water, now I see sharks all around me again.

I thought it was just a matter of changing a word or two in the "if" statement, and it would appear on forumdisplay page.

I'll tackle your sugestion in a few hours.

After I do as you recommended, do I still "copy the html from your page source" as before and place it between the "if" statements?

Really Lynne, thanks so much for your help. This forum means the world to me, and I want it close to perfect when it goes live.

Lynne 12-10-2008 06:11 PM

You can do it with just the template. It's just cleaner the other way. If you want to do it with the template then do what I posted here - https://vborg.vbsupport.ru/showpost....8&postcount=24 only do it to the FORUMDISPLAY template. (Put it right after $navbar like on there if that's where you want it).

Ghost Shadow 12-10-2008 07:24 PM

At this point I just want the simplest road as possible, later I can play around, learn and fine tune things.

I did as you suggested, simple route, copied the "if" statement from SHOWTHREAD (where it was working perfectly) and posted it in FORUMDISPLAY, below $navbar.

Nothing shows up.

Do i need to change anything here? <if condition="$thread[forumid]=='2'">

Lynne 12-10-2008 08:42 PM

In the post above yours, I said to use the condition posted in post 24 or this thread where I use $forum[forumid], not $thread[forumid]. You are not *in* a thread, therefore you do not have the variable $thread available to use.

Ghost Shadow 12-10-2008 09:00 PM

After I post last post I made that change:
Code:

<if condition="$forum[forumid]=='2'">
Does not work? id# should be the same, right?

Code:

$navbar

<if condition="$forum[forumid]=='2'">
<!-- message -->
                <div id="post_message_2">
                       
                        <div align="center"><br />
</div><table class="stg_table tborder" style="width:100%; "><tbody><tr class="alt2"><td><img src="http://www.warfaith.com/images/postimages/Bud1.jpg" border="0" alt="" /></td><td><font size="1">The <b>&quot;Dharma Wheel&quot;</b>, symbolizes Buddhist law, endless cycles of birth &amp; rebirth. Eight spokes represent the <b>&quot;Eightfold path&quot;</b> to enlightenment..</td><td><font face="Verdana"><font size="1"><b><font color="SeaGreen">BUDDHISM</font> </b>- Founded in North India by Siddhartha Gautama, the Buddha (Enlightened One) in about 500 BCE. The teaching spread to Sri Lanka, Thailand, Tibet, Chino &amp; Japan. Buddhist belief is based on the Four Noble Truths: 1.All forms of life is suffering. 2.All became the Buddha. Once desire &amp; attachment suffering is caused by desire. 3.The cure to is overcome, Enlightenment is possible, i.e. desire is the overcoming of desire. 4.Desire can be cured by following the Eightfold Path.The Eightfold Path to liberation involves:Perfect Wisdom; Perfect Altitude; Perfect Speech; Perfect Action; Perfect Livelihood; Perfect Effort; Perfect awareness and Perfectabsorption. Meditation is the key to indcleansing &amp; thought clarity.</font></font></td></tr><tr class="alt1"><td></font><img src="http://www.warfaith.com/images/postimages/Bud2.jpg" border="0" alt="" /></td><td><font size="1"><font color="DarkGreen"><b>NUMBERS</b></font> <font color="Red">311 million</font><b>                                                                                                            <font color="DarkGreen">BRANCHES</font></b> <b>Lesser Vehicle:</b> <font color="Red">(Hinayana): conservative.</font> <b>Greater Vehicle:</b> <font color="Red">(Mahayana): liberal.<font color="Black"></td><td></font> <font face="Verdana"><font size="1"><b><font color="Black"><font color="SeaGreen">COSMOLOGY BIOGRAPHY</font> </font></b><font color="Black">- Siddhartha Gautama was born (ca) 566 BCE. Married at the age of 16. Al age 29, after the birth of a son, he left his family. He entered a state of homelessness. Joined various teachers and spent 7 years in ascetic seclusion. At the age of 35, he realised 'Enlightenment' &amp; became the Buddha. Once desire &amp; attachment is overcome, Enlightenment is possible, i.e escape from the death-birth cycle. He </font></font></font></font><font face="Verdana"><font size="1">remained an itinerant teacher until his death at the gas of 80.</font></font></font> </td></tr></tbody></table><!-- table generated by StG's vB Code [table] v.0.1.7.1 (stable) o.127 --><br />

<table class="stg_table tborder" style="width:100%; "><tbody><tr class="alt2"><td><font size="1"><font color="Magenta"><b>SACRED TEXTS:</b></font> Tripitaka: 'The Baskets' canon of Buddhist literature; discourses of the Buddha and/or his desciples.</font></td><td><font size="1"><font color="Magenta"><b>GODHEAD:</b></font> No omnipotent creator God. Many God-like beings subject to the law of rebirth (Dharma).</font></td><td><font color="Magenta"><b><font size="1">COSMOLOGY:</font></b></font> <font face="Verdana"><font size="1">Cyclical, endless becoming &amp; dissolving. No point of creation.</font></font></td><td><font color="Magenta"><b><font face="Verdana"><font size="1">ON TIME:</font></font></b></font><font face="Verdana"><font size="1"> Cyclical &amp; not Important as cycle at rebirth continues forever.</font></font></td><td><font size="1"><font color="Magenta"><b>ON THE NATURE OF THE SOUL:</b></font> Life continues after death In another form. The cycle of birth / death can only be broken by achieving Enlightenment.</font></td></tr></tbody></table><!-- table generated by StG's vB Code [table] v.0.1.7.1 (stable) o.127 -->

                </div>
                <!-- / message -->
</if>
<if condition="$forum[forumid]=='7'">
Testing 3
</if>
<if condition="$forum[forumid]=='8'">
Testing 8
</if>


<if condition="$show['forumslist']">


Lynne 12-10-2008 09:06 PM

Did you try it as you originally had it with Testing 2 showing up? What was the result with that?

Ghost Shadow 12-10-2008 09:19 PM

Quote:

Originally Posted by Lynne (Post 1682725)
Did you try it as you originally had it with Testing 2 showing up? What was the result with that?

Yes, doesn't work:
Code:

$navbar

<if condition="$forum[forumid]=='2'">
Testing 2
</if>
<if condition="$forum[forumid]=='7'">
Testing 3
</if>
<if condition="$forum[forumid]=='8'">
Testing 8
</if>



<if condition="$show['forumslist']">


Lynne 12-10-2008 09:28 PM

Use $foruminfo[forumid] or $forumid instead of $forum[forumid]

Ghost Shadow 12-10-2008 09:40 PM

BINGO....$foruminfo[forumid] DID IT...PERFECT...I learned so much from your patience in helping me.

Thanks so much Lynne for sticking with it till the end. Thank You!!! :):D:up:

https://vborg.vbsupport.ru/external/2008/12/76.jpg

RESOLVED!!:up:

Lynne 12-10-2008 09:41 PM

All right - Looks good!


All times are GMT. The time now is 08:06 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.01655 seconds
  • Memory Usage 1,869KB
  • 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
  • (8)bbcode_code_printable
  • (7)bbcode_html_printable
  • (1)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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