Advertisement:

Author Topic: Functionality requests for SSI in the next version of SMF  (Read 87200 times)

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Functionality requests for SSI in the next version of SMF
« on: December 25, 2006, 04:01:55 AM »
All,

As part of the new features to be added in the next version of SMF I'd like to further expand the SSI functions available - but I need the communities input. Apologies in advance for not trawling through the countless threads that have no doubt requested things in the past but I would like to keep it all together - hence this topic.

So - what additions would you like to SSI in the next release? Are there any things you've been hacking in the last couple of years that you think should be part of the core code? If you can provide some suggestions I'll collect them all together - consider them with the team here - and let you guys know what the outcome will be.

Regards,

Grudge
« Last Edit: April 12, 2007, 11:00:03 AM by groundup »
I'm only a half geek really...

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Functionality requests for SSI in the next version of SMF
« Reply #1 on: December 25, 2006, 05:16:40 AM »
The main thing I'd like would be a function to retrieve individual posts (I'm sure there's a mod for that somewhere, but I haven't looked around). Also, a variant of the ssi_recentTopics function, which accepts board ID's to include rather than exclude :).
I can't think of anything else at the moment, although I probably will later (I'll be back :P)
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Ben_S

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,702
  • xxx
Re: Functionality requests for SSI in the next version of SMF
« Reply #2 on: December 25, 2006, 09:10:24 AM »
Grab single message and an archive type feature would be great, by archive, I mean along the lines of http://www.redandwhitekop.com/archive.php http://www.redandwhitekop.com/archive.php?aid=646
Liverpool FC Forum with 14 million+ posts.

Offline Rudolf

  • SMF Hero
  • ******
  • Posts: 1,934
  • Gender: Male
  • iamanoompaloompa
Re: Functionality requests for SSI in the next version of SMF
« Reply #3 on: December 25, 2006, 09:54:42 AM »
Here's one
What the SSI needs is more flexibility, with the modified code I can write external pages just like they would be an extra action in the forum. With the current one it's bit more difficult.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Offline nitins60

  • Sr. Member
  • ****
  • Posts: 838
  • Gender: Male
  • LoVE mAKeS lIFe bEauTIfUL
    • Simple Mobile Forum - SMF
Re: Functionality requests for SSI in the next version of SMF
« Reply #4 on: December 29, 2006, 12:41:43 PM »
Code: [Select]
ssi_theme = "1";
there is no option for selection theme of forum, it doesn't matter theme number! When administrator change theme, so it should also change according to theme rather than changing theme number!
Code: [Select]
ssi_theme="auto"; something like s good!

Offline yomasta3

  • Semi-Newbie
  • *
  • Posts: 28
    • SirJtaa
Re: Functionality requests for SSI in the next version of SMF
« Reply #5 on: December 31, 2006, 08:34:39 AM »
Just put everything in SMF_API.php into SSI.php. That would help me a ******load more then having 2 files that interfere with eachother. lol.

Offline Grudge

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,742
  • Gender: Male
  • Unofficial nuisance
Re: Functionality requests for SSI in the next version of SMF
« Reply #6 on: January 01, 2007, 04:11:59 PM »
Code: [Select]
ssi_theme = "1";
there is no option for selection theme of forum, it doesn't matter theme number! When administrator change theme, so it should also change according to theme rather than changing theme number!
Code: [Select]
ssi_theme="auto"; something like s good!
But if you simply don't set $ssi_theme then it will do auto anyway?
I'm only a half geek really...

Offline nitins60

  • Sr. Member
  • ****
  • Posts: 838
  • Gender: Male
  • LoVE mAKeS lIFe bEauTIfUL
    • Simple Mobile Forum - SMF
Re: Functionality requests for SSI in the next version of SMF
« Reply #7 on: January 02, 2007, 12:13:35 AM »
But i have tested it, there is some difference using ssi_theme! When i don't use this, it loads theme template, but doesn't retrieve style.Css!

Offline Tippmaster

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,188
Re: Functionality requests for SSI in the next version of SMF
« Reply #8 on: January 02, 2007, 12:17:09 AM »
I was thinking, wouldn't it be great if hitting "reply" to SSI_boardnews or the like brought us back to the page the function was on?

I have this: If it would appeal to others. Each topic in a specific board has a page automatically created with replies and a link added. I think it's alot like what ben has but i haven't looked at his really well yet.

