Difference between revisions of "Extensions:User Watching"
(→Usage: Added options for the widget.) Tag: 2017 source edit |
|||
| Line 23: | Line 23: | ||
== Usage == | == Usage == | ||
| − | < | + | |
| + | The dashboard has a widget of showing only when there are people you watch by default. If you wish to change it and always show, find the following in _recent_watching_submissions.blade.php | ||
| + | <syntaxhighlight lang="html">@if(count($watchedSubmissions)) | ||
| + | <div class="card my-2 text-center"> | ||
| + | <div class="card-header"> | ||
| + | <h5>From People You Watch</h5> | ||
| + | </div> | ||
| + | <div class="card-body"> | ||
| + | <div class="row"> | ||
| + | @foreach($watchedSubmissions as $submission) | ||
| + | <div class="col-md-3 col-6 mb-2"> | ||
| + | @include('galleries._thumb', ['submission' => $submission]) | ||
| + | </div> | ||
| + | @endforeach | ||
| + | <div class="col-12"> | ||
| + | <a class="float-right" href="account/watching">View all People You Watch...</a> | ||
| + | </div> | ||
| + | </div> | ||
| + | </div> | ||
| + | </div> | ||
| + | @endif</syntaxhighlight> | ||
| + | |||
| + | |||
| + | Replace it with: | ||
| + | <syntaxhighlight lang="html"><div class="card my-2 text-center"> | ||
| + | <div class="card-header"> | ||
| + | <h5>From People You Watch</h5> | ||
| + | </div> | ||
| + | <div class="card-body"> | ||
| + | <div class="row"> | ||
| + | @if(count($watchedSubmissions)) | ||
| + | @foreach($watchedSubmissions as $submission) | ||
| + | <div class="col-md-3 col-6 mb-2"> | ||
| + | @include('galleries._thumb', ['submission' => $submission]) | ||
| + | </div> | ||
| + | @endforeach | ||
| + | @else | ||
| + | <div class="col-12">You don't watch anyone yet.</div> | ||
| + | @endif | ||
| + | <div class="col-12"><a class="float-right" href="account/watching">View all People You Watch...</a></div> | ||
| + | </div> | ||
| + | </div> | ||
| + | </div></syntaxhighlight> | ||
| + | |||
== Troubleshooting == | == Troubleshooting == | ||
<!-- Are there known issues or errors that require user action? Who should they contact, and where, for support? --> | <!-- Are there known issues or errors that require user action? Who should they contact, and where, for support? --> | ||
Revision as of 16:48, 25 February 2026
| Description | Adds a simple watching feature for users to watch others and see their gallery submissions. |
|---|---|
| Author(s) | Camyza |
| Status | stable |
| Github | extension/user-watching-v3 |
| LK Version | 3.0.0 |
| Contains a Migration | |
Adds a simple watching feature for users to watch other users to see their gallery submissions on the dashboard and on their own Watching page underneath the user submenu in the navigation bar.
Installation
Pull the extension and deal with any conflicts that will arise.
Do the following commands once you resolve all conflicts.
php artisan migratephp artisan update-extension-trackerphp artisan optimizex2
Configuration
Not much to configure unless you don't want the default settings for how many to display per pages.
To change the amount of artwork to showcase in the Watching page, find the getWatching function in WatchController and fine this line:
$submissions = GallerySubmission::whereIn('user_id', $ids)->with(['gallery', 'user'])->visible($user)->latest()->paginate(20)->appends($request->query());
You can change the 20 in paginate(20) to whichever number you prefer.
To change the amount on the dashboard, go to getIndex function in HomeController and find this line:
$watchedSubmissions = GallerySubmission::whereIn('user_id', $followingIds)->with(['gallery', 'user'])->visible($user)->latest()->take(8)->get();
You can change the 8 in take(8) to whichever you prefer to show on the dashboard.
Usage
The dashboard has a widget of showing only when there are people you watch by default. If you wish to change it and always show, find the following in _recent_watching_submissions.blade.php
@if(count($watchedSubmissions))
<div class="card my-2 text-center">
<div class="card-header">
<h5>From People You Watch</h5>
</div>
<div class="card-body">
<div class="row">
@foreach($watchedSubmissions as $submission)
<div class="col-md-3 col-6 mb-2">
@include('galleries._thumb', ['submission' => $submission])
</div>
@endforeach
<div class="col-12">
<a class="float-right" href="account/watching">View all People You Watch...</a>
</div>
</div>
</div>
</div>
@endif
Replace it with:
<div class="card my-2 text-center">
<div class="card-header">
<h5>From People You Watch</h5>
</div>
<div class="card-body">
<div class="row">
@if(count($watchedSubmissions))
@foreach($watchedSubmissions as $submission)
<div class="col-md-3 col-6 mb-2">
@include('galleries._thumb', ['submission' => $submission])
</div>
@endforeach
@else
<div class="col-12">You don't watch anyone yet.</div>
@endif
<div class="col-12"><a class="float-right" href="account/watching">View all People You Watch...</a></div>
</div>
</div>
</div>