collapse

* User Info

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

* Who's Online

  • Dot Guests: 53
  • Dot Hidden: 0
  • Dot Users: 1
  • Dot Users Online:

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • virsa punjabi: hi Sinan are you available for paid work?
    Today at 01:32:50 AM
  • Bullet: Shoutbox is not for support!
    June 14, 2013, 05:25:48 PM
  • ivanotero: como pongo un chat en mi foro
    June 10, 2013, 06:22:15 PM
  • Bohimina: Can someone help me in my thread? TY
    June 04, 2013, 05:06:25 PM
  • dhayzon: ;P
    June 04, 2013, 12:27:55 PM
  • dhayzon: Hello all
    June 04, 2013, 12:27:47 PM
  • ComeAtMeBrosef: hi
    June 04, 2013, 12:13:23 AM
  • dhayzon: hi
    June 03, 2013, 05:30:18 PM
  • mag07: Hello all, registration captcha on the forums is a nightmare, took me 4 tries, listen option doesn't work either :S
    June 03, 2013, 02:32:42 AM
  • Divecall: whats happend?
    May 31, 2013, 02:26:35 AM
  • Randomking: if any one is there can you reply so i know ur listening
    May 30, 2013, 09:52:00 AM
  • Randomking: hey guys i have a quick question?
    May 30, 2013, 09:51:38 AM
  • BurkeKnight: Hi all. I'm back. :)
    May 27, 2013, 05:38:45 AM
  • Skaty: [link]
    May 21, 2013, 02:54:27 PM
  • Skaty: tooltip in sp block
    May 21, 2013, 02:54:20 PM
  • Tattoocu_CarteL: neden adres yazınca link diye çikiyor direk adres çiksa olmaz mı
    May 19, 2013, 11:54:41 AM
  • Tattoocu_CarteL: [link]
    May 19, 2013, 11:54:26 AM
  • Old Fossil: Hey Nathaniel
    May 16, 2013, 09:41:05 AM
  • Nathaniel: lurk
    May 16, 2013, 03:19:14 AM

* Team Blog

* Recent Posts

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

Author Topic: Recent topic with popup  (Read 2101 times)

0 Members and 1 Guest are viewing this topic.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 55
  • Gender: Male
  • Simple portal is great
    • LogoOff Theme club for SMF®
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Recent topic with popup
« on: June 25, 2011, 02:20:49 AM »
..::Recent Topic with avatar and popup preview::..
Verson 1.2


Code: [Select]
/**
 * Recent Topic with avatar and popup preview
 * Version 1.2
 * @author logooff.net
 */
 
//SETUP

$number_of_posts =10; // here you can change number of posts
$default_avatar = 'http://www.pohrani.com/f/45/mu/1bzggGqq/noavatar.png'; // enter URL of default avatar you want. Like this 'http://www.url.com/image.jpg'

//SETUP END
global $contex, $txt, $settings;
$array = ssi_recentTopics($number_of_posts, null, null, 'array');
echo '
<table class="side_class_row">';
foreach ($array as $post)
{
global $memberContext;
      loadMemberData($post['poster']['id']);
      loadMemberContext($post['poster']['id']);
echo '
  <tr>
<td class="side_class_replies">', $post['replies'], '</td>
            <td  class="side_class_new">';
                if (!empty($post['new']) )
                    echo'';
                else
                    echo'
                    <img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="new" />';
             echo'
            </td>
            <td></td>
    <td><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>
             </td>
<td>';
            if (!empty($memberContext[$post['poster']['id']]['avatar']['href'])){
echo '<img src="' . $memberContext[$post['poster']['id']]['avatar']['href'] . '" width="30" height="30" alt="', $post['poster']['name'], '" />';
                    }           
            else {
echo '<img src="' . $default_avatar .'" alt="default_avatar" width="30" height="30" />';
                }
        echo'
            </td>
            <td></td>
    </tr>
        <tr>
            <td colspan="6"><p class="side_class_poster"><span class="floatleft">', $txt['replies'], '</span> ', $post['poster']['link'], ' </p><hr class="side_hr" /></td>
        </tr>';
}
echo '
    </table>
