Skip to content

Commit

Permalink
Update to 1.1.0 and provide a @trigger interface
Browse files Browse the repository at this point in the history
  • Loading branch information
lashtear committed Jan 8, 2013
1 parent 7c99b0c commit 87739ed
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 10 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2013-01-07 Emily Backes [email protected]

Update to 1.1.0 release.

Add @vz use to hooks demo code to simplify dbref rewrite.

Add @trigger based interface for better handling huge jobs on
systems with a small function-invocation limit.


2012-01-24 Emily Backes [email protected]

Update to 1.0.1 release.
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,31 @@ This can be used for general forum posting from within the MUX, but is targetted

Originally produced for [The Reach](http://thereachmux.org/)

## Primary interfaces:
## Interface

### Function interface
* fn_post_new_topic
* fn_post_reply
* fn_simple_post_new_topic
* fn_simple_post_reply
* fn_post_job

### Trigger interface
* trig_post_job

## Compatibility

Very little, currently, but feedback and patches are welcome. We have this working with:

* Anomaly Jobs 6.4 + a lot of patches
* Anomaly Jobs 6
* phpBB 3.0
* TinyMux 2.10 + [a few patches](https://github.com/lashtear/tinymux/tree/thereach)
* MySQL 5.1
* TinyMux 2.10
* MySQL 5.1 and 5.5

Source code is provided in the format of the general MUSH unformatter tools that we all use; attributes must be unwrapped before feeding into the MUX.

Loki has been investigating RHOST+SMF compatibility. Patches are quite welcome.

## Acknowledgements

The idea of archiving AJ's completed jobs to a permanent forum was originally [Loki](http://github.com/kkragenbrink)'s (Nuitari@DLAoM), and he completed working versions on DragonLance: Age of Mortals MUSH and [Haunted Memories: Vienna by Night](http://www.haunted-memories.net/) for AJ5 and SMF.
Expand Down
9 changes: 6 additions & 3 deletions hooks.mush
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ QUIT
@vc me=#2621
-

&hook_apr %vc=think ulocal( #5185/fn_post_job, %0 )
@vz %vc=#5185
-

&hook_dny %vc=think ulocal( #5185/fn_post_job, %0 )
&hook_apr %vc=@trigger %vz/trig_post_job=%0
-

&hook_com %vc=think ulocal( #5185/fn_post_job, %0 )
&hook_dny %vc=@trigger %vz/trig_post_job=%0
-

&hook_com %vc=@trigger %vz/trig_post_job=%0
-
58 changes: 55 additions & 3 deletions jobs-archive.mush
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# fn_simple_post_reply
# fn_post_job

# Copyright (c) 2011 Emily Backes
# Copyright (c) 2011-2013 Emily Backes
#
# All rights reserved.
#
Expand Down Expand Up @@ -57,11 +57,11 @@ QUIT
-
@desc %va=Functions for posting to PHPBB3 forums using mysql
-
&copyright %va=Copyright (c) 2011 Emily Backes
&copyright %va=Copyright (c) 2011-2013 Emily Backes
-
&license %va=BSD 3-Clause
-
&version %va=1.0.1
&version %va=1.1.0
-

# conf prefix of forum tables
Expand Down Expand Up @@ -708,6 +708,58 @@ QUIT
%qt )))))
-

# takes
# DBREF of job

&trig_post_job %va=
@assert
setr( e,
switch( 1,
not( isdbref( %0 )), #-1 Invalid job DBREF,
not( strmatch( name( %0 ), Job* )), #-1 Not a job,
not( strmatch( xget( setr(p, parent( parent( %0 ))), vc ), %qp )),
#-1 Not in a bucket,
not( strmatch( name( %qp ), *Job Parent Object* )), #-1 Invalid JPO,
strcat(
setq( u, ulocal( %va/fn_get_user_id, default(%!/CONF_FORUM_USER, +jobs) )),
setq( f, ulocal( %va/fn_get_forum_id, lcstr( name( parent( %0 ))))),
switch( %qu|%qf,
#-1*|*, #-1 Unable to locate +jobs user,
*|#-1*, #-1 Unknown to locate bucket forum,
1 ))))=@pemit %#=<ERROR> trig_post_job setup returned %qe;

@assert
setr( t,
ulocal( %va/fn_post_new_topic,
%qu,
%qf,
strtrunc( get( %0/title ), 96 ),
ulocal( %va/fn_summarize_job, %0 ),
get( %0/opened_on )))=@pemit %#=<ERROR> trig_post_job topic post returned %qe;

@dol lnum( 1, dec( get( %0/num_comment )))={
think setq( c, get( %0/comment_## ));
think iter( lnum( 1, 5 ), setq( %i0, index( %qc, |, %i0, 1 )));
think iter( 1 2,
strcat(
setq( p,
mid( %q5,
mul( ulocal( %va/conf_lbuf_div2 ), dec( %i0 )),
ulocal( %va/conf_lbuf_div2 ))),
if( or( strlen( %qp ), not( dec( %i0 ))),
ulocal( %va/fn_post_reply,
%qu,
%qt,
strcat(
if( gt( strlen( %q5 ), ulocal( %va/conf_lbuf_div2 )),
This post was larger than half LBUF size and
is split into two pieces. This is part %i0 of 2.),
ulocal( %va/fn_summarize_job_entry,
%0, %q1, %q2, %q3, %q4, %qp, ## )),
%q2))))
}
-

# takes
# list of DBREFs
# returns list of names, english style
Expand Down

0 comments on commit 87739ed

Please sign in to comment.