[TaylorJ] Blogs

[TaylorJ] Blogs 1.3.0

No permission to download
besides the header_image distortion. I haven't figured out a proper way to stretch the images perfectly due to not having any limitations (size and width/height) on the xf:uploadrow being used for it and not figuring out yet how to implement them
Meanwhile you can add object-fit: cover; to the .taylorjBlogs.blog-header-image img selector

1723244393959.webp

For the Create blog button, you can add icon="add" to the button code to get the + before the text.
HTML:
<xf:button href="{{ link('blogs/add') }}" icon="add" overlay="true" class="button--cta">{{ phrase('taylorj_blogs_create_blog') }}</xf:button>
 
Last edited by a moderator:
Also @Old Nick / and anyone else that wants the hot fix for this

In src/addons/TaylorJ/Blogs/Setup.php replace both lines 48 and 72 with the below
PHP:
$table->addColumn('blog_post_state', 'enum')->values(['visible','schdeduled'])->setDefault('visible')

This will be included on the next beta but I've had more difficulty getting alerts to send out to everyone that's watched a blog than I expected.

Done this and works wonders...but when I go to edit a blog now it creates another one on top of it.
 
Done this and works wonders...but when I go to edit a blog now it creates another one on top of it.
 
@Taylor J tell me if i post too much !! 🤪

For the blog index view... some cosmetics...
HTML:
<div class="blog-header-image taylorjBlogs">
    <xf:if is="$blog.blog_header_image">
        <img src="{$blog.blog_header_image}" alt="Header Image" />
    <xf:else />
        <xf:fa icon="fad fa-book" class="taylorjBlogs-noImage"/>
    </xf:if>
</div>
Less code
Less:
.taylorjBlogs-noImage {
    color: @xf-chromeTextColor;
    font-size: 5rem;
    margin-top: 11%;
}

.taylorjBlogs.block {
    width: 100%;
    display: flex;
    flex-display: row;
    flex-wrap: wrap;
    //gap: 5px;
    gap: 15px;
}

h1 {
    margin: 10px 0 0;
    font-size: large;
}

1723246679994.webp
 
Last edited by a moderator:
  • InvalidArgumentException: Batch install error: xf_taylorj_blogs_blog_post: Column type 'VARCHAR' for column 'blog_post_state' must include a length.
  • src/XF/Db/Schema/Column.php:466
  • Generated by: admin
  • Aug 10, 2024 at 1:16 PM

Stack trace​

#0 src/XF/Db/Schema/Column.php(443): XF\Db\Schema\Column->getColumnDefinitionSql()
#1 src/XF/Db/Schema/Create.php(86): XF\Db\Schema\Column->getDefinition()
#2 src/XF/Db/Schema/AbstractDdl.php(154): XF\Db\Schema\Create->getQueries()
#3 src/XF/Db/SchemaManager.php(194): XF\Db\Schema\AbstractDdl->apply()
#4 src/XF/Install/InstallHelperTrait.php(907): XF\Db\SchemaManager->createTable('xf_taylorj_blog...', Object(Closure))
#5 src/addons/TaylorJ/Blogs/Setup.php(36): XF\AddOn\AbstractSetup->createTable('xf_taylorj_blog...', Object(Closure))
#6 src/XF/AddOn/StepRunnerInstallTrait.php(62): TaylorJ\Blogs\Setup->installStep2(Array)
#7 src/XF/AddOn/StepRunnerInstallTrait.php(29): TaylorJ\Blogs\Setup->installStepRunner(2, Array)
#8 src/XF/Job/AddOnInstallBatch.php(299): TaylorJ\Blogs\Setup->install(Array)
#9 src/XF/Job/AddOnInstallBatch.php(95): XF\Job\AddOnInstallBatch->stepAction(Object(XF\Timer))
#10 src/XF/Job/Manager.php(275): XF\Job\AddOnInstallBatch->run(8)
#11 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#12 src/XF/Job/Manager.php(121): XF\Job\Manager->runJobEntry(Array, 8)
#13 src/XF/Admin/Controller/ToolsController.php(146): XF\Job\Manager->runByIds(Array, 8)
#14 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\ToolsController->actionRunJob(Object(XF\Mvc\ParameterBag))
#15 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(Hampel\KnownBots\XF\Admin\Controller\Tools), NULL)
#16 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Hampel\KnownBots\XF\Admin\Controller\Tools), NULL)
#17 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#18 src/XF/App.php(2813): XF\Mvc\Dispatcher->run()
#19 src/XF.php(802): XF\App->run()
#20 admin.php(15): XF::runApp('XF\\Admin\\App')
#21 {main}

