Advertisement:

Author Topic: SimplePortal  (Read 1540106 times)

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,277
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5540 on: June 19, 2020, 04:32:03 PM »

@Xpresskonami:
What you are actually after is a custom PHP block to display the desired effect.



@0ver12:
Try adding position: relative to your custom body css.
 

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline 0ver12

  • Semi-Newbie
  • *
  • Posts: 26
Re: SimplePortal
« Reply #5541 on: June 19, 2020, 06:12:09 PM »
@0ver12:
Try adding position: relative to your custom body css.

Didn't work

It continues to pull the predefined class established in Default Body Class.

this is my css code, included on index.css:

Code: [Select]
.right_block
{
   position: relative;
   padding: 0.5em 1em;
   font-size: 0.9em;
   line-height: 1.3em;
   border: 1px solid #bbb;
   background: #f0f6f0;
   margin: 0;
}

And an image of my block configuration, attached.

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,277
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5542 on: June 19, 2020, 10:52:26 PM »

Add you custom class to portal.css at the bottom of the file.
Also make sure you clear browser history prior to testing .css changes so the browser reloads the file else it will pull the data from its cache.


My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Xpresskonami

  • Jr. Member
  • **
  • Posts: 312
  • Gender: Male
Re: SimplePortal
« Reply #5543 on: June 20, 2020, 06:38:30 AM »

@Xpresskonami:
What you are actually after is a custom PHP block to display the desired effect.

yes i did that from 'Source/portalBlock.php' and this is the result i got, the topics are not grid in boardnews. This is the code and the <div> attached to it. instead of the topic to be in Grid, they not displaying as grid.

Code: [Select]
foreach ($return as $news)
{
echo '
<div class="sp_article_content">';

if (empty($style['no_title']))
{
echo '<div class="container">
                            <div class="row">
<div class="col-md-4"><div style="background-color: tomato;color: white;padding: 10px;">
<h1>
<a href="', $news['href'], '" >', $news['subject'], '</a>
</h1>
</div>';
}

if (strpos($style['body']['class'], 'roundframe') !== false)
{
echo '
<span class="upperframe"><span></span></span>';
}

echo '
<div', empty($style['body']['class']) ? '' : ' class="' . $style['body']['class'] . '"', '>';

if (empty($style['no_body']))
{
echo '
<span class="topslice"><span></span></span>';
}

echo '
<div class="sp_content_padding"', !empty($style['body']['style']) ? ' style="' . $style['body']['style'] . '"' : '', '>';

if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
echo '
<a href="', $scripturl, '?action=profile;u=', $news['poster']['id'], '"><img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" class="sp_float_right" /></a>
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
else
echo '
<div class="middletext">', $news['time'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';

echo '
<div class="post"><hr />', $news['body'], '</div>
<div class="sp_right">', $news['link'], ' ',  $news['new_comment'], '</div>
</div>';

if (empty($style['no_body']))
{
echo '
<span class="botslice"><span></span></span>';
}

echo '
</div>';

if (strpos($style['body']['class'], 'roundframe') !== false)
{
echo '
<span class="lowerframe"><span></span></span>';
}

echo '
</div></div></div></div>';
}

From the attachment... the second topic is under the first topic, but i want it to be at the right hand side/beside the first topic. just to make it look Grid

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,277
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5544 on: June 20, 2020, 11:11:44 AM »

edit this:
Code: [Select]
<div class="sp_article_content">

to this:
Code: [Select]
<div class="sp_article_content" style="display: inline-block;">
add this to the custom body style of the block:
Code: [Select]
overflow: auto;white-space: nowrap;width: 100%;
Without testing it I don't know if that will provide the desired effect.
You'll need to do some trial & error to get it the way you want.

The point is the child container needs inline styling so it can flow horizontally & the parent container (your block) needs to drop down to the next row when it reaches the end of its parent container (the center column in this case). 
If you google search the desired effect in short you will likely find some examples from stackoverflow and/or w3schools.
ie. "css evenly distribute divs horizontally"

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Xpresskonami

  • Jr. Member
  • **
  • Posts: 312
  • Gender: Male
Re: SimplePortal
« Reply #5545 on: June 20, 2020, 04:38:56 PM »

edit this:
Code: [Select]
<div class="sp_article_content">

to this:
Code: [Select]
<div class="sp_article_content" style="display: inline-block;">
add this to the custom body style of the block:
Code: [Select]
overflow: auto;white-space: nowrap;width: 100%;
Without testing it I don't know if that will provide the desired effect.
You'll need to do some trial & error to get it the way you want.

The point is the child container needs inline styling so it can flow horizontally & the parent container (your block) needs to drop down to the next row when it reaches the end of its parent container (the center column in this case). 
If you google search the desired effect in short you will likely find some examples from stackoverflow and/or w3schools.
ie. "css evenly distribute divs horizontally"

