Difference between revisions of "Extensions:User Ads"
Tag: 2017 source edit |
Tag: 2017 source edit |
||
| Line 32: | Line 32: | ||
== Troubleshooting == | == Troubleshooting == | ||
| − | There shouldn't be any bugs. | + | There shouldn't be any bugs. Ping me in the general-help channel in the LK server if you have any issues. |
== Images == | == Images == | ||
<!-- Do you have any images to show what it looks like in action? --> | <!-- Do you have any images to show what it looks like in action? --> | ||
Revision as of 04:04, 20 February 2026
| Description | Users can submit ads to the site that will show up on all pages. |
|---|---|
| Author(s) | Camyza |
| Status | stable |
| Github | user-ads-v3 |
| LK Version | v3.0.0 |
| Contains a Migration | |
Allows users and staff alike to create user advertisements (aka ads) to the site. Only logged in members of the site can see the ads.
It doesn't allow any tags, just plain text when submitting, so no linking, no bold, no nothing to make it pretty nor prone to injections.
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 optimize
Configuration
The user ads are called with @include('layouts._user_ads') in app.blade.php by default. If you move this elsewhere, like the Dashboard, you may have to fiddle with the back end. There's a messy @php to allow the randomized ads to be pulled into app.blade.php file from the _user_ads.blade.php file since I wasn't able to figure out how to make it work without it.
Every day, Kernel checks to see if any User Ads are a week old to delete while set to daily(). This is because if set to weekly in Kernel, it will actually last 12 to 13 days to how I set it up via Commands file using Laravel's scheduler. I wasn't sure how to go about it the other way to make it easier to read, but in this way, it's quick, and it shouldn't be hard on a site.
You can also adjust the look of the user ads index and the ads itself with these files: resources/views/user_ads/index.blade.php resources/views/user_ads/_user_ads.blade.php
This also adds a new staff power, manage_uses_ads, so be sure to add to those who you wish to help moderate any ads.
Usage
Display in the app.blade.php for only logged in users. It will not show to guests unless you edit it.
Users can delete their own ads but cannot edit their own.
Staff with the power manage_uses_ads are able to delete and edit ads regardless of who made them.
Staff view only shows edit and delete. To create an ad, you must go to the user_ads folder of your site (example: site.com/user_ads)
Troubleshooting
There shouldn't be any bugs. Ping me in the general-help channel in the LK server if you have any issues.