home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / SYSOP / MODS1.ZIP / LISTPLUS.MOD < prev    next >
Text File  |  1995-06-04  |  13KB  |  430 lines

  1. And now, the modification you've all been waiting for!!!!
  2.  
  3. 6Θ════════════════════════════════════════════════════════════════════════════Θ
  4.           0Asylum Listplus Modification for WWIV 4.24
  5. 6Θ════════════════════════════════════════════════════════════════════════════Θ
  6.  
  7. ┌─────────────────────────────────────────────────────────────────────────────┐
  8. │ ModTitle: Asylum Listfiles 4.0 for 4.24                       May, 26 1995  │
  9. │ What Is?: Vision/2 style file listing.  Common 4.0+ Mod                     │
  10. │                                                                             │
  11. │ Difficulty:  Yeah, maybe... so?                                             │
  12. │                                                                             │
  13. │ Files affected: FCNS.H, NEWUSER.C, BBS.C, MMENU.C, XFEROVL.C, MAKEFILE.MAK  │
  14. │                 XFER.C...maybe others :)                                    │
  15. │ Includes info for using this mod with Sam's Kilobyte per day mod, also      │
  16. │ Support for Spotnick's FILEPOINTS                                           │
  17. │ BY: Asylum Group (Zu Digital, 1@8421, and Sam, 1@4051).  No.  Don't ask.    │
  18. └─────────────────────────────────────────────────────────────────────────────┘
  19.  
  20.  
  21. The Modification:
  22.  
  23.   READ LISTPLUS.DOC!  It contains important information not found anywhere
  24.   else.
  25.  
  26.   Please take steps to ensure your BBS can be recovered in case of a problem.
  27.   I take no responsibility in you doing this, if you can't put in this mod
  28.   without losing your userrec or whatever else may happen, then don't install
  29.   it.
  30.  
  31.   Now... this modification seems to work real well, special care is taken to
  32.   avoid memory allocation/overrun/leaks problems (probably 99% of real
  33.   problems) but I am not prefect.
  34.  
  35.  
  36. + Add
  37. - Subtract
  38. * Change
  39. = Existing
  40. @# See number
  41.  
  42. Step A)
  43.   This is a Common mod, which means you need to have COMMON installed.
  44.   Common version 4.0 or greater is needed for this version (the later, the
  45.   more debugged).
  46.  
  47.  
  48. Step B)
  49.   Put the .MOD, .C and I guess the .DOC in your source dir, I believe all the
  50.   others go in your gfiles dir.
  51.  
  52.   Files going in your gfiles are (don't hate me if I miss one)
  53.     LPSYSOP.*
  54.     LISTPLUS.HLP
  55.     REQPLUS.*
  56.     LPSEARCH.*
  57.  
  58.  
  59. Step 1) MMENU.C
  60.     In dlmainmenu, option 'K' to config your file listing
  61.  
  62. =       case 'J':
  63. =         if (okconf(&thisuser))
  64. =           jump_conf(CONF_DIRS);
  65. =         break;
  66. +       case 'K':
  67. +         if(ok_listplus())
  68. +           config_file_list();
  69. +         break;
  70. =       case 'L':
  71. =         tagging=1;
  72. =         listfiles();
  73. =         tagging=0;
  74. =         break;
  75.  
  76.  
  77.  
  78.  
  79. Set 2) XFEROVL.C
  80.   In the section where you dis/enable the filetagging, print a little
  81.   text so that you know which file tagging is enabled.
  82.  
  83.   Function xfer_defaults, towards the begining of the function
  84.  
  85.  
  86. =      else
  87. =        outstr(get_string(1362));
  88. =      pl(")");
  89. +
  90. +      if(!(thisuser.sysstatus & sysstatus_listplus)
  91. +           && !(thisuser.sysstatus & sysstatus_no_tag))
  92. +        pl("  (ListPlus!)");
  93. +      else if (!(thisuser.sysstatus & sysstatus_no_tag))
  94. +        pl("  (Internal Tagging)");
  95. +
  96. =      pl(get_string(809));
  97. =      nl();
  98. =      prt(2,get_string(297));
  99. =    }
  100.  
  101.  
  102. Step 3) XFEROVL.C
  103.   In the section where you dis/enable the filetagging, if you enable it, check
  104.   to see if the user wants internal or listplus file tagging.
  105.  
  106.   Function xfer_defaults, A ways down, almost the very end of the function...
  107.   Replace the entire Case '5' with this one:
  108.  
  109.  
  110.      case '5':
  111.        if (thisuser.sysstatus & sysstatus_no_tag)
  112.        {
  113.          thisuser.sysstatus -= sysstatus_no_tag;
  114.          check_listplus();
  115.        }
  116.        else
  117.          thisuser.sysstatus += sysstatus_no_tag;
  118.        break;
  119.  
  120. Step 4) XFER.C
  121.   Change the next five functions so that they call my functions if the user
  122.   has ansi available, if not, use old functions.
  123.  
  124.   A. Function ListFiles
  125.  
  126. = void listfiles(void)
  127. = {
  128. =   char s[81];
  129. =   int i,abort,next=0,f;
  130. =   uploadsrec u;
  131.  
  132. +   if(ok_listplus())
  133. +   {
  134. +     listfiles_plus(LIST_DIR);
  135. +     return;
  136. +   }
  137.  
  138. =   dliscan();
  139.  
  140.  
  141.   B. Function NScanDir
  142.  
  143. = void nscandir(int d, int *abort)
  144. = {
  145. =   int i,od,next=0,f;
  146. =   uploadsrec u;
  147. =
  148. =   if ((dir_dates[udir[d].subnum]) && (dir_dates[udir[d].subnum]<nscandate))
  149. =     return;
  150. =
  151. =   od=curdir;
  152. =   curdir=d;
  153. =   dliscan();
  154. =   if (this_date>=nscandate) {
  155.  
  156. +   if(ok_listplus())
  157. +   {
  158. +     *abort=listfiles_plus(NSCAN_DIR);
  159. +     curdir=od;
  160. +     return;
  161. +   }
  162.  
  163. =     f=sh_open1(dlfn,O_RDONLY | O_BINARY);
  164. =     for (i=1; (i<=numf) && (!(*abort)) && (!hangup) && (tagging!=0); i++) {
  165.  
  166.  
  167.   C. Function NScanAll
  168.  
  169. = void nscanall(void)
  170. = {
  171. =   int abort,i,i1,count,color,ac=0;
  172. =
  173. =   /* ------------- DO NOT PUT BLOCK HERE!!!!!!! --------------*/
  174. =   /* ------------- DO NOT PUT BLOCK HERE!!!!!!! --------------*/
  175. =   if ((uconfdir[1].confnum!=-1) && (okconf(&thisuser))) {
  176. =     if (!x_only) {                  /* ARE YOU PAYING ATTENTION? */
  177. =       nl();                         /* ARE YOU PAYING ATTENTION? */
  178. =       prt(5,get_string(1379));      /* ARE YOU PAYING ATTENTION? */
  179. =       ac=yn();                      /* ARE YOU PAYING ATTENTION? */
  180. =       nl();                         /* ARE YOU PAYING ATTENTION? */
  181. =     } else                          /* ARE YOU PAYING ATTENTION? */
  182. =       ac=1;                         /* ARE YOU PAYING ATTENTION? */
  183. =     if (ac)                         /* ARE YOU PAYING ATTENTION? */
  184. =       tmp_disable_conf(1);          /* ARE YOU PAYING ATTENTION? */
  185. =   }                                 /* ARE YOU PAYING ATTENTION? */
  186. =
  187. +   if(ok_listplus())                 /* THERE, PUT THE BLOCK OF   */
  188. +   {                                 /* CODE HERE, AFTER THE      */
  189. +     int save_dir=curdir;            /* ABOVE CHUNK OF STOCK CODE */
  190. +
  191. +     listfiles_plus(NSCAN_NSCAN);
  192. +     if(ac)
  193. +       tmp_disable_conf(0);
  194. +     curdir=save_dir;
  195. +     return;
  196. +   }
  197.  
  198.  
  199. =  abort=0;
  200. =  num_listed=0;
  201. =  count=0;
  202. =  color=3;
  203. =  if (!x_only) {
  204.  
  205.  
  206.   D. Function SearchAll
  207.  
  208. = void searchall(void)
  209. = {
  210. =   int i,i1,pts,abort,pty,ocd,next=0,f,count,color,ac=0;
  211. =   char s[81];
  212. =   uploadsrec u;
  213.  
  214. +   if(ok_listplus())
  215. +   {
  216. +     listfiles_plus(SEARCH_ALL);
  217. +     return;
  218. +   }
  219.  
  220.  
  221. 5A) XFEROVL.C function FindDescription
  222.   E. Function FindDescription
  223.  
  224. = void finddescription(void)
  225. = {
  226. =   uploadsrec u;
  227. =   int i,i1,i2,abort,ocd,pts,next=0,f,count,color,ac=0;
  228. =   char s[81],s1[81];
  229.  
  230. +   if(ok_listplus())
  231. +   {
  232. +     listfiles_plus(SEARCH_ALL);
  233. +     return;
  234. +   }
  235.  
  236.  
  237. Step 5) XFER.C function ratio_ok
  238.     Down in function ratio_ok, you need to clear the screen before
  239.     displaying your error message.
  240.  
  241. = if ((syscfg.req_ratio>0.0001) && (ratio()<syscfg.req_ratio)) {
  242. =      ok=0;
  243. *      CLS();  // Change from nln(2) to CLS() and add nl()
  244. +      nl();
  245.  
  246.        and a little below that
  247.  
  248. = if (!(thisuser.exempt & exempt_post))
  249. =    if ((syscfg.post_call_ratio>0.0001) && (post_ratio()<syscfg.post_call_ratio)) {
  250. =      ok=0;
  251. *      CLS();        // remove nln(2) and add CLS() and nl()
  252. +      nl();
  253.  
  254.  
  255. Step 6) MAKEFILE (Borland C, Turbo C'rs are on your own)
  256.   Add listplus.obj to the BBS_OVL (overlaid) part:
  257.  
  258. =        srsend.obj   subedit.obj  subreq.obj   subxtr.obj   \
  259. =        sysopf.obj   tedit.obj    uedit.obj    voteedit.obj \
  260. =        xferovl.obj  xfertmp.obj  xinit.obj    common.obj \
  261. +        listplus.obj                                      ^^^^ that \ is added
  262.      ^^^^^^^^^^^^ add this
  263.  
  264.   And this one: be sure to notice the '\' at the end of EVERY line
  265. =        $(OBJ)\subedit.obj  $(OBJ)\subreq.obj   $(OBJ)\subxtr.obj   \
  266. =        $(OBJ)\sysopf.obj   $(OBJ)\tedit.obj    $(OBJ)\uedit.obj    \
  267. =        $(OBJ)\voteedit.obj $(OBJ)\xferovl.obj  $(OBJ)\xfertmp.obj  \
  268. *        $(OBJ)\xinit.obj    $(OBJ)\common.obj   $(OBJ)\listplus.obj
  269.                         ^^^^^^^^^^^^^^^^^^^ add this
  270.  
  271.   And down a ways...
  272.  
  273. = xferovl.obj : xferovl.c
  274. =   $(TCC_OVL)
  275. = xfertmp.obj : xfertmp.c
  276. =   $(TCC_OVL)
  277. = xinit.obj   : xinit.c
  278. =   $(TCC_OVL)
  279. = common.obj : common.c
  280. =  $(TCC_OVL)
  281. + listplus.obj : listplus.c
  282. + $(TCC_OVL)
  283.  
  284.  
  285.  
  286. Step 7) FCNS.H
  287.   Update fcns.h by typing MAKE FCNS, or by manually installing the following
  288.   definitions:
  289.  
  290. /* File: listplus.c */
  291.  
  292. void colorize_foundtext(char *text, struct search_record *search_rec, int color);
  293. void printtitle_plus(void);
  294. void build_header(void);
  295. int first_file_pos(void);
  296. int lp_configured_lines(void);
  297. void print_searching(void);
  298. void catch_divide_by_zero(int x);
  299. int listfiles_plus(int type);
  300. int listfiles_plus_function(int type);
  301. void drawfile(int filepos, int filenum);
  302. void undrawfile(int filepos, int filenum);
  303. int add_batch(char *filename, int dn, long fs);
  304. int printinfo_plus(uploadsrec *u, int filenum, int marked, int LinesLeft, struct search_record *search_rec);
  305. int load_config_listing(int config);
  306. void write_config_listing(int config);
  307. void unload_config_listing(void);
  308. int print_extended_plus(char *fn, int numlist, int indent, int color, struct search_record *search_rec);
  309. void show_fileinfo(uploadsrec *u);
  310. int check_lines_needed(uploadsrec *u);
  311. char *lp_read_extended_description(char *fn);
  312. void lp_zap_ed_info(void);
  313. void lp_get_ed_info(void);
  314. void prep_menu_items(char **menu_items);
  315. int prep_search_rec(struct search_record *search_rec, int type);
  316. int calc_max_lines(void);
  317. void sysop_configure(void);
  318. int SelectColor(int which);
  319. void check_listplus(void);
  320. void config_file_list(void);
  321. void update_user_config_screen(uploadsrec *u, int which);
  322. int rename_filename(char *fn, int dn);
  323. int remove_filename(char *fn, int dn);
  324. int move_filename(char *fn, int dn);
  325. void do_batch_sysop_command(int mode, char *filename);
  326. void smmsm(void);
  327. void load_lp_config(void);
  328. void save_lp_config(void);
  329. int search_criteria(struct search_record *sr);
  330. void load_listing(void);
  331. void view_file(char *filename);
  332. void download_plus(char *file);
  333. void request_file(char *filename);
  334. int ok_listplus(void);
  335. int compare_criteria(struct search_record *sr, uploadsrec *ur);
  336. int lp_compare_strings(char *raw, char *formula);
  337. int lp_compare_strings_wh(char *raw, char *formula, unsigned *pos, int size);
  338. int lp_get_token(char *formula, unsigned *pos);
  339. int lp_get_value(char *raw, char *formula, unsigned *pos);
  340.  
  341.  
  342.  
  343. Step 8) Do what you do to get a BBS.EXE... (in other words, you are done)
  344.  
  345. ──═────────═─────────══───────────═──────────═══───────────═══────────═───────═
  346.  
  347.  
  348. KiloByte Per Day Mod
  349.   If you use this, or some other mod that keeps track of who/what/when, or
  350.   adds additional resritions, as this one does, you will need to add something
  351.   like this:
  352.  
  353. If you do use KBPERDAY, #define KBPERDAY (or uncomment it) in Listplus.c
  354.  
  355.   1) And down in function ratio_ok, you need to clear the screen before
  356.      displaying your error message.
  357.  
  358. =        if (thisuser.kbdowntoday+kbbatch > ss.messages_read)    /* +kbbatch is KBper Wayne Fix */
  359. =        {
  360. =          ok=0;
  361. *          CLS();  /* Change the nl() to CLS() */
  362. =          nl();
  363.  
  364.  
  365.  
  366. ─═════════════════──════════════─────════════─═══════════════───══════════─═══
  367.  
  368.  
  369. Adding option 'K'onfig to the pulldown menus
  370.  
  371. 1) In file PDCOMP.H
  372.  
  373. =                         #ifdef PDCOMPILER
  374. =                           {"DEBUG"},
  375. =                         #else
  376. =                           {pd_debug},
  377. =                         #endif
  378. =
  379. =                         #ifdef PDCOMPILER
  380. =                           {"LIST_COMMON"},
  381. =                         #else
  382. =                           {pd_show_common_mods},
  383. =                         #endif
  384. =
  385. +                         #ifdef PDCOMPILER
  386. +                           {"KONFIG"},
  387. +                         #else
  388. +                           {config_file_list},
  389. +                         #endif
  390. =
  391. =                           {0}
  392. = };  /* End of commands */
  393.  
  394.  
  395. 2) TRAN_PD.SRC
  396.  
  397. =   StartItem "Other"
  398. +     "Konfig you file list K"  K   konfig
  399. =     "Chat with sysop      C"  C   reqchat
  400. =     "Enter Chat room       "  0   chat_room
  401. =     "Time Bank            $"  $   time_bank
  402. =     "Transfer options     T"  T   xfer_defaults
  403. =     "Sysop menu           W"  W   sysop_pd
  404. =       MinSL 255
  405. =   EndItem
  406.  
  407.  
  408. 3) PDCOMP.EXE
  409.   Rebuild it, type BCC pdcomp.c \lib\wildargs.obj
  410.                  ^^^ your correct path
  411.  
  412. 4) TRAN_PD.PDM
  413.   Rebuild it, type PDCOMP tran_pd.src
  414.   Move the *.PDM file into your DATA directory
  415.  
  416. 5) BBS.EXE
  417.   Finally, bbs.exe has to be rebuilt so it can read in the new PDCOMP.H info,
  418.   otherwise, your menus will act very crazy.
  419.  
  420. Done!
  421.  
  422.  
  423. ' Void this
  424. ' Real idiots think that real programmers only use one tool
  425.  
  426.  
  427. Look for more great mods from the Asylum group...
  428.  
  429. Go Chiefs (I know....it's a little early, but hey- Joe's gone.)
  430.