<style type="text/css">
.side_class_poster
{
     font-size:10px;
     margin: 0;
     padding: 0;
     text-align: right;
}
table.side_class_row hr
     margin: 0;
     padding: 0;
}
.side_class_row
{
     padding:4px;
     width: 100%;
}
td.side_class_replies
{
     text-align:center;
     width:3%;
}
td.side_class_new
{
     text-align:center;
     width:3%;
}
.triangle-isosceles {
    position: fixed;
    top: 300px;
    left: 400px;
    padding:15px;
    margin:1em 0 3em;
    color:#fff;
    max-width: 400px;
    border: 1px solid #222222;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    border-radius:10px;
    -moz-box-shadow: 3px 3px 39px 2px #222222;
    -webkit-box-shadow: 3px 3px 39px 2px #222222;
    box-shadow: 3px 3px 39px 2px #222222;
    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>';
Enjoy!


29.08.2011
Version 1.2
  • Added Setupable avatar


16.07.2011
  • Added avatar (thanx to blue)
  • Fixed XHTML validation
  • Added setup for number of posts
« Last Edit: August 29, 2011, 10:03:41 AM by rocknroller »
                 
»  TOTM winner - Glacier

Offline Blue

  • Customizer
  • *
  • Posts: 375
  • Gender: Male
  • Block Maker? =P
Re: Recent topic with popup
« Reply #1 on: July 03, 2011, 07:59:47 AM »
Here, try this:

Code: [Select]
<?php

$array 
ssi_recentTopics(10nullnull'array');
global 
$contex$txt$settings;
echo 
'
<table class="side_class_row">
        <thead>
            <tr>
                <td>'
$txt['replies'], '</td>
                <td></td>
                <td></td>
<td></td>
                <td></td>
            </tr>
        <thead>'
;
foreach (
$array as $post)
{

global $memberContext;
      
loadMemberData($post['poster']['id']);
      
loadMemberContext($post['poster']['id']);


echo 
'
        <tbody>
  <tr>
<td class="side_class_replies">'
$post['replies'], '</td>
            <td  class="side_class_new">'
;
                if (!empty(
$post['new']) )
                    echo
'';
                else
                    echo
'
                    <img src="' 
$settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />';
             echo
'
                </td>
                <td></td>
     <td>
                    <div class="triangle-isosceles" id="'
$post['topic'], '" style="display: none">'$post['preview'], '</div>
                    <a href="'
$post['href']. '" target="_self" onmouseover="document.getElementById(\''$post['topic'], '\').style.display = \'block\'" onmouseout="document.getElementById(\''$post['topic'], '\').style.display = \'none\'">'$post['short_subject'], '</a>
                </td>
<td><img src="' 
$memberContext[$post['poster']['id']]['avatar']['href'] . '" width="30px" height="30px" /></td>
                <td class="side_class_poster"><pre> '
$post['poster']['name'], ' </pre> </td>
     </tr>
            <tr>
                <td colspan="5"><hr></td>
            </tr>
        </tbody>'
;
}
echo 
'
    </table> 
<style> 
.side_class_poster pre
{
     font-size:10px;
}
.side_class_row
{
     padding:4px;
     width: 100%;
}
td.side_class_replies
{
     text-align:center;
     width:3%;
}
td.side_class_new
{
     text-align:center;
     width:3%;
}
.triangle-isosceles {
    position: fixed;
    top: 300px;
    left: 400px;
    padding:15px;
    margin:1em 0 3em;
    color:#fff;
    max-width: 400px;
    border: 1px solid #222222;
    -moz-border-radius:10px;
    -webkit-border-radius:10px;
    border-radius:10px;
    -moz-box-shadow: 3px 3px 39px 2px #222222;
    -webkit-box-shadow: 3px 3px 39px 2px #222222;
    box-shadow: 3px 3px 39px 2px #222222;
    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>'
;

?>
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline agent47

  • Jr. Member
  • **
  • Posts: 63
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #2 on: July 03, 2011, 09:19:48 AM »
Wow this looks so awesome.... I wish someone would implement this for this mod. It'll look so awesome.

Offline Blue

  • Customizer
  • *
  • Posts: 375
  • Gender: Male
  • Block Maker? =P
Re: Recent topic with popup
« Reply #3 on: July 03, 2011, 09:32:40 AM »
I have to re-do that block since that was my first block ever  ;P

Maybe, when I start I'll ask rocknroller if I can use his code.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 55
  • Gender: Male
  • Simple portal is great
    • LogoOff Theme club for SMF®
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #4 on: July 03, 2011, 09:44:25 AM »
I have to re-do that block since that was my first block ever  ;P

Maybe, when I start I'll ask rocknroller if I can use his code.

tnx friend for avatar, sure you can use it. I'm glad that someone like this code.  :D
                 
»  TOTM winner - Glacier

Offline Blue

  • Customizer
  • *
  • Posts: 375
  • Gender: Male
  • Block Maker? =P
Re: Recent topic with popup
« Reply #5 on: July 03, 2011, 10:01:39 AM »
Glad I could help ;)
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Offline agent47

  • Jr. Member
  • **
  • Posts: 63
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #6 on: July 03, 2011, 10:07:23 AM »
You guys rule!

Offline S@ffz

  • Jr. Member
  • **
  • Posts: 58
    • GraphicJunki Creative Design
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #7 on: August 11, 2011, 07:26:28 PM »
I have to re-do that block since that was my first block ever  ;P

Maybe, when I start I'll ask rocknroller if I can use his code.

Are you still going too Blue?
 is it possible to reduce the amount of topics displayed?
« Last Edit: August 11, 2011, 07:30:36 PM by saffz »

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 55
  • Gender: Male
  • Simple portal is great
    • LogoOff Theme club for SMF®
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #8 on: August 16, 2011, 03:18:41 PM »
I have to re-do that block since that was my first block ever  ;P

Maybe, when I start I'll ask rocknroller if I can use his code.

Are you still going too Blue?
is it possible to reduce the amount of topics displayed?

Edited first post.. :)
                 