http://model98.org/reviews.php?

The only thing php can't do is tell you how much milk is left in the fridge.



Offline Panzer-

  • Full Member
  • ***
  • Posts: 481
  • Gender: Male
  • www.lastkarrde.com
    • Lastkarrde.com
Re: Functionality requests for SSI in the next version of SMF
« Reply #9 on: January 04, 2007, 11:21:30 PM »
There already is the ssi_menubar (Not sure on the exact name). I was wondering if there could be an ssi_boarddisplay, basically it would show the board and footer but no navigation bar/menubar/header. That way people could incorporate SMF into their websites easier.

Offline Tippmaster

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,188
Re: Functionality requests for SSI in the next version of SMF
« Reply #10 on: January 05, 2007, 05:19:23 PM »
There already is the ssi_menubar (Not sure on the exact name). I was wondering if there could be an ssi_boarddisplay, basically it would show the board and footer but no navigation bar/menubar/header. That way people could incorporate SMF into their websites easier.

I had a similar idea a while back..It would be pretty cool.
The only thing php can't do is tell you how much milk is left in the fridge.



Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Functionality requests for SSI in the next version of SMF
« Reply #11 on: January 05, 2007, 08:10:34 PM »
Quote
That way people could incorporate SMF into their websites easier.
What's wrong with using the layer system for incorperating SMF into a site?
Integrating the forum into your site..., second post :D
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Peter Duggan

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,663
  • Gender: Male
    • Peat Stack or Pete's Tack?

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline Panzer-

  • Full Member
  • ***
  • Posts: 481
  • Gender: Male
  • www.lastkarrde.com
    • Lastkarrde.com
Re: Functionality requests for SSI in the next version of SMF
« Reply #14 on: January 06, 2007, 01:48:42 PM »
I think personally it would help non coders with their website - forum integration.

Offline Sarke

  • Jr. Member
  • **
  • Posts: 315
Re: Functionality requests for SSI in the next version of SMF
« Reply #15 on: January 06, 2007, 01:50:54 PM »
Hi, new around these parts.  I'm in the process of switching from IPB and I'm having a hard time with missing features that I get from IPBSDK.  By no means is IPBSDK perfect, but it does make things much easier.  I hope you'll have a look at the functions it provides and consider making similar for SSI.

