How do I make the topics from a board (with a limit, of course) display in a blocK? For example, just a small list of topic names that link to the topic. Oh say, the five most recently created topics for board 5.
I think this is what you're looking for.
http://www.tinyportal.net/smf/index.php?topic=596.0
Quote from: IchBinÃ,â,,¢ on November 14, 2005, 07:00:58 AM
I think this is what you're looking for.
http://www.tinyportal.net/smf/index.php?topic=596.0
That's too large, I'm afraid. I only want text links...is that possible?
Hmm, I just now noticed the RSS Feed box...that would work.
EDIT: Or not :P. No feed is displayed after I configure it.
I'm doing this in a column block ... the only difference is that I rewrote the ssi_recentTopics call to accept a board value to include - ie, the "array(9)" parameter, in the default ssi_recentTopics command it requires you to provide a list of boards to exclude boards (difficult to maintain if you are going to be adding boards).
global $context, $scripturl;
$result=ssi_recentTopics_hack(10,array(9),'return');
foreach($result as $my){
echo '<span class="smalltext">'.$my['link'];
// 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['newtime'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '<br>';
}
echo '</span>';
Quote from: iowamf on November 14, 2005, 06:46:26 PM
I'm doing this in a column block ... the only difference is that I rewrote the ssi_recentTopics call to accept a board value to include - ie, the "array(9)" parameter, in the default ssi_recentTopics command it requires you to provide a list of boards to exclude boards (difficult to maintain if you are going to be adding boards).
global $context, $scripturl;
$result=ssi_recentTopics_hack(10,array(9),'return');
foreach($result as $my){
echo '<span class="smalltext">'.$my['link'];
// 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['newtime'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '<br>';
}
echo '</span>';
Hmm, won't let me use that code in a PHP block.
I'm a rookie - bled all over the keyboard with that one.
Perpaps try it in a PHP article and debug there?
Sorry I can't be of more help - just trying to help out where/when I can as this board has helped me.
The output of that looks like the 2nd box (note, I stripped the time out).
Quote from: iowamf on November 14, 2005, 09:27:17 PM
I'm a rookie - bled all over the keyboard with that one.
Perpaps try it in a PHP article and debug there?
Sorry I can't be of more help - just trying to help out where/when I can as this board has helped me.
The output of that looks like the 2nd box (note, I stripped the time out).
i like to see the hacked version if possible?
thanks
snork
Not sure I understand your question - I'm calling the code I posted a "hack" as it has limited usage ... but it does produce the output shown in the attachment and my error log isn't going too crazy.
Quote from: iowamf on November 15, 2005, 03:10:41 AM
Not sure I understand your question - I'm calling the code I posted a "hack" as it has limited usage ... but it does produce the output shown in the attachment and my error log isn't going too crazy.
right, i assume you reworked the original code to work with the block, i was interested in see what you excluded
Iowamf, what is the code for the modified ssi_recentTopics_hack function?
ssi_recentTopics();
I think?
Depends on what you want criminal.
this code is not working only what to do
I want to display topics from board 39.0 only :-\
global $context, $scripturl;
$result=ssi_ssi_recentTopics(10,array(39.0),'return');
foreach($result as $my){
echo '<span class="smalltext">'.$my['link'];
// 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['newtime'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '<br>';
}
echo '</span>';
take out the .0 Only use the number not the decimal number.
inside a scriptbox it looks like
(https://www.tinyportal.net/index.php?action=dlattach;topic=1365.0;attach=12958;image)
inside a phpbox it looks like this
(https://www.tinyportal.net/index.php?action=dlattach;topic=1365.0;attach=12960;image)
Well it goes in a PHP box. If you are using the <?php tags in your code please remove them. If not, please post exactly what you are putting into your PHPbox.
global $context, $scripturl;
$result=ssi_ssi_recentTopics(10,array(39.0),'return');
foreach($result as $my){
echo '<span class="smalltext">'.$my['link'];
// 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['newtime'], '#new"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" border="0" /></a>';
echo '<br>';
}
echo '</span>';
I am using this code in php box
This line:
$result=ssi_ssi_recentTopics(10,array(39.0),'return');
Needs to be this:
$result=ssi_recentTopics(10,array(39.0),'return');
it gives some syntax error it says
Parse error: syntax error, unexpected T_STRING in /home/omsitesc/public_html/omsaigan/Sources/Load.php(1735) : eval()'d code(35) : eval()'d code on line 11
first the error was on line 1 now it is resolved
now it shows the next error on line 11