Difference between revisions of "Extensions:Comments"

From Lorekeeper Wiki
Jump to navigation Jump to search
Tag: 2017 source edit
m (Added updating to v2 link)
 
(19 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Extensioninfobox|title=the extension's name|desc=A short description|auth=Ne-wt, Preimpression|status=stable|github={{Github|user=ne-wt|branch=branch}}|migration=yes|package=yes}}
+
{{Extensioninfobox|title=Comments|desc=Adds comments and a sales area to lorekeeper.|auth=Ne-wt, Preimpression|status=stable|github={{Github|user=ne-wt|branch=comments-addon}}|migration=yes|package=no|modified-main=yes}}
<!-- Put a short summary of your extension here! -->
+
 
 +
Add comments to your sites! Comments will notify users when commented on and replied to.
 +
 
 +
Mentions are not yet developed, unfortunately.
 +
 
 +
== Thanks ==
 +
Special thank you to Uri (Preimpression) who not only helped make this project possible, but significantly reduced its development time. Please consider donating to their ko-fi!
 +
 
 +
https://ko-fi.com/preimpression
 +
 
 +
Also thanks to Laravelista for providing the original package.
 +
 
 
== Installation ==
 
== Installation ==
PLEASE NOTE THAT THIS EXTENSION IS INSTALLED IN A DIFFERENT MANNER THAN USUAL EXTENSIONS. IF YOU ARE NOT WELL EXPERIENCED WITH YOUR SITE AND USING YOUR IDE, PLEASE CONSIDER ASKING FOR HELP INSTALLING.
+
'''<u>As of October 8, 2020, the Comments extension has been separated from the original package.</u>'''
 +
''As always, we highly recommend installing locally and testing on a local testing server (via XAMPP or something similar) to ensure everything is working.''
 +
 
 +
# Pull the branch (comments-addon) and merge. Make sure to check your conflicts manually - don't rely on Sourcetree to handle the merge!
 +
# Run the command: <code>composer update</code> so that your server will ensure it has some of the minor packages (such as Honeypot by Spatie, which is spam-prevention package).
 +
#* You may need to include composer.lock in this push if you are on a limited hosting plan and composer complains about memory.
 +
# Run the command: <code>php artisan migrate</code> so that Laravel will update the database accordingly.
 +
# If you had the package prior to the October 8 update, run <code>php artisan view:clear</code> to clear your view caches.
 +
 
 +
I recommend playing with comments before repeating the process for your production site. This will allow you to catch any errors before it can affect your site. Please let me know if you happen to find any.
 +
If you encounter any errors please let me know!
 +
 
 
== Configuration ==
 
== Configuration ==
 
Comments come with the following extensions installed:  
 
Comments come with the following extensions installed:  
Line 10: Line 32:
 
If you do not wish to use these please consider removing before pushing to your site.
 
If you do not wish to use these please consider removing before pushing to your site.
  
If you make any local changes to your vendor folder, you *can ftp your comments folder directly to your server, as git does not track the vendor folder.*
 
 
== Usage ==
 
== Usage ==
 
To add comments to a new ''page'', add the following:
 
To add comments to a new ''page'', add the following:
*Add <code>use Laravelista\Comments\Commentable;</code> to the top of your model
+
* Add <code>use App\Traits\Commentable;</code> to the top of your model
*Add <code>use Commentable;</code> within the curly brackets (e.g Controller extends Controller <code>{ use Commentable;)</code>
+
* Add <code>use Commentable;</code> within the curly brackets (e.g Controller extends Controller <code>{ use Commentable;)</code>
*Add <code>@comments([
+
* Add <code>@comments([ 'model' => $modelvariable, 'perPage' => 5 ])</code> to your view
    'model' => $modelvariable,
+
* You will also need to update your Notifications inside CommentController to handle whatever new system you're adding comments to.
    'approved' => true ])</code> to your view
+
 
 
== Troubleshooting ==
 
== Troubleshooting ==
 
If you need support please @ me in the lorekeeper discord, Newt#7776.
 
If you need support please @ me in the lorekeeper discord, Newt#7776.
 
Please note I heavily advise testing on local before pushing to production.  
 
Please note I heavily advise testing on local before pushing to production.  
 +
 
== See Also ==
 
== See Also ==
<!-- Any relevant other pages. You may consider linking to related extensions, for instance. -->
+
If you have errors, try [https://www.tutsmake.com/laravel-clear-cache-using-artisan-command-cli/ clearing your laravel caches] before anything!
 +
* [[Updating:_to_2.0.0]]

Latest revision as of 09:09, 25 March 2024

Comments
Description Adds comments and a sales area to lorekeeper.
Author(s) Ne-wt, Preimpression
Status stable
Github comments-addon
LK Version Unspecified
Contains a Migration
Is part of LK v2 (modified-main)






Add comments to your sites! Comments will notify users when commented on and replied to.

Mentions are not yet developed, unfortunately.

Thanks

Special thank you to Uri (Preimpression) who not only helped make this project possible, but significantly reduced its development time. Please consider donating to their ko-fi!

https://ko-fi.com/preimpression

Also thanks to Laravelista for providing the original package.

Installation

As of October 8, 2020, the Comments extension has been separated from the original package. As always, we highly recommend installing locally and testing on a local testing server (via XAMPP or something similar) to ensure everything is working.

  1. Pull the branch (comments-addon) and merge. Make sure to check your conflicts manually - don't rely on Sourcetree to handle the merge!
  2. Run the command: composer update so that your server will ensure it has some of the minor packages (such as Honeypot by Spatie, which is spam-prevention package).
    • You may need to include composer.lock in this push if you are on a limited hosting plan and composer complains about memory.
  3. Run the command: php artisan migrate so that Laravel will update the database accordingly.
  4. If you had the package prior to the October 8 update, run php artisan view:clear to clear your view caches.

I recommend playing with comments before repeating the process for your production site. This will allow you to catch any errors before it can affect your site. Please let me know if you happen to find any. If you encounter any errors please let me know!

Configuration

Comments come with the following extensions installed:

  • User Avatars
  • Sales Page Addon
  • User Ranks Icon Addon

If you do not wish to use these please consider removing before pushing to your site.

Usage

To add comments to a new page, add the following:

  • Add use App\Traits\Commentable; to the top of your model
  • Add use Commentable; within the curly brackets (e.g Controller extends Controller { use Commentable;)
  • Add @comments([ 'model' => $modelvariable, 'perPage' => 5 ]) to your view
  • You will also need to update your Notifications inside CommentController to handle whatever new system you're adding comments to.

Troubleshooting

If you need support please @ me in the lorekeeper discord, Newt#7776. Please note I heavily advise testing on local before pushing to production.

See Also

If you have errors, try clearing your laravel caches before anything!