• Modifying CPP files for a complete ignoramus

    From The Dust Council to All on Wednesday, December 18, 2019 16:43:30
    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.
  • From Digital Man to The Dust Council on Wednesday, December 18, 2019 17:07:44
    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
  • From MRO@BBSESINF to The Dust Council on Sunday, December 22, 2019 04:22:16
    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 :::
  • From Mortifis@ALLEYCAT to The Dust Council on Monday, December 23, 2019 11:14:55
    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
  • From Mortifis@ALLEYCAT to Digital Man on Monday, December 23, 2019 23:36:59
    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
  • From Digital Man to Mortifis on Tuesday, December 24, 2019 12:59:31
    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
  • From Mortifis@ALLEYCAT to Digital Man on Saturday, December 28, 2019 14:39:01
    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.

    Sorry, my impression was that he wanted a file to be displayed before the NUQ was started "right after typing NEW"

    ---
    ■ Synchronet ■ AlleyCat! BBS - http://alleycat.synchro.net:81