TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 606
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 404
  • Total: 404

Scrolling Recent Topics Block

Started by HaxXxoR, April 06, 2006, 02:17:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Wartog


Swampy

anyone get this to work with 0.9.5 yet?

myndcraft

Quote from: swampy on September 09, 2006, 07:02:24 PM
anyone get this to work with 0.9.5 yet?

I was wondering the same thing =)

Swampy


marzi

Hello,
I have this working with SMF 1.1 RC3 and TinyPortal v0.9.6beta. This mod was very easy to "install" thanks to the clear and simple directions.
My problem: the recent posts that are in the scrolling window are also being displayed at the bottom of the portal page. I cannot seem to find out how to remove the recent posts from the bottom of the page while leaving them in the scroll box. I think I must be able to the page-bottom display it off somewhere but cannot find out where to do it.
Can anyone help me?
See it on my test site at http://www.marscafe.com/forum/index.php
Thank you.

joybreezy

I am trying to get this to work on 1.1.3 -Tp 98 and no go.  Nothing happened.  I did notice that my code was a little different than what was explained here.  Can anyone review and tell me what I am doing wrong? 

here is my code

  echo '<marquee  behavior="scroll" direction="up" height="200px" scrolldelay=" 10" scrollamount=" 1" onmouseover="this.stop()"   onmouseout="this.start()">';
echo '
<div style="width: 100%; overflow: hidden;">';
foreach($context['TPortal']['menu'] as $cn){
echo str_repeat("&nbsp;&nbsp;", ($cn['sub']+1));

IchBin

Your code seems to be incomplete joybreezy.

joybreezy

Quote from: IchBinâ„¢ on July 25, 2007, 04:23:41 PM
Your code seems to be incomplete joybreezy.

Ok.. I went and looked at my code again and I noticed that the first line of coding I was instructed to input actually started on line 177, but the ending code for the counter++ is actually on line 170.  So now I am REALLY confused.. LOL


// TPortal recent topics block
function TPortal_recentbox()
{
global $context, $settings, $options, $txt , $modSettings;

    // is it a number?
if(!is_numeric($context['TPortal']['recentboxnum']))
$context['TPortal']['recentboxnum']='10';

// leave out the recycle board, if any
if(isset($modSettings['recycle_board']))
$bb=array($modSettings['recycle_board']);
else
$bb=array();

$what=ssi_recentTopics($num_recent = $context['TPortal']['recentboxnum'], $bb, $output_method = 'array');
// Output the topics
$counter=1; $cmax=count($what);
echo '
<div style="width: 100%; ' , $context['TPortal']['recentboxscroll']==1 ? 'overflow: auto; height: 20ex;' : '' , '">';
foreach($what as $w){
echo '
<div class="smalltext"><a href="'.$w['href'].'">'.$w['short_subject'].'</a></div>
<div class="smalltext">', $txt[525], ' <b>', $w['poster']['link'], '</b></div>
<div class="smalltext">';
if(!$w['new'])
echo '<a href="'.$w['href'].'"><img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';

echo '['.$w['time'].']
</div>';

if($counter != $cmax)
echo '<hr />';
$counter++;
}
echo '
</div></marquee>';
}

// TPortal categories
function TPortal_catmenu()
{
global $context, $settings, $options , $scripturl;

if(isset($context['TPortal']['menu']) && !empty($context['TPortal']['menu'])){
   echo '<marquee  behavior="scroll" direction="up" height="200px" scrolldelay=" 10" scrollamount=" 1" onmouseover="this.stop()"   onmouseout="this.start()">';
echo '
<div style="width: 100%; overflow: hidden;">';
foreach($context['TPortal']['menu'] as $cn){
echo str_repeat("&nbsp;&nbsp;", ($cn['sub']+1));
if((!isset($cn['icon']) || (isset($cn['icon']) && $cn['icon']=='')) && $cn['type']!='head' && $cn['type']!='spac'){
echo '<img src="'.$settings['images_url'].'/TPdivider2.gif" alt="" />&nbsp;';
}
elseif(isset($cn['icon']) && $cn['icon']!='' && $cn['type']!='head' && $cn['type']!='spac'){
echo '<img alt="*" src="'.$cn['icon'].'" />&nbsp;';
}
switch($cn['type']){
case 'cats' :
echo '<a href="'. $scripturl. '?cat='.$cn['IDtype'].'" ' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '>'.$cn['name'].'</a><br />';
break;
case 'arti' :
echo '<a href="'. $scripturl. '?page='.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '>'.$cn['name'].'</a><br />';
break;
case 'link' :
echo '<a href="'.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '>'.$cn['name'].'</a><br />';
break;
case 'head' :
echo '<b>'.$cn['IDtype'].'</b><br />';
break;
case 'spac' :
echo '<br />';
break;
default :
echo '<a href="'.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '>'.$cn['name'].'</a><br />';
break;
}
}
echo '
</div>';
}
}



IchBin

And while you were at it you confused the heck out of me as well...

What are you trying to do? Why are you posting the code for the catmenu? You see the part where is says function tportal_catmenu()? That is the code for the category menu that TP has. Everything above it is the code for the recent topics. What do you want to do with it?

This website is proudly hosted on Crocweb Cloud Website Hosting.