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,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 561
  • Total: 561

custom "Recent Topics from Board X, Y, Z only" php block

Started by iowamf, November 04, 2005, 09:47:16 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

spurry

      lol thanks

      how do i add space between from this

    • SMF
    • SMF


    to look like this

    • SMF
    space here
    • SMF


IchBin

Change this code:
echo '<li>'.$my['link'].'</li>';

To this:
echo '<li style="padding-bottom: 8px">'.$my['link'].'</li>';

Change the number 8 to what you need.

spurry

global $context, $scripturl, $settings, $txt;
$bullet = '<img src="'.$settings['images_url'].'/TPdivider.gif" alt="" border="0" style="margin:0 2px 0 0;" />';

$result=ssi_recentTopics_Include(10,array(32),'return');

foreach($result as $my){
  echo "$bullet";
  echo '<li style="padding-bottom: 8px">'.$my['link'].'</li>';

  // is this topic new? (assume they are logged in)
if (!$my['new'] && $context['user']['is_logged'])
        echo ' <a href="', $scripturl, '?topic=', $my['topic'], '.from', $my['new_from'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '<br />';

}
echo '</span>';


ok but now it hase a dot and a image at each line?

efil

Thanks,
Efil.

alhaudhie

Quote from: JRW on July 17, 2006, 10:54:15 PM
This is the code to put the bullets in the box, left aligned, and also add the "new" graphic for new posts:


$result=ssi_recentTopics(10,array(15),'return');
echo'<right>';
echo '<ul style="padding-left: 15px;">';
foreach($result as $my){
echo '<Li>'.$my['link'].'</Li>';
if(!$my['new'])
echo '<a href="'.$my['href'].'"><img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';
}
echo '</UL>';
echo'</center>';
echo '<span class="smalltext"></span>';


THIS IS working great for me..

but how can i put character limit?



IchBin

echo '<Li>'.substr($my['link'], 1, 20).'</Li>';

Start with character 1 and end with character 20.

alhaudhie

I have try a several way to put
echo '<Li>'.substr($my['link'], 1, 20).'</Li>';

in

$result=ssi_recentTopics(10,array(15),'return');
echo'<right>';
echo '<ul style="padding-left: 15px;">';
foreach($result as $my){
echo '<Li>'.$my['link'].'</Li>';
if(!$my['new'])
echo '<a href="'.$my['href'].'"><img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" /></a> ';
}
echo '</UL>';
echo'</center>';
echo '<span class="smalltext"></span>';


but its still fail...

IchBin

#109
Perhaps you could explain what "but its still fail..." means? I have no idea what you are seeing or not seeing. Please explain.

BTW, what is this?
echo'<right>';

Never seen an HTML tag for right.

This website is proudly hosted on Crocweb Cloud Website Hosting.