[AP] Style Suite

[AP] Style Suite [Paid] 2.11.9

No permission to buy (€15.00)
Edit: Oh oh I see wthat there's options in the Style Properties to disable, so I can just make a theme for sensitive folks.
As of now this would be the only way, but I do like the idea and think a simple "Disable user customizations" checkbox in user preference would be easy & great for accessibility, so I'll add it to the Todo list.
 

Hello!​

Thank you again for the speedy update and responsiveness.

I do have some feedback (uh oh spaghettio)

I tried running the Postbit rebuild command (testing) and got this error:

ErrorException: [E_WARNING] fopen(): Filename cannot be empty in src/addons/apathy/StyleSuite/Job/Postbit.php at line 52
  1. XF::handlePhpError()
  2. fopen() in src/addons/apathy/StyleSuite/Job/Postbit.php at line 52
  3. apathy\StyleSuite\Job\Postbit->rebuildById() in src/XF/Job/AbstractRebuildJob.php at line 47
  4. XF\Job\AbstractRebuildJob->run() in src/XF/Job/Manager.php at line 260
  5. XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line 202
  6. XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 86
  7. XF\Job\Manager->runQueue() in src/XF/Admin/Controller/Tools.php at line 141
  8. XF\Admin\Controller\Tools->actionRunJob() in src/XF/Mvc/Dispatcher.php at line 352
  9. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 263
  10. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
  11. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
  12. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2351
  13. XF\App->run() in src/XF.php at line 517
  14. XF::runApp() in admin.php at line 13

It's not really necessary to rebuild them right now but it is probably not by design!

Additionally enabling the "disable user styles" disables everything except for the Postbit, although it's mentioned in the description. I know there's a "disable postbits" section in the users Style Settings so maybe there's a conflict there? it did cause an error in the ACP to view the postbit when tall styles are disabled.
 
I tried running the Postbit rebuild command (testing) and got this error:
Someone reported a very similar error to me the other day but I wasn't able to replicate it. FTR though, It's only useful to run that job though if you have "Allow linking of Image URLs for Postbits" enabled in the admin panel, if you only allow uploaded & preset postbits theres no need to run that job.
I'll keep trying to replicate it anyway.
Additionally enabling the "disable user styles" disables everything except for the Postbit, although it's mentioned in the description. I know there's a "disable postbits" section in the users Style Settings so maybe there's a conflict there? it did cause an error in the ACP to view the postbit when tall styles are disabled.
Dunno how I managed that, thanks for letting me know. It's not due to conflict now, I actually just completely forgot to link the "Disable user styles" button up to postbits. I'll try get another update out later on today with that addressed.
 
apathy updated [AP] Style Suite with a new update entry:

2.1.3

  • (Hopefully) fix fopen(1.jpeg): failed to open stream: No such file or directory
  • Validate glow CSS during save process
  • Validate colors during save process
  • Fix an issue where a users tooltip style would still apply after they had their permission revoked
  • Fix typo in custom title permission check
  • Migrate some checks into User entity to help simplify condition checks in templates
  • Fix postbits not respecting a users "Disable user styles" preference

Read the rest of this update entry...
 
@apathy Now getting this when someone tried to register:

