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: 561
  • Total: 562
  • @rjen

Recent Articles For Center Block

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

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alhaudhie

#80
sorry for my bad english...

i mean, u can see the image for the article category ( the space between the image soo far) how can i make it not soo far...? or how can i make harizontal row between article?

IchBin

Take out the <p> and </p> tags in your code.

alhaudhie

how can i make it to take image from custom folder?

JPDeni

Put in an img tag just like you would on an html page.

alhaudhie

when using the new version of TP, the icon of article is replace...

before this in the old tp.. we put the image address...
in the new tp the icon of my article must be upload in tp-files/tp-articles/icons/myimages.png.

that why i think the article icon is gone...
how can i edit it to call from tp-files/tp-articles/icons/ ?

fussilet

hi  alhaudhie
When you look for when you look for in the Tportal.AdminTemp

alhaudhie

why this code cant read the intro article when it using html code exactly?

global $scripturl;

$max_shown=3;
$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.mysite.net/v10/imej/umum.png') 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 '
    <a href="' . $scripturl . '?cat=' . $row[7] . '">
       <img src="/v10/tp-files/tp-articles/icons/' . $row[8] . '" align="left" hspace="5"></a>
       <a href="' . $scripturl . '?page=' . $row[0] . '">
       <b><font size="2px">' . $row[1] . '</font></b></a>
       <font size="1"><em>by <a href="' . $scripturl . '?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>
    </td>';
     echo '</tr></table>';
   $cnt++;
}
if  ($cnt=0) {
    echo 'No Articles Available';
}

IchBin

Looks to me like its fetching the intro's. If you don't have an intro set, it won't work. The article has to be an html/bbc article type. PHP articles don't have an intro.


Lafemme

hello,

i want to use this code, i like it very much :) However.. i do not see the categorie image at all... I use TP 1.0.6

this is the code that i am using :

Quote$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"><font size="4">' . $row[1] . '</font></a> <font size="1">by <a href="http://www.bimeiden.nl/index.php?action=profile;u=' . $row[4] . '">' . $row[3] . '</a> on ' . date( "m/d/y", $row[5] ) . '</font></div>
<font size="1">' . $row[2] . '</font>
     </p></td>';
     echo '</tr></table>';
   $cnt++;
}
If  ($cnt=0) {
    echo '<td>Geen artikelen beschikbaar';
    }

Does anybody have an idea?  Thank you

IchBin

Please post code in the BBC [ code ] brackets. Posting code in a quote loses some of the code elements as its parsed as a quote instead of code. Where did you get this code? It looks like you or someone added the link to the query? It will not work with that..

This website is proudly hosted on Crocweb Cloud Website Hosting.