[Sticky] List of "hooks" in the script
The following is a list of "hooks" where code can be added to the script via the PREFIXfanfiction_codeblocks table. This gives developers the ability to easily add functionality at certain points of the without hacking the files.
Each "hook" is assigned a name.
Developers will enter the following information into the database:
code_id - An auto-increment id number. Let the database assign this.
code_text - The text of your code additions. A smart idea is to put an include statement here pointing to the additional code. That way you don't have to change the code text in the database each time you make a change in your code. Especially makes things easier during development. 🙂
code_type - The "hook" location.
code_module - Assign a module name to this code text. This is assigned to quickly allow code blocks to be added and removed.
The current list of "hook" names:
addchapter - Used in stories.php to add information from custom chapter options to the database.
addseries - Used in series.php to add information from custom series options to the database.
addstory - Used in stories.php to add information from custom story options to the database.
adminnotices - Used in the main admin.php page and in the info block to assign admin notices. This information will be appended to the notice of the number of chapters in the submission queue.
AO - Used in the User Statistics panel to add custome items to the "Author of:" list.
browsesorts - Used to add custome select options to the sort form on the browse pages.
browseterms - Used to add custom selection to the queries on the browse pages. You will most likely use this in conjunction with the browsesorts hook.
delcategory - Used when a category is deleted to update information for the items on the site.
delchapter - Used to remove custom information from the database associated with a specific chapter that is being deleted.
delchar - Used when a character is deleted to update all the items on the site.
delclass - Used when a classification or classification_type is deleted from the site to update the items on the site.
deleteseries - Used in series.php to delete custom content concerning a series from the database.
delstory - Used to remove custom information from the database associated with a specific story that is being deleted.
deluser - Used to delete all items associated with a member when that member is deleted.
editchapter - Used in stories.php to update information from custom chapter options in the database.
editseries - Used in series.php to update information from custom series options in the database.
editstory - Used in stories.php to update information from custom story options in the database.
logtype - Used in the Admin log area to add new log types to the list.
membersList - Used to add new options to the selections available on the "Members" page.
otherresults - Used to select other results and display them in a list on the browse pages.
revadd - Used in reviews.php to add a review for an item that is not a story or series.
revauthor - Used to select the author of a reviewed item. This is used in reviews.php to determine if the visitor has permission to respond, edit, or delete the review.
revdelete - Used in reviews.php to delete a review that is not for a story or series.
revfix - Used in the Archive Maintenance page. If you have custom review types, use this to supply a way to recalculate the reviews for your custom type.
reviewsby - Used in the Reviews By panel to display the "block" of information about the specific item the review is for.
revreceived - Used in the Reviews Received panel to display the list of reviews that are not for stories or series. Will be appended to the end of the table under the stories list.
revqueries - Used in reviews.pphp to select the reviews for an item that is not a story or a series.
revtitle - Used in reviews.php to build the title for a review that is for an item that is not a story or a series.
searchform - Used in search.php to add new selection options for the advanced search form. In most cases this will be the same code you will use in the browsesorts hook.
seriesblock - Used to display custom information about a series in the series listings.
seriesform - Used in series.php to add custom options to the add and edit forms for a series.
seriestitle - Used to add custom information to the series title block.
sitestats - Used in the info block to add custom stats to the list.
storyblock - Used to display custom information about a story in the listing of stories. This information will also be used in the viewstory.
storyend - Used to add custom information to the display of the last chapter of a story in viewstory.php.
storyform - Used in includes/storyform.php to add custom information to the form displayed when adding or editing a story.
storyindex - Used to add custom information to the story index page in viewstory.php
userTabs - Used to add special information to the "tabs" in the viewuser.php page.
viewstory - Used to add custom information to the viewstory.php page.