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,913
  • Total Topics: 21,308
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 588
  • Total: 589
  • @rjen

Recent Articles For Center Block

Started by opschf, March 13, 2006, 03:48:35 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Lafemme

#90
woops.. sorry... 

$max_shown=5;
$articles=db_query("SELECT a.id,a.subject,a.intro,a.author,a.authorid,a.date,c.value1 as category,a.category as category_id, IF(length(c.value4) > 0,c.value4,'http://www.bimeiden.nl/tp-files/tp-articles/icons/TPadm-article.gif') as category_img FROM smf_tp_articles a inner join smf_tp_variables c on a.category = c.id WHERE approved=1 AND off=0 ORDER BY date DESC LIMIT " . $max_shown, __FILE__,__LINE__);
$cnt=0;

While ($row=mysql_fetch_row($articles))
{
    echo '<table cellspacing="0" cellpadding="0" width="100%" style="margin-top: 4px;
             margin-bottom: 4px;" border="0"><tr><td>';
    echo '
    <p><a href="http://www.bimeiden.nl/index.php/cat,' . $row[7] . '.html"><img src="' . $row[8] . '" align="left" hspace="5"></a> <a href="http://www.bimeiden.nl/index.php/page,' . $row[0] . '.html"><b><font size="4">' . $row[1] . '</font></b></a> <font size="1"><em>by <a href="http://www.bimeiden.nl/index.php?action=profile;u=' . $row[4] . '"><b>' . $row[3] . '</b></a> on ' . date( "m/d/y", $row[5] ) . '</em></font></div>
<font size="1">' . $row[2] . '</font>
     </p></td>';
     echo '</tr></table>';
   $cnt++;
}
If  ($cnt=0) {
    echo '<td>No Articles Available';
    }


I got this code from thisreply in this topic..  http://www.tinyportal.net/index.php/topic,3320.msg184800.html#msg184800

also removind the <p> tag will result in an error.. if i want to decrease the space...
Do you also know what i have to change to make the titles one font smaller? because the titels are huge :D

IchBin

I'm assuming this is the font code for the title.
<b><font size="4">' . $row[1] . '</font>

Change the size to what you'd like and see if thats the line. If not, try the other <font> tags in the code. Experiment is the best way to learn.

Lafemme

oke Ichbin..  thank you for the reply..

does anyone else have the problem with not showing the category image? If so, how did  you fix it?

CWJT

How to I add in the time in this format [Today at 23:59:59]?

IchBin

#94
You change the code where it sets the date.
</a> on ' . date( "m/d/y", $row[5] ) . '</em>

Take a look at www.php.net/date to see how you can change the date of the format to what you want.

</a> Today at ' . date( "m/d/y", $row[5] ) . '</em> (change the m/d/y to the options you get from the php.net page that you need.

CWJT

Is it possible to script it such that if it was posted today it will display today as the date and if was viewed the next day it will show yesterday's date just like recent topics.

Lafemme

oke.. it would be great if this  script  (that i have posted a couple of posts before)also parses bcc code :) since some intro's have some bcc code and now that's not shown in this block. :D

Itch

I'm not sure if it will work or not. Add doUBBC() to whatever part you want to parse bbc code on.

doUBBC($row[0]) for example.

Lafemme


willcom

If I wanted to replace the little icon in this code for the article image, what code would I put in place of <img src="' . $row[8] . '" align="left" hspace="5"> Please excuse my php innocence.

This website is proudly hosted on Crocweb Cloud Website Hosting.