SSI Multiple Board News (ssi_multiBoardNews)

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

Previous topic - Next topic

Bijan641

Oh no. Thats really weird.

http://www.dotswoof.com/forum/index.php?board=13.0

Thats the link to the board. Right now there are two posts. Is there anything else on forums that might interfere with this function? I have added other mods.

By the way, thank you so much for the help, I really do appreciate it.

Bijan641

Thank a lot. If you happen to figure something out that would be great. Thanks for all the help so far.

tanshin

Hi there, I'm trying to work with this and so far it's going... okay. It's working, so that's a plus :P

My goal is to have only the avatar, author, and title to display (you know my setup from my questions earlier). I've been testing it over here:
http://nintendoaddict.com/ssi.php
My forum is here: smf.nintendoaddict.com

Any words of wisdom?

tanshin


tanshin

Well I was kinda at a loss as to what I need to do to remove everything except the author, avatar, and post title. And then possibly have a colon between the author and post title, in addition to changing the limit to the length of the post title.

tanshin

Here are the two SSI files. The _test file is the link I showed (I changed the name for purposes of readability), and SSI.php is the SSI file.

tanshin

That's what I get for using Dreamweaver :P

Okay, so looking at this page: http://nintendoaddict.com/ssi.php
The items seem to have levels, however I'm assuming that is because of the styling elements that are in the code you provided?

EDIT: Oh! I just remembered something  O:) What about making the post titles link to the posts?

tanshin

Ah, that looks better... however (I know, I'm probably royally getting on your nerves now) the post contents is being shown...

tanshin

#28
Sorry, I must have said stuff wrong at first. I was just interested in having the avatar, author, and title since it is meant to be a little "preview" for people visiting the index. You can see what I mean here http://nintendoaddict.com with the Recent Reviews area.

EDIT: However, now the avatars aren't showing up  ;D And I know what you mean about frustration like that, I often feel the same way... only not with code since I don't code very often. I'm more of a designer...

tanshin

Alright, thank you so much! I doubt I'd have even gotten to this point if I didn't find this mod of yours. Now I feel like I can start skinning my forum! (I also feel like I was talking like Huck Finn because I was just reading it...)

But, go take some deep breaths... or watch some Ellen (that always cheers me up) or something so you aren't frustrated ;)

tanshin

I just realized you aren't in the US so... but I was referring to Ellen DeGeneres.

Neverhurry

Hi Arantor,

can you help me with the attachment images, i tried the following but it shows no attachment images.

another questions is how should i do to make it sort by last reply date desc (by default it is sorted by the first message date desc).

$parameters = array(
  'limit' => 25,
  'category' => array(30),
  'board_disp' => true,
  'category_disp' => true,
  'avatar' => 'left',
  'attachments' => 'thumbnail',
  'length' => 500,
);
ssi_multiBoardNews($parameters);


thanks in advance.  :D
I am using SMF 2.0.1, curve themes.

Neverhurry

#32
Quote from: Arantor on January 24, 2010, 11:28:52 AM
Are all the boards in category 30 visible by guests?

It is sorted by first message date because it is *board news*, like ssi_boardNews does, it doesn't order topics by the last date but the order they were posted. If you change it you won't be able to uninstall it, btw.

No they are not visible by guests. Does it matter?
Too bad. I need sort by last reply, and will not uninstall it, can you still help?

But I think I can live with sorted by the first message.

3rd question, is it possible to add link to the first post title so that the users can conviniently click?

PS: i am using smf 2.0 rc2. attached is the SSI.php file.

thanks!
I am using SMF 2.0.1, curve themes.

Neverhurry

#33
Quote from: Arantor on January 24, 2010, 12:23:40 PM
Yes, it does matter because unless they're visible by guests (as the mod's description states) they will NOT be visible.

You don't need to modify SSI.php to get that (like you don't need to modify any of the SSI functions to change their layout) - that's what output_type is for, to return as an array to get it in a different format.

I do not have time right now to go through this, though.

Thanks Arantor, i figured out the subject link.
Yes, return as an array is a good idea.

I changed all those boards are visible for guests, and guests have permission to see the attachment images. But still the attachment images don't show, that frustrates me the most.
I am using SMF 2.0.1, curve themes.

Neverhurry

Quote from: Arantor on January 24, 2010, 01:48:46 PM
Can I see a link please?

yes, 21arte.com

the strange thing is, as a guest one can only see the name and the size of the attached pic. as an admin, one can't even see this info, nor the pic. but as a normal member, one can see the picture, very strange. I have given permission to all the groups including guests to see attached pictures. the boards are visible to all groups and guests. thank you arantor!

I am using SMF 2.0.1, curve themes.

Neverhurry

#35
Quote from: Arantor on January 25, 2010, 03:10:10 AM
Attachments are not visible to guests in that board, as proven by the fact that if a guest tries to view it from the link, it won't load but pushes instead to the login form.

i set those boards' permission profile to reply only, thus, even i gave permission to guests to view attachments, this permission doesn't affect boards with permission profile to reply only. I have to create a permission profile and give permission to guests to view attachment and chose the newly created permission profile to the boards. Now the guests can view the attachments.

Strange thing is: the admin can not see the attachment.  Who knows why and how to solve this weird problem? Could it be a bug? Thanks.....

:'( :'( :'(
I am using SMF 2.0.1, curve themes.

Neverhurry

Hi, arantor, when I tried today the code from you, i found out (perhaps) a bug, can you have a look?

the following code works:

$parameters = array(
  'limit' => 3,
  'board' => array(63,50),
);
ssi_multiBoardNews($parameters);


but the following code doesn't work (I narrowed the board chose to only one board, board id:63):

$parameters = array(
  'limit' => 3,
  'board' => array(63),
);
ssi_multiBoardNews($parameters);


I am using SMF 2.0.1, curve themes.

Neverhurry

#37
Hi Arantor,

I try to learn returning as an array, i studied your code (http://www.simplemachines.org/community/index.php?topic=355945.msg2460410#msg2460410)
and add at the last part some codes try to get the attachment, but i failed, can you help me? Thank you!



$parameters = array(
   'limit' => 3,
    'avatar' => 'left',
   'attachments'=> 'inline',
   'board'=> array(50,63),
   'category' => array(26),
   '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 am using SMF 2.0.1, curve themes.

Neverhurry

Quote from: Arantor on January 25, 2010, 01:22:02 PM
Right, you telling me it doesn't work doesn't help me to fix it at all, not one iota. What does it actually do and what do you think it's supposed to do?

I put the code inside a PortaMX's php block now, but it shows nothing, and it doesn't give any error info either.

I would like to learn how returning as an array works.

I would like to see 3 topics with avatar, poster name, short subject, body of the first post, and attachment images (width=150px, float to right). thanks!  :)
I am using SMF 2.0.1, curve themes.

Neverhurry

I am using SMF 2.0.1, curve themes.

Advertisement: