News:

Wondering if this will always be free?  See why free is better.

Main Menu

SimplePortal

Started by SimplePortal Team, March 10, 2008, 11:16:07 PM

Previous topic - Next topic

Chen Zhen


@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

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

0ver12

Quote from: Chen Zhen on June 19, 2020, 04:32:03 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:


.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.

Chen Zhen


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

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Xpresskonami

Quote from: Chen Zhen on June 19, 2020, 04:32:03 PM

@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.

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

Chen Zhen


edit this:

<div class="sp_article_content">


to this:
<div class="sp_article_content" style="display: inline-block;">

add this to the custom body style of the block:
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

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Xpresskonami

Quote from: Chen Zhen on June 20, 2020, 11:11:44 AM

edit this:

<div class="sp_article_content">


to this:
<div class="sp_article_content" style="display: inline-block;">

add this to the custom body style of the block:
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

0ver12

Quote from: Chen Zhen 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.

Thanks man!

Chen Zhen

@0ver12:
No problem.




@Xpresskonami:

The page indexing output is from the end of that function you are editing:

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

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Xpresskonami

Quote from: Chen Zhen 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:

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.

Chen Zhen


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

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Xpresskonami

#5550
Quote from: Chen Zhen on June 21, 2020, 12:44:56 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 ?

Xpresskonami

Quote from: Xpresskonami on June 21, 2020, 05:53:18 AM
Quote from: Chen Zhen on June 21, 2020, 12:44:56 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;
}

Chen Zhen


You forgot the underscore...

#sp_block_15

Quote from: Chen ZhenAlso 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

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Stirius

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.

Chen Zhen

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

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Stirius

Quote from: Chen Zhen 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.



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?


Arantor

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.

Stirius

#5557
Quote from: Arantor 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.

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.

Stirius

Quote from: Chen Zhen 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.



Hi, any news regarding the update?

Thank you.

Chen Zhen


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

"Either you repeat the same conventional doctrines everybody is saying, or else you say something true, and it will sound like it's from Neptune." - Noam Chomsky

Advertisement: