Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

February 08, 2023, 04:31:28 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 194005
  • Total Topics: 21135
  • Online today: 64
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 1
Guests: 48
Total: 49

Author Topic: [php] Block "Scrolling Marquee Recent topics"  (Read 20030 times)

0 Members and 1 Guest are viewing this topic.

Offline rocknroller

  • Better to live 100 years as a millionaire than 7 days in misery.
  • Jr. Member
  • **
  • Posts: 33
  • Mini chat HR
    • Mini Chat - Domaca Pricaonica
[php] Block "Scrolling Marquee Recent topics"
« on: March 21, 2012, 10:22:26 AM »
Hello everyone, this is my first post here, so to contribute something.
if this isn't right place moderators please move it.

Add this code into php block. Remove body and title from block, put it in top, upper, bottom or lower block. It's really nice way to show recent posts and does not occupy much space.

Code: [Select]
global $settings, $txt, $scripturl, $post;
$array = ssi_recentTopics(16, null, null, 'array');
echo '<marquee scrollamount="3" class="moving" onmouseover="this.stop()" onmouseout="this.start()">';
foreach ($array as $post)
{              if (!empty($post['new']) )
                    echo'';
                else
                    echo'<img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />';echo'<div class="triangle-isosceles" id="a', $post['topic'], '" style="display: none">', $post['preview'], '</div><a href="'. $post['href']. '" target="_self" onmouseover="document.getElementById(\'a', $post['topic'], '\').style.display = \'block\'" onmouseout="document.getElementById(\'a', $post['topic'], '\').style.display = \'none\'">', $post['short_subject'], '</a>';
}
echo '</marquee>
<style type="text/css">
marquee.moving a
{
     font-size:12px;
     font-weight:bold;
     margin-right:50px;
}
.triangle-isosceles {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index:1000;
    padding:15px;
    margin:1em 0 3em;
    color:#fff;
    max-width: 400px;
    border: 1px solid #ccc;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    border-radius:10px;
    -moz-box-shadow: 1px 1px 0px 0px #777;
    -webkit-box-shadow: 1px 1px 0px 0px #777;
    box-shadow: 1px 1px 0px 0px #777;
    background: -moz-linear-gradient(top, rgba(41,137,216,0.9) 0%, rgba(30,87,153,0.9) 94%, rgba(30,87,153,0.9) 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(41,137,216,0.9)), color-stop(94%,rgba(30,87,153,0.9)), color-stop(100%,rgba(30,87,153,0.9)));
    background: -webkit-linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    background: -o-linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    background: -ms-linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
    background: linear-gradient(top, rgba(41,137,216,0.9) 0%,rgba(30,87,153,0.9) 94%,rgba(30,87,153,0.9) 100%);
}
</style>';


*block uses marquee tah which is not XHTML vaild
*block uses CSS3


« Last Edit: March 22, 2012, 09:47:06 AM by rocknroller »
Tra

Offline ZarPrime

  • Friends
  • *
  • Posts: 4653
Re: [php] Block "Scrolling Marquee Recent topics"
« Reply #1 on: March 22, 2012, 04:29:24 AM »
rocknroller,

The first line in your code is not necessary and will cause an error in the block.  Also, I have edited the subject of your topic ...

Code: (Remove from code) [Select]
require_once('SSI.php');
Other than that, nice job. O0

ZarPrime

Offline rocknroller

  • Better to live 100 years as a millionaire than 7 days in misery.
  • Jr. Member
  • **
  • Posts: 33
  • Mini chat HR
    • Mini Chat - Domaca Pricaonica
Re: [php] Block "Scrolling Marquee Recent topics"
« Reply #2 on: March 22, 2012, 09:48:08 AM »
Removed, thank you.
Tra