> For the complete documentation index, see [llms.txt](https://playground.e107sk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://playground.e107sk.com/e107-efiction-integration/outdated/members-vs-authors.md).

# Members vs authors

## fanfiction\_authors table

| field name   | Note                            | e107            |
| ------------ | ------------------------------- | --------------- |
| uid          | Author ID                       |                 |
| penname      | Author Penname                  | user\_loginname |
| realname     |                                 | user\_name      |
| email        |                                 | user\_email     |
| website      |                                 | (UEF)           |
| bio          |                                 | user\_signature |
| image        |                                 | user\_image     |
| date         | Date of registration            | user\_join      |
| admincreated | Created by Admin, not real user |                 |
| password     |                                 | user\_password  |

**Note:** eFiction separates authors by numbers of stories - if you have at least one story, you are listed as the author, if you are just registered, you are listed as member. &#x20;

Not to mess those terms (meanings), we try to use this naming convention:

* user - e107 user
* author - e107 user + fanfiction\_authors table
* member - author without story...  this should be replaced in the future

{% hint style="info" %}
e107 users are all members (including authors).  eFiction authors table just extends users table and allows to use eFiction functionality. &#x20;
{% endhint %}

## fanfiction\_authorprefs table

**Explanatory notes:**

❌ - moved to Removed fields

✅ - replaced by something else

User's settings for eFiction part. The user has to be author to have access to this settings.&#x20;

| Field name | Meaning                                | Note |
| ---------- | -------------------------------------- | ---- |
| uid        | Author ID (not User ID)                |      |
| newreviews | Contact for new reviews                |      |
| newrespond | Contact when author responds to review |      |
| ageconsent |                                        |      |
| alertson   | Contact when favorites are updated     |      |
| tinyMCE    | Use tinyMCE WYSWYG editor              |      |
| sortby     | Default Story Sort                     |      |
| storyindex | Display table of contents for stories  |      |
| validated  |                                        |      |
| categories |                                        |      |
| contact    |                                        |      |
| stories    |                                        |      |
| level      | ✅                                      |      |
| userskin   | ❌                                      |      |

There was a question if not to move those settings to UEF (e107 user extended fields).  In this phase, it was rejected. This table is too much used, so it will be left untouched for now.&#x20;

### Replaced fields

✅ -  applied in version (last checked)

| Field name | Description       | From version |
| ---------- | ----------------- | ------------ |
| level      | replaced with UEF | ✅1.0.3       |

```
<extendedFields>
     <field name="level" type='EUF_DROPDOWN' text="Level" default='0' active="true" system="0" parms="^,^^,^^,^0^,^^,^" 
			values="1,2,3,4" read="255" write="250" applicable="253" signup="0" />
</extendedFields>
```

{% hint style="info" %}
After installation there is the record change in the setup file. To be sure, always check UEF after  installation.
{% endhint %}

![Available UEF in 1.0.3](/files/-MbzgQyzPtlvK0VFJj3p)

### Removed fields

| Key      | Description                                                                                                                  | From version |
| -------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------ |
| userskin | it was used for choosing the appearance of the site. Listed skins from skins folder except for hidden skins from site prefs. | ✅1.0.2       |

## fanfiction\_authorfields table

This table **was removed** and it was fully replaced with UEF (e107 user extended fields) functionality.&#x20;

The always-installed field is the only beta-reader field. If there is a need for some next field, new fields can be added to the installation.  For example website from the author table. Any new field can be added via the admin interface anytime now.

```
<extendedFields>
	<field name="betareader" type='EUF_RADIO' text="Beta-reader" default='0' active="true" system="0" values="LAN_YES,LAN_NO" />
</extendedFields>
```

When the author clicks on the Author fields, the user settings page will be displayed with those fields. Those settings/fields are available for all users, not only for authors.

## How to work with e107 users:

`USERID` - user ID for actual logged-in user

`$userData = e107::user(USERID);`

* get all user data +  all extended fields in one array

`$author_uid = $userData['user_plugin_efiction_author'];` \
`$author_level = $userData['user_plugin_efiction_level'];`

* author UID and Level for checking access to efiction stuff

efiction constants:

|               |                                                         |
| ------------- | ------------------------------------------------------- |
| `uLEVEL`      | for checking access to not only admin functionality     |
| `isADMIN`     | user is admin for efiction part                         |
| `isMEMBER`    | user is member for efiction part                        |
| `USERUID`     | author user ID (ID for member for efiction part)        |
| `USERPENNAME` | author penname - it can be different from e107 username |

{% hint style="info" %}
to check how this work, look at inc/get\_session\_vars.php
{% endhint %}

## TODO:

e107 user profile - e\_user.php fix

{% content-ref url="/pages/-Maw\_M4UMxlSr2AVr8GA" %}
[efiction\_authors](/e107-efiction-integration/outdated/authors-class.md)
{% endcontent-ref %}