Non of this work, but after i did lot of work on it. i got this result but the Pagination refuse to be clear out from the right side

Offline 0ver12

  • Semi-Newbie
  • *
  • Posts: 26
Re: SimplePortal
« Reply #5546 on: June 20, 2020, 06:32:28 PM »

Add you custom class to portal.css at the bottom of the file.
Also make sure you clear browser history prior to testing .css changes so the browser reloads the file else it will pull the data from its cache.

Thanks man!

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,277
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5547 on: June 21, 2020, 12:25:43 AM »
@0ver12:
No problem.



@Xpresskonami:

The page indexing output is from the end of that function you are editing:
Code: [Select]
if (!empty($per_page))
echo '
<div class="sp_page_index">', $txt['sp-articlesPages'], ': ', $page_index, '</div>';

If you didn't edit that part then the div should have dropped down below your previous content.
What you showed in your image may also be a result of broken HTML.
Perhaps you left a previous inline DIV open.
 

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Xpresskonami

  • Jr. Member
  • **
  • Posts: 312
  • Gender: Male
Re: SimplePortal
« Reply #5548 on: June 21, 2020, 12:39:32 AM »
@0ver12:
No problem.



@Xpresskonami:

The page indexing output is from the end of that function you are editing:
Code: [Select]
if (!empty($per_page))
echo '
<div class="sp_page_index">', $txt['sp-articlesPages'], ': ', $page_index, '</div>';

If you didn't edit that part then the div should have dropped down below your previous content.
What you showed in your image may also be a result of broken HTML.
Perhaps you left a previous inline DIV open.

I later fixed that. But the mobile view is not friendly, so I pend it for now... I may work on the mobile later in the day.

I want to set a block sticky. How can I do that.

I mean, I created a right bar HTML block. I want to set the block sticky, the block I'd is 13. How can I set the block I'd 13 sticky when scrolling down.

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,277
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5549 on: June 21, 2020, 12:44:56 AM »

What do you mean sticky?
You want it to show on top of everything else?

I'm not sure exactly what effect you're after but mess around with the position attribute.
ref.
https://www.w3schools.com/cssref/pr_class_position.asp

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Xpresskonami

  • Jr. Member
  • **
  • Posts: 312
  • Gender: Male
Re: SimplePortal
« Reply #5550 on: June 21, 2020, 05:53:18 AM »

What do you mean sticky?
You want it to show on top of everything else?


I mean position: fixed from the w3school. How can I set the block to be position fixed??

Will I set it up in the HTML block id I create or at portal.css ?
« Last Edit: June 21, 2020, 06:21:13 AM by Xpresskonami »

Offline Xpresskonami

  • Jr. Member
  • **
  • Posts: 312
  • Gender: Male
Re: SimplePortal
« Reply #5551 on: June 21, 2020, 07:59:26 AM »

What do you mean sticky?
You want it to show on top of everything else?


I mean position: fixed from the w3school. How can I set the block to be position fixed??

Will I set it up in the HTML block id I create or at portal.css ?


i go through the w3school ref link.. i come up with this and set it under portal.css but its not working.

#sp_block15
    {
    top: 10px; width: 295px; position: fixed;
}

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,277
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5552 on: June 21, 2020, 09:58:29 PM »

You forgot the underscore...

#sp_block_15

Quote from: Chen Zhen
Also make sure you clear browser history prior to testing .css changes so the browser reloads the file else it will pull the data from its cache.

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Stirius

  • Semi-Newbie
  • *
  • Posts: 68
Re: SimplePortal
« Reply #5553 on: July 02, 2020, 10:16:12 AM »
Hello,

I think the shoutbox was buggy and allowed to send spam emails, see here https://www.simplemachines.org/community/index.php?topic=573979.msg4062375#new

Well, I just installed SP-Shoutbox Options which "could??" help however after this mod is live, the shouts are not loaded and finished properly. When you send the shout, it gets stuck on

Uncaught TypeError: XMLDoc.getElementsByTagName is not a function
    at onShoutReceived (portal.js?237:27)
    at XMLHttpRequest.oSendDoc.onreadystatechange (script.js?fin20:23)
onShoutReceived   @   portal.js?237:27
oSendDoc.onreadystatechange   @   script.js?fin20:23
XMLHttpRequest.send (async)      
sendXMLDocument   @   script.js?fin20:25
sp_submit_shout   @   portal.js?237:19
onclick

When you refresh the page, the new text is there but not before you refresh the page.

How to fix it?

Thank you.

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,277
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5554 on: July 05, 2020, 07:45:52 PM »
The shoutbox uses Ajax (via javascript) to get the updated data it needs and then refreshes the shoutbox container (specific div).
It's going to do that every X number of seconds depending on the setting you made in SP admin.
If you are monitoring activity on your website then of course you are going to see it query that url frequently.
Imo it has nothing to do with your email problem.
Disable the shoutbox altogether for some time & see if the spam emails keep recurring.


