UnderwareDESIGN

General => General Support => Topic started by: kevin on September 02, 2012, 03:50:52 PM

Title: Forum Custom Tags / Forum Questions
Post by: kevin on September 02, 2012, 03:50:52 PM


Forum Custom Tags / Forum Questions




Q: How Do I Post PlayBASIC Source Code Snippets With Syntax Highlighting ?


        Answer:    PlayBASIC programmers can post source code snippets using the PBCODE keyword in squared bracket form.     The syntax highlighting parser supports  comments (single/multi line), most operators, constants, commands/functions  etc   Making it  mostly inline with the PlayBASIC IDE.    The keywords list was defined from the PlayBASIC V1.64N3.

 
      To insert a highlighted code, the forum parser expects the source code fragment to be between a pair of  [**pbcode]  and [/pbcode]  tags  (remove the **)

    eg.  So this,

   [**pbcode]

Do
   Cls
   print "Hello World"

   Sync
Loop

   [/pbcode]


   would become this, we when remove ** from the opening tag

   [pbcode]
Do
   Cls
   print "Hello World"

   Sync
Loop
   [/pbcode]



    Well,  as you can no doubt now see, the syntax highlighter tags for PB code fragments have been added.   There's a few issues with it, mostly due to the SMF pre-parsing the post before the parser gets a go at it.  But ya get that.




Q: How Do I Post Youtube or Vimeo Videos ?


        Answer:    The forum only supports (simple) embedding of Youtube and Vimeo videos at this time.  Therefore it's unable to automatically parse urls from those sites to embed the video, rather the user is required to wrap the video ID between square bracket tags.  

        YouTube Example

         In youtube links, the  video ID  is the characters between "v=" and the "&" character.   So in the link bellow the id for this video would be hoxwn_G-TTI

         http://www.youtube.com/watch?v=hoxwn_G-TTI&feature=player_embedded (http://www.youtube.com/watch?v=hoxwn_G-TTI&feature=player_embedded)  

         To embed this video, we wrap square bracket youtube tags around the id ie [**youtube]hoxwn_G-TTI[/youtube]    - Note, I've inserted the ** characters into the first tag just so we can see it the link in the post, when we remove those characters, forum will parse the tags and show the video like this.

         


         

        Viemo Example

         In viemo links, the  video ID  is the characters following the  "/" and the between any following  "&" characters.   So in the link bellow, the id for this video would be 43676648

         http://vimeo.com/43676648 (http://vimeo.com/43676648)


         To embed this video, we wrap square bracket vimeo tags around the id ie [**vimeo]43676648[/vimeo]    - Note, I've inserted the ** characters into the first tag just so we can see it the link in the post, when we remove those characters, forum will parse the tags and show the video like this.

         [vimeo]43676648[/vimeo]





Q: Why don't the custom tags appear in previews of posts ?


         Answer:   This occurs as by product of how the custom tags are embedded into the forum template, because they'll only work when viewing a post, not in previews.