// html gen by eric marcarelli #include #include #include #include #include #include char guy = 2; // 1000 char heart = 3; // 1002 char dymin = 4; // 1003 char clover = 5; // 1004 char spade = 6; // 1005 char fsign = 11; // 1006 char msign = 12; // 1007 char music = 14; // 1008 char sun = 15; // 1009 char leftarrow = 16; // 1010 char rightarrow = 17; // 1011 char updownarrows = 18; // 1012 char platform = 22; // 1013 char g1 = 176; // 1014 char g2 = 177; // 1015 char wall = 178; // 1016 char vline = 179; // 1017 char hline = 196; // 1018 char dhline = 205; // 1019 char block = 219; // 1020 char circle = 249; // 1021 char square = 254; // 1022 char otherguy = 1; // 1023 void DrawHLine(); void DrawDHLine(); int Rnum(int,int); void gotoxy(int,int); void error(); void simplepg(); void fullpg(); void texteditor(); void navbar(); void help(); void about(); char body[1000000]; int tt; void gotoxy(int x, int y) { COORD coord; coord.X = x; coord.Y = y; SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord); } void DrawHLine() { int t = 80; while (t > 0) { cout << hline; t--; } } void DrawDHLine() { int t = 80; while (t > 0) { cout << dhline; t--; } } void DrawVLine() { int t = 23; while (t > 0) { cout << vline; cout << "\n"; t--; } } int Rnum(int min,int max) { int value; value = min + rand() % max; return value; } // srand(time(NULL)); int main() { char t; system("cls"); HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ); WORD wOldColorAttrs; CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(h, &csbiInfo); wOldColorAttrs = csbiInfo.wAttributes; SetConsoleTextAttribute ( h, FOREGROUND_GREEN | FOREGROUND_INTENSITY ); DrawHLine(); cout << "\t\t " << block << " " << block << " " << block << block << block << " " << block << block << " " << block << block << " " << block << " " << block << block << block << block << " " << block << block << block << block << " " << block << " " << block; cout << "\n"; cout << "\t\t " << block << " " << block << " " << " " << block << " " << " " << block << " " << block << " " << block << " " << block << " " << block << " " << block << " " << block << block << " " << block; cout << "\n"; cout << "\t\t " << block << block << block << " " << " " << block << " " << " " << block << " " << " " << block << " " << block << " " << block << " " << block << block << " " << block << block << block << " " << block << block << block << block; cout << "\n"; cout << "\t\t " << block << " " << block << " " << " " << block << " " << " " << block << " " << " " << block << " " << block << " " << block<< " " << block << " " << block << " " << block << " " << block << block; cout << "\n"; cout << "\t\t " << block << " " << block << " " << " " << block << " " << " " << block << " " << " " << block << " " << block << block << block << " " << block << block << block << block << " " << block << block << block << block << " " << block << " " << block; cout << "\n"; DrawHLine(); cout << "\t\t\t VERSION 1.0"; cout << "\n"; cout << "\t\t\t By Eric Marcarelli"; cout << "\n"; DrawDHLine(); SetConsoleTextAttribute ( h, FOREGROUND_RED | FOREGROUND_INTENSITY ); cout << "\n\t\t\t Select An Option"; cout << "\n\n"; SetConsoleTextAttribute ( h, FOREGROUND_BLUE | FOREGROUND_INTENSITY ); cout << "\t\t\t a) Generate Full Page"; cout << "\n"; cout << "\t\t\t b) Generate Basic Page"; cout << "\n"; cout << "\t\t\t c) Generate Navigation Bar"; cout << "\n"; cout << "\t\t\t d) Help"; cout << "\n"; cout << "\t\t\t e) About HTML Gen"; cout << "\n"; cout << "\t\t\t f) Exit\n"; SetConsoleTextAttribute ( h, wOldColorAttrs); t = getche(); switch (t) { case 'a': fullpg(); break; case 'b': simplepg(); break; case 'c': navbar(); break; case 'd': help(); break; case 'e': about(); break; case 'f': system("cls"); SetConsoleTextAttribute ( h, wOldColorAttrs); cout << "CLOSING HTML GEN..."; exit(0); break; default: error(); cout << " Please select a letter from the menu, you can not use capital letters"; cout << "\n\n"; cout << "\t\t\tPress ENTER to return to menu\n"; SetConsoleTextAttribute ( h, wOldColorAttrs); getch(); main(); break; } } void error() { system("cls"); HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ); WORD wOldColorAttrs; CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(h, &csbiInfo); wOldColorAttrs = csbiInfo.wAttributes; SetConsoleTextAttribute ( h, FOREGROUND_RED | FOREGROUND_INTENSITY ); DrawHLine(); cout << "\t\t\t\t ERROR\n"; DrawDHLine(); cout << "\n"; } void simplepg () { FILE *hFile; char ch; char filename[100]; system("cls"); HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ); WORD wOldColorAttrs; CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(h, &csbiInfo); wOldColorAttrs = csbiInfo.wAttributes; SetConsoleTextAttribute ( h, FOREGROUND_BLUE | FOREGROUND_INTENSITY ); DrawHLine(); cout << "\t\t\t\tBASIC PAGE GENERATOR\n"; DrawDHLine(); SetConsoleTextAttribute ( h, wOldColorAttrs); cout << "\n"; cout << "Enter a file name (.html or .htm extention is recamended)> "; gets(filename); cout << "\n"; if ((hFile = fopen (filename, "r")) != NULL) { cout << "WARNING: " << filename << " exists, overwrite? (y/n)> "; cin >> ch; fclose (hFile); } if (ch == 'n') main(); cout << "\nNow writing " << filename << ". This may take a minute..."; hFile = fopen (filename, "w"); fprintf (hFile, "\n"); fprintf (hFile, "\n"); fprintf (hFile, "\n",filename); fprintf (hFile, " \n"); fprintf (hFile, "\n"); fprintf (hFile, "\n"); fprintf (hFile, "Your text here.\n"); fprintf (hFile, "\n"); fprintf (hFile, "\n"); fclose (hFile); cout << "\n\n"; getch(); if ((hFile = fopen (filename, "r")) != NULL) { cout << filename << " written successfully. You may now open it with your favorite text editor."; fclose (hFile); } else cout << "Error, unable to write " << filename << "."; cout << "\n\n"; cout << "Press ENTER to return to the menu"; getch(); main(); } void fullpg () { FILE *hFile; char ch; int done; char filename[100]; char title[100]; char header[100]; char subheader[100]; char linkcolor[100]; char textcolor[100]; char bgcolor[100]; char font[100]; char link1[100]; char link1url[100]; char link2[100]; char link2url[100]; char link3[100]; char link3url[100]; char link4[100]; char link4url[100]; char link5[100]; char link5url[100]; char link6[100]; char link6url[100]; char link7[100]; char link7url[100]; char link8[100]; char link8url[100]; char link9[100]; char link9url[100]; char link10[100]; char link10url[100]; char answ; system("cls"); HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ); WORD wOldColorAttrs; CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(h, &csbiInfo); wOldColorAttrs = csbiInfo.wAttributes; SetConsoleTextAttribute ( h, FOREGROUND_BLUE | FOREGROUND_INTENSITY ); DrawHLine(); cout << "\t\t\t\t FULL PAGE GENERATOR\n"; DrawDHLine(); SetConsoleTextAttribute ( h, wOldColorAttrs); cout << "\n"; cout << "Enter page title> "; gets(title); cout << "Enter text color> "; gets(textcolor); cout << "Enter link color> "; gets(linkcolor); cout << "Enter back ground color> "; gets(bgcolor); cout << "Enter font sytle> "; gets(font); cout << "Enter header (press enter to skip)> "; gets(header); cout << "Enter sub-header (press enter to skip)> "; gets(subheader); cout << "Enter link text, enter the word 'done' to end links> "; gets(link1); if ((link1[0] == 'd') && (link1[1] == 'o') && (link1[2] == 'n') && (link1[3] == 'e')) { done = 1; link2[0] = 'd';link2[1] = 'o';link2[2] = 'n';link2[3] = 'e'; link3[0] = 'd';link3[1] = 'o';link3[2] = 'n';link3[3] = 'e'; link4[0] = 'd';link4[1] = 'o';link4[2] = 'n';link4[3] = 'e'; link5[0] = 'd';link5[1] = 'o';link5[2] = 'n';link5[3] = 'e'; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link1url); } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link2); if ((link2[0] == 'd') && (link2[1] == 'o') && (link2[2] == 'n') && (link2[3] == 'e')) { done = 1; link3[0] = 'd';link3[1] = 'o';link3[2] = 'n';link3[3] = 'e'; link4[0] = 'd';link4[1] = 'o';link4[2] = 'n';link4[3] = 'e'; link5[0] = 'd';link5[1] = 'o';link5[2] = 'n';link5[3] = 'e'; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link2url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link3); if ((link3[0] == 'd') && (link3[1] == 'o') && (link3[2] == 'n') && (link3[3] == 'e')) { done = 1; link4[0] = 'd';link4[1] = 'o';link4[2] = 'n';link4[3] = 'e'; link5[0] = 'd';link5[1] = 'o';link5[2] = 'n';link5[3] = 'e'; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link3url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link4); if ((link4[0] == 'd') && (link4[1] == 'o') && (link4[2] == 'n') && (link4[3] == 'e')) { done = 1; link5[0] = 'd';link5[1] = 'o';link5[2] = 'n';link5[3] = 'e'; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link4url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link5); if ((link5[0] == 'd') && (link5[1] == 'o') && (link5[2] == 'n') && (link5[3] == 'e')) { done = 1; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link5url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link6); if ((link6[0] == 'd') && (link6[1] == 'o') && (link6[2] == 'n') && (link6[3] == 'e')) { done = 1; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link6url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link7); if ((link7[0] == 'd') && (link7[1] == 'o') && (link7[2] == 'n') && (link7[3] == 'e')) { done = 1; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link7url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link8); if ((link8[0] == 'd') && (link8[1] == 'o') && (link8[2] == 'n') && (link8[3] == 'e')) { done = 1; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link8url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link9); if ((link9[0] == 'd') && (link9[1] == 'o') && (link9[2] == 'n') && (link9[3] == 'e')) { done = 1; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link9url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link10); if ((link10[0] == 'd') && (link10[1] == 'o') && (link10[2] == 'n') && (link10[3] == 'e')) { done = 1; } else { cout << "Enter link URL> "; gets(link10url); } } cout << "Now you need to decide how to enter your body text. You have two choices, add it later using a text editor to open the finished file, or using HTML GEN EDITOR now. If you choose to use the HTML GEN EDITOR, remeber that you may only enter numbers, letters, and move back with backspace. Trying to delete, move the cursor, or press enter will cause errors."; cout << "\n\n"; cout << "Use HTML GEN EDITOR? (y/n)> "; cin >> answ; if (answ == 'y') { tt = 0; cout << "TEXT EDITOR OPEN, PRESS ESC WHEN DONE\n\n"; texteditor(); system("cls"); cout << "\nTEXT EDITOR CLOSED\n"; } getch(); cout << "The page is now ready to write!"; cout << "\n\n"; cout << "Enter a file name (.html or .htm extention is recamended)> "; gets(filename); cout << "\n"; if ((hFile = fopen (filename, "r")) != NULL) { cout << "WARNING: " << filename << " exists, overwrite? (y/n)> "; cin >> ch; fclose (hFile); } if (ch == 'n') main(); cout << "\nNow writing " << filename << ". This may take a minute..."; hFile = fopen (filename, "w"); fprintf (hFile, "\n"); fprintf (hFile, "\n"); fprintf (hFile, "\n",filename); fprintf (hFile, "%s\n",title); fprintf (hFile, "\n"); if ((link1[0] != 'd') && (link1[1] != 'o') && (link1[2] != 'n') && (link1[3] != 'e')) { fprintf (hFile, "
\n"); fprintf (hFile, "
"); fprintf (hFile, "Navigation
"); fprintf (hFile, "%s
",link1url,link1); } if ((link2[0] != 'd') && (link2[1] != 'o') && (link2[2] != 'n') && (link2[3] != 'e')) fprintf (hFile, "%s
",link2url,link2); if ((link3[0] != 'd') && (link3[1] != 'o') && (link3[2] != 'n') && (link3[3] != 'e')) fprintf (hFile, "%s
",link3url,link3); if ((link4[0] != 'd') && (link4[1] != 'o') && (link4[2] != 'n') && (link4[3] != 'e')) fprintf (hFile, "%s
",link4url,link4); if ((link5[0] != 'd') && (link5[1] != 'o') && (link5[2] != 'n') && (link5[3] != 'e')) fprintf (hFile, "%s
",link5url,link5); if ((link6[0] != 'd') && (link6[1] != 'o') && (link6[2] != 'n') && (link6[3] != 'e')) fprintf (hFile, "%s
",link6url,link6); if ((link7[0] != 'd') && (link7[1] != 'o') && (link7[2] != 'n') && (link7[3] != 'e')) fprintf (hFile, "%s
",link7url,link7); if ((link8[0] != 'd') && (link8[1] != 'o') && (link8[2] != 'n') && (link8[3] != 'e')) fprintf (hFile, "%s
",link8url,link8); if ((link9[0] != 'd') && (link9[1] != 'o') && (link9[2] != 'n') && (link9[3] != 'e')) fprintf (hFile, "%s
",link9url,link9); if ((link10[0] != 'd') && (link10[1] != 'o') && (link10[2] != 'n') && (link10[3] != 'e')) fprintf (hFile, "%s
",link10url,link10); if ((link1[0] != 'd') && (link1[1] != 'o') && (link1[2] != 'n') && (link1[3] != 'e')) fprintf (hFile, "

