Skip to main content
[ADDON] SimplePortal Started by Spuds · · Read 338984 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic

Re: [ADDON] SimplePortal

Reply #630

Quote from: Spuds – That first one is strange since that variable does not appear on that line.

I found what it was. I removed the bit about drag & drop of the blocks on portal page.
However, I had removed the main call for javascript. (Starts around 237)

Code: (FULL) [Select]
// We use drag and sort blocks for the front page
$javascript = '';
// Javascript to allow D&D ordering of the front page blocks, not for guests
if (($modSettings['sp_portal_mode'] == 1)
&& empty($_REQUEST['action']) && empty($_REQUEST['board']) && !($user_info['is_guest'] || $user_info['id'] == 0))
{
$modSettings['jquery_include_ui'] = true;
$javascript .= '
// Set up our sortable call
$().elkSortable({
sa: "userblockorder",
error: "' . $txt['portal_order_error'] . '",
title: "' . $txt['portal_order_title'] . '",
handle: ".sp_drag_header",
tag: ".sp_column",
opacity: 0.9,
connect: ".sp_column",
containment: "#main_content_section",
tolerance: "pointer",
href: "/",
placeholder: "ui-state-highlight",
axis: "",
});';
}


That's what had removed, but in reality, this is what needed to remove:

Code: (CORRECT) [Select]
// Javascript to allow D&D ordering of the front page blocks, not for guests
if (($modSettings['sp_portal_mode'] == 1)
&& empty($_REQUEST['action']) && empty($_REQUEST['board']) && !($user_info['is_guest'] || $user_info['id'] == 0))
{
$modSettings['jquery_include_ui'] = true;
$javascript .= '
// Set up our sortable call
$().elkSortable({
sa: "userblockorder",
error: "' . $txt['portal_order_error'] . '",
title: "' . $txt['portal_order_title'] . '",
handle: ".sp_drag_header",
tag: ".sp_column",
opacity: 0.9,
connect: ".sp_column",
containment: "#main_content_section",
tolerance: "pointer",
href: "/",
placeholder: "ui-state-highlight",
axis: "",
});';
}


Needed to leave this behind:

Code: (LEAVE) [Select]
// We use drag and sort blocks for the front page
$javascript = '';

Re: [ADDON] SimplePortal

Reply #631

See how easy it is to create:bug:  :grin:


Re: [ADDON] SimplePortal

Reply #633

:woozy_face:LOL

Re: [ADDON] SimplePortal

Reply #634

Quote from: Burke Knight –
Needed to leave this behind:

Code: (LEAVE) [Select]
// We use drag and sort blocks for the front page
$javascript = '';

One of my project programmers years ago was lamenting the code he inherited and was trying to "clean up"... told us in a progress meeting: "Until I put one of the nonsensical comments that I deleted back in, including all three trailing periods, the damn thing wouldn't compile!"  :confused:

:stuck_out_tongue:

// Deep inside every dilemma lies a solution that involves explosives //

Re: [ADDON] SimplePortal

Reply #635

And a minor update to 1.0.3

  • Prevent error when article attachment is missing.
  • Provide generic "not found" image for any missing article attachments
  • Add admin option to disable user ability to arrange blocks
  • Fix issue where the top menu was left on "Community" when viewing a board/etc, it now correctly show "Forum" as active
  • Article attachments were not working as expected when Auto Manage attachments was enabled.

http://addons.elkarte.net/feature/Simple-Portal.html


 

Re: [ADDON] SimplePortal

Reply #637

I would figure you had them since most are ones you reported  :cool:

Re: [ADDON] SimplePortal

Reply #638

Quote from: Spuds – I would figure you had them since most are ones you reported  :cool:

And since you said that, here's another issue:

QuoteType of error: General
Exception: Class "SP_Abstract_Block" not found
index.php?action=xmlhttp;sa=blockorder;xml
File: sources/subs/spblocks/RecentEx.block.php
Line: 29

Line 29:
Code: [Select]
class Recent_Ex_Block extends SP_Abstract_Block

Strange error that does not appear to have any effect besides error log entry.

Re: [ADDON] SimplePortal

Reply #639

Thanks for the report .. I'll take a look as soon as I'm done adding a new feature to 2.0 ... getting close :D

Re: [ADDON] SimplePortal

Reply #640

@Spuds

Board News Block...

Is there a way, to divide each post into it's own div with a space between them?
Right now, I have an hr then the next post's title, but would like it to show each post in it's own div, if possible.
Kind of making each post into it's own block, look wise. Since set the main display as No Title and Roundframe.

Re: [ADDON] SimplePortal

Reply #641

Quote from: Burke Knight –
Code: [Select]
class Recent_Ex_Block extends SP_Abstract_Block
Looks like to fix that we need to move up the require_once of that class (it does not autoload in 1.1) So in sources\admin\PortalAdminBlocks.controller.php we need to add a line.
Code: (find) [Select]
		// We'll need the utility functions from here.
require_once(SUBSDIR . '/PortalAdmin.subs.php');
require_once(SUBSDIR . '/Portal.subs.php');
Code: (replace) [Select]
		// We'll need the utility functions from here.
require_once(SUBSDIR . '/PortalAdmin.subs.php');
require_once(SUBSDIR . '/Portal.subs.php');
require_once(SUBSDIR . '/spblocks/SPAbstractBlock.class.php');
I think the best thing to do is make the edit in sources\subs\spblocks\BoardNews.block.php  in that file in the template_sp_boardNews function
Code: (find) [Select]
	// Output all the details we have found
foreach ($data['news'] as $news)
{
$attachment = $news['attachment'];

echo '
<h3 class="category_header">' . (empty($modSettings['messageIcons_enable'])
and just add a div to the start of that like
Code: (replace) [Select]
	// Output all the details we have found
foreach ($data['news'] as $news)
{
$attachment = $news['attachment'];

echo '
<div class="well">
<h3 class="category_header">' . (empty($modSettings['messageIcons_enable'])
I used the class well (that is roundframe), but content, or forumpost or ... whatever you want would work fine.  Also be sure to close that new div at the end of the function, so it looks like:
Code: (replace) [Select]
		echo $news['body'], '
</div>
<div class="submitbutton">', $news['link'], ' ', $news['new_comment'], '</div>
</div>
</div>
</div>';