collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 529
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Tooltip in SP Block  (Read 25890 times)

0 Members and 1 Guest are viewing this topic.

Offline Skaty

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
Re: Tooltip in SP Block
« Reply #20 on: June 14, 2013, 08:02:21 AM »
Underdog,

is this can make a cpu load ?

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Tooltip in SP Block
« Reply #21 on: June 14, 2013, 09:52:49 AM »
Underdog,

is this can make a cpu load ?

Skaty,

  I do not understand your question. Can you please attempt to explain this so I may understand exactly what you are asking?
 
Thank you.

Offline Skaty

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
Re: Tooltip in SP Block
« Reply #22 on: June 14, 2013, 04:33:36 PM »
My server cpu load is high then before. Is this php block can make a high cpu load ? when deactivate this php block cpu load is normal again.

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Tooltip in SP Block
« Reply #23 on: June 14, 2013, 11:46:47 PM »
My server cpu load is high then before. Is this php block can make a high cpu load ? when deactivate this php block cpu load is normal again.

Skaty,

  When I test the cpu usage with the code operating (& other content on the same page), it is so minimal that I do not see an issue. Also looking at the code I do not see any issue regarding the loops and/or mysql query.

  Did you adjust the code in your block somehow? If so display it in a code block here so I may peruse it.
 

Offline Skaty

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
Re: Tooltip in SP Block
« Reply #24 on: June 15, 2013, 07:09:25 AM »
i didn't add or change the codes, just put them in a php block.  when a activate the block, i can see 4-5 more processess from cpanel. and if 10 member will be online on my smf, it is given me even 505 error. it is weird. it is effected immediately. i can open pages very fast if the block is deactivated, but when i activated it is slowing so fast, and like i said more processing.






Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Tooltip in SP Block
« Reply #25 on: June 15, 2013, 10:59:22 PM »
Skaty,

  I've looked the block code over & don't really see an issue with it. Although we can attempt to limit the db query a little more. How many images are you opting to display and from which board id# specifically? Although this would not cause a 505 error.

  After reading up on a 505 page error (which I have never encountered prior), I found that it occurs when the web server does not support the http protocol being used. This can be caused by a corrupt request, meaning that page errors can cause the page to become corrupt & end up in a 505 error for the client. Although the code I provided is compliant, other code on your forum page is not compliant and imo it is possible that this could cause the page to become corrupt. It would be prudent to fix all the compliancy errors on the page in an attempt to rectify the situation.

  Taking a look at the css you provided (that I used), I see that some of the older cross-browser syntax is no longer necessary. I don't think it should be causing the 505 error issue as those browsers should be compatible with both old & new syntax. Try this code anyhow which only contains the current newer syntax for the background & shadow:

Code: [Select]
global $smcFunc, $scripturl;

/* Edit these variables */
$imageWidth = 80;
$imageHeight = 40;
$imageAmount = 5;
$boards = array(1,2);
$showText = false;
$showLinks = false;
$showDate = true;
$showPoster = true;
$maxChars = 150;
$authorText = 'Author: ';
$linebreak = '<hr />';

/* Do not edit below this line */

$count = 0;
$tooltipStyle = '
position: fixed;
    top: 300px;
    left: 400px;
    padding:15px;
    margin:1em 0 3em;
    color:#fff;
    max-width: 400px;
    border: 1px solid #222222;   
    border-radius:10px;   
    box-shadow: 3px 3px 39px 2px #222222;
    background-color: #2989d8;';

$request = $smcFunc['db_query']('', '
              SELECT t.id_topic, m.subject, m.body, m.smileys_enabled, m.id_msg, m.poster_time, m.id_member
              FROM {db_prefix}topics AS t             
              INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
              WHERE t.id_board IN ({array_int:boards})
              ORDER BY t.id_topic DESC
              LIMIT {int:limit}',
              array(
                'boards' => $boards,
                'limit' => 25,
              )
            );

$topics = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
$body = $row['body'];
$row['body'] = strip_tags(strtr(parse_bbc($row['body'], $row['smileys_enabled'], $row['id_msg']), array('<br />' => ' ')));
if (!$showLinks)
$row['body'] = preg_replace('@(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)@', '[link]',$row['body']);

if ($smcFunc['strlen']($row['body']) > $maxChars)
$row['body'] = $smcFunc['substr']($row['body'], 0, $maxChars) . '...';

censorText($row['subject']);
censorText($row['body']);
        $row['body'] = preg_replace('/\s{2,}/',' ',html_entity_decode($row['body']));
        $row['body'] = wordwrap($row['body'], 60, "<br />\n", true);
$poster = ssi_fetchMember($row['id_member'], false);
$topics[] = array(
'id_topic' => $row['id_topic'],
'body' => $row['body'],
'subject' => $row['subject'],
'poster_id' => $showPoster ? ($authorText . $poster[$row['id_member']]['username'] . '<br />') : false,
'poster_time' => $showDate ? (date("F j, Y, g:i a", $row['poster_time']) . '<br />') : false,
'first_image' => preg_match_all('~\[img[^]]*\]([^]]*)\[\/img\]~i', $body, $images) ? '<img src="' . $images[1][0] . '" alt="' . $row['subject'] . '" style="height:'.$imageHeight.'px;width:'.$imageWidth.'px;" />' : '',
);
}
$smcFunc['db_free_result']($request);

echo '
<table style="width:100%;border:0px;text-align:center;">
<tr class="centertext">';

foreach ($topics as $key => $topic)
{
if ($topic['first_image'])
{
if ($showText)
$text = '<br />' . $topic['subject'];
else
$text = false;

if (!$topic['poster_id'] && !$topic['poster_time'])
$linebreak = false;

echo '               
<td style="font-size:11px;position:relative;">
<div id="tooltip', $key, '" style="display: none;',$tooltipStyle,'">
<span style="font-size:9px;position:relative;">', $topic['poster_id'], $topic['poster_time'], '</span>
', $linebreak, '
<span style="float:left;position:relative;">', $topic['body'], '</span>
</div>
<span  id="hotspot'.$key.'" onmouseover="document.getElementById(\'tooltip', $key, '\').style.display = \'block\'" onmouseout="document.getElementById(\'tooltip', $key, '\').style.display = \'none\'" style="text-align:center;">
<a href="'. $scripturl. '?topic='. $topic['id_topic']. '.0" style="text-decoration:none;">' . $topic['first_image'] . $text . '</a>
</span>
</td>';
$count++;
if ($count >= $imageAmount)
break;   
}             
}

echo '
</tr>
</table>';



« Last Edit: June 15, 2013, 11:05:25 PM by Underdog »

Offline Skaty

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
Re: Tooltip in SP Block
« Reply #26 on: June 16, 2013, 07:40:43 AM »
it is given me 505 error when cpu load is too much.  i'm using it with 12 images and 1,2 boards.  when i tried with 4 images it is little bit better but still effect it.  can we change the tooltip's content to just ''topic's title'' ?

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: Tooltip in SP Block
« Reply #27 on: June 16, 2013, 04:13:29 PM »

Skaty,

  What I was attempting to inform you with my last post was that it is my opinion that something else is causing your 505 page error. I really do not think that this block should cause any high server load with only displaying 12 images (or 4 as you say you've tested). When I run your forum page through a validation filter, it has many html errors caused by your other blocks.

  For testing purposes, would it be ok to ask you to temporarily disable the top 2 right blocks on your forum page and enable the block I posted? Let your users browse your forum and inform me if the server load is normal after that. I see even more issues other than those blocks but let us try them first if you like.
 

Offline Skaty

  • Semi Newbie
  • *
  • Posts: 33
  • SMF Version: 2.0.2
Re: Tooltip in SP Block
« Reply #28 on: June 28, 2013, 04:41:11 PM »
Thank you for your excellent help Underdog but i coudn't figrured out what is the issue about this. maybe it is my server but i can't use it now. but i live eventually.

thank you again, regards.

Offline TrickyRicky

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2.0.5
  • SP Version: 2.3.5
Re: Tooltip in SP Block
« Reply #29 on: January 06, 2014, 02:44:31 AM »
Just what i was looking for thanks.