Daily Lucky Numbers:
14
20
21
29
33
44

ehportal help

Started by bigguy, November 08, 2015, 09:30:13 PM

Previous topic - Next topic

bigguy

Quotes don't work still. Not sure why....no errors in the logs.

Chen Zhen

#46
Try what is posted in the downloads once more.
It should work.. I tried it on 2 test sites with quotes in some news items.
If it does not work please report it and perhaps put in quotes the exact item you attempted for news that failed.
Bullets now work for news items if enabled (general block settings ~ News) & the amount of items is more than one.

Unfortunately applying 2 News blocks on 1 page causes malfuntions except in the last one displayed on the page.
Not that anyone would do this but I used block id's for the containers yet it still behaves this way.. working on that part for now.

Also the BBCode within redirect text at SMF 2.1 has been accepted therefore that display will show properly for the latest GitHub version.

bigguy

I will try it soon, possibly tonight. Just got home from work not to long ago.

Chen Zhen


You work in the Sifto mine right?
What do you do there, drive machinery?

GeorG

When you install the error:
Parse error: syntax error, unexpected '&&' (T_BOOLEAN_AND), expecting ')' in *\*\*\Sources\PortalBlocks.php on line 1623

Fix ../Sources/PortalBlocks.php

Code (find) Select
', (!empty($bullets && count($context['news_lines']) > 1) ? '
$("a").filter(function(){
var myId = this.id.match(/sp_news_nav_' . $id . '_*/);
return myId;
}).removeClass("sp-active").addClass("sp-inactive");
document.getElementById("sp_news_nav_' . $id . '_" + ct).className = "sp-active";
$("div#' . $blockId . '").css("padding-bottom", "1%");
' : ''), '


Code (replace) Select
', (!empty($bullets) && count($context['news_lines']) > 1) ? '
$("a").filter(function(){
var myId = this.id.match(/sp_news_nav_' . $id . '_*/);
return myId;
}).removeClass("sp-active").addClass("sp-inactive");
document.getElementById("sp_news_nav_' . $id . '_" + ct).className = "sp-active";
$("div#' . $blockId . '").css("padding-bottom", "1%");
' : '', '

bigguy

Quote from: Chen Zhen on November 23, 2015, 07:41:22 PM

You work in the Sifto mine right?
What do you do there, drive machinery?

No, but most of the people I know do. I was down there on a tour of the mine. I have a lot more pics that will be going up. I found it amazing that it was all solid salt....no rock anywhere down there....like no where man, lol. It's nuts down there. It's about as far down as the CN Tower is high. It goes about 4 kilometers out under lake Huron.

Chen Zhen

If I lived closer I would probably apply for a job.
I am getting laid off in about a year's time from a job I have had for 20 years!
T.O. is a little far from that mine though..  :-\

GeorG,

  Thanks for the report. I actually fixed it prior but must have forgotten to save the edited package & re-uploaded the wrong zip file in error.
It has now been fixed.

bigguy

I tell ya, it would be a great job. A lot of salt floatin around in the air though. I mean after 2 hours down there you can really taste it on your lips. I have a bother-in-law that works there and so does my neigbhor. I will post more pics soon.

On to other things though. I created a page in ehportal and I got an error. Some undefined index for page_info on line 103 or something of subs-portal.php. Here is the code in that section and what I did to clear the error:

Original code:
    // Some variables for ease.
    $action = !empty($context['current_action']) ? $context['current_action'] : '';
    $sub_action = !empty($context['current_subaction']) ? $context['current_subaction'] : '';
    $board = !empty($context['current_board']) ? 'b' . $context['current_board'] : '';
    $topic = !empty($context['current_topic']) ? 't' . $context['current_topic'] : '';
    $page = !empty($_REQUEST['page']) ? 'p' . $page_info['id'] : '';
    $portal = (empty($action) && empty($sub_action) && empty($board) && empty($topic) && SMF != 'SSI' && $modSettings['sp_portal_mode'] == 1) || $action == 'portal' || !empty($context['standalone']) ? true : false;



I changed the one line from page to page_info

    // Some variables for ease.
    $action = !empty($context['current_action']) ? $context['current_action'] : '';
    $sub_action = !empty($context['current_subaction']) ? $context['current_subaction'] : '';
    $board = !empty($context['current_board']) ? 'b' . $context['current_board'] : '';
    $topic = !empty($context['current_topic']) ? 't' . $context['current_topic'] : '';
    $page = !empty($_REQUEST['page_info']) ? 'p' . $page_info['id'] : '';
    $portal = (empty($action) && empty($sub_action) && empty($board) && empty($topic) && SMF != 'SSI' && $modSettings['sp_portal_mode'] == 1) || $action == 'portal' || !empty($context['standalone']) ? true : false;



Chen Zhen

#53
No that will not work properly.
The issue is that it needs to check if the $_REQUEST variable is empty first.
To do that it needs to be in brackets.

Like this...

// Some variables for ease.
$action = (!empty($context['current_action'])) ? $context['current_action'] : '';
$sub_action = (!empty($context['current_subaction'])) ? $context['current_subaction'] : '';
$board = (!empty($context['current_board'])) ? 'b' . $context['current_board'] : '';
$topic = (!empty($context['current_topic'])) ? 't' . $context['current_topic'] : '';
$page = (!empty($_REQUEST['page'])) ? 'p' . $page_info['id'] : '';
$portal = (empty($action) && empty($sub_action) && empty($board) && empty($topic) && SMF != 'SSI' && $modSettings['sp_portal_mode'] == 1) || $action == 'portal' || !empty($context['standalone']) ? true : false;


Also... your quotes within the news are not working because you have not updated to the latest on the download page.
All errors reported here have been adjusted as of this moment.

Thank you for the report.

bigguy

Awesome, ok I will update tomorrow for sure to the latest version. Nothing is throwing errors right now and the about page is working that I created so I will leave it alone til I update to the latest version.

Chen Zhen


Actually what I just posted was wrong and I should have taken a closer look prior to responding.
It's not the $_REQUEST variable that was throwing the error but rather the $page_info array because it is not defined at that point.
In fact it is not used at all in that specific function nor is the $page variable less that particular line.
You could just comment it out, delete it or assign the $page variable to the $_REQUEST['page'] value.



// Some variables for ease.
$action = !empty($context['current_action']) ? $context['current_action'] : '';
$sub_action = !empty($context['current_subaction']) ? $context['current_subaction'] : '';
$board = !empty($context['current_board']) ? 'b' . $context['current_board'] : '';
$topic = !empty($context['current_topic']) ? 't' . $context['current_topic'] : '';
$page = (!empty($_REQUEST['page'])) ? $_REQUEST['page'] : '';
$portal = (empty($action) && empty($sub_action) && empty($board) && empty($topic) && SMF != 'SSI' && $modSettings['sp_portal_mode'] == 1) || $action == 'portal' || !empty($context['standalone']) ? true : false;

bigguy

So what I did was fine then I guess. If there have been no further fixes then I will continue to hunt for bugs for now. I just downloaded the version that's in the downloads area.

Chen Zhen

After installing it anew please test quoted news items & then let me know if it works for you.
Thanks.

bigguy


bigguy

I will probably be updating the site today seeing as I have no work today and not to much to do around the house so I have spare time....I hope. :)