The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Java Problem
I am trying to create an extra info click point on each thread within the threadbit using javascript.
So under every thread title there will be a clickable 'Extra Info' ie. The Title of my Thread Extra Info The extra info is called from another template, the code i am using does work but only for the first thread. How can i get this to work with all threads? PHP Code:
|
#2
|
||||
|
||||
What does your threadbit code look like? You probably need a unique id for each thread and it doesn't look like you have one in the code posted.
BTW, java is NOT javascript. They are two very different languages. You are posting javascript, not java. |
#3
|
|||
|
|||
Just aswell you knew what i meant
HTML Code:
<script language="JavaScript"> function expand(param) { param.style.display=(param.style.display=="none")?"":"none"; } </script> <tr> <td class="$bgclass" id="td_threadstatusicon_$thread[realthreadid]"> $thread[openclose_editable] <img src="$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" id="thread_statusicon_$thread[realthreadid]" alt="<if condition="$show['threadcount']"><phrase 1="$thread[dot_count]" 2="$thread[dot_lastpost]">$vbphrase[have_x_posts_in_thread_last_y]</phrase></if>" border="" /> </td> <td valign="middle" class="$bgclass" id="td_threadtitle_$thread[realthreadid]" title="$thread[preview]"> $thread[title_editable] <div> <h3 style="margin-bottom: 0px; margin-top: 0px;"> <a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]"<if condition="$show['gotonewpost']"> style="font-weight:bold"</if> >$thread[threadtitle]</a> <!-- <br /><a href="javascript:expand(document.getElementById('div1'))">Extra Info</a> <div class="dottedBorders" id="div1" width="300px" style="display:none"> <span class="normal">$extrainfo </span> </div> --> <if condition="$thread['pagenav']">$stylevar[dirmark]<span class="smallfont" style="white-space:nowrap">(<img class="inlineimg" src="$stylevar[imgdir_misc]/multipage.gif" alt="$vbphrase[multipage_thread]" border="0" /> $thread[pagenav]<if condition="$show[pagenavmore]"> ... <a href="showthread.php?$session[sessionurl]t=$thread[threadid]&page=$thread[totalpages]$thread[highlight]">$vbphrase[last_page]</a></if>)</span></if></h3> </div> <if condition="$show['unsubscribe']"> <div class="smallfont"> <a href="newreply.php?$session[sessionurl]do=newreply&t=$thread[threadid]" rel="nofollow">$vbphrase[reply]</a> | <a href="subscription.php?$session[sessionurl]do=removesubscription&return=ucp&t=$thread[threadid]" rel="nofollow">$vbphrase[unsubscribe]</a> </div><br /> </if> <if condition="$show['inlinemod']"> <td class="<if condition="$show['forumlink']">alt2<else />alt1</if>"> <input type="checkbox" name="tlist[$thread[realthreadid]]" id="tlist_$thread[realthreadid]" value="$thread[checkbox_value]" <if condition="$show['disabled']">disabled="disabled"</if> /> </td> </if> </tr> |
#4
|
||||
|
||||
Again, you aren't passing a unique variable. These needs to be unique (ids MUST be unique):
HTML Code:
expand(document.getElementById('div1')) ... id="div1" (Someone else should actual help with this as I am no javascript expert at all.) |
#5
|
|||
|
|||
You are having the same issue I ran into when I was echoing out mootools dropdown menus for refbacks
Lynne hit the nail on the head, you MUST have unique IDs. So you need to set things up in an array, then to echo out the ID. So you want it to increase by one number or so fourth. If you Google it you will find tons of documents and whatnot on how to customize your javascript and add the PHP. |
#6
|
||||
|
||||
The thread id is unique. So, if you could incorporate that into the id, then you will have a unique id.
|
#7
|
|||
|
|||
I did it earlier today, just by trial and error. i just replaced div1 with $thread[threadid] and guess what,.. it worked!
Dont know if there is a better way of doing what im doing but hey it works. |
#8
|
|||
|
|||
Ok, now that i have that sorted is there a way of closing one box when another opens?
|
#9
|
|||
|
|||
Try reviewing :
http://www.infoentropy.com/mochikit_...ck_outside_box |
#10
|
|||
|
|||
Thanks, i'll take a look but i shouldnt have used the word 'box' as it doesnt open a box it just reveals what has been hidden. I still may get some pointers though.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|