News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SSI Multiple Board News (ssi_multiBoardNews)

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

Previous topic - Next topic

luuuciano

No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Suki

where do you define both Truncate_String() and shorten_subject() ?

both functions must be either on the same file prueba.php or in some other file you need to call with a require_once()
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

luuuciano

Well, Truncate_String was added to the end of SSI
And shorten_subject... mmm no idea... it was on codes examples here... its not defined on SSI, but it worked (maybe its on smf core, required somewhere in SSI)
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Suki

Well I test it and got no errors with plain text message, also, if you are using html inside your messages it will give you errors since that function isn't built to support html tags, if you set for example 50 and the 50 character is inside an html tag it will cut the tag in the nearest space, thus breaking the html code.

You need to find a function that does support html code.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Biology Forums

Quote@shuban  this mod acts the same as the SSI boardnews function, it just adds more parameters and the possibility to include multiple board the fetch the news from, if you don't have a frontpage or something similar then this mod is not for you.

Thanks!

HeroicTofu

Hello. I'm currently using SMF Version 2.0.2 and saw this mod in glee only to find that the file is incompatible. Is there a quick and easy way to modify this to work with 2.0.2 or is there something that does about the same job that's already compatible? I'm in the process of learning PHP but I'm nowhere near good enough to know what the heck I'm looking for in mod scene. Any help would be appreciated  :D

Arantor

The main code will work just fine. See http://wiki.simplemachines.org/smf/How_can_install_a_mod_that_doesn%27t_work_in_my_SMF_version and follow the main instructions (not the bit at the bottom that says 1.1.x only)

HeroicTofu

Quote from: Arantor on January 20, 2012, 10:11:11 PM
The main code will work just fine. See http://wiki.simplemachines.org/smf/How_can_install_a_mod_that_doesn%27t_work_in_my_SMF_version and follow the main instructions (not the bit at the bottom that says 1.1.x only)

This worked absolutely perfectly, thank you very much :D

luuuciano

woa...... Arantor... the former guy that had more post like none (almost)... sudenly have nearly 500???
What happened? there is a thread... or something to read/keep informed about that?
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

Arantor

You haven't been paying attention, I post a lot. Still nowhere near like I used to though ;)

Mick.

Quote from: Arantor on January 21, 2012, 07:12:06 AM
You haven't been paying attention, I post a lot. Still nowhere near like I used to though ;)
Hahaha arrowtotheknee. I kew it was you. Welcome back brother.

Arantor

Thanks, though the way things are going (out here in RL), I doubt it'll have any permanence to it. :(

Motorhed

Hey, quick question...

Is there any way to have this mod show only ONE attachment per post?

I want to have it so the first image attached to the post is shown, but not any others attached to that post...

sealanach

Hi there, I am newbie for SMF and this mod.

I installed 3 mods (advise by this topic) but when i try this code (below) The forum show

QuoteFatal error: Call to undefined function ssi_multiBoardNews() in D:\xampp\htdocs\fullexp\Sources\Load.php(2151) : eval()'d code(20) : eval()'d code on line 20

echo'
<div align="center">
<table width="915px" border="0" cellpadding="2" cellspacing="2" bgcolor="f9f7f5">
<tr valign="top">
<td>
<div>
<h3 class="titlebg grid_header"><span class="left"></span>Blog Home - blog description goes here</h3>
<div class="roundframe grid">
';

$parameters = array(
'limit' => 1,
'board' => array(4),
'board_disp' => false,
'category_disp' => false,
'length' => 300,
'attachments' => 'none',
);

ssi_multiBoardNews($parameters);

echo'
</div>
</td>
<td>
<div>
<h3 class="titlebg grid_header"><span class="left"></span>Categories</h3>
<table class="tborder" width="100%">
<tr class="windowbg">
<td>
<li><a href="http://192.168.1.10/fullexp/index.php?action=blog">Blog Home</a></li>
<hr />
<li><a href="http://192.168.1.10/fullexp/index.php?action=category2">category 2</a></li>
<li><a href="http://192.168.1.10/fullexp/index.php?action=category3">category 3</a></li>
<li><a href="http://192.168.1.10/fullexp/index.php?action=category4">category 4</a></li>
<li><a href="http://192.168.1.10/fullexp/index.php?action=category5">category 5</a></li>
</td>
</tr>
</table>
<br />
<span class="lowerframe"><span><!-- // --></span></span>
<br class="clear">
</div>
</td>
</tr>
</table>
</div>
';


Please, give me advise. Thank and sorry in my poor English.

My SMF version is 2.0.2 no mod except 3 mods that i say.

ormuz

How can I add the user website ($row['website_url']) to this mod?

Suki

You will need to modify the main query and add the avatar row, then when the data array is built you can ad the avatar param under member, is a bit messy since you have to take care of custom avatars, predefined avatars and attached avatars, take a lok at Load.php to see how is done.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

ormuz

Quote from: Suki on July 25, 2012, 09:12:15 AM
You will need to modify the main query and add the avatar row, then when the data array is built you can ad the avatar param under member, is a bit messy since you have to take care of custom avatars, predefined avatars and attached avatars, take a lok at Load.php to see how is done.

Is this for my question? I'm asking about the user website, not the avatar...

Thanks,

Suki

oh, right hahaha

in that case you just need to fetch the column on the main query: 

IFNULL(mem.real_name, m.poster_name) AS poster_name, m.poster_time, mem.website_title, mem.website_url,

then on the member key:


'poster' => array(
'id' => $row['id_member'],
'name' => $row['poster_name'],
'href' => !empty($row['id_member']) ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
'link' => !empty($row['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name'],
'website' => !empty($row['website_url']) ? '<a href="' . $row['website_url'] . '">' . $row['website_title'] . '</a>' : '',
), ),

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

ormuz

Thanks, it works! I've missed the main query when I was trying, damm!

Mr. Jinx

Quote from: Suki on December 27, 2011, 09:40:43 AM
@luuuciano  Yes, sometimes a couple of good old if/else  is better for readability than several ternaries.

You can s how X characters, for tha ti use this function:


function Truncate_String($string, $limit, $break = ' ', $pad = '...')
{
if(empty($limit))
$limit = 30;

/* return with no change if string is shorter than $limit */
if(strlen($string) <= $limit)
return $string;

/* is $break present between $limit and the end of the string? */
if(false !== ($breakpoint = strpos($string, $break, $limit)))
if($breakpoint < strlen($string) - 1)
$string = substr($string, 0, $breakpoint) . $pad;

return $string;
}



@shuban  this mod acts the same as the SSI boardnews function, it just adds more parameters and the possibility to include multiple board the fetch the news from, if you don't have a frontpage or something similar then this mod is not for you.
Thanks for this example Suki! Exactly what I needed.
Maybe a nice feature for this Mulitple Boardnews mod?
Instead of just breaking the news item after x nummer of characters: add a custom string where the text should break.
This way an article writer can write some intro text. At the breakingpoint he just adds a custom string (for example '---').

Advertisement: