SSI Multiple Board News (ssi_multiBoardNews)

Started by vbgamer45, December 25, 2009, 01:57:08 AM

Previous topic - Next topic

Neverhurry

I see.  :D
But what should I do if i want news from just one board, in this case, from Board id=50?
This mod is a very very useful. I wish you success and that a lot of people will use it. Thank you for this great mod.
I am using SMF 2.0.1, curve themes.

Neverhurry

Quote from: Arantor on January 25, 2010, 04:01:46 PM
If you want it from just one board, it's fine but it's still subject to the age restriction too.

array(50) would work, and I think even just using 'board' => 50, would work too, but it's been a while.

i tried the following code, it shows the avatar, short subject, first post body, but no attachment images:

$parameters = array(
   'board'=> array(50,63),
   'limit' => 3,
    'avatar' => 'left',
   'attachments'=> 'inline',
   'output_type' => 'array',
);

// Don't need to state about board_disp and category_disp, we're not using them
$return = ssi_multiBoardNews($parameters);

foreach ($return['topics'] as $news)
                  {
echo '
         <div style="clear:left;">';
   if (isset($news['poster']['avatar']))
      echo '<img class="ssi_avatar" src="' . $news['poster']['avatar']['href'] . '" style="margin:0 1em 1em 1em; float: ' . $parameters['avatar'] . '" />';
   echo $news['poster']['link'], ': <a href="', $news['href'], '">', shorten_subject($news['subject'], 30), '</a></div>
   <div class="post" style="padding: 2ex 0;">', $news['body'], '</div>';
                 
       if (isset($news['attachments']))               
                     echo '
         <div class="ssi_attach" style="margin-top:0.3em;float:right;">';
                  if ($news['attachments']['width'] > 0)
                     echo '
            <img src="', $news['attachments']['href'], '" width="150px" height="" />';         
                  }


I tried both  'board'=> array(50), and  'board'=> 50, but it gives no result, no error info, nothing.

is "$news['attachments']" wrong? - i am not sure about it, i just wrote it intuitively, i might have been wrong of course, i don't know much about PHP.

Last, http://www.simplemachines.org/community/index.php?topic=355945.msg2473705#msg2473705
about the strange thing that as an admin, i can't view attachment images... is it a smf bug?

i really appreciate your help.
I am using SMF 2.0.1, curve themes.

Neverhurry

Hi Arantor:

in SSI.php line 2195:

            'link' => '<a href="' . $scripturl . '?topic=' . $row['id_board'] . '.0">' .

I suppose that "topic" should be "board"?
I am using SMF 2.0.1, curve themes.

tanshin

#43
Guess who's back :P

So, I have one final question for this. I plan to zebra stripe the output of ssi with three styles. How would I go about doing this?

EG:
style1
style2
styleLast

tanshin

If you still have the link to my site, http://nintendoaddict.com, you can get a pretty good idea as to what I mean. It exists both in the main section, as well as the review sidebar block.

tanshin

Right now for the latest news area I'm using a modification of the loop. I believe this is the whole section:

<?php $c 0;?>
    <?php if(have_posts()): ?><?php while (have_posts()) : the_post(); ?>
                    <?php $c++;
if( $c == $wp_query->post_count $extra_class 'newslast';
elseif( $c == $extra_class 'newstwo';
else $extra_class 'newsone';
?>

    <div <?php post_class($extra_class?> id="post-<?php the_ID(); ?>">
        <div class="latestNewsDate"><?php the_time('l, M jS, Y - g:i A'); ?></div>
                        <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="latestNewsTitle"><?php the_title(); ?></a>
    <div class="latestNewsText">
<?php the_content(); ?>
            <p class="tag">
<?php _e('Under&#38;#58;'); ?> <?php the_category(', '?>
</p>
    </div>
                    </div>
    <?php endwhile; ?>


As for the recent reviews area, I am just doing that manually since reviews aren't very frequent, however I'd like to use the same styles from that.
- latestPostsEntry
- latestPostsEntry2
- latestPostsEntryEnd

Neverhurry

Hi Arantor,

if there are image tags [img][/img] inside $news['body'] (message content), and it happens to be a big picture, then the board news block will be broken, is there a way to resize those picture to a width, for example, equals 100px? Can you help? Many thanks in advance.
I am using SMF 2.0.1, curve themes.

KensonPlays

Quote from: Arantor on December 26, 2009, 11:36:28 AM
:)

If there's any other features I could look at including, please do let me know. Icons were very much a last minute thing, I never actually planned to include them originally.

Well, maybe a bigger mod for easily including SSI for those complete newbs who don't know the code and are scared of editing/messing it up!

Owner of Mesozoic Haven

Neverhurry

Quote from: Arantor on February 04, 2010, 12:39:29 PM
Not reliably, no, there isn't, except disabling them, or forcing scrollbars.

Too bad!  :'(  I believe many who is going to use this mod will come across this problem.
I am using SMF 2.0.1, curve themes.

tanshin

Hey there, so the SSI file only seems to be picking up new threads, rather than any post or reply.

Attached is the code (the include is in my index template file).

tanshin

Oh, alright then. I thought there was an option I was missing :P

Oh well, I can live with the way it works now.

Mick.

Odd....

I can view only images hosted somewhere else as admin....but if i logout, i can view uploaded images just fine.

$parameters = array(
  'limit' => 5,
  'board' => array(296,2297,298,299,300,301,302,303),
  'board_disp' => true,
  'category_disp' => true,
  'avatar' => 'right',
  'attachments' => 'inline',
 
 
);
ssi_multiBoardNews($parameters);


http://www.chevyavalancheclub.com/av_registry.php

Mick.

Quote from: Arantor on February 07, 2010, 04:52:21 AM
The attachments, as the mod's description says, must be visible to guests in order for them to show up, since it uses the regular attachments code.

Gotcha. 

The mod works for my liking anyways.  Thanx Arantor.

Mick.

Is there a way to show a certain amount of characters...like breadcrumbs?

Mick.


program5

I am using the code below.
Is it possible to show the first attachment only ? If yes, please tell me how.
Regards

$parameters = array(
  'limit' => 5,
  'board' => array(1,2),
  'category' => array(3),
  'board_disp' => true,
  'category_disp' => true,
  'avatar' => 'left',
  'attachments' => 'thumbnail',
  'length' => 50,
  );
ssi_multiBoardNews($parameters);

program5

Arantor,

I know You dont (officially) provide support for Your mods but You still help people.
This is much appreciated.

Thank You :)

kizer

#57
Wow I can't believe I haven't seen this before. I was trying to create this before and well I was told it didn't work. Now I see why. ;)

I do have a question I'm trying to look through your SSI.php mod and I'd really like to wrap the output of each in this.

<div class=front>
the post info here
</div>

However looking through every line there is in that code man it makes it really hard.

This is an example of what I'm talking about.
http://www.links4jeeps.com/index.php?custom=yes&TID=custom-l4jwriteup

Of course I wanted it to be news related and basically in this format, but with the box around it which is my call to the <div class=front>
http://www.links4jeeps.com/forum/ssi_test2.php

I'm sure I can tinker around with this a while and figure things out, but I'm just having issues figuring out the echo portion of the code. Meaning I'd like it to output exactly what your example is, but it appears I have to do it in Echo in order to wrap the div around it.
Own a Jeep? Links4Jeeps.com

Neverhurry

Quote from: BlueDevil on February 06, 2010, 10:51:09 PM
Odd....

I can view only images hosted somewhere else as admin....but if i logout, i can view uploaded images just fine.

$parameters = array(
  'limit' => 5,
  'board' => array(296,2297,298,299,300,301,302,303),
  'board_disp' => true,
  'category_disp' => true,
  'avatar' => 'right',
  'attachments' => 'inline',
 
 
);
ssi_multiBoardNews($parameters);


http://www.chevyavalancheclub.com/av_registry.php

Blue Devil, I got the same problem as an admin, those attached images aren't shown to admin. This is very weird. I hope somebody can fix it.
I am using SMF 2.0.1, curve themes.

Neverhurry

Quote from: Arantor on January 25, 2010, 03:51:37 PM
No, it's not a bug.

There is a performance capping limit inside the code (just as there is in ssi_boardNews) to limit how many messages and topics can be examined. I really need to add a new option to the mod to remove that, I think, several people seem to assume it's a bug with the mod when it actually isn't.

Hi, Arantor. Can you tell me where is the "performance capping limit" inside the code (inside ssi_boardNews too)?

QuoteThe board that appears to be empty just has a message sufficiently old in comparison to the most recent that it's falling out of the capped area.

Does it mean, if there is a very old message in one board, then multiboardnews function will not work?

Thank you for your reply!

I am using SMF 2.0.1, curve themes.

Advertisement: