• Modifying CPP files for a complete ignoramus

    From The Dust Council@1:103/705 to All on Wed Dec 18 16:43:30 2019
    OK folks, I have written some Perl, PHP, shell scripts, but I am not any kind of serious programmer.

    WHAT I AM TRYING TO ACCOMPLISH:

    I want to print a text file to new users before they start filling out the new user questionairre. This would be printed right after they enter New at the main login prompt.

    HEARTACHE AND IGNOMINY:

    At first I started modding newuser_signup.js in hopes this was it, but I am guessing this is probably for something else (the Web interface)?

    I did track down /src/sbbs3/newuser.cpp

    As per something in the docs, I am trying to simply get changes I make to show, so I am trying to use a preprocessor symbol to do this. I get what this does but I have no idea - being an amateur - how to set this so it is detected at compile time.

    So here is some example. All it does for now is try to IF-THEN whether the preprocessor symbol is set. It is a nonsense modification.

    #ifdef DUSTMODS
    bputs(text[UserOnTwoNodes]);
    logline(LOG_WARNING,"N!","DUSTCOUNCIL MODS RECOGNIZED");
    else
    bputs(text[StartingNewUserRegistration]);
    logline(LOG_WARNING,"N!","ORIGINAL CODE EXECUTING");
    #endif

    FIRST QUESTION: Having now set DUSTMODS, how would I compile this, both with and without defining DUSTMODS so I could switch back and forth between the original code. Some things online say CFLAGS= can be used but unsure how to set these. Also, is there a way I can just do a make install and have it only recompile anything I've modded (or changed the DUSTMODS setting on), or do I do it by file or what?

    SECOND QUESTION: notice those LOG_WARNING statements, which I've copied from elsewhere. Neither of them logs anything regardless, but I am unsure why.

    THIRD QUESTION: How would I have it print a file in the TEXT directory, say, prenew.msg ?

    I tried adding a bunch of things, but none of them would print the file. I think I tried:

    console.printfile(system.text_dir+"prenew.msg", P_NOABORT);

    which seems like it ought to work but even without the preprocessor If-then, nothing gets printed.

    I am trying to insert this on around line 54 of newuser.cpp, right where I've put in the preprocessor if-thens in the earlier example. That seems like where it ought to go.

    Thanks.
    --- SBBSecho 3.10-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to The Dust Council on Wed Dec 18 17:07:44 2019
    Re: Modifying CPP files for a complete ignoramus
    By: The Dust Council to All on Wed Dec 18 2019 04:43 pm

    OK folks, I have written some Perl, PHP, shell scripts, but I am not any kind of serious programmer.

    WHAT I AM TRYING TO ACCOMPLISH:

    I want to print a text file to new users before they start filling out the new user questionairre. This would be printed right after they enter New
    at
    the main login prompt.

    HEARTACHE AND IGNOMINY:

    At first I started modding newuser_signup.js in hopes this was it, but I am guessing this is probably for something else (the Web interface)?

    It's an unused experiment. You can ignore it.

    I did track down /src/sbbs3/newuser.cpp

    I would not recommend modifying the C/C++ source files unless you've exhausted all other methods of configuration and customization to acheive the desired result.

    In this case, I think you want to edit one of the following:
    - ctrl/text.dat (StartingNewUserRegistration line)
    - text/newuser.msg

    ... or worst case, edit newuser.js (copy to "mods" directory first).


    digital man

    Synchronet "Real Fact" #49:
    Synchronet program was named 'sbbs' instead of 'sync' to avoid conflict w/Unix.
    Norco, CA WX: 55.3øF, 25.0% humidity, 0 mph S wind, 0.00 inches rain/24hrs
    --- SBBSecho 3.10-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From MRO@1:103/705 to The Dust Council on Sun Dec 22 04:22:16 2019
    Re: Modifying CPP files for a complete ignoramus
    By: The Dust Council to All on Wed Dec 18 2019 04:43 pm

    OK folks, I have written some Perl, PHP, shell scripts, but I am not any
    kin
    of serious programmer.

    WHAT I AM TRYING TO ACCOMPLISH:


    hey, you should read all the synchronet documentation. i would start with the old stuff and then the stuff on the wiki. also read the whatsnew files.

    what you are talking about is already built into synchronet.
    check out the customisation section of the docs.
    ---
    þ Synchronet þ ::: BBSES.info - free BBS services :::
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to The Dust Council on Mon Dec 23 11:14:55 2019
    OK folks, I have written some Perl, PHP, shell scripts, but I am not
    any
    kind of serious programmer.

    WHAT I AM TRYING TO ACCOMPLISH:

    I want to print a text file to new users before they start filling out
    the
    new user questionairre. This would be printed right after they enter
    New at
    the main login prompt.

    It seems that the easiest why to accomplish what you want is to modify
    the login.js script and in the section //New user application if(str.toUpperCase() == "NEW") {
    bbs.menu("somefile");
    // do not include extension it will look for somefile.asc in
    /sbbs/text/menu
    var still_signup = console.yesno("Continue with new user application")
    if(!still_signup) bbs.hangup();

    if(bbs.newuser()) { ... }

    yes there is a cleaner way but this will give you what you want without modifying *.cpp and makefile :-P

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to Digital Man on Mon Dec 23 23:36:59 2019
    Re: Modifying CPP files for a complete ignoramus
    By: The Dust Council to All on Wed Dec 18 2019 04:43 pm

    OK folks, I have written some Perl, PHP, shell scripts, but I am not any kind of serious programmer.

    WHAT I AM TRYING TO ACCOMPLISH:

    I want to print a text file to new users before they start filling out the new user questionairre. This would be printed right after they
    enter
    New at the main login prompt.

    HEARTACHE AND IGNOMINY:

    At first I started modding newuser_signup.js in hopes this was it, but I am guessing this is probably for something else (the Web interface)?

    It's an unused experiment. You can ignore it.

    I did track down /src/sbbs3/newuser.cpp

    I would not recommend modifying the C/C++ source files unless you've exhausted all other methods of configuration and customization to acheive the desired result.

    In this case, I think you want to edit one of the following:
    - ctrl/text.dat (StartingNewUserRegistration line)
    - text/newuser.msg

    ... or worst case, edit newuser.js (copy to "mods" directory first).


    digital man

    topographically speaking ... /sbbs/exec/login.js (line 56)
    // New user application
    if(str.toUpperCase()=="NEW") {
    var still_apply;
    if(bbs.menu_exists("somefile")) bbs.menu("somefile");
    if(!still_apply = console.yesno("Continue with New User Application")) {
    console.clear();
    console.writeln("Whatever, Dude!\r\n");
    bbs.hangup();
    }

    if(bbs.newuser()) {
    bbs.logon();
    exit();
    }
    continue;
    }

    seems easier then mucking around with other scripts ... correct me if I am incorrect, please.


    PS Merry Christmas to you and Yours from me and Mine!

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Mortifis on Tue Dec 24 12:59:31 2019
    Re: Re: Modifying CPP files for a complete ignoramus
    By: Mortifis to Digital Man on Mon Dec 23 2019 11:36 pm

    Re: Modifying CPP files for a complete ignoramus
    By: The Dust Council to All on Wed Dec 18 2019 04:43 pm

    OK folks, I have written some Perl, PHP, shell scripts, but I am not any kind of serious programmer.

    WHAT I AM TRYING TO ACCOMPLISH:

    I want to print a text file to new users before they start filling
    out
    the new user questionairre. This would be printed right after they enter New at the main login prompt.

    HEARTACHE AND IGNOMINY:

    At first I started modding newuser_signup.js in hopes this was it,
    but
    I am guessing this is probably for something else (the Web
    interface)?

    It's an unused experiment. You can ignore it.

    I did track down /src/sbbs3/newuser.cpp

    I would not recommend modifying the C/C++ source files unless you've exhausted all other methods of configuration and customization to
    acheive
    the desired result.

    In this case, I think you want to edit one of the following:
    - ctrl/text.dat (StartingNewUserRegistration line)
    - text/newuser.msg

    ... or worst case, edit newuser.js (copy to "mods" directory first).


    digital man

    topographically speaking ... /sbbs/exec/login.js (line 56)
    // New user application
    if(str.toUpperCase()=="NEW") {
    var still_apply;
    if(bbs.menu_exists("somefile")) bbs.menu("somefile");
    if(!still_apply = console.yesno("Continue with New User Application")) {
    console.clear();
    console.writeln("Whatever, Dude!\r\n");
    bbs.hangup();
    }

    if(bbs.newuser()) {
    bbs.logon();
    exit();
    }
    continue;
    }

    seems easier then mucking around with other scripts ... correct me if I am incorrect, please.

    My first suggestion was to modify display files, no scripts.

    PS Merry Christmas to you and Yours from me and Mine!

    You too!

    digital man

    Synchronet/BBS Terminology Definition #20:
    DOS = Disk Operating System (as in PC-DOS and MS-DOS)
    Norco, CA WX: 56.3øF, 73.0% humidity, 5 mph ENE wind, 0.04 inches rain/24hrs --- SBBSecho 3.10-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)