Request state​

array(4) {
["url"] => string(24) "/admin.php?tools/run-job"
["referrer"] => string(45) "https://mozodeals.com/admin.php?tools/run-job"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(3) {
["_xfRedirect"] => string(81) "https://mozodeals.com/admin.php?add-ons/install-from-archive-complete&batch_id=43"
["_xfToken"] => string(8) "********"
["only_ids"] => string(5) "25001"
}
}

One or more add-ons currently have actions pending and may be in an inconsistent state. Because of this, some errors may be suppressed and unexpected behavior may occur. If this does not change shortly, please contact the add-on author for guidance.
%s
" style="box-sizing: border-box; float: right; position: relative;">
 
Last edited:
One or more add-ons currently have actions pending and may be in an inconsistent state. Because of this, some errors may be suppressed and unexpected behavior may occur. If this does not change shortly, please contact the add-on author for guidance.
%s
" style="box-sizing: border-box; float: right; position: relative;">
 
  • InvalidArgumentException: Batch install error: xf_taylorj_blogs_blog_post: Column type 'VARCHAR' for column 'blog_post_state' must include a length.
  • src/XF/Db/Schema/Column.php:466
  • Generated by: admin
  • Aug 10, 2024 at 1:16 PM

Stack trace​

#0 src/XF/Db/Schema/Column.php(443): XF\Db\Schema\Column->getColumnDefinitionSql()
#1 src/XF/Db/Schema/Create.php(86): XF\Db\Schema\Column->getDefinition()
#2 src/XF/Db/Schema/AbstractDdl.php(154): XF\Db\Schema\Create->getQueries()
#3 src/XF/Db/SchemaManager.php(194): XF\Db\Schema\AbstractDdl->apply()
#4 src/XF/Install/InstallHelperTrait.php(907): XF\Db\SchemaManager->createTable('xf_taylorj_blog...', Object(Closure))
#5 src/addons/TaylorJ/Blogs/Setup.php(36): XF\AddOn\AbstractSetup->createTable('xf_taylorj_blog...', Object(Closure))
#6 src/XF/AddOn/StepRunnerInstallTrait.php(62): TaylorJ\Blogs\Setup->installStep2(Array)
#7 src/XF/AddOn/StepRunnerInstallTrait.php(29): TaylorJ\Blogs\Setup->installStepRunner(2, Array)
#8 src/XF/Job/AddOnInstallBatch.php(299): TaylorJ\Blogs\Setup->install(Array)
#9 src/XF/Job/AddOnInstallBatch.php(95): XF\Job\AddOnInstallBatch->stepAction(Object(XF\Timer))
#10 src/XF/Job/Manager.php(275): XF\Job\AddOnInstallBatch->run(8)
#11 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#12 src/XF/Job/Manager.php(121): XF\Job\Manager->runJobEntry(Array, 8)
#13 src/XF/Admin/Controller/ToolsController.php(146): XF\Job\Manager->runByIds(Array, 8)
#14 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\ToolsController->actionRunJob(Object(XF\Mvc\ParameterBag))
#15 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(Hampel\KnownBots\XF\Admin\Controller\Tools), NULL)
#16 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Hampel\KnownBots\XF\Admin\Controller\Tools), NULL)
#17 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#18 src/XF/App.php(2813): XF\Mvc\Dispatcher->run()
#19 src/XF.php(802): XF\App->run()
#20 admin.php(15): XF::runApp('XF\\Admin\\App')
#21 {main}

Request state​

array(4) {
["url"] => string(24) "/admin.php?tools/run-job"
["referrer"] => string(45) "https://mozodeals.com/admin.php?tools/run-job"
["_GET"] => array(1) {
["tools/run-job"] => string(0) ""
}
["_POST"] => array(3) {
["_xfRedirect"] => string(81) "https://mozodeals.com/admin.php?add-ons/install-from-archive-complete&batch_id=43"
["_xfToken"] => string(8) "********"
["only_ids"] => string(5) "25001"
}
}

One or more add-ons currently have actions pending and may be in an inconsistent state. Because of this, some errors may be suppressed and unexpected behavior may occur. If this does not change shortly, please contact the add-on author for guidance.
%s
" style="box-sizing: border-box; float: right; position: relative;">
Two lines to edit in setup.php
 
Already reported, that will be fixed in a future release i guess.
 
XF 2.3

It is possible to create posts in other people's blogs. The button appears if user A is on user B's blog.
But even hiding the button if we know the URL for creating a blog post then we can do it.
 
Back
Top Bottom