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)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Extensioninfobox|title=the extension's name|desc=Adds comments and a sales area to lorekeeper.|auth=Ne-wt, Preimpression|status=stable|github=Please Follow the Guide|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}}
 +
 
 +
Add comments to your sites! Comments will notify users when commented on and replied to.
 +
 
 +
Mentions are not yet developed, unfortunately.
 +
 
 
== Thanks ==
 
== 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!
 
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
 
https://ko-fi.com/preimpression
== Installation ==
 
'''<u>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>'''
 
'''I highly recommend installing locally before pushing to production'''
 
  
Pull the branch <code>Comment-Addons</code> from https://github.com/Ne-wt/lorekeeper.git
+
Also thanks to Laravelista for providing the original package.
Once pulled, run the command <code>composer install</code> on your local folder. This will install the config files for comments. You can also use <code>composer require laravelista/comments</code>. Please check and match your commit numbers to the repo.
 
  
'''If you forget this step, your comments will not work and you will receive 500 errors on all models containing comment code.'''
+
== Installation ==
 
+
'''<u>As of October 8, 2020, the Comments extension has been separated from the original package.</u>'''
Please note that currently, this composer package is not a standalone host and relies on GitHub API. This means you may be denied installing from the repository for a period of time. I unfortunately cannot predict how long. I am working on seeing if I can host it as a live 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.''
 
 
Once both processes have completed, run <code>php artisan migrate</code>
 
 
 
You will now (hopefully) have comments locally.
 
  
 +
# 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.
 
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!
  
 
Once comfortable with the state of the package, push any files to your site that sourcetree detects. You may need to include composer.lock in this push if you are on a limited hosting plan.
 
 
 
Once pushed, run <code>composer install</code> in <code>sitename.com/www</code>. You can also use <code>composer require laravelista/comments</code>. Please check and match your commit numbers to the repo.
 
 
Finally, run <code>php artisan migrate</code>
 
 
After, you should have comments installed.
 
 
 
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 41: 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([ 'model' => $modelvariable,'approved' => true ])</code> to your view
+
* Add <code>@comments([ 'model' => $modelvariable, 'perPage' => 5 ])</code> to your view
 +
* You will also need to update your Notifications inside CommentController to handle whatever new system you're adding comments to.
 +
 
 
== 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!