»  TOTM winner - Glacier

Offline S@ffz

  • Jr. Member
  • **
  • Posts: 58
    • GraphicJunki Creative Design
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #9 on: August 28, 2011, 03:59:00 PM »
Thanks rocknroller

One more Question how can I tidy the contents displayed in the block as they are very space apart and almost looks
bare.   As you can see from the attached image 5 post are displayed and there is a scroll bar at the bottom.   :(
and I don't know how or where to tidy this block.  Any help would be much appreciated.

Offline rocknroller

  • Jr. Member
  • **
  • Posts: 55
  • Gender: Male
  • Simple portal is great
    • LogoOff Theme club for SMF®
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Recent topic with popup
« Reply #10 on: August 29, 2011, 09:24:31 AM »
Thanks rocknroller

One more Question how can I tidy the contents displayed in the block as they are very space apart and almost looks
bare.   As you can see from the attached image 5 post are displayed and there is a scroll bar at the bottom.   :(
and I don't know how or where to tidy this block.  Any help would be much appreciated.

i was changed code in first post today with newer version, first change the code and is still have problem send me link of your forum, so can check with firebug. :)
« Last Edit: August 29, 2011, 10:05:18 AM by rocknroller »
                 
»  TOTM winner - Glacier

Offline S@ffz

  • Jr. Member
  • **
  • Posts: 58
    • GraphicJunki Creative Design
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #11 on: October 19, 2011, 03:14:27 AM »
Great block guys

thanks  ;D
« Last Edit: October 19, 2011, 03:19:48 AM by saffz »

Offline FrizzleFried

  • Full Member
  • ***
  • Posts: 103
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Recent topic with popup
« Reply #12 on: April 04, 2012, 12:41:50 AM »
Was wondering if there is a way to limit the forums this block looks for... I have a NSFW forum i want it to ignore.