Below are some functions I find very useful and would like to see in SSI (remember I'm new to SMF so if these are already there forgive me).  They're not directly from IPBSDK but inspired by it, and it's how I would have done it (probably add "ssi_" infront of the function names):

list_members($group = '') returns an array of user ids with all the members in that group (or all members if $group is left blank).

list_online_members() returns an array of the members that are currently online.

topic_info($topic_id) returns an array with info on the topic, such as subject, topic starter, array of post ids in topic, array user ids who posted in it (perhaps have the user id as the key and the value as the number of post in the topic by that user).

post_info($post_id) returns an array with info on the post, just like mentioned earlier in this topic.

member_info($user_id = '') returns an array with info about the member. False if no $user_id is specified and if the current person is not logged in.

is_online($user_id = '') returns a true or false depending on if the specified user is online. If $user_id is blank, check to see if the person viewing the page is logged in. Sort of like a reverse is_guest() function.

is_admin($user_id = '') returns a true or false depending on the specified user (or current user if blank) is an admin.

is_in_group($group_array, $user_id = '') returns a true or false depending on if the specified user (or current user if blank) is in any of the member groups specified.

I know the last few you can get through $user_info, but not for any user specified and with a bit more code.  I should also note that I find (as I'm sure many do), for example, that

Code: [Select]
if (is_admin())
is more convenient than

Code: [Select]
if ($user_info['is_admin'])
even though it's just a small change.  Functions like that are easy to code so I suggest they be included for the sake of convenience.


Thanks for your time, and keep up the good work!
My MODs          Please don't PM me for support, post in the appropriate topic.

Offline Sarke

  • Jr. Member
  • **
  • Posts: 315
Re: Functionality requests for SSI in the next version of SMF
« Reply #16 on: January 06, 2007, 01:59:41 PM »
Another one...

name_to_id($user_name) returns the id.
My MODs          Please don't PM me for support, post in the appropriate topic.

Offline Panzer-

  • Full Member
  • ***
  • Posts: 481
  • Gender: Male
  • www.lastkarrde.com
    • Lastkarrde.com
Re: Functionality requests for SSI in the next version of SMF
« Reply #17 on: January 06, 2007, 08:42:32 PM »
IPBSDK is basically equivilant to the ssi. Except its a mod for IPB whereas its built in for SMF.

Offline Daniel15

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,221
  • Gender: Male
  • http://dan.cx/
    • daaniel on Facebook
    • Daniel15 on GitHub
    • daniel15 on LinkedIn
    • @Daniel15 on Twitter
    • Daniel15
Re: Functionality requests for SSI in the next version of SMF
« Reply #18 on: January 07, 2007, 04:37:08 AM »
Sarke, a lot of the things you've suggested already exist. I'll give you some code examples:

Quote
list_online_members() returns an array of the members that are currently online.
Code: [Select]
<?php
require('SSI.php');

$online ssi_whosOnline('array');
echo 
'<pre>'print_r($onlinetrue), '</pre>';
?>


Quote
member_info($user_id = '') returns an array with info about the member.
Code: [Select]
<?php
require('SSI.php');

// By ID:
loadMemberData(1);
loadMemberContext(1);
// At this point, $memberContext[user_id] contains the user's details
echo '<pre>'print_r($memberContext[1], true), '</pre>';

// By username:
$return loadMemberData('Daniel15');
$userID $return[0];
loadMemberContext($userID);
echo 
'<pre>'print_r($memberContext[$userID], true), '</pre>';


// If you really want a function to replicate that IPB-SDK functionality :-)
function member_info($member_id)
{
loadMemberData($member_id);
loadMemberContext($member_id);
return $memberContext[$member_id];
}
?>


Quote
is_online($user_id = '') returns a true or false depending on if the specified user is online.
It's in the array retrieved above

Quote
is_admin($user_id = '') returns a true or false depending on the specified user (or current user if blank) is an admin.
I believe this is also returned in the array above.

Quote
is_in_group($group_array, $user_id = '') returns a true or false depending on if the specified user (or current user if blank) is in any of the member groups specified.
All their groups are in the array returned above

Quote
name_to_id($user_name) returns the id.
Load the user's data (above), and then get the name :)

Also, note that there's heaps of information (especially on the current user) in the large $context array.
Daniel15, former Customisation team member, resigned due to lack of time. I still love everyone here :D.
Go to smfshop.com for SMFshop support, do NOT email or PM me!

Offline B Patterson

  • Full Member
  • ***
  • Posts: 512
  • Gender: Male
  • Never Miss an Opportunity to be Great
Re: Functionality requests for SSI in the next version of SMF
« Reply #19 on: January 17, 2007, 10:13:33 PM »
Subscribed Topic Replies
I added this to my SSI.php for use with my index.php page.  Basically, instead of using TP (too much bloat for me) I created my own index.php page and then used SSI to power it.  I created a function to get the latest unread topics that you are subscribed to.  Basically, it comes down to something like this:
function ssi_unreadReplies($output_method 'echo')
{
	
global 
$db_prefix$context$settings$scripturl;

	
$topic_ids = array();
	
$last_msg_ids = array();
	
$return = array();

	
$request db_query("SELECT MAX(lmr.ID_MSG)
	
	
	
	
FROM 
{$db_prefix}log_mark_read AS lmr
	
	
	
	
WHERE lmr.ID_MEMBER = " 
$context['user']['id'] . "
	
	
	
	
LIMIT 0, 1"
__FILE____LINE__);
	
list(
$max) = mysql_fetch_row($request);
	
mysql_free_result($request);

	
$request db_query("
	
	
SELECT m.ID_TOPIC
	
	
FROM 
{$db_prefix}log_notify AS ln
	
	
LEFT JOIN 
{$db_prefix}messages AS m
	
	
	
ON ln.ID_TOPIC = m.ID_TOPIC
	
	
WHERE ln.ID_MEMBER = '" 
$context['user']['id'] . "'
	
	
	
AND m.ID_MSG > '
{$max}'
	
	
	
AND ln.sent = '1'
	
	
GROUP BY m.ID_TOPIC
	
	
ORDER BY m.posterTime DESC"
__FILE____LINE__);

	
while(
$row mysql_fetch_assoc($request))
	
{
	
	
$topic_ids[] = $row['ID_TOPIC'];
	
}
	
mysql_free_result($request);

	
if(!empty(
$topic_ids))
	
{

	
	
if(
count($topic_ids)>1)
	
	
	
$wclause "m.ID_TOPIC IN (" implode(', '$topic_ids) . ")";
	
	
else if(
count($topic_ids == 1))
	
	
	
$wclause "m.ID_TOPIC = '" $topic_ids[0] . "'";

	
	
$request db_query("
	
	
	
SELECT m.subject, t.ID_TOPIC, 
	
	
	
	
t.ID_LAST_MSG
	
	
	
FROM 
{$db_prefix}topics AS t
	
	
	
LEFT JOIN 
{$db_prefix}messages AS m
	
	
	
	
ON t.ID_FIRST_MSG = m.ID_MSG
	
	
	
WHERE " 
$wclause__FILE____LINE__);

	
	
while(
$row mysql_fetch_assoc($request))
	
	
{
	
	
	
$last_msg_ids[] = $row['ID_LAST_MSG'];

	
	
	
$return[$row['ID_TOPIC']]['topic'] = array(
	
	
	
	
'id' => $row['ID_TOPIC'],
	
	
	
	
'subject' => $row['subject'],
	
	
	
	
'short_subject' => shorten_subject($row['subject'], 30)
	
	
	
);
	
	
	

	
	
}
	
	
mysql_free_result($request);

	
	
$request db_query("
	
	
	
SELECT m.posterName, m.posterTime, m.smileysEnabled, m.body, m.ID_TOPIC, m.ID_MSG
	
	
	
FROM 
{$db_prefix}messages AS m
	
	
	
WHERE m.ID_MSG IN (" 
implode(', '$last_msg_ids) . ")
	
	
	
"
__FILE____LINE__);

	
	
while(
$row mysql_fetch_assoc($request))
	
	
{

	
	
	
$row['body'] = parse_bbc($row['body'], $row['smileysEnabled'], $row['ID_MSG']);
	
	
	
	

	
	
	
if (
strlen($row['body']) > 512)
	
	
	
	
$row['body'] = substr($row['body'], 0512) . '...';

	
	
	
censorText($row['subject']);
	
	
	
censorText($row['body']);

	
	
	
$return[$row['ID_TOPIC']]['post'] = array(
	
	
	
	
	
'poster' => $row['posterName'],
	
	
	
	
	
'timestamp' => forum_time(true$row['posterTime']),
	
	
	
	
	
'time' => timeformat($row['posterTime']),
	
	
	
	
	
'href' => $scripturl '?topic=' $row['ID_TOPIC'] . '.new;topicseen#new',
	
	
	
	
	
'preview' => substr($row['body'], 0102) . '...',
	
	
	
	
	
'body' => $row['body']
	
	
	
);
	
	
}
	
	
mysql_free_result($request);
	
}

	
if(
$output_method != 'echo' || empty($return))
	
	
return 
$return;

	
echo 
'
	
<table>
	
	
<tr>
	
	
	
<th>Subject</th><th>Poster</th><th>Posted</th>
	
	
</tr>'
;
	
if(!empty(
$return))
	
	
foreach(
$return as $topic)
	
	
{
	
	
	
echo 
'
	
	
<tr>
	
	
	
<table>
	
	
	
	
<tr>
	
	
	
	
	
<td style="border-top, border-left: 1px solid #000;">' 
$topic['link'] . '</td>
	
	
	
	
	
<td style="border-top: 1px solid #000;">' 
$topic['poster'] . '</td>
	
	
	
	
	
<td style="border-top, border-right: 1px solid #000;">' 
$topic['time'] . '</td>
	
	
	
	
</tr>
	
	
	
	
<tr>
	
	
	
	
	
<td colspan="3" style="border: 1px solid #000; border-top: 1px solid #ccc; background-color: #ccc">' 
$topic['preview'] . '</td>
	
	
	
	
</tr>
	
	
	
</table>
	
	
</tr>'
;
	
	
}
	
else
	
	
echo 
'
	
	
<tr>
	
	
	
<td colspan="3">No messages to display...</td>
	
	
</tr>'
;
	
echo 
'
	
</table>'
;
}


You can see this in action at www.roundcubeforum.net.  I love the feature it adds.  And so do my users.  When they log in from the front page, they can immediately see exactly what posts have been active for them.  This is very much the same as what vB has under the user Control Panel.