GIDForums  

Go Back   GIDForums > Site Info and Feedback > GIDNetwork™ > GIDForums™
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 01-Nov-2003, 01:41
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

Upgrade of BBCode class sometime today


As you know, most of the custom BBCodes we use here are managed by a single BBCode class, as I mentioned, these used to ONLY handle custom BBCodes such as HTML, C++ and CSS.

Since using Mozilla Firebird, viewing PHP codes here have become unbearable for me personally since the existing vB script handling of PHP bbcode somehow adds an extra new line after each line of PHP code which messes up everything.

I have re-done the BBcodes class here to include PHP bbcodes as well but I am also planning to scrap existing code to handle C/C++ bbcodes until I have a chance to sit down and really do it all over again...

If you see the board down for a bit, you'll know why...
  #2  
Old 01-Nov-2003, 05:20
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough

update


It looks like I am unable to upload any changes today - on my way out!

Anyway, so far, my localhost tests reveal really pretty colours for supported code bbcodes.

Just another few hours of checking and I am sure I'll be making the changes - so expect something different tomorrow!
  #3  
Old 02-Nov-2003, 00:44
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 783
admin will become famous soon enough

PHP / HTML / CSS / CODE BBCode upgrade complete


Note the new colours and layout for the following codes:

Sample: XHTML / HTML
HTML Code:
<body> <table style="width:760px; margin:auto;"> <!-- row and cells --> </table> </body>

Sample: CSS
CSS Code:
/*  this is a multi-line comment
    nothing here; just comments
    */
a {  
  color: #3366CC;  
  text-decoration: none
}
body {  
  background-color: #DCDCDC;
  font-family: "Times New Roman", Times, serif;  
  font-size: 1em;  
  line-height: 2em;  
  color: #336699;
  margin-top: 0.1em;
  margin-right: 0.1em;
  margin-bottom: 0.1em;
  margin-left: 0.1em
  }

Sample: PHP
PHP Code:

<?php
// FILENAME: FUNCTIONS.INC.PHP

define( 'NL', "\r\n" );
define( 'MAGIC_QUOTES_GPC', get_magic_quotes_gpc() );


function get_previous_form_values()
{
  $tmp = array();
  $stripped = '';
  $args = func_get_args();
  foreach( $args as $arg )
  {
    $stripped = stripInputData( $_POST[ $arg ] );
    $tmp[ $arg ] = htmlentities( $stripped, ENT_QUOTES );
  }
  unset( $args, $stripped );
  return $tmp;
} 
?>


Sample: CODE
Code:
<?php // FILENAME: FUNCTIONS.INC.PHP define( 'NL', "\r\n" ); define( 'MAGIC_QUOTES_GPC', get_magic_quotes_gpc() ); function get_previous_form_values() { $tmp = array(); $stripped = ''; $args = func_get_args(); foreach( $args as $arg ) { $stripped = stripInputData( $_POST[ $arg ] ); $tmp[ $arg ] = htmlentities( $stripped, ENT_QUOTES ); } unset( $args, $stripped ); return $tmp; } ?>

Looks like there are still a few bugs to iron out but these are just cosmetics... when the time is right I will work on upgrading the C++ bbcode next. This one will be a complete re-write though!
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #4  
Old 03-Nov-2003, 05:41
admin's Avatar
admin admin is offline
Administrator
 
Join Date: Sep 2002
Posts: 783
admin will become famous soon enough

C / C++ bbcode upgraded!


After what seems like months of experimenting with numerous ideas and regular expressions (yuck!), I think I finalled got the C / C++ bbcodes here on GIDForums™ working well...!

Here's the new look:

Sample: C / C++
CPP / C++ / C Code:
// Hey emacs, this is a -*- C++ -*- file
#ifndef _STACK_H
#define _STACK_H

#include <stdexcept>
using namespace std;

template <typename T, int max> class Stack {
public:
    // C'Tor for empty stacks
    Stack() throw() {
        top = 0;
    }

    // Add t to the top of the stack
    void push(T t) {
        if(isfull())
            throw overflow_error("Stack overflow!");
        contents[top++] = t;
    }

    // Remove and return the top of the stack
    T pop(){
        if(isempty())
            throw underflow_error("Stack underflow!");
        return contents[--top];
    }
    
    // Will push() succeed?
    bool isfull(){
        return top>= max;
    }

    // Will pop() succeed?
    bool isempty(){
        return top==0;
    }
private:
    int top;
    T contents[max];
    
};
__________________
Custom BB codes you can use here:
[HTML] | [C++] | [CSS] | [JAVA] | [PY] | [VB]
  #5  
Old 03-Nov-2003, 08:18
BobbyDouglas's Avatar
BobbyDouglas BobbyDouglas is offline
Regular Member
 
Join Date: Aug 2003
Posts: 789
BobbyDouglas has a spectacular aura aboutBobbyDouglas has a spectacular aura about
Pretty cool i gotta say
__________________
Mr. Bob's Web Design - Tirelessly looking for ways to enhance the customer base of your business.
 
 

Recent GIDBlogUS Elections and the ?Voter?s Responsibility? by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
GIDForums enables New [C] / [C++] bbcode. admin C++ Forum 20 25-Aug-2008 06:48
problem with creating class mohammed C++ Forum 1 11-Oct-2003 10:04
need help to define a class in C++ yannoush C++ Forum 7 09-Sep-2003 01:28
Php bbcode issue Caged MySQL / PHP Forum 3 06-Aug-2003 19:55

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:18.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.