my_table_$post[postid] ?????

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gomjaba
    Senior Member
    • Jan 2005
    • 970
    • 3.5.x

    my_table_$post[postid] ?????

    Using THIS Post from Jake Bunce, I am trying to use this code to put into the postbit_legacy on vb 3.5.2

    The code stated :

    Code:
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <thead>
    	<tr>
    		<td class="tcat">
    			<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('my_table')"><img id="collapseimg_my_table" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_my_table].gif" alt="" border="0" /></a>
    			TABLE TITLE
    		</td>
    	</tr>
    </thead>
    <tbody id="collapseobj_my_table" style="$vbcollapse[collapseobj_my_table]">
    	<tr>
    		<td class="alt1">
    			STUFF THAT IS HIDDEN WHEN THE TABLE IS COLLAPSED
    		</td>
    	</tr>
    </tbody>
    </table>
    Since it is a postbit we supposed to use my_table_$post[postid] I tried to swap my_table with my_table_$post[postid] but I cannot even save the template since it gives me a lot of errors .. Could someone please help me there ?

    So what happens basicially in postbit when clicking the image to collapse, it collapses the first postbit only and not the actuall table I am trying to collapse ..
    Last edited by Gomjaba; Fri 16 Dec '05, 7:45am.
    I'm not under the alkafluence of inkahol like some thinkle peep I am!
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    See the second post from that thread. Use this code which follows the template code from the last code block in the second post. I have added in the $post[postid] variable so this code will work in the postbit template as is:

    Code:
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <thead>
    	<tr>
    		<td class="[color=green]tcat[/color]">
    			[color=blue]<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('[color=red]my_table_$post[postid][/color]')"><img id="collapseimg_[color=red]my_table_$post[postid][/color]" src="$stylevar[imgdir_button]/collapse_[color=green]tcat[/color][color=brown]{[/color]$[color=brown]GLOBALS['[/color]vbcollapse[color=brown]'][/color][[color=brown]'[/color]collapseimg_[color=red]my_table_[color=brown]' .[/color] $post[postid][/color]][color=brown]}[/color].gif" alt="" border="0" /></a>[/color]
    			TABLE TITLE
    		</td>
    	</tr>
    </thead>
    <tbody [color=purple]id="collapseobj_[color=red]my_table_$post[postid][/color]" style="[color=brown]{[/color]$[color=brown]GLOBALS['[/color]vbcollapse[color=brown]'][/color][[color=brown]'[/color]collapseobj_[color=red]my_table_[color=brown]' .[/color] $post[postid][/color]][color=brown]}[/color]"[/color]>
    	<tr>
    		<td class="alt1">
    			STUFF THAT IS HIDDEN WHEN THE TABLE IS COLLAPSED
    		</td>
    	</tr>
    </tbody>
    </table>

    Comment

    • Gomjaba
      Senior Member
      • Jan 2005
      • 970
      • 3.5.x

      #3
      THANKS Works like a charm. I did see your 2nd post, but I did not understand, either because of PHP knowledge or simply language wise

      One question though , how can I have it either collapsed or expanded on default ?
      I'm not under the alkafluence of inkahol like some thinkle peep I am!

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        They are expanded by default because the user does not have a cookie entry for the new table. The only way I know to make them collapsed by default requires giving up the ability of the table to remember its state across multiple page loads.

        Replace this code:

        Code:
        <tbody [color=purple]id="collapseobj_[color=red]my_table_$post[postid][/color]" style="[color=brown]{[/color]$[color=brown]GLOBALS['[/color]vbcollapse[color=brown]'][/color][[color=brown]'[/color]collapseobj_[color=red]my_table_[color=brown]' .[/color] $post[postid][/color]][color=brown]}[/color]"[/color]>
        ...with this code:

        Code:
        <tbody [color=purple]id="collapseobj_[color=red]my_table_$post[postid][/color]" style="display: none;"[/color]>
        Now it will always be collapsed by default. It will reset to collapsed when the page is refreshed even if the user expanded it previously.

        Comment

        • Gomjaba
          Senior Member
          • Jan 2005
          • 970
          • 3.5.x

          #5
          THANK you very much
          I'm not under the alkafluence of inkahol like some thinkle peep I am!

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