"); fprintf (hFile, "",textcolor); fprintf (hFile, "\n",linkcolor); fprintf (hFile, "\n",bgcolor); fprintf (hFile, "\n",font); fprintf (hFile, "
\n"); fprintf (hFile, "

%s

\n",header); fprintf (hFile, "

%s

\n",subheader); fprintf (hFile, "
\n"); fprintf (hFile, "%s\n",body); fprintf (hFile, "\n"); fclose (hFile); cout << "\n\n"; getch(); if ((hFile = fopen (filename, "r")) != NULL) { cout << filename << " written successfully. You may now edit it with your favorite text editor, or use it as-is."; fclose (hFile); } else cout << "Error, unable to write " << filename << "."; cout << "\n\n"; cout << "Press ENTER to return to the menu"; getch(); main(); } void texteditor() { char ttt; cout << body; ttt = getche(); if (ttt != 27) { body[tt] = ttt; tt++; system("cls"); texteditor(); } } void navbar () { FILE *hFile; char ch; int done; char filename[100]; char linkcolor[100]; char textcolor[100]; char bgcolor[100]; char font[100]; char link1[100]; char link1url[100]; char link2[100]; char link2url[100]; char link3[100]; char link3url[100]; char link4[100]; char link4url[100]; char link5[100]; char link5url[100]; char link6[100]; char link6url[100]; char link7[100]; char link7url[100]; char link8[100]; char link8url[100]; char link9[100]; char link9url[100]; char link10[100]; char link10url[100]; char answ; system("cls"); HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ); WORD wOldColorAttrs; CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(h, &csbiInfo); wOldColorAttrs = csbiInfo.wAttributes; SetConsoleTextAttribute ( h, FOREGROUND_BLUE | FOREGROUND_INTENSITY ); DrawHLine(); cout << "\t\t\t\tNAVIGATION BAR GENERATOR\n"; DrawDHLine(); SetConsoleTextAttribute ( h, wOldColorAttrs); cout << "\n"; cout << "Enter text color> "; gets(textcolor); cout << "Enter link color> "; gets(linkcolor); cout << "Enter back ground color> "; gets(bgcolor); cout << "Enter font sytle> "; gets(font); cout << "Enter link text, enter the word 'done' to end links> "; gets(link1); if ((link1[0] == 'd') && (link1[1] == 'o') && (link1[2] == 'n') && (link1[3] == 'e')) { done = 1; link2[0] = 'd';link2[1] = 'o';link2[2] = 'n';link2[3] = 'e'; link3[0] = 'd';link3[1] = 'o';link3[2] = 'n';link3[3] = 'e'; link4[0] = 'd';link4[1] = 'o';link4[2] = 'n';link4[3] = 'e'; link5[0] = 'd';link5[1] = 'o';link5[2] = 'n';link5[3] = 'e'; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link1url); } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link2); if ((link2[0] == 'd') && (link2[1] == 'o') && (link2[2] == 'n') && (link2[3] == 'e')) { done = 1; link3[0] = 'd';link3[1] = 'o';link3[2] = 'n';link3[3] = 'e'; link4[0] = 'd';link4[1] = 'o';link4[2] = 'n';link4[3] = 'e'; link5[0] = 'd';link5[1] = 'o';link5[2] = 'n';link5[3] = 'e'; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link2url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link3); if ((link3[0] == 'd') && (link3[1] == 'o') && (link3[2] == 'n') && (link3[3] == 'e')) { done = 1; link4[0] = 'd';link4[1] = 'o';link4[2] = 'n';link4[3] = 'e'; link5[0] = 'd';link5[1] = 'o';link5[2] = 'n';link5[3] = 'e'; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link3url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link4); if ((link4[0] == 'd') && (link4[1] == 'o') && (link4[2] == 'n') && (link4[3] == 'e')) { done = 1; link5[0] = 'd';link5[1] = 'o';link5[2] = 'n';link5[3] = 'e'; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link4url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link5); if ((link5[0] == 'd') && (link5[1] == 'o') && (link5[2] == 'n') && (link5[3] == 'e')) { done = 1; link6[0] = 'd';link6[1] = 'o';link6[2] = 'n';link6[3] = 'e'; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link5url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link6); if ((link6[0] == 'd') && (link6[1] == 'o') && (link6[2] == 'n') && (link6[3] == 'e')) { done = 1; link7[0] = 'd';link7[1] = 'o';link7[2] = 'n';link7[3] = 'e'; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link6url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link7); if ((link7[0] == 'd') && (link7[1] == 'o') && (link7[2] == 'n') && (link7[3] == 'e')) { done = 1; link8[0] = 'd';link8[1] = 'o';link8[2] = 'n';link8[3] = 'e'; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link7url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link8); if ((link8[0] == 'd') && (link8[1] == 'o') && (link8[2] == 'n') && (link8[3] == 'e')) { done = 1; link9[0] = 'd';link9[1] = 'o';link9[2] = 'n';link9[3] = 'e'; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link8url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link9); if ((link9[0] == 'd') && (link9[1] == 'o') && (link9[2] == 'n') && (link9[3] == 'e')) { done = 1; link10[0] = 'd';link10[1] = 'o';link10[2] = 'n';link10[3] = 'e'; } else { cout << "Enter link URL> "; gets(link9url); } } if (done != 1) { cout << "Enter link text, enter the word 'done' to end links> "; gets(link10); if ((link10[0] == 'd') && (link10[1] == 'o') && (link10[2] == 'n') && (link10[3] == 'e')) { done = 1; } else { cout << "Enter link URL> "; gets(link10url); } } cout << "The navigation bar is now ready to write!"; cout << "\n\n"; cout << "Enter a file name (.html or .htm extention is recamended)> "; gets(filename); cout << "\n"; if ((hFile = fopen (filename, "r")) != NULL) { cout << "WARNING: " << filename << " exists, overwrite? (y/n)> "; cin >> ch; fclose (hFile); } if (ch == 'n') main(); cout << "\nNow writing " << filename << ". This may take a minute..."; hFile = fopen (filename, "w"); fprintf (hFile, "\n"); fprintf (hFile, "\n",filename); if ((link1[0] != 'd') && (link1[1] != 'o') && (link1[2] != 'n') && (link1[3] != 'e')) { fprintf (hFile, "
\n"); fprintf (hFile, "
"); fprintf (hFile, "Navigation
"); fprintf (hFile, "%s
",link1url,link1); } if ((link2[0] != 'd') && (link2[1] != 'o') && (link2[2] != 'n') && (link2[3] != 'e')) fprintf (hFile, "%s
",link2url,link2); if ((link3[0] != 'd') && (link3[1] != 'o') && (link3[2] != 'n') && (link3[3] != 'e')) fprintf (hFile, "%s
",link3url,link3); if ((link4[0] != 'd') && (link4[1] != 'o') && (link4[2] != 'n') && (link4[3] != 'e')) fprintf (hFile, "%s
",link4url,link4); if ((link5[0] != 'd') && (link5[1] != 'o') && (link5[2] != 'n') && (link5[3] != 'e')) fprintf (hFile, "%s
",link5url,link5); if ((link6[0] != 'd') && (link6[1] != 'o') && (link6[2] != 'n') && (link6[3] != 'e')) fprintf (hFile, "%s
",link6url,link6); if ((link7[0] != 'd') && (link7[1] != 'o') && (link7[2] != 'n') && (link7[3] != 'e')) fprintf (hFile, "%s
",link7url,link7); if ((link8[0] != 'd') && (link8[1] != 'o') && (link8[2] != 'n') && (link8[3] != 'e')) fprintf (hFile, "%s
",link8url,link8); if ((link9[0] != 'd') && (link9[1] != 'o') && (link9[2] != 'n') && (link9[3] != 'e')) fprintf (hFile, "%s
",link9url,link9); if ((link10[0] != 'd') && (link10[1] != 'o') && (link10[2] != 'n') && (link10[3] != 'e')) fprintf (hFile, "%s
",link10url,link10); if ((link1[0] != 'd') && (link1[1] != 'o') && (link1[2] != 'n') && (link1[3] != 'e')) fprintf (hFile, "

