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?

August 19, 2022, 05:51:03 AM

Login with username, password and session length
Members
  • Total Members: 3843
  • Latest: Tricky
Stats
  • Total Posts: 193479
  • Total Topics: 21088
  • Online today: 58
  • Online ever: 1035
  • (November 26, 2020, 04:45:12 AM)
Users Online
Users: 1
Guests: 54
Total: 55

Author Topic: Some format finessing  (Read 17482 times)

0 Members and 1 Guest are viewing this topic.

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Some format finessing
« on: February 04, 2006, 12:10:33 PM »
I've been fiddling ........

Recent Topics

I've had a go at reformatting the Recent Topics Block (TPortalBlocks.template). I have added bullets, removed the line across (HR) and closed the gap a bit. I know that the bullet removes content from a line with hidden overflow but I think that the overall effect is better. The 'New' icon is clickable as with the forums.

Code: [Select]
// 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);
    foreach($what as $w){
            echo '<div style="white-space: nowrap; overflow: hidden; padding: 0px 4px;" class="smalltext">
                  <img src="'.$settings['images_url'].'/TPdivider.gif" alt="" />&nbsp;<b><a href="'.$w['href'].'">'.$w['short_subject'].'</a></b>
                                    </div>
                                    <div style="white-space: nowrap; overflow: hidden; padding: 0px 4px; " 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 '<img src="'.$settings['images_url'].'/blank.gif" alt="" width="12" / >'.$w['time'].'</div>';

           if($counter != $cmax)
                   echo '<img src="'.$settings['images_url'].'/blank.gif" alt="" height="6" / >';
           $counter++;
    }
}


To get the best from this, and from other blocks, I suggest that you add this to the style.css. It will help with all block displays including RSS feeds.

Code: [Select]
.smalltext a:link, .smalltext a:visited
{
font-size: x-small;
font-family: verdana, sans-serif;
font-weight:700;
}

Content Menu

I like the way it looks, the span tags improve the display for me and the small caps help show the headers.

Code: [Select]
// TPortal categories
function TPortal_catmenu()
{
        global $context, $settings, $options , $scripturl;

    if(isset($context['TPortal']['menu']) && !empty($context['TPortal']['menu'])){
        foreach($context['TPortal']['menu'] as $cn){
             echo str_repeat("&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'].'/TPdivider.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 '<span class="smalltext"><a href="'. $scripturl. '?cat='.$cn['IDtype'].'" ' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '>'.$cn['name'].'</a></span><br />';
                    break;
                case 'arti' :
                    echo '<span class="smalltext"><a href="'. $scripturl. '?page='.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '>'.$cn['name'].'</a></span><br />';
                    break;
                case 'link' :
                    echo '<span class="smalltext"><a href="'.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '>'.$cn['name'].'</a></span><br />';
                    break;
                case 'head' :
                    echo '<span class="smalltext" style="font-variant: small-caps; font-weight: bold;">'.$cn['IDtype'].'</span><br />';
                    break;
                case 'spac' :
                    echo '<br />';
                    break;
                default :
                    echo '<a href="'.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '>'.$cn['name'].'</a><br />';
                    break;
             }
        }
    }
}



[attachment deleted by admin]

[attachment deleted by admin]
« Last Edit: February 04, 2006, 12:14:07 PM by nokonium »

crip

  • Guest
Re: Some format finessing
« Reply #1 on: February 04, 2006, 01:40:00 PM »
What kind of Gallery are you using?..it's really nice.


Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Re: Some format finessing
« Reply #2 on: February 04, 2006, 03:49:55 PM »
I have 3 links to galleries, only one is mine. The best one is Freds I think made with iView MediaPro. The ones of mine with the slideshow were made with Photoshop.

crip

  • Guest
Re: Some format finessing
« Reply #3 on: February 05, 2006, 03:14:35 AM »
Home made, always the best..Ty.

haktanir

  • Guest
Re: Some format finessing
« Reply #4 on: February 19, 2006, 10:48:28 AM »
I was wordering, is there a way to make RSS links open in new browser window? People lose the forum once they click on a news item.

Offline G6Cad

  • Friends
  • *
  • Posts: 12643
    • FamiljeGodis
Re: Some format finessing
« Reply #5 on: February 19, 2006, 12:32:30 PM »
looks really great :) More of this kind of copy and paste code. This is the fun part when even I get it to work  :laugh:

ramapoughnative

  • Guest
Re: Some format finessing
« Reply #6 on: February 23, 2006, 08:58:36 AM »
Could you tell me where you put the code under 'content menu' in your post?

Offline Nokonium

  • Aging Hippie
  • Friends
  • *
  • Posts: 1384
    • Our-Local
Re: Some format finessing
« Reply #7 on: February 23, 2006, 10:17:02 AM »
That is also in TPortalBlocks.template  :)

ramapoughnative

  • Guest
Re: Some format finessing
« Reply #8 on: February 23, 2006, 10:26:59 AM »
Thanks!

crip

  • Guest
Re: Some format finessing
« Reply #9 on: February 23, 2006, 10:33:46 AM »
That is also in TPortalBlocks.template  :)

you a fiddling, and i'm a piddling. ;D