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,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 716
  • Total: 716

Multifunction Article Snippet [Version 1.1 out]

Started by Megaforum, November 24, 2007, 07:56:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fangweile

#70
hello dragoon

I have tried your code but it doesnt show either.


[edit]
I have figured it out:
here is the code i used:


echo'<table><tr><td>';articles(
$mode = 1,
$limit = 5,
$cats = array(),
$show_comments = true,
$show_views = true,
$show_rating = true,
$show_time = true,
$show_category = true,
$show_author = true,
$show_articleComment = true,
$output_method = 'echo'
);

echo'</td><td>';articles(
$mode = 1,
$limit = 5,
$cats = array(),
$show_comments = true,
$show_views = true,
$show_rating = true,
$show_time = true,
$show_category = true,
$show_author = true,
$show_articleComment = true,
$output_method = 'echo'
);

echo'</td><td>';articles(
$mode = 1,
$limit = 5,
$cats = array(),
$show_comments = true,
$show_views = true,
$show_rating = true,
$show_time = true,
$show_category = true,
$show_author = true,
$show_articleComment = true,
$output_method = 'echo'
);
echo'</td></tr></table>';


I was having a trial and error and then luckily its perfectly works.
Thanks a lot Dragoon.
This article snippet is really great.





@koolad

maybe you just copy the wrong code there

require_once($sourcedir . '/Artclestats.php');

It must be

require_once($sourcedir . '/ArticleSnippet.php');

koolaid

Quote@koolad

maybe you just copy the wrong code there

The filename is right. I changed how that php displays the info into this:

Comments: 1 | Views: 519
Rating: (5 Votes)

and renamed to Artclestats.php for articles since i use ArticleSnippet.php for the blocks. The code works fine in a block so i'm sure that the filename isn't the problem.

I'm trying to get it to work inside a php article because i have a list of articles with which i would like to display the above info beside each of them.

Dragoon is that possible?

supportingactors

It's a great block snippet -- which as was mentioned earlier should be one of the standard features :)

One thing I've been searching for, which I'm hoping this might be able to accomplish (or be modded to do): is there a way to have it output to an XML/RSS feed of the articles' titles? So far as I can find there's no one who's created such a thing for TP .98. (Does TP 1.0.5b include RSS?)

IchBin

Any questions not related to the topic should be posted in their own topic in the appropriate board. Feature requests would be a good place to start your post after you search the board to make sure it hasn't been requested already.

supportingactors

Quote from: IchBinâ,,¢ on July 25, 2008, 07:20:27 PM
Any questions not related to the topic should be posted in their own topic in the appropriate board.
I *was* asking about this block and whether it can output to an XML format -- the question about 1.0.5 was ancillary, since if it already includes RSS, then it makes such a block less necessary.

limteam

Hi  its a great mod. But  how to set articles in horizontal position?

alhaudhie

how can i put the background image? I have this

// echo  '<div style="width: 100%; height: 135px; overflow: auto">';
echo '<table border="0" width="100%" cellspacing="1" cellpadding="1" id="RecentArticlesTBL" class="bordercolor">
<tr align="center" valign="middle" class="catbgcustom">
<td colspan="2"><span class="smalltext">Artikel Terbaru</span></td>';
// Show author column?
if($show_author)echo'
<td><span class="smalltext">Author:</span></td>';
// Show category column?
if($show_category)echo'
<td><span class="smalltext">Kategori</span></td>';
// Show the time its posted on column
if($show_time)echo'
<td><span class="smalltext">Published on:</span></td>';

// Show views column?
if($show_views)echo'
<td><span class="smalltext">Paparan</span></td>';
// Show comments column?
if($show_comments)echo'
<td><span class="smalltext">Ulasan</span></td>';
echo'</tr>';
foreach ($items as $i)
{
$counter++;
echo '<tr align="left" valign="middle">
       <td class="windowbg2">
   <img src="' . $settings['images_url']. '/topic/folder.png" width="16" height="16" border="0" alt="" /></td>
       <td class="windowbg"><span class="smalltext">',$i['article']['artLink'],'</a></span>';
echo '';
echo '</div>';
// Show the author?
            if($show_author)
            echo '<td class="windowbg2"><span class="smalltext">',$i['author']['link'],'</span></td>';

// Show its category?
            if($show_category && $i['article']['is_categorized'])
            echo '<td class="windowbg"><span class="smalltext">',$i['cat']['link'],'</span></td>';

            // Show the time its posted on
if($show_time)
            echo '<td class="windowbg"><span class="smalltext">',$i['article']['time'],'</span></td>';

// Show there ratings?
if($show_rating)
{

// Is it rated?
    if($i['article']['is_rated'])
    {
        echo '<td align="center" class="windowbg2"><span class="smalltext">',str_repeat('<img src="'.$settings['images_url'].'/tpblue.gif" style="width: .7em; height: .7em; margin-right: 2px;" alt="" />', $i['article']['rating']),' (',$i['article']['voters'],' rates)</span></td>';
        }
// No?
        else
        {
       



        }


// Show the no. of views?
if($show_views)
  echo '<td align="center" class="windowbg"><span class="smalltext">',$i['article']['views'],' </span></td>';


// Show the no. of comments?
if($show_comments)
    echo '<td align="center" class="windowbg"><span class="smalltext">',$i['article']['comments'],'</a></span></td>';


    }


echo '</span></td>';
if($counter < $limit)
echo '';
}
echo '</table>';
}


i want to put only one background image for all table.


Renegd98

I have to admit I have never seen that Ichbin...  too good...

IchBin

I only use it for those types of things that can be learned about with a simple google search. :D

This website is proudly hosted on Crocweb Cloud Website Hosting.