"); fprintf (hFile, "",textcolor); fprintf (hFile, "\n",linkcolor); fprintf (hFile, "\n",bgcolor); fprintf (hFile, "\n",font); fprintf (hFile, "\n"); fclose (hFile); cout << "\n\n"; getch(); if ((hFile = fopen (filename, "r")) != NULL) { cout << filename << " written successfully. You may now add it to your page with your favorite text editor."; fclose (hFile); } else cout << "Error, unable to write " << filename << "."; cout << "\n\n"; cout << "Press ENTER to return to the menu"; getch(); main(); } void about() { system("cls"); HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ); WORD wOldColorAttrs; CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(h, &csbiInfo); wOldColorAttrs = csbiInfo.wAttributes; SetConsoleTextAttribute ( h, FOREGROUND_BLUE | FOREGROUND_INTENSITY ); DrawHLine(); cout << "\t\t\t\tABOUT HTML GEN\n"; DrawDHLine(); SetConsoleTextAttribute ( h, wOldColorAttrs); cout << "\n"; // // cout << "\t HTML Gen Version 1.0\n"; cout << "\t By Eric Marcarelli\n"; cout << "\t\n"; cout << "\tHTML Gen is a program that lets you quickly and easily generate quality\n"; cout << "\tweb pages in HTML! The full page is a complete page, it is great for \n"; cout << "\tbeginners, and requires no extra editing after its generated. The \n"; cout << "\tsimple page is made for people to have an outline while writing \n"; cout << "\tthier own code. And, as the name implies the navigation bar generates\n"; cout << "\ta navigation bar with up to ten links, ready to stick on your site.\n"; cout << "\t\n"; cout << "\t The Future\n"; cout << "\tIn future versions I plan to include features like an HTML lesson, \n"; cout << "\t informarion about hosting your websites, and more things to generate. \n"; cout << "\tSo check back soon!\n\n\tYou can contact me with questions/commments at SMB3Master@hotmail.com.\n"; cout << "\t\n"; cout << "\tPress ENTER to return the menu...\n"; getch(); main(); } void help() { system("cls"); HANDLE h = GetStdHandle ( STD_OUTPUT_HANDLE ); WORD wOldColorAttrs; CONSOLE_SCREEN_BUFFER_INFO csbiInfo; GetConsoleScreenBufferInfo(h, &csbiInfo); wOldColorAttrs = csbiInfo.wAttributes; SetConsoleTextAttribute ( h, FOREGROUND_BLUE | FOREGROUND_INTENSITY ); DrawHLine(); cout << "\t\t\t\t\tHELP\n"; DrawDHLine(); SetConsoleTextAttribute ( h, wOldColorAttrs); cout << "\n"; // // cout << "\tHTML Gen is very simple. All you need to do is select a menu option,\n"; cout << "\t answer a few questions, and genterate!\n"; cout << "\t\n"; cout << "\t Comman Problems \n"; cout << "\tBelow are some problems I think might come up most. If your problem \n"; cout << "\tisn't listed here feel free to email me at SMB3Master@hotmail.com\n"; cout << "\t\n"; cout << "\t1) Error, can't write page. Most likely you are trying to write to a \n"; cout << "\tread only file, make sure that the option is not selected.\n"; cout << "\t\n"; cout << "\t2) The test editor makes wierd characters on the screen. The text \n"; cout << "\tis very simple, it can't hand more then plain text. If it generates\n"; cout << "\tsomething odd just open your page with a program like notpad and \n"; cout << "\tdelete them.\n"; cout << "\t\n"; cout << "\tPress ENTER to return the menu...\n"; getch(); main(); }