vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Programming Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=188)
-   -   [TIP] Leave Comments (https://vborg.vbsupport.ru/showthread.php?t=84994)

Sephiroth32 10-14-2002 10:00 PM

[TIP] Leave Comments
 
This isnt a very in depth thing but some people never seem to think about thr wonderul <!-- --> tag.

You should always leave comments in your code when creating complex tables and templets. lets take the welcome pannel for instance.
This mod has one big table then one row, then a 3 cells with tables rows and cells inside them and some with tables rows and cells inside the tables inside the cell with tables rows and cells.
confusing eh?

well if you leave comments you can look for them and instantly know exactly where you are.
so we can turn something like this:
Code:

<table border="0" cellpadding="2" cellspacing="1" bgcolor="#000000">
 <tr bgcolor="#0055CC">
  <td colspan="3">
  <normalfont>Welcome to {boardtitle}!
  </td>
 </tr>
 <tr>
  <td bgcolor="#DDDDDD">
  <smallfont>Avater:
    <table>
    <tr>
      <td> 
      <br><img src="avater.gif">
      </td>
      </tr>
    </table>
  </td>
  </tr>
</table>

(left out most of the pannle caouse i was pressed for time)

into this:
Code:

<!-- Start main table -->
<table border="0" cellpadding="2" cellspacing="1" bgcolor="#000000">

<!-- catagory like row/cell -->
 <tr bgcolor="#0055CC">
  <td colspan="3">
  <normalfont>Welcome to {boardtitle}!
  </td>
 </tr>

<!-- main row with the three main cells -->
 <tr>
<!-- avater cell -->
  <td bgcolor="#DDDDDD">
  <smallfont>Avater:

<!-- avater table -->
    <table>
    <tr>
      <td> 
      <br><img src="avater.gif">
      </td>
      </tr>
    </table>

<!-- end avatar cell -->
  </td>
<!-- end main row -->
  </tr>
<!-- end main table -->
</table>

see wasnt that less confusing?

anyway thats my tip. enjoy :)

Tony G 10-15-2002 05:28 AM

Nice tip, it can be useful for finding code for a specific part of your design. :)

Phate 11-01-2002 11:46 PM

yup yup


All times are GMT. The time now is 02:33 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01212 seconds
  • Memory Usage 1,713KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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