I will look into the error reported from the plugin since I wrote it some time ago.
Just make sure you download it from my site & not the archived SP forum.

 

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.

Offline Stirius

  • Semi-Newbie
  • *
  • Posts: 68
Re: SimplePortal
« Reply #5555 on: July 06, 2020, 05:11:38 PM »
The shoutbox uses Ajax (via javascript) to get the updated data it needs and then refreshes the shoutbox container (specific div).
It's going to do that every X number of seconds depending on the setting you made in SP admin.
If you are monitoring activity on your website then of course you are going to see it query that url frequently.
Imo it has nothing to do with your email problem.
Disable the shoutbox altogether for some time & see if the spam emails keep recurring.


I will look into the error reported from the plugin since I wrote it some time ago.
Just make sure you download it from my site & not the archived SP forum.

 

Hello,

yeah I know that it shoud update it regularly. However, I don't believe that there should be a request similar to this
?PHPSESSID=vcisne4cs7hhkdl2dt891vgh83&type=rss;action=.xml and around 200 times in a second. That IP is from Netherlands and is nowhere banned which is just strange. Just the hash behind = is changed every single request.

Regarding the ajax error, it is an issue only when using your mod, the single shoutbox works fine without yours.

Funny thing is that the shoutbox is hidden to everybody except some internal groups. So how the hell can still somebody tries to access it via URL?


Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,782
    • StoryBB/StoryBB on GitHub
Re: SimplePortal
« Reply #5556 on: July 06, 2020, 05:15:30 PM »
That's not a request to the shoutbox; that's a request to your RSS feed, and if you're not on 2.0.17 it's possible you have the infamous bug that triggered it.

In fact if you are on 2.0.17 but upgraded from 2.0.16, double check all the edits got made.
Please don’t PM me for paid work, I’m not for hire, and even if I was, I doubt you could afford me.
USD$150 per hour. Typical waiting list 3 months.

Offline Stirius

  • Semi-Newbie
  • *
  • Posts: 68
Re: SimplePortal
« Reply #5557 on: July 06, 2020, 05:27:32 PM »
That's not a request to the shoutbox; that's a request to your RSS feed, and if you're not on 2.0.17 it's possible you have the infamous bug that triggered it.

In fact if you are on 2.0.17 but upgraded from 2.0.16, double check all the edits got made.

Yeah, we upgraded from 2.0.16. Is there a way of checking or updating or reinstalling the last version? Or, some link with more info how to proceed? Btw. RSS is disabled, rights for all groups as well.

Also if you talk about this one https://www.simplemachines.org/community/index.php?topic=571025.0 then that is correct in our news.php I still have a feeling that most likely someone is trying to use the RSS and news feature to send the spams somehow. Using our smtp.

Thanks.
« Last Edit: July 06, 2020, 05:38:47 PM by Stirius »

Offline Stirius

  • Semi-Newbie
  • *
  • Posts: 68
Re: SimplePortal
« Reply #5558 on: July 13, 2020, 06:47:17 AM »
The shoutbox uses Ajax (via javascript) to get the updated data it needs and then refreshes the shoutbox container (specific div).
It's going to do that every X number of seconds depending on the setting you made in SP admin.
If you are monitoring activity on your website then of course you are going to see it query that url frequently.
Imo it has nothing to do with your email problem.
Disable the shoutbox altogether for some time & see if the spam emails keep recurring.


I will look into the error reported from the plugin since I wrote it some time ago.
Just make sure you download it from my site & not the archived SP forum.

 

Hi, any news regarding the update?

Thank you.

Offline Chen Zhen

  • Sophist Member
  • *****
  • Posts: 1,277
  • Gender: Male
  • If you're going through hell, keep going!
    • Underdog-01 on GitHub
    • WebDev.ca
Re: SimplePortal
« Reply #5559 on: July 15, 2020, 03:12:41 AM »

I found no issue with the SP extra shoutbox options plugin.
It is running on SMF 2.0.17 + SP 2.3.7 without any problems.

Please make sure to download the latest version here:
https://web-develop.ca/index.php?action=downloads;area=stable_simple_portal_plugins;file=25

Also note that improperly altering the reg. expression arguments in that plugin's settings can break the shoutbox.
If you altered those settings improperly and don't know how to fix it then there is a default option to revert it to its original state.




There is an edit to SP itself regarding the shoutbox for replacing deprecated javascript code that may or may not be relevant:
https://www.simplemachines.org/community/index.php?topic=227599.msg4047375#msg4047375



   

My SMF Mods & Plug-Ins

WebDev
Simple Portal Support

Request politely & demand nothing.