Code:
[LIST]
[*]XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'ap_ss_disable_user_styles' in 'field list'
[*]src/XF/Db/AbstractStatement.php:230
[*]Generated by: Unknown account
[*]Mar 14, 2022 at 12:18 PM
[/LIST]
[HEADING=2]Stack trace[/HEADING]
INSERT  INTO `xf_user_option` (`content_show_signature`, `show_dob_year`, `show_dob_date`, `receive_admin_email`, `email_on_conversation`, `push_on_conversation`, `creation_watch_state`, `interaction_watch_state`, `sv_alerts_popup_skips_mark_read`, `sv_alerts_page_skips_mark_read`, `sv_alerts_page_skips_summarize`, `sv_alerts_summarize_threshold`, `user_id`, `is_discouraged`, `alert_optout`, `push_optout`, `use_tfa`, `show_zodiac`, `thuix_collapse_postbit`, `thuix_collapse_sidebar`, `thuix_collapse_sidebar_nav`, `thuix_font_size`, `ap_ss_disable_user_styles`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(41): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(56): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(220): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#5 src/XF/Mvc/Entity/Entity.php(1514): XF\Db\AbstractAdapter->insert('xf_user_option', Array, false)
#6 src/XF/Mvc/Entity/Entity.php(1246): XF\Mvc\Entity\Entity->_saveToSource()
#7 src/XF/Mvc/Entity/Entity.php(1264): XF\Mvc\Entity\Entity->save(true, false)
#8 src/XF/Service/User/Registration.php(301): XF\Mvc\Entity\Entity->save()
#9 src/XF/Service/ValidateAndSavableTrait.php(42): XF\Service\User\Registration->_save()
#10 src/XF/Pub/Controller/Register.php(423): XF\Service\User\Registration->save()
#11 src/addons/XenSoluce/AvatarGallery/XF/Pub/Controller/Register.php(79): XF\Pub\Controller\Register->actionRegister()
#12 src/XF/Mvc/Dispatcher.php(352): XenSoluce\AvatarGallery\XF\Pub\Controller\Register->actionRegister(Object(XF\Mvc\ParameterBag))
#13 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Register', 'Register', Object(XF\Mvc\RouteMatch), Object(XenSoluce\AvatarGallery\XF\Pub\Controller\Register), NULL)
#14 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XenSoluce\AvatarGallery\XF\Pub\Controller\Register), NULL)
#15 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#16 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#17 src/XF.php(517): XF\App->run()
#18 index.php(20): XF::runApp('XF\\Pub\\App')
#19 {main}
[HEADING=2]Request state[/HEADING]
array(4) {
  ["url"] => string(18) "/register/register"
  ["referrer"] => string(28) "https://zoldos.net/register/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(19) {
    ["_xfToken"] => string(8) "********"
    ["6d32a73410a7ea759854c49b3c49ef204ca061db"] => string(5) "xx"
    ["username"] => string(0) ""
    ["fb0b5d042b0a70b2465c72f1d07bf0d217f7ef42"] => string(26) "l1@gmail.com"
    ["email"] => string(0) ""
    ["e5b90003fec4ec084680a11963324e188df06f49"] => string(8) "********"
    ["gallery_avatar"] => string(0) ""
    ["dob_month"] => string(1) "1"
    ["dob_day"] => string(2) "20"
    ["dob_year"] => string(4) "1989"
    ["location"] => string(4) "USA "
    ["g-recaptcha-response"] => string(548) "03AGdBq25aTcMX-aY2XaBIBRZTmZ9u_I7c8_cdzXaVf16qKQZQPfIxs6o1O5lUgCqfn4QDBmdSt7dTI5xFfr42JhtzIa_80yfS1yiW-DP3MqqNXvMoP227lSDrrrxJJBLhmLyvD7zkHuLuwinK4c5vDaiNVJWTbjk4-VNO0rIH8aIJzG8r0O1sczwJt_wA8v7CKlSW7J-R1NbiB9aohgdsynkaPFKkgm_-i2VP4zKSLDuhxyPDgVL0kej3rO0PUXhkSU3rxEC7-PB51QIuY5XIaPP45_d6jWUVSGsLM4n8tgVz0G7m6LlEVrGx3aySOUlZBmLpXDeAxl5JZAk_eE01n2zQVp6igPCKnBlmo_bMv4VhgdMFWhjcw-jZTUUAVMU1jlVjYbnY66b6VGUr0uv0Pa7KKPb5LT6zqZ6L12_FioT4JfTL7Jw-eLTDptIamw6LG2QseZRoIwiiU9fftC4R3j5bRw0rpmzBrMLUDZMvSqMplzL3zAjmnj1SfkK5Ji9ZeP8WmryKY-7PTunFvR_zE40jaE9T_wNuCQ"
    ["email_choice"] => string(1) "1"
    ["accept"] => string(1) "1"
    ["reg_key"] => string(16) "mWQ-jcmcikfOaNG9"
    ["dd3adfc81c2cdc5b69d6124825b68bd9ba57f372"] => string(16) "America/New_York"
    ["_xfRequestUri"] => string(10) "/register/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}

:(
 
Not home atm but will be in about an hour and a half so I'll take a look at this then, you could disable the addon and get them to register then reenable it in the meantime
Yup, that's what I did and the registration worked. I'll keep it disabled until I hear back from you. Thanks!
 
Hi Apathy! Purchased this evening. Very happy. Just a few tweaks I want to make and perhaps suggestions if I may.

I want to blend in my postbit image with the background of that panel. On my previous manual code for a postbit image, I used the following -

.postbit_background {
position: absolute;
height: 250px;
width: 164px;
margin-top: -12px;
margin-left: -12px;
border-radius: 4px;
opacity: .9;
-webkit-mask-image: linear-gradient(to top, transparent, rgba(31,31,31,0.8));
background-size: cover !important;
background-repeat: no-repeat;
background-position: center center;
border-radius: 0;
}

Right now, it looks like this -

1647295823375.png

Ideally, I'd like to blend the image into the background using a gradient. I guess I could make transparent pngs for the backgrounds blending out but if possible to do with css, this would save some extra work.

My second request or idea is if you can set a default repeat option for all postbits (perhaps the top option, non-repeating) or set a default option per uploaded postbit image (this would be cool)

Maybe also option to rename as well as delete. I notice if you rename the file on your server, it doesn't update in the acp, so you'd have to delete and re-upload but if members have already selected this then it may cause issues.

Thank you! :)
 
Last edited:
Hi Apathy! Purchased this evening. Very happy. Just a few tweaks I want to make and perhaps suggestions if I may.

I want to blend in my postbit image with the background of that panel. On my previous manual code for a postbit image, I used the following -



Right now, it looks like this -

View attachment 265916

Iddeally, I'd like to blend the image into the background using a gradient. I guess I could make transparent pngs for the backgrounds blending out but if possible to do with css, this would save some extra work.

My second request or idea is if you can set a default repeat option for all postbits (perhaps the top option, non-repeating) or set a default option per uploaded postbit image (this would be cool)

Maybe also option to rename as well as delete. I notice if you rename the file on your server, it doesn't update in the acp, so you'd have to delete and re-upload but if members have already selected this then it may cause issues.

Thank you! :)

There's a slight gradient applied over postbits already to sort of dim them out a bit and make them easier on the eyes. If you enable Dev mode for Xenforo you can go to Appearance -> Template modifications -> [AP] Style Suite: post_macros.
There's 3 different lines where a variable called $css is being defined, and the relevant CSS exists in there. It's messy to look at since some of my column names are kinda long, but if you copy the whole "Replace" section into a text editor you could CTRL+F: background-image:linear-gradient(rgba(0,0,0,0.'.{$xf.options.ap_pbit_gradient_top}.'), rgba(0,0,0,0.'.{$xf.options.ap_pbit_gradient_btm}.')) and replace the 3 instances with background-image:linear-gradient(to top, transparent, rgba(31,31,31,0.8)).

We already expose admin options for gradient strength but in the future I might replace them with 3 new Style Properties:
  • Gradient start color
  • Gradient end color
  • Gradient direction
In regards to your second suggestion, it should default to no-repeat, even if the button isn't selected in your Style Settings. I have already noticed the button isn't auto-selected, I'll make sure that's sorted for the next update.

I think the ability to rename should be easy enough but I want to focus on squashing bugs atm or general polish rather than adding too many new features/options, so I'll address your first two suggestions as soon as I can, but the rename might not be for a couple weeks instead.
 
In testing, if you go to a users profile in the admin cp - You cannot change their postbit. The dropdown that is present doesn't have any of the uploaded postbits listed.

Not sure if that makes sense.

1647799026162.webp

As always - thank you :)
 
In testing, if you go to a users profile in the admin cp - You cannot change their postbit. The dropdown that is present doesn't have any of the uploaded postbits listed.

Not sure if that makes sense.

As always - thank you :)
I'm aware of it but it had actually slipped my mind so TY for the reminder - I think the admin editor is also lacking the ability to upload postbit & username icon images, so I'll have all this addressed in the next update.
 
apathy updated [AP] Style Suite with a new update entry:

2.1.4

  • Create macros for style setting templates to ensure Public & Admin controllers stay in sync
  • Rebase postbit settings admin controller
  • Create template helper for handling postbits
  • Auto-select "no-repeat" postbit option in templates
  • Remove old postbit gradient strength admin options
  • Create style properties for handling postbit gradients

Read the rest of this update entry...
 